aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/jpeglib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.am134
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.in1094
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/README351
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/aclocal.m49652
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.136
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.c739
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cderror.h134
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.c181
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.h187
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/change.log346
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.1348
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.c643
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ckconfig.c402
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/coderules.txt118
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.guess1522
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.sub1771
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure15928
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac356
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/depcomp688
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.1252
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.c617
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/example.c433
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/filelist.txt215
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install-sh527
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install.txt1096
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jaricom.c153
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapimin.c288
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapistd.c161
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcarith.c937
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccoefct.c454
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccolor.c490
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcdctmgr.c482
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jchuff.c1576
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcinit.c65
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmainct.c293
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmarker.c682
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmaster.c858
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcomapi.c106
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.bcc48
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.cfg53
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.dj38
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.h45
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mac43
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.manx43
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mc652
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.sas43
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.st42
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.txt164
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vc45
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vms37
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.wat38
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcparam.c632
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcprepct.c358
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcsample.c545
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jctrans.c382
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapimin.c396
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapistd.c275
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdarith.c776
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatadst.c267
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatasrc.c275
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcoefct.c741
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcolor.c512
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdct.h393
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jddctmgr.c384
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdhuff.c1541
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdinput.c661
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmainct.c512
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmarker.c1406
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmaster.c531
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmerge.c400
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdosaobj.txt16
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdpostct.c290
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdsample.c361
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdtrans.c140
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.c252
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.h304
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctflt.c174
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctfst.c230
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctint.c4348
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctflt.c235
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctfst.c368
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctint.c5137
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jinclude.h91
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemansi.c167
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdos.c638
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdosa.asm379
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmac.c289
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmgr.c1119
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemname.c276
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemnobs.c109
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemsys.h198
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmorecfg.h369
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegint.h426
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpeglib.h1160
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.1285
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.c560
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant1.c857
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant2.c1311
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jutils.c227
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jversion.h14
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.map4
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.txt3085
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ltmain.sh9655
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makcjpeg.st36
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makdjpeg.st36
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeadsw.vc677
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeasln.v1033
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdep.vc682
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdsp.vc6130
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecfil.v1069
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecmak.vc6159
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecvcx.v1076
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddep.vc682
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddsp.vc6130
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedfil.v1069
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedmak.vc6159
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedvcx.v1076
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.ansi221
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.bcc292
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.dj227
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.manx221
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mc6256
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mms225
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.sas259
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.unix235
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vc273
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vms142
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.wat240
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdep.vc6423
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsp.vc6285
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsw.vc629
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejfil.v10186
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejmak.vc6425
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejsln.v1017
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejvcx.v10112
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeproj.mac213
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdep.vc66
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdsp.vc678
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerfil.v1030
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makermak.vc6110
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makervcx.v1062
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdep.vc643
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdsp.vc6122
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketfil.v1063
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketmak.vc6131
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketvcx.v1074
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdep.vc66
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdsp.vc678
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewfil.v1030
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewmak.vc6110
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewvcx.v1062
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makljpeg.st68
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maktjpeg.st30
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makvms.opt4
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/missing376
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdbmp.c480
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdcolmap.c253
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdgif.c38
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.163
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.c515
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdppm.c459
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdrle.c387
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdswitch.c365
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdtarga.c500
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/readme.dos15
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/structure.txt941
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.bmpbin0 -> 35050 bytes
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.jpgbin0 -> 5764 bytes
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.ppm4
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimgp.jpgbin0 -> 5645 bytes
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testorig.jpgbin0 -> 5770 bytes
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testprog.jpgbin0 -> 5655 bytes
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.c1597
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.h213
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/usage.txt637
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wizard.txt211
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrbmp.c442
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrgif.c399
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.1103
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.c583
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrppm.c269
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrrle.c305
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrtarga.c253
183 files changed, 105077 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.am b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.am
new file mode 100644
index 0000000..b4b4600
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.am
@@ -0,0 +1,134 @@
1## Process this file with automake to produce Makefile.in
2#
3# Automake Makefile for the JPEG library
4#
5# This file is written by Bob Friesenhahn, Guido Vollbeding
6#
7
8# Sources to build library
9LIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
10 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
11 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
12 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
13 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
14 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
15 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
16 jquant2.c jutils.c jmemmgr.c @MEMORYMGR@.c
17
18# System dependent sources
19SYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
20
21# Headers which are installed to support the library
22INSTINCLUDES = jerror.h jmorecfg.h jpeglib.h
23
24# Headers which are not installed
25OTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \
26 jversion.h transupp.h
27
28# Manual pages (Automake uses 'MANS' for itself)
29DISTMANS= cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
30
31# Other documentation files
32DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
33 structure.txt coderules.txt filelist.txt change.log
34
35# Makefiles for various systems
36MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
37 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
38 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
39 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
40 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
41 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
42 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
43 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
44 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
45 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
46 makefile.mms makefile.vms makvms.opt
47
48# Configuration files
49CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
50 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
51 jconfig.vms
52
53# Support scripts for configure
54CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
55
56# Miscellaneous support files
57OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
58 libjpeg.map
59
60# Test support files
61TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
62 testimgp.jpg
63
64# libtool libraries to build
65lib_LTLIBRARIES = libjpeg.la
66
67# Library sources for libjpeg.la
68libjpeg_la_SOURCES = $(LIBSOURCES)
69
70# LDFLAGS for libjpeg.la
71libjpeg_la_LDFLAGS = -no-undefined \
72 -version-info $(JPEG_LIB_VERSION)
73
74if HAVE_LD_VERSION_SCRIPT
75 libjpeg_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libjpeg.map
76endif
77
78# Executables to build
79bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
80
81# Executable sources & libs
82cjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \
83 rdswitch.c cdjpeg.c
84cjpeg_LDADD = libjpeg.la
85djpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \
86 rdcolmap.c cdjpeg.c
87djpeg_LDADD = libjpeg.la
88jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c
89jpegtran_LDADD = libjpeg.la
90rdjpgcom_SOURCES = rdjpgcom.c
91wrjpgcom_SOURCES = wrjpgcom.c
92
93# Manual pages to install
94man_MANS = $(DISTMANS)
95
96# Headers to install
97include_HEADERS = $(INSTINCLUDES)
98
99# Other distributed headers
100noinst_HEADERS = $(OTHERINCLUDES)
101
102# Other distributed files
103EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \
104 $(OTHERFILES) $(TESTFILES)
105
106# Files to be cleaned
107CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \
108 testoutt.jpg
109
110# Install jconfig.h
111install-data-local:
112 $(mkinstalldirs) $(DESTDIR)$(includedir)
113 $(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h
114
115# Uninstall jconfig.h
116uninstall-local:
117 rm -f $(DESTDIR)$(includedir)/jconfig.h
118
119# Run tests
120test: check-local
121check-local:
122 rm -f testout*
123 ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
124 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
125 ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
126 ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
127 ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
128 ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
129 cmp $(srcdir)/testimg.ppm testout.ppm
130 cmp $(srcdir)/testimg.bmp testout.bmp
131 cmp $(srcdir)/testimg.jpg testout.jpg
132 cmp $(srcdir)/testimg.ppm testoutp.ppm
133 cmp $(srcdir)/testimgp.jpg testoutp.jpg
134 cmp $(srcdir)/testorig.jpg testoutt.jpg
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.in b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.in
new file mode 100644
index 0000000..cbbbc3f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/Makefile.in
@@ -0,0 +1,1094 @@
1# Makefile.in generated by automake 1.11.2 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
6# Foundation, Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18#
19# Automake Makefile for the JPEG library
20#
21# This file is written by Bob Friesenhahn, Guido Vollbeding
22#
23
24
25
26VPATH = @srcdir@
27pkgdatadir = $(datadir)/@PACKAGE@
28pkgincludedir = $(includedir)/@PACKAGE@
29pkglibdir = $(libdir)/@PACKAGE@
30pkglibexecdir = $(libexecdir)/@PACKAGE@
31am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
32install_sh_DATA = $(install_sh) -c -m 644
33install_sh_PROGRAM = $(install_sh) -c
34install_sh_SCRIPT = $(install_sh) -c
35INSTALL_HEADER = $(INSTALL_DATA)
36transform = $(program_transform_name)
37NORMAL_INSTALL = :
38PRE_INSTALL = :
39POST_INSTALL = :
40NORMAL_UNINSTALL = :
41PRE_UNINSTALL = :
42POST_UNINSTALL = :
43build_triplet = @build@
44host_triplet = @host@
45target_triplet = @target@
46ANSI2KNR = @ANSI2KNR@
47@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=$(srcdir)/libjpeg.map
48bin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \
49 rdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT)
50subdir = .
51DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
52 $(top_srcdir)/configure $(am__configure_deps) \
53 $(srcdir)/jconfig.cfg ansi2knr.c ansi2knr.1 depcomp \
54 $(include_HEADERS) $(noinst_HEADERS)
55ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
56am__aclocal_m4_deps = $(top_srcdir)/configure.ac
57am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
58 $(ACLOCAL_M4)
59am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
60 configure.lineno config.status.lineno
61mkinstalldirs = $(install_sh) -d
62CONFIG_HEADER = jconfig.h
63CONFIG_CLEAN_FILES =
64CONFIG_CLEAN_VPATH_FILES =
65am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
66am__vpath_adj = case $$p in \
67 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
68 *) f=$$p;; \
69 esac;
70am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
71am__install_max = 40
72am__nobase_strip_setup = \
73 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
74am__nobase_strip = \
75 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
76am__nobase_list = $(am__nobase_strip_setup); \
77 for p in $$list; do echo "$$p $$p"; done | \
78 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
79 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
80 if (++n[$$2] == $(am__install_max)) \
81 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
82 END { for (dir in files) print dir, files[dir] }'
83am__base_list = \
84 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
85 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
86am__uninstall_files_from_dir = { \
87 test -z "$$files" \
88 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
89 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
90 $(am__cd) "$$dir" && rm -f $$files; }; \
91 }
92am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
93 "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)"
94LTLIBRARIES = $(lib_LTLIBRARIES)
95libjpeg_la_LIBADD =
96am__objects_1 = jaricom$U.lo jcapimin$U.lo jcapistd$U.lo jcarith$U.lo \
97 jccoefct$U.lo jccolor$U.lo jcdctmgr$U.lo jchuff$U.lo \
98 jcinit$U.lo jcmainct$U.lo jcmarker$U.lo jcmaster$U.lo \
99 jcomapi$U.lo jcparam$U.lo jcprepct$U.lo jcsample$U.lo \
100 jctrans$U.lo jdapimin$U.lo jdapistd$U.lo jdarith$U.lo \
101 jdatadst$U.lo jdatasrc$U.lo jdcoefct$U.lo jdcolor$U.lo \
102 jddctmgr$U.lo jdhuff$U.lo jdinput$U.lo jdmainct$U.lo \
103 jdmarker$U.lo jdmaster$U.lo jdmerge$U.lo jdpostct$U.lo \
104 jdsample$U.lo jdtrans$U.lo jerror$U.lo jfdctflt$U.lo \
105 jfdctfst$U.lo jfdctint$U.lo jidctflt$U.lo jidctfst$U.lo \
106 jidctint$U.lo jquant1$U.lo jquant2$U.lo jutils$U.lo \
107 jmemmgr$U.lo @MEMORYMGR@$U.lo
108am_libjpeg_la_OBJECTS = $(am__objects_1)
109libjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS)
110AM_V_lt = $(am__v_lt_$(V))
111am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
112am__v_lt_0 = --silent
113libjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
114 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
115 $(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@
116PROGRAMS = $(bin_PROGRAMS)
117am_cjpeg_OBJECTS = cjpeg$U.$(OBJEXT) rdppm$U.$(OBJEXT) \
118 rdgif$U.$(OBJEXT) rdtarga$U.$(OBJEXT) rdrle$U.$(OBJEXT) \
119 rdbmp$U.$(OBJEXT) rdswitch$U.$(OBJEXT) cdjpeg$U.$(OBJEXT)
120cjpeg_OBJECTS = $(am_cjpeg_OBJECTS)
121cjpeg_DEPENDENCIES = libjpeg.la
122am_djpeg_OBJECTS = djpeg$U.$(OBJEXT) wrppm$U.$(OBJEXT) \
123 wrgif$U.$(OBJEXT) wrtarga$U.$(OBJEXT) wrrle$U.$(OBJEXT) \
124 wrbmp$U.$(OBJEXT) rdcolmap$U.$(OBJEXT) cdjpeg$U.$(OBJEXT)
125djpeg_OBJECTS = $(am_djpeg_OBJECTS)
126djpeg_DEPENDENCIES = libjpeg.la
127am_jpegtran_OBJECTS = jpegtran$U.$(OBJEXT) rdswitch$U.$(OBJEXT) \
128 cdjpeg$U.$(OBJEXT) transupp$U.$(OBJEXT)
129jpegtran_OBJECTS = $(am_jpegtran_OBJECTS)
130jpegtran_DEPENDENCIES = libjpeg.la
131am_rdjpgcom_OBJECTS = rdjpgcom$U.$(OBJEXT)
132rdjpgcom_OBJECTS = $(am_rdjpgcom_OBJECTS)
133rdjpgcom_LDADD = $(LDADD)
134am_wrjpgcom_OBJECTS = wrjpgcom$U.$(OBJEXT)
135wrjpgcom_OBJECTS = $(am_wrjpgcom_OBJECTS)
136wrjpgcom_LDADD = $(LDADD)
137DEFAULT_INCLUDES = -I.@am__isrc@
138depcomp = $(SHELL) $(top_srcdir)/depcomp
139am__depfiles_maybe = depfiles
140am__mv = mv -f
141COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
142 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
143LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
144 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
145 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
146 $(AM_CFLAGS) $(CFLAGS)
147AM_V_CC = $(am__v_CC_$(V))
148am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
149am__v_CC_0 = @echo " CC " $@;
150AM_V_at = $(am__v_at_$(V))
151am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
152am__v_at_0 = @
153CCLD = $(CC)
154LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
155 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
156 $(AM_LDFLAGS) $(LDFLAGS) -o $@
157AM_V_CCLD = $(am__v_CCLD_$(V))
158am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
159am__v_CCLD_0 = @echo " CCLD " $@;
160AM_V_GEN = $(am__v_GEN_$(V))
161am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
162am__v_GEN_0 = @echo " GEN " $@;
163SOURCES = $(libjpeg_la_SOURCES) $(cjpeg_SOURCES) $(djpeg_SOURCES) \
164 $(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(wrjpgcom_SOURCES)
165man1dir = $(mandir)/man1
166NROFF = nroff
167MANS = $(man_MANS)
168HEADERS = $(include_HEADERS) $(noinst_HEADERS)
169ETAGS = etags
170CTAGS = ctags
171ACLOCAL = @ACLOCAL@
172AMTAR = @AMTAR@
173AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
174AR = @AR@
175AS = @AS@
176AUTOCONF = @AUTOCONF@
177AUTOHEADER = @AUTOHEADER@
178AUTOMAKE = @AUTOMAKE@
179AWK = @AWK@
180CC = @CC@
181CCDEPMODE = @CCDEPMODE@
182CFLAGS = @CFLAGS@
183CPP = @CPP@
184CPPFLAGS = @CPPFLAGS@
185CYGPATH_W = @CYGPATH_W@
186DEFS = @DEFS@
187DEPDIR = @DEPDIR@
188DLLTOOL = @DLLTOOL@
189DSYMUTIL = @DSYMUTIL@
190DUMPBIN = @DUMPBIN@
191ECHO_C = @ECHO_C@
192ECHO_N = @ECHO_N@
193ECHO_T = @ECHO_T@
194EGREP = @EGREP@
195EXEEXT = @EXEEXT@
196FGREP = @FGREP@
197GREP = @GREP@
198INSTALL = @INSTALL@
199INSTALL_DATA = @INSTALL_DATA@
200INSTALL_PROGRAM = @INSTALL_PROGRAM@
201INSTALL_SCRIPT = @INSTALL_SCRIPT@
202INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
203JPEG_LIB_VERSION = @JPEG_LIB_VERSION@
204LD = @LD@
205LDFLAGS = @LDFLAGS@
206LIBOBJS = @LIBOBJS@
207LIBS = @LIBS@
208LIBTOOL = @LIBTOOL@
209LIPO = @LIPO@
210LN_S = @LN_S@
211LTLIBOBJS = @LTLIBOBJS@
212MAINT = @MAINT@
213MAKEINFO = @MAKEINFO@
214MANIFEST_TOOL = @MANIFEST_TOOL@
215MEMORYMGR = @MEMORYMGR@
216MKDIR_P = @MKDIR_P@
217NM = @NM@
218NMEDIT = @NMEDIT@
219OBJDUMP = @OBJDUMP@
220OBJEXT = @OBJEXT@
221OTOOL = @OTOOL@
222OTOOL64 = @OTOOL64@
223PACKAGE = @PACKAGE@
224PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
225PACKAGE_NAME = @PACKAGE_NAME@
226PACKAGE_STRING = @PACKAGE_STRING@
227PACKAGE_TARNAME = @PACKAGE_TARNAME@
228PACKAGE_URL = @PACKAGE_URL@
229PACKAGE_VERSION = @PACKAGE_VERSION@
230PATH_SEPARATOR = @PATH_SEPARATOR@
231RANLIB = @RANLIB@
232SED = @SED@
233SET_MAKE = @SET_MAKE@
234SHELL = @SHELL@
235STRIP = @STRIP@
236U = @U@
237VERSION = @VERSION@
238abs_builddir = @abs_builddir@
239abs_srcdir = @abs_srcdir@
240abs_top_builddir = @abs_top_builddir@
241abs_top_srcdir = @abs_top_srcdir@
242ac_ct_AR = @ac_ct_AR@
243ac_ct_CC = @ac_ct_CC@
244ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
245am__include = @am__include@
246am__leading_dot = @am__leading_dot@
247am__quote = @am__quote@
248am__tar = @am__tar@
249am__untar = @am__untar@
250bindir = @bindir@
251build = @build@
252build_alias = @build_alias@
253build_cpu = @build_cpu@
254build_os = @build_os@
255build_vendor = @build_vendor@
256builddir = @builddir@
257datadir = @datadir@
258datarootdir = @datarootdir@
259docdir = @docdir@
260dvidir = @dvidir@
261exec_prefix = @exec_prefix@
262host = @host@
263host_alias = @host_alias@
264host_cpu = @host_cpu@
265host_os = @host_os@
266host_vendor = @host_vendor@
267htmldir = @htmldir@
268includedir = @includedir@
269infodir = @infodir@
270install_sh = @install_sh@
271libdir = @libdir@
272libexecdir = @libexecdir@
273localedir = @localedir@
274localstatedir = @localstatedir@
275mandir = @mandir@
276mkdir_p = @mkdir_p@
277oldincludedir = @oldincludedir@
278pdfdir = @pdfdir@
279prefix = @prefix@
280program_transform_name = @program_transform_name@
281psdir = @psdir@
282sbindir = @sbindir@
283sharedstatedir = @sharedstatedir@
284srcdir = @srcdir@
285sysconfdir = @sysconfdir@
286target = @target@
287target_alias = @target_alias@
288target_cpu = @target_cpu@
289target_os = @target_os@
290target_vendor = @target_vendor@
291top_build_prefix = @top_build_prefix@
292top_builddir = @top_builddir@
293top_srcdir = @top_srcdir@
294
295# Sources to build library
296LIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
297 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
298 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
299 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
300 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
301 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
302 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
303 jquant2.c jutils.c jmemmgr.c @MEMORYMGR@.c
304
305
306# System dependent sources
307SYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
308
309# Headers which are installed to support the library
310INSTINCLUDES = jerror.h jmorecfg.h jpeglib.h
311
312# Headers which are not installed
313OTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \
314 jversion.h transupp.h
315
316
317# Manual pages (Automake uses 'MANS' for itself)
318DISTMANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
319
320# Other documentation files
321DOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \
322 structure.txt coderules.txt filelist.txt change.log
323
324
325# Makefiles for various systems
326MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
327 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
328 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
329 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
330 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
331 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
332 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
333 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
334 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
335 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
336 makefile.mms makefile.vms makvms.opt
337
338
339# Configuration files
340CONFIGFILES = jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
341 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
342 jconfig.vms
343
344
345# Support scripts for configure
346CONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp missing
347
348# Miscellaneous support files
349OTHERFILES = jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
350 libjpeg.map
351
352
353# Test support files
354TESTFILES = testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
355 testimgp.jpg
356
357
358# libtool libraries to build
359lib_LTLIBRARIES = libjpeg.la
360
361# Library sources for libjpeg.la
362libjpeg_la_SOURCES = $(LIBSOURCES)
363
364# LDFLAGS for libjpeg.la
365libjpeg_la_LDFLAGS = -no-undefined -version-info $(JPEG_LIB_VERSION) \
366 $(am__append_1)
367
368# Executable sources & libs
369cjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \
370 rdswitch.c cdjpeg.c
371
372cjpeg_LDADD = libjpeg.la
373djpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \
374 rdcolmap.c cdjpeg.c
375
376djpeg_LDADD = libjpeg.la
377jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c
378jpegtran_LDADD = libjpeg.la
379rdjpgcom_SOURCES = rdjpgcom.c
380wrjpgcom_SOURCES = wrjpgcom.c
381
382# Manual pages to install
383man_MANS = $(DISTMANS)
384
385# Headers to install
386include_HEADERS = $(INSTINCLUDES)
387
388# Other distributed headers
389noinst_HEADERS = $(OTHERINCLUDES)
390
391# Other distributed files
392EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \
393 $(OTHERFILES) $(TESTFILES)
394
395
396# Files to be cleaned
397CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \
398 testoutt.jpg
399
400all: jconfig.h
401 $(MAKE) $(AM_MAKEFLAGS) all-am
402
403.SUFFIXES:
404.SUFFIXES: .c .lo .o .obj
405am--refresh: Makefile
406 @:
407$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
408 @for dep in $?; do \
409 case '$(am__configure_deps)' in \
410 *$$dep*) \
411 echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
412 $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
413 && exit 0; \
414 exit 1;; \
415 esac; \
416 done; \
417 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
418 $(am__cd) $(top_srcdir) && \
419 $(AUTOMAKE) --foreign Makefile
420.PRECIOUS: Makefile
421Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
422 @case '$?' in \
423 *config.status*) \
424 echo ' $(SHELL) ./config.status'; \
425 $(SHELL) ./config.status;; \
426 *) \
427 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
428 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
429 esac;
430
431$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
432 $(SHELL) ./config.status --recheck
433
434$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
435 $(am__cd) $(srcdir) && $(AUTOCONF)
436$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
437 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
438$(am__aclocal_m4_deps):
439
440jconfig.h: stamp-h1
441 @if test ! -f $@; then rm -f stamp-h1; else :; fi
442 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
443
444stamp-h1: $(srcdir)/jconfig.cfg $(top_builddir)/config.status
445 @rm -f stamp-h1
446 cd $(top_builddir) && $(SHELL) ./config.status jconfig.h
447$(srcdir)/jconfig.cfg: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
448 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
449 rm -f stamp-h1
450 touch $@
451
452distclean-hdr:
453 -rm -f jconfig.h stamp-h1
454install-libLTLIBRARIES: $(lib_LTLIBRARIES)
455 @$(NORMAL_INSTALL)
456 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
457 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
458 list2=; for p in $$list; do \
459 if test -f $$p; then \
460 list2="$$list2 $$p"; \
461 else :; fi; \
462 done; \
463 test -z "$$list2" || { \
464 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
465 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
466 }
467
468uninstall-libLTLIBRARIES:
469 @$(NORMAL_UNINSTALL)
470 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
471 for p in $$list; do \
472 $(am__strip_dir) \
473 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
474 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
475 done
476
477clean-libLTLIBRARIES:
478 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
479 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
480 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
481 test "$$dir" != "$$p" || dir=.; \
482 echo "rm -f \"$${dir}/so_locations\""; \
483 rm -f "$${dir}/so_locations"; \
484 done
485libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES)
486 $(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)
487install-binPROGRAMS: $(bin_PROGRAMS)
488 @$(NORMAL_INSTALL)
489 test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
490 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
491 for p in $$list; do echo "$$p $$p"; done | \
492 sed 's/$(EXEEXT)$$//' | \
493 while read p p1; do if test -f $$p || test -f $$p1; \
494 then echo "$$p"; echo "$$p"; else :; fi; \
495 done | \
496 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
497 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
498 sed 'N;N;N;s,\n, ,g' | \
499 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
500 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
501 if ($$2 == $$4) files[d] = files[d] " " $$1; \
502 else { print "f", $$3 "/" $$4, $$1; } } \
503 END { for (d in files) print "f", d, files[d] }' | \
504 while read type dir files; do \
505 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
506 test -z "$$files" || { \
507 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
508 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
509 } \
510 ; done
511
512uninstall-binPROGRAMS:
513 @$(NORMAL_UNINSTALL)
514 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
515 files=`for p in $$list; do echo "$$p"; done | \
516 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
517 -e 's/$$/$(EXEEXT)/' `; \
518 test -n "$$list" || exit 0; \
519 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
520 cd "$(DESTDIR)$(bindir)" && rm -f $$files
521
522clean-binPROGRAMS:
523 @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
524 echo " rm -f" $$list; \
525 rm -f $$list || exit $$?; \
526 test -n "$(EXEEXT)" || exit 0; \
527 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
528 echo " rm -f" $$list; \
529 rm -f $$list
530cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES)
531 @rm -f cjpeg$(EXEEXT)
532 $(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS)
533djpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES)
534 @rm -f djpeg$(EXEEXT)
535 $(AM_V_CCLD)$(LINK) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS)
536jpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES)
537 @rm -f jpegtran$(EXEEXT)
538 $(AM_V_CCLD)$(LINK) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS)
539rdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES)
540 @rm -f rdjpgcom$(EXEEXT)
541 $(AM_V_CCLD)$(LINK) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS)
542wrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES)
543 @rm -f wrjpgcom$(EXEEXT)
544 $(AM_V_CCLD)$(LINK) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS)
545
546mostlyclean-compile:
547 -rm -f *.$(OBJEXT)
548
549distclean-compile:
550 -rm -f *.tab.c
551./ansi2knr: ansi2knr.$(OBJEXT)
552 $(LINK) ansi2knr.$(OBJEXT) $(LIBS)
553ansi2knr.$(OBJEXT): $(CONFIG_HEADER)
554
555clean-krextra:
556 -rm -f ansi2knr
557
558mostlyclean-kr:
559 -test "$U" = "" || rm -f *_.c
560
561@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@$U.Plo@am__quote@
562@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg$U.Po@am__quote@
563@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg$U.Po@am__quote@
564@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg$U.Po@am__quote@
565@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom$U.Plo@am__quote@
566@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin$U.Plo@am__quote@
567@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd$U.Plo@am__quote@
568@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith$U.Plo@am__quote@
569@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct$U.Plo@am__quote@
570@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor$U.Plo@am__quote@
571@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr$U.Plo@am__quote@
572@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff$U.Plo@am__quote@
573@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit$U.Plo@am__quote@
574@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct$U.Plo@am__quote@
575@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker$U.Plo@am__quote@
576@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster$U.Plo@am__quote@
577@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi$U.Plo@am__quote@
578@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam$U.Plo@am__quote@
579@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct$U.Plo@am__quote@
580@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample$U.Plo@am__quote@
581@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans$U.Plo@am__quote@
582@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin$U.Plo@am__quote@
583@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd$U.Plo@am__quote@
584@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith$U.Plo@am__quote@
585@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst$U.Plo@am__quote@
586@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc$U.Plo@am__quote@
587@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct$U.Plo@am__quote@
588@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor$U.Plo@am__quote@
589@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr$U.Plo@am__quote@
590@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff$U.Plo@am__quote@
591@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput$U.Plo@am__quote@
592@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct$U.Plo@am__quote@
593@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker$U.Plo@am__quote@
594@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster$U.Plo@am__quote@
595@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge$U.Plo@am__quote@
596@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct$U.Plo@am__quote@
597@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample$U.Plo@am__quote@
598@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans$U.Plo@am__quote@
599@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror$U.Plo@am__quote@
600@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt$U.Plo@am__quote@
601@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst$U.Plo@am__quote@
602@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint$U.Plo@am__quote@
603@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt$U.Plo@am__quote@
604@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst$U.Plo@am__quote@
605@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint$U.Plo@am__quote@
606@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr$U.Plo@am__quote@
607@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran$U.Po@am__quote@
608@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1$U.Plo@am__quote@
609@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2$U.Plo@am__quote@
610@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils$U.Plo@am__quote@
611@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp$U.Po@am__quote@
612@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap$U.Po@am__quote@
613@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif$U.Po@am__quote@
614@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom$U.Po@am__quote@
615@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm$U.Po@am__quote@
616@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle$U.Po@am__quote@
617@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch$U.Po@am__quote@
618@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga$U.Po@am__quote@
619@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp$U.Po@am__quote@
620@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp$U.Po@am__quote@
621@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif$U.Po@am__quote@
622@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom$U.Po@am__quote@
623@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm$U.Po@am__quote@
624@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle$U.Po@am__quote@
625@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga$U.Po@am__quote@
626
627.c.o:
628@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
629@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
630@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
631@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
632@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
633
634.c.obj:
635@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
636@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
637@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
638@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
639@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
640
641.c.lo:
642@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
643@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
644@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
645@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
646@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
647@MEMORYMGR@_.c: @MEMORYMGR@.c $(ANSI2KNR)
648 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/@MEMORYMGR@.c; then echo $(srcdir)/@MEMORYMGR@.c; else echo @MEMORYMGR@.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
649cdjpeg_.c: cdjpeg.c $(ANSI2KNR)
650 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cdjpeg.c; then echo $(srcdir)/cdjpeg.c; else echo cdjpeg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
651cjpeg_.c: cjpeg.c $(ANSI2KNR)
652 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cjpeg.c; then echo $(srcdir)/cjpeg.c; else echo cjpeg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
653djpeg_.c: djpeg.c $(ANSI2KNR)
654 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/djpeg.c; then echo $(srcdir)/djpeg.c; else echo djpeg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
655jaricom_.c: jaricom.c $(ANSI2KNR)
656 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jaricom.c; then echo $(srcdir)/jaricom.c; else echo jaricom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
657jcapimin_.c: jcapimin.c $(ANSI2KNR)
658 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcapimin.c; then echo $(srcdir)/jcapimin.c; else echo jcapimin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
659jcapistd_.c: jcapistd.c $(ANSI2KNR)
660 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcapistd.c; then echo $(srcdir)/jcapistd.c; else echo jcapistd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
661jcarith_.c: jcarith.c $(ANSI2KNR)
662 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcarith.c; then echo $(srcdir)/jcarith.c; else echo jcarith.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
663jccoefct_.c: jccoefct.c $(ANSI2KNR)
664 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jccoefct.c; then echo $(srcdir)/jccoefct.c; else echo jccoefct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
665jccolor_.c: jccolor.c $(ANSI2KNR)
666 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jccolor.c; then echo $(srcdir)/jccolor.c; else echo jccolor.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
667jcdctmgr_.c: jcdctmgr.c $(ANSI2KNR)
668 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcdctmgr.c; then echo $(srcdir)/jcdctmgr.c; else echo jcdctmgr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
669jchuff_.c: jchuff.c $(ANSI2KNR)
670 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jchuff.c; then echo $(srcdir)/jchuff.c; else echo jchuff.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
671jcinit_.c: jcinit.c $(ANSI2KNR)
672 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcinit.c; then echo $(srcdir)/jcinit.c; else echo jcinit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
673jcmainct_.c: jcmainct.c $(ANSI2KNR)
674 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcmainct.c; then echo $(srcdir)/jcmainct.c; else echo jcmainct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
675jcmarker_.c: jcmarker.c $(ANSI2KNR)
676 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcmarker.c; then echo $(srcdir)/jcmarker.c; else echo jcmarker.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
677jcmaster_.c: jcmaster.c $(ANSI2KNR)
678 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcmaster.c; then echo $(srcdir)/jcmaster.c; else echo jcmaster.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
679jcomapi_.c: jcomapi.c $(ANSI2KNR)
680 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcomapi.c; then echo $(srcdir)/jcomapi.c; else echo jcomapi.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
681jcparam_.c: jcparam.c $(ANSI2KNR)
682 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcparam.c; then echo $(srcdir)/jcparam.c; else echo jcparam.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
683jcprepct_.c: jcprepct.c $(ANSI2KNR)
684 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcprepct.c; then echo $(srcdir)/jcprepct.c; else echo jcprepct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
685jcsample_.c: jcsample.c $(ANSI2KNR)
686 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcsample.c; then echo $(srcdir)/jcsample.c; else echo jcsample.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
687jctrans_.c: jctrans.c $(ANSI2KNR)
688 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jctrans.c; then echo $(srcdir)/jctrans.c; else echo jctrans.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
689jdapimin_.c: jdapimin.c $(ANSI2KNR)
690 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdapimin.c; then echo $(srcdir)/jdapimin.c; else echo jdapimin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
691jdapistd_.c: jdapistd.c $(ANSI2KNR)
692 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdapistd.c; then echo $(srcdir)/jdapistd.c; else echo jdapistd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
693jdarith_.c: jdarith.c $(ANSI2KNR)
694 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdarith.c; then echo $(srcdir)/jdarith.c; else echo jdarith.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
695jdatadst_.c: jdatadst.c $(ANSI2KNR)
696 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdatadst.c; then echo $(srcdir)/jdatadst.c; else echo jdatadst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
697jdatasrc_.c: jdatasrc.c $(ANSI2KNR)
698 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdatasrc.c; then echo $(srcdir)/jdatasrc.c; else echo jdatasrc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
699jdcoefct_.c: jdcoefct.c $(ANSI2KNR)
700 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdcoefct.c; then echo $(srcdir)/jdcoefct.c; else echo jdcoefct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
701jdcolor_.c: jdcolor.c $(ANSI2KNR)
702 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdcolor.c; then echo $(srcdir)/jdcolor.c; else echo jdcolor.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
703jddctmgr_.c: jddctmgr.c $(ANSI2KNR)
704 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jddctmgr.c; then echo $(srcdir)/jddctmgr.c; else echo jddctmgr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
705jdhuff_.c: jdhuff.c $(ANSI2KNR)
706 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdhuff.c; then echo $(srcdir)/jdhuff.c; else echo jdhuff.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
707jdinput_.c: jdinput.c $(ANSI2KNR)
708 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdinput.c; then echo $(srcdir)/jdinput.c; else echo jdinput.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
709jdmainct_.c: jdmainct.c $(ANSI2KNR)
710 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmainct.c; then echo $(srcdir)/jdmainct.c; else echo jdmainct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
711jdmarker_.c: jdmarker.c $(ANSI2KNR)
712 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmarker.c; then echo $(srcdir)/jdmarker.c; else echo jdmarker.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
713jdmaster_.c: jdmaster.c $(ANSI2KNR)
714 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmaster.c; then echo $(srcdir)/jdmaster.c; else echo jdmaster.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
715jdmerge_.c: jdmerge.c $(ANSI2KNR)
716 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmerge.c; then echo $(srcdir)/jdmerge.c; else echo jdmerge.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
717jdpostct_.c: jdpostct.c $(ANSI2KNR)
718 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdpostct.c; then echo $(srcdir)/jdpostct.c; else echo jdpostct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
719jdsample_.c: jdsample.c $(ANSI2KNR)
720 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdsample.c; then echo $(srcdir)/jdsample.c; else echo jdsample.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
721jdtrans_.c: jdtrans.c $(ANSI2KNR)
722 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdtrans.c; then echo $(srcdir)/jdtrans.c; else echo jdtrans.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
723jerror_.c: jerror.c $(ANSI2KNR)
724 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jerror.c; then echo $(srcdir)/jerror.c; else echo jerror.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
725jfdctflt_.c: jfdctflt.c $(ANSI2KNR)
726 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jfdctflt.c; then echo $(srcdir)/jfdctflt.c; else echo jfdctflt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
727jfdctfst_.c: jfdctfst.c $(ANSI2KNR)
728 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jfdctfst.c; then echo $(srcdir)/jfdctfst.c; else echo jfdctfst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
729jfdctint_.c: jfdctint.c $(ANSI2KNR)
730 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jfdctint.c; then echo $(srcdir)/jfdctint.c; else echo jfdctint.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
731jidctflt_.c: jidctflt.c $(ANSI2KNR)
732 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jidctflt.c; then echo $(srcdir)/jidctflt.c; else echo jidctflt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
733jidctfst_.c: jidctfst.c $(ANSI2KNR)
734 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jidctfst.c; then echo $(srcdir)/jidctfst.c; else echo jidctfst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
735jidctint_.c: jidctint.c $(ANSI2KNR)
736 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jidctint.c; then echo $(srcdir)/jidctint.c; else echo jidctint.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
737jmemmgr_.c: jmemmgr.c $(ANSI2KNR)
738 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jmemmgr.c; then echo $(srcdir)/jmemmgr.c; else echo jmemmgr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
739jpegtran_.c: jpegtran.c $(ANSI2KNR)
740 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jpegtran.c; then echo $(srcdir)/jpegtran.c; else echo jpegtran.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
741jquant1_.c: jquant1.c $(ANSI2KNR)
742 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jquant1.c; then echo $(srcdir)/jquant1.c; else echo jquant1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
743jquant2_.c: jquant2.c $(ANSI2KNR)
744 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jquant2.c; then echo $(srcdir)/jquant2.c; else echo jquant2.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
745jutils_.c: jutils.c $(ANSI2KNR)
746 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jutils.c; then echo $(srcdir)/jutils.c; else echo jutils.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
747rdbmp_.c: rdbmp.c $(ANSI2KNR)
748 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdbmp.c; then echo $(srcdir)/rdbmp.c; else echo rdbmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
749rdcolmap_.c: rdcolmap.c $(ANSI2KNR)
750 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdcolmap.c; then echo $(srcdir)/rdcolmap.c; else echo rdcolmap.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
751rdgif_.c: rdgif.c $(ANSI2KNR)
752 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdgif.c; then echo $(srcdir)/rdgif.c; else echo rdgif.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
753rdjpgcom_.c: rdjpgcom.c $(ANSI2KNR)
754 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdjpgcom.c; then echo $(srcdir)/rdjpgcom.c; else echo rdjpgcom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
755rdppm_.c: rdppm.c $(ANSI2KNR)
756 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdppm.c; then echo $(srcdir)/rdppm.c; else echo rdppm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
757rdrle_.c: rdrle.c $(ANSI2KNR)
758 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdrle.c; then echo $(srcdir)/rdrle.c; else echo rdrle.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
759rdswitch_.c: rdswitch.c $(ANSI2KNR)
760 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdswitch.c; then echo $(srcdir)/rdswitch.c; else echo rdswitch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
761rdtarga_.c: rdtarga.c $(ANSI2KNR)
762 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdtarga.c; then echo $(srcdir)/rdtarga.c; else echo rdtarga.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
763transupp_.c: transupp.c $(ANSI2KNR)
764 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/transupp.c; then echo $(srcdir)/transupp.c; else echo transupp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
765wrbmp_.c: wrbmp.c $(ANSI2KNR)
766 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrbmp.c; then echo $(srcdir)/wrbmp.c; else echo wrbmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
767wrgif_.c: wrgif.c $(ANSI2KNR)
768 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrgif.c; then echo $(srcdir)/wrgif.c; else echo wrgif.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
769wrjpgcom_.c: wrjpgcom.c $(ANSI2KNR)
770 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrjpgcom.c; then echo $(srcdir)/wrjpgcom.c; else echo wrjpgcom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
771wrppm_.c: wrppm.c $(ANSI2KNR)
772 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrppm.c; then echo $(srcdir)/wrppm.c; else echo wrppm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
773wrrle_.c: wrrle.c $(ANSI2KNR)
774 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrrle.c; then echo $(srcdir)/wrrle.c; else echo wrrle.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
775wrtarga_.c: wrtarga.c $(ANSI2KNR)
776 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrtarga.c; then echo $(srcdir)/wrtarga.c; else echo wrtarga.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
777@MEMORYMGR@_.$(OBJEXT) @MEMORYMGR@_.lo cdjpeg_.$(OBJEXT) cdjpeg_.lo \
778cjpeg_.$(OBJEXT) cjpeg_.lo djpeg_.$(OBJEXT) djpeg_.lo \
779jaricom_.$(OBJEXT) jaricom_.lo jcapimin_.$(OBJEXT) jcapimin_.lo \
780jcapistd_.$(OBJEXT) jcapistd_.lo jcarith_.$(OBJEXT) jcarith_.lo \
781jccoefct_.$(OBJEXT) jccoefct_.lo jccolor_.$(OBJEXT) jccolor_.lo \
782jcdctmgr_.$(OBJEXT) jcdctmgr_.lo jchuff_.$(OBJEXT) jchuff_.lo \
783jcinit_.$(OBJEXT) jcinit_.lo jcmainct_.$(OBJEXT) jcmainct_.lo \
784jcmarker_.$(OBJEXT) jcmarker_.lo jcmaster_.$(OBJEXT) jcmaster_.lo \
785jcomapi_.$(OBJEXT) jcomapi_.lo jcparam_.$(OBJEXT) jcparam_.lo \
786jcprepct_.$(OBJEXT) jcprepct_.lo jcsample_.$(OBJEXT) jcsample_.lo \
787jctrans_.$(OBJEXT) jctrans_.lo jdapimin_.$(OBJEXT) jdapimin_.lo \
788jdapistd_.$(OBJEXT) jdapistd_.lo jdarith_.$(OBJEXT) jdarith_.lo \
789jdatadst_.$(OBJEXT) jdatadst_.lo jdatasrc_.$(OBJEXT) jdatasrc_.lo \
790jdcoefct_.$(OBJEXT) jdcoefct_.lo jdcolor_.$(OBJEXT) jdcolor_.lo \
791jddctmgr_.$(OBJEXT) jddctmgr_.lo jdhuff_.$(OBJEXT) jdhuff_.lo \
792jdinput_.$(OBJEXT) jdinput_.lo jdmainct_.$(OBJEXT) jdmainct_.lo \
793jdmarker_.$(OBJEXT) jdmarker_.lo jdmaster_.$(OBJEXT) jdmaster_.lo \
794jdmerge_.$(OBJEXT) jdmerge_.lo jdpostct_.$(OBJEXT) jdpostct_.lo \
795jdsample_.$(OBJEXT) jdsample_.lo jdtrans_.$(OBJEXT) jdtrans_.lo \
796jerror_.$(OBJEXT) jerror_.lo jfdctflt_.$(OBJEXT) jfdctflt_.lo \
797jfdctfst_.$(OBJEXT) jfdctfst_.lo jfdctint_.$(OBJEXT) jfdctint_.lo \
798jidctflt_.$(OBJEXT) jidctflt_.lo jidctfst_.$(OBJEXT) jidctfst_.lo \
799jidctint_.$(OBJEXT) jidctint_.lo jmemmgr_.$(OBJEXT) jmemmgr_.lo \
800jpegtran_.$(OBJEXT) jpegtran_.lo jquant1_.$(OBJEXT) jquant1_.lo \
801jquant2_.$(OBJEXT) jquant2_.lo jutils_.$(OBJEXT) jutils_.lo \
802rdbmp_.$(OBJEXT) rdbmp_.lo rdcolmap_.$(OBJEXT) rdcolmap_.lo \
803rdgif_.$(OBJEXT) rdgif_.lo rdjpgcom_.$(OBJEXT) rdjpgcom_.lo \
804rdppm_.$(OBJEXT) rdppm_.lo rdrle_.$(OBJEXT) rdrle_.lo \
805rdswitch_.$(OBJEXT) rdswitch_.lo rdtarga_.$(OBJEXT) rdtarga_.lo \
806transupp_.$(OBJEXT) transupp_.lo wrbmp_.$(OBJEXT) wrbmp_.lo \
807wrgif_.$(OBJEXT) wrgif_.lo wrjpgcom_.$(OBJEXT) wrjpgcom_.lo \
808wrppm_.$(OBJEXT) wrppm_.lo wrrle_.$(OBJEXT) wrrle_.lo \
809wrtarga_.$(OBJEXT) wrtarga_.lo : $(ANSI2KNR)
810
811mostlyclean-libtool:
812 -rm -f *.lo
813
814clean-libtool:
815 -rm -rf .libs _libs
816
817distclean-libtool:
818 -rm -f libtool config.lt
819install-man1: $(man_MANS)
820 @$(NORMAL_INSTALL)
821 test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
822 @list=''; test -n "$(man1dir)" || exit 0; \
823 { for i in $$list; do echo "$$i"; done; \
824 l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
825 sed -n '/\.1[a-z]*$$/p'; \
826 } | while read p; do \
827 if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
828 echo "$$d$$p"; echo "$$p"; \
829 done | \
830 sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
831 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
832 sed 'N;N;s,\n, ,g' | { \
833 list=; while read file base inst; do \
834 if test "$$base" = "$$inst"; then list="$$list $$file"; else \
835 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
836 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
837 fi; \
838 done; \
839 for i in $$list; do echo "$$i"; done | $(am__base_list) | \
840 while read files; do \
841 test -z "$$files" || { \
842 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
843 $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
844 done; }
845
846uninstall-man1:
847 @$(NORMAL_UNINSTALL)
848 @list=''; test -n "$(man1dir)" || exit 0; \
849 files=`{ for i in $$list; do echo "$$i"; done; \
850 l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
851 sed -n '/\.1[a-z]*$$/p'; \
852 } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
853 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
854 dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
855install-includeHEADERS: $(include_HEADERS)
856 @$(NORMAL_INSTALL)
857 test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
858 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
859 for p in $$list; do \
860 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
861 echo "$$d$$p"; \
862 done | $(am__base_list) | \
863 while read files; do \
864 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
865 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
866 done
867
868uninstall-includeHEADERS:
869 @$(NORMAL_UNINSTALL)
870 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
871 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
872 dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
873
874ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
875 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
876 unique=`for i in $$list; do \
877 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
878 done | \
879 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
880 END { if (nonempty) { for (i in files) print i; }; }'`; \
881 mkid -fID $$unique
882tags: TAGS
883
884TAGS: $(HEADERS) $(SOURCES) jconfig.cfg $(TAGS_DEPENDENCIES) \
885 $(TAGS_FILES) $(LISP)
886 set x; \
887 here=`pwd`; \
888 list='$(SOURCES) $(HEADERS) jconfig.cfg $(LISP) $(TAGS_FILES)'; \
889 unique=`for i in $$list; do \
890 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
891 done | \
892 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
893 END { if (nonempty) { for (i in files) print i; }; }'`; \
894 shift; \
895 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
896 test -n "$$unique" || unique=$$empty_fix; \
897 if test $$# -gt 0; then \
898 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
899 "$$@" $$unique; \
900 else \
901 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
902 $$unique; \
903 fi; \
904 fi
905ctags: CTAGS
906CTAGS: $(HEADERS) $(SOURCES) jconfig.cfg $(TAGS_DEPENDENCIES) \
907 $(TAGS_FILES) $(LISP)
908 list='$(SOURCES) $(HEADERS) jconfig.cfg $(LISP) $(TAGS_FILES)'; \
909 unique=`for i in $$list; do \
910 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
911 done | \
912 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
913 END { if (nonempty) { for (i in files) print i; }; }'`; \
914 test -z "$(CTAGS_ARGS)$$unique" \
915 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
916 $$unique
917
918GTAGS:
919 here=`$(am__cd) $(top_builddir) && pwd` \
920 && $(am__cd) $(top_srcdir) \
921 && gtags -i $(GTAGS_ARGS) "$$here"
922
923distclean-tags:
924 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
925check-am: all-am
926 $(MAKE) $(AM_MAKEFLAGS) check-local
927check: check-am
928all-am: Makefile $(ANSI2KNR) $(LTLIBRARIES) $(PROGRAMS) $(MANS) \
929 $(HEADERS) jconfig.h
930install-binPROGRAMS: install-libLTLIBRARIES
931
932installdirs:
933 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)"; do \
934 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
935 done
936install: install-am
937install-exec: install-exec-am
938install-data: install-data-am
939uninstall: uninstall-am
940
941install-am: all-am
942 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
943
944installcheck: installcheck-am
945install-strip:
946 if test -z '$(STRIP)'; then \
947 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
948 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
949 install; \
950 else \
951 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
952 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
953 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
954 fi
955mostlyclean-generic:
956
957clean-generic:
958 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
959
960distclean-generic:
961 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
962 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
963
964maintainer-clean-generic:
965 @echo "This command is intended for maintainers to use"
966 @echo "it deletes files that may require special tools to rebuild."
967clean: clean-am
968
969clean-am: clean-binPROGRAMS clean-generic clean-krextra \
970 clean-libLTLIBRARIES clean-libtool mostlyclean-am
971
972distclean: distclean-am
973 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
974 -rm -rf ./$(DEPDIR)
975 -rm -f Makefile
976distclean-am: clean-am distclean-compile distclean-generic \
977 distclean-hdr distclean-libtool distclean-tags
978
979dvi: dvi-am
980
981dvi-am:
982
983html: html-am
984
985html-am:
986
987info: info-am
988
989info-am:
990
991install-data-am: install-data-local install-includeHEADERS install-man
992
993install-dvi: install-dvi-am
994
995install-dvi-am:
996
997install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
998
999install-html: install-html-am
1000
1001install-html-am:
1002
1003install-info: install-info-am
1004
1005install-info-am:
1006
1007install-man: install-man1
1008
1009install-pdf: install-pdf-am
1010
1011install-pdf-am:
1012
1013install-ps: install-ps-am
1014
1015install-ps-am:
1016
1017installcheck-am:
1018
1019maintainer-clean: maintainer-clean-am
1020 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
1021 -rm -rf $(top_srcdir)/autom4te.cache
1022 -rm -rf ./$(DEPDIR)
1023 -rm -f Makefile
1024maintainer-clean-am: distclean-am maintainer-clean-generic
1025
1026mostlyclean: mostlyclean-am
1027
1028mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \
1029 mostlyclean-libtool
1030
1031pdf: pdf-am
1032
1033pdf-am:
1034
1035ps: ps-am
1036
1037ps-am:
1038
1039uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
1040 uninstall-libLTLIBRARIES uninstall-local uninstall-man
1041
1042uninstall-man: uninstall-man1
1043
1044.MAKE: all check-am install-am install-strip
1045
1046.PHONY: CTAGS GTAGS all all-am am--refresh check check-am check-local \
1047 clean clean-binPROGRAMS clean-generic clean-krextra \
1048 clean-libLTLIBRARIES clean-libtool ctags distclean \
1049 distclean-compile distclean-generic distclean-hdr \
1050 distclean-libtool distclean-tags dvi dvi-am html html-am info \
1051 info-am install install-am install-binPROGRAMS install-data \
1052 install-data-am install-data-local install-dvi install-dvi-am \
1053 install-exec install-exec-am install-html install-html-am \
1054 install-includeHEADERS install-info install-info-am \
1055 install-libLTLIBRARIES install-man install-man1 install-pdf \
1056 install-pdf-am install-ps install-ps-am install-strip \
1057 installcheck installcheck-am installdirs maintainer-clean \
1058 maintainer-clean-generic mostlyclean mostlyclean-compile \
1059 mostlyclean-generic mostlyclean-kr mostlyclean-libtool pdf \
1060 pdf-am ps ps-am tags uninstall uninstall-am \
1061 uninstall-binPROGRAMS uninstall-includeHEADERS \
1062 uninstall-libLTLIBRARIES uninstall-local uninstall-man \
1063 uninstall-man1
1064
1065
1066# Install jconfig.h
1067install-data-local:
1068 $(mkinstalldirs) $(DESTDIR)$(includedir)
1069 $(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h
1070
1071# Uninstall jconfig.h
1072uninstall-local:
1073 rm -f $(DESTDIR)$(includedir)/jconfig.h
1074
1075# Run tests
1076test: check-local
1077check-local:
1078 rm -f testout*
1079 ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
1080 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
1081 ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
1082 ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
1083 ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
1084 ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
1085 cmp $(srcdir)/testimg.ppm testout.ppm
1086 cmp $(srcdir)/testimg.bmp testout.bmp
1087 cmp $(srcdir)/testimg.jpg testout.jpg
1088 cmp $(srcdir)/testimg.ppm testoutp.ppm
1089 cmp $(srcdir)/testimgp.jpg testoutp.jpg
1090 cmp $(srcdir)/testorig.jpg testoutt.jpg
1091
1092# Tell versions [3.59,3.63) of GNU make to not export all variables.
1093# Otherwise a system limit (for SysV at least) may be exceeded.
1094.NOEXPORT:
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/README b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/README
new file mode 100644
index 0000000..07bb50b
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/README
@@ -0,0 +1,351 @@
1The Independent JPEG Group's JPEG software
2==========================================
3
4README for release 8d of 15-Jan-2012
5====================================
6
7This distribution contains the eighth public release of the Independent JPEG
8Group's free JPEG software. You are welcome to redistribute this software and
9to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
10
11This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
12Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
13Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
14and other members of the Independent JPEG Group.
15
16IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
17(also known as JPEG, together with ITU-T SG16).
18
19
20DOCUMENTATION ROADMAP
21=====================
22
23This file contains the following sections:
24
25OVERVIEW General description of JPEG and the IJG software.
26LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
27REFERENCES Where to learn more about JPEG.
28ARCHIVE LOCATIONS Where to find newer versions of this software.
29ACKNOWLEDGMENTS Special thanks.
30FILE FORMAT WARS Software *not* to get.
31TO DO Plans for future IJG releases.
32
33Other documentation files in the distribution are:
34
35User documentation:
36 install.txt How to configure and install the IJG software.
37 usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
38 rdjpgcom, and wrjpgcom.
39 *.1 Unix-style man pages for programs (same info as usage.txt).
40 wizard.txt Advanced usage instructions for JPEG wizards only.
41 change.log Version-to-version change highlights.
42Programmer and internal documentation:
43 libjpeg.txt How to use the JPEG library in your own programs.
44 example.c Sample code for calling the JPEG library.
45 structure.txt Overview of the JPEG library's internal structure.
46 filelist.txt Road map of IJG files.
47 coderules.txt Coding style rules --- please read if you contribute code.
48
49Please read at least the files install.txt and usage.txt. Some information
50can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
51ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
52
53If you want to understand how the JPEG code works, we suggest reading one or
54more of the REFERENCES, then looking at the documentation files (in roughly
55the order listed) before diving into the code.
56
57
58OVERVIEW
59========
60
61This package contains C software to implement JPEG image encoding, decoding,
62and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
63method for full-color and gray-scale images.
64
65This software implements JPEG baseline, extended-sequential, and progressive
66compression processes. Provision is made for supporting all variants of these
67processes, although some uncommon parameter settings aren't implemented yet.
68We have made no provision for supporting the hierarchical or lossless
69processes defined in the standard.
70
71We provide a set of library routines for reading and writing JPEG image files,
72plus two sample applications "cjpeg" and "djpeg", which use the library to
73perform conversion between JPEG and some other popular image file formats.
74The library is intended to be reused in other applications.
75
76In order to support file conversion and viewing software, we have included
77considerable functionality beyond the bare JPEG coding/decoding capability;
78for example, the color quantization modules are not strictly part of JPEG
79decoding, but they are essential for output to colormapped file formats or
80colormapped displays. These extra functions can be compiled out of the
81library if not required for a particular application.
82
83We have also included "jpegtran", a utility for lossless transcoding between
84different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
85applications for inserting and extracting textual comments in JFIF files.
86
87The emphasis in designing this software has been on achieving portability and
88flexibility, while also making it fast enough to be useful. In particular,
89the software is not intended to be read as a tutorial on JPEG. (See the
90REFERENCES section for introductory material.) Rather, it is intended to
91be reliable, portable, industrial-strength code. We do not claim to have
92achieved that goal in every aspect of the software, but we strive for it.
93
94We welcome the use of this software as a component of commercial products.
95No royalty is required, but we do ask for an acknowledgement in product
96documentation, as described under LEGAL ISSUES.
97
98
99LEGAL ISSUES
100============
101
102In plain English:
103
1041. We don't promise that this software works. (But if you find any bugs,
105 please let us know!)
1062. You can use this software for whatever you want. You don't have to pay us.
1073. You may not pretend that you wrote this software. If you use it in a
108 program, you must acknowledge somewhere in your documentation that
109 you've used the IJG code.
110
111In legalese:
112
113The authors make NO WARRANTY or representation, either express or implied,
114with respect to this software, its quality, accuracy, merchantability, or
115fitness for a particular purpose. This software is provided "AS IS", and you,
116its user, assume the entire risk as to its quality and accuracy.
117
118This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
119All Rights Reserved except as specified below.
120
121Permission is hereby granted to use, copy, modify, and distribute this
122software (or portions thereof) for any purpose, without fee, subject to these
123conditions:
124(1) If any part of the source code for this software is distributed, then this
125README file must be included, with this copyright and no-warranty notice
126unaltered; and any additions, deletions, or changes to the original files
127must be clearly indicated in accompanying documentation.
128(2) If only executable code is distributed, then the accompanying
129documentation must state that "this software is based in part on the work of
130the Independent JPEG Group".
131(3) Permission for use of this software is granted only if the user accepts
132full responsibility for any undesirable consequences; the authors accept
133NO LIABILITY for damages of any kind.
134
135These conditions apply to any software derived from or based on the IJG code,
136not just to the unmodified library. If you use our work, you ought to
137acknowledge us.
138
139Permission is NOT granted for the use of any IJG author's name or company name
140in advertising or publicity relating to this software or products derived from
141it. This software may be referred to only as "the Independent JPEG Group's
142software".
143
144We specifically permit and encourage the use of this software as the basis of
145commercial products, provided that all warranty or liability claims are
146assumed by the product vendor.
147
148
149ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
150sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
151ansi2knr.c is NOT covered by the above copyright and conditions, but instead
152by the usual distribution terms of the Free Software Foundation; principally,
153that you must include source code if you redistribute it. (See the file
154ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
155of any program generated from the IJG code, this does not limit you more than
156the foregoing paragraphs do.
157
158The Unix configuration script "configure" was produced with GNU Autoconf.
159It is copyright by the Free Software Foundation but is freely distributable.
160The same holds for its supporting scripts (config.guess, config.sub,
161ltmain.sh). Another support script, install-sh, is copyright by X Consortium
162but is also freely distributable.
163
164The IJG distribution formerly included code to read and write GIF files.
165To avoid entanglement with the Unisys LZW patent, GIF reading support has
166been removed altogether, and the GIF writer has been simplified to produce
167"uncompressed GIFs". This technique does not use the LZW algorithm; the
168resulting GIF files are larger than usual, but are readable by all standard
169GIF decoders.
170
171We are required to state that
172 "The Graphics Interchange Format(c) is the Copyright property of
173 CompuServe Incorporated. GIF(sm) is a Service Mark property of
174 CompuServe Incorporated."
175
176
177REFERENCES
178==========
179
180We recommend reading one or more of these references before trying to
181understand the innards of the JPEG software.
182
183The best short technical introduction to the JPEG compression algorithm is
184 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
185 Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
186(Adjacent articles in that issue discuss MPEG motion picture compression,
187applications of JPEG, and related topics.) If you don't have the CACM issue
188handy, a PostScript file containing a revised version of Wallace's article is
189available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
190a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
191omits the sample images that appeared in CACM, but it includes corrections
192and some added material. Note: the Wallace article is copyright ACM and IEEE,
193and it may not be used for commercial purposes.
194
195A somewhat less technical, more leisurely introduction to JPEG can be found in
196"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
197M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
198good explanations and example C code for a multitude of compression methods
199including JPEG. It is an excellent source if you are comfortable reading C
200code but don't know much about data compression in general. The book's JPEG
201sample code is far from industrial-strength, but when you are ready to look
202at a full implementation, you've got one here...
203
204The best currently available description of JPEG is the textbook "JPEG Still
205Image Data Compression Standard" by William B. Pennebaker and Joan L.
206Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
207Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
208standards (DIS 10918-1 and draft DIS 10918-2).
209Although this is by far the most detailed and comprehensive exposition of
210JPEG publicly available, we point out that it is still missing an explanation
211of the most essential properties and algorithms of the underlying DCT
212technology.
213If you think that you know about DCT-based JPEG after reading this book,
214then you are in delusion. The real fundamentals and corresponding potential
215of DCT-based JPEG are not publicly known so far, and that is the reason for
216all the mistaken developments taking place in the image coding domain.
217
218The original JPEG standard is divided into two parts, Part 1 being the actual
219specification, while Part 2 covers compliance testing methods. Part 1 is
220titled "Digital Compression and Coding of Continuous-tone Still Images,
221Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
22210918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
223Continuous-tone Still Images, Part 2: Compliance testing" and has document
224numbers ISO/IEC IS 10918-2, ITU-T T.83.
225IJG JPEG 8 introduces an implementation of the JPEG SmartScale extension
226which is specified in two documents: A contributed document at ITU and ISO
227with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced
228Image Coding", April 2006, Geneva, Switzerland. The latest version of this
229document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N
2305799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany.
231
232The JPEG standard does not specify all details of an interchangeable file
233format. For the omitted details we follow the "JFIF" conventions, revision
2341.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
235and thus received a formal publication status. It is available as a free
236download in PDF format from
237http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
238A PostScript version of the JFIF document is available at
239http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
240http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
241
242The TIFF 6.0 file format specification can be obtained by FTP from
243ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
244found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
245IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
246Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
247(Compression tag 7). Copies of this Note can be obtained from
248http://www.ijg.org/files/. It is expected that the next revision
249of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
250Although IJG's own code does not support TIFF/JPEG, the free libtiff library
251uses our library to implement TIFF/JPEG per the Note.
252
253
254ARCHIVE LOCATIONS
255=================
256
257The "official" archive site for this software is www.ijg.org.
258The most recent released version can always be found there in
259directory "files". This particular version will be archived as
260http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible
261"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip.
262
263The JPEG FAQ (Frequently Asked Questions) article is a source of some
264general information about JPEG.
265It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
266and other news.answers archive sites, including the official news.answers
267archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
268If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
269with body
270 send usenet/news.answers/jpeg-faq/part1
271 send usenet/news.answers/jpeg-faq/part2
272
273
274ACKNOWLEDGMENTS
275===============
276
277Thank to Juergen Bruder for providing me with a copy of the common DCT
278algorithm article, only to find out that I had come to the same result
279in a more direct and comprehensible way with a more generative approach.
280
281Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the
282ITU JPEG (Study Group 16) meeting in Geneva, Switzerland.
283
284Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
285Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
286
287Thank to Thomas Richter and Daniel Lee for inviting me to the
288ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16)
289meeting in Berlin, Germany.
290
291Thank to John Korejwa and Massimo Ballerini for inviting me to
292fruitful consultations in Boston, MA and Milan, Italy.
293
294Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
295Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel
296for corresponding business development.
297
298Thank to Nico Zschach and Dirk Stelling of the technical support team
299at the Digital Images company in Halle for providing me with extra
300equipment for configuration tests.
301
302Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful
303communication about JPEG configuration in Sigma Photo Pro software.
304
305Thank to Andrew Finkenstadt for hosting the ijg.org site.
306
307Last but not least special thank to Thomas G. Lane for the original
308design and development of this singular software package.
309
310
311FILE FORMAT WARS
312================
313
314The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
315with ITU-T SG16) currently promotes different formats containing the name
316"JPEG" which is misleading because these formats are incompatible with
317original DCT-based JPEG and are based on faulty technologies.
318IJG therefore does not and will not support such momentary mistakes
319(see REFERENCES).
320There exist also distributions under the name "OpenJPEG" promoting such
321kind of formats which is misleading because they don't support original
322JPEG images.
323We have no sympathy for the promotion of inferior formats. Indeed, one of
324the original reasons for developing this free software was to help force
325convergence on common, interoperable format standards for JPEG files.
326Don't use an incompatible file format!
327(In any case, our decoder will remain capable of reading existing JPEG
328image files indefinitely.)
329
330Furthermore, the ISO committee pretends to be "responsible for the popular
331JPEG" in their public reports which is not true because they don't respond to
332actual requirements for the maintenance of the original JPEG specification.
333
334There are currently distributions in circulation containing the name
335"libjpeg" which claim to be a "derivative" or "fork" of the original
336libjpeg, but don't have the features and are incompatible with formats
337supported by actual IJG libjpeg distributions. Furthermore, they
338violate the license conditions as described under LEGAL ISSUES above.
339We have no sympathy for the release of misleading and illegal
340distributions derived from obsolete code bases.
341Don't use an obsolete code base!
342
343
344TO DO
345=====
346
347Version 8 is the first release of a new generation JPEG standard
348to overcome the limitations of the original JPEG specification.
349More features are being prepared for coming releases...
350
351Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/aclocal.m4 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/aclocal.m4
new file mode 100644
index 0000000..877e89d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/aclocal.m4
@@ -0,0 +1,9652 @@
1# generated automatically by aclocal 1.11.2 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5# Inc.
6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18[m4_warning([this file was generated for autoconf 2.68.
19You have another version of autoconf. It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
21To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
23# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24#
25# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27# Foundation, Inc.
28# Written by Gordon Matzigkeit, 1996
29#
30# This file is free software; the Free Software Foundation gives
31# unlimited permission to copy and/or distribute it, with or without
32# modifications, as long as this notice is preserved.
33
34m4_define([_LT_COPYING], [dnl
35# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37# Foundation, Inc.
38# Written by Gordon Matzigkeit, 1996
39#
40# This file is part of GNU Libtool.
41#
42# GNU Libtool is free software; you can redistribute it and/or
43# modify it under the terms of the GNU General Public License as
44# published by the Free Software Foundation; either version 2 of
45# the License, or (at your option) any later version.
46#
47# As a special exception to the GNU General Public License,
48# if you distribute this file as part of a program or library that
49# is built using GNU Libtool, you may include this file under the
50# same distribution terms that you use for the rest of that program.
51#
52# GNU Libtool is distributed in the hope that it will be useful,
53# but WITHOUT ANY WARRANTY; without even the implied warranty of
54# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55# GNU General Public License for more details.
56#
57# You should have received a copy of the GNU General Public License
58# along with GNU Libtool; see the file COPYING. If not, a copy
59# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60# obtained by writing to the Free Software Foundation, Inc.,
61# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62])
63
64# serial 57 LT_INIT
65
66
67# LT_PREREQ(VERSION)
68# ------------------
69# Complain and exit if this libtool version is less that VERSION.
70m4_defun([LT_PREREQ],
71[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72 [m4_default([$3],
73 [m4_fatal([Libtool version $1 or higher is required],
74 63)])],
75 [$2])])
76
77
78# _LT_CHECK_BUILDDIR
79# ------------------
80# Complain if the absolute build directory name contains unusual characters
81m4_defun([_LT_CHECK_BUILDDIR],
82[case `pwd` in
83 *\ * | *\ *)
84 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85esac
86])
87
88
89# LT_INIT([OPTIONS])
90# ------------------
91AC_DEFUN([LT_INIT],
92[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
93AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94AC_BEFORE([$0], [LT_LANG])dnl
95AC_BEFORE([$0], [LT_OUTPUT])dnl
96AC_BEFORE([$0], [LTDL_INIT])dnl
97m4_require([_LT_CHECK_BUILDDIR])dnl
98
99dnl Autoconf doesn't catch unexpanded LT_ macros by default:
100m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103dnl unless we require an AC_DEFUNed macro:
104AC_REQUIRE([LTOPTIONS_VERSION])dnl
105AC_REQUIRE([LTSUGAR_VERSION])dnl
106AC_REQUIRE([LTVERSION_VERSION])dnl
107AC_REQUIRE([LTOBSOLETE_VERSION])dnl
108m4_require([_LT_PROG_LTMAIN])dnl
109
110_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111
112dnl Parse OPTIONS
113_LT_SET_OPTIONS([$0], [$1])
114
115# This can be used to rebuild libtool when needed
116LIBTOOL_DEPS="$ltmain"
117
118# Always use our own libtool.
119LIBTOOL='$(SHELL) $(top_builddir)/libtool'
120AC_SUBST(LIBTOOL)dnl
121
122_LT_SETUP
123
124# Only expand once:
125m4_define([LT_INIT])
126])# LT_INIT
127
128# Old names:
129AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131dnl aclocal-1.4 backwards compatibility:
132dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134
135
136# _LT_CC_BASENAME(CC)
137# -------------------
138# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
139m4_defun([_LT_CC_BASENAME],
140[for cc_temp in $1""; do
141 case $cc_temp in
142 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144 \-*) ;;
145 *) break;;
146 esac
147done
148cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149])
150
151
152# _LT_FILEUTILS_DEFAULTS
153# ----------------------
154# It is okay to use these file commands and assume they have been set
155# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156m4_defun([_LT_FILEUTILS_DEFAULTS],
157[: ${CP="cp -f"}
158: ${MV="mv -f"}
159: ${RM="rm -f"}
160])# _LT_FILEUTILS_DEFAULTS
161
162
163# _LT_SETUP
164# ---------
165m4_defun([_LT_SETUP],
166[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167AC_REQUIRE([AC_CANONICAL_BUILD])dnl
168AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
169AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170
171_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172dnl
173_LT_DECL([], [host_alias], [0], [The host system])dnl
174_LT_DECL([], [host], [0])dnl
175_LT_DECL([], [host_os], [0])dnl
176dnl
177_LT_DECL([], [build_alias], [0], [The build system])dnl
178_LT_DECL([], [build], [0])dnl
179_LT_DECL([], [build_os], [0])dnl
180dnl
181AC_REQUIRE([AC_PROG_CC])dnl
182AC_REQUIRE([LT_PATH_LD])dnl
183AC_REQUIRE([LT_PATH_NM])dnl
184dnl
185AC_REQUIRE([AC_PROG_LN_S])dnl
186test -z "$LN_S" && LN_S="ln -s"
187_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
188dnl
189AC_REQUIRE([LT_CMD_MAX_LEN])dnl
190_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192dnl
193m4_require([_LT_FILEUTILS_DEFAULTS])dnl
194m4_require([_LT_CHECK_SHELL_FEATURES])dnl
195m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196m4_require([_LT_CMD_RELOAD])dnl
197m4_require([_LT_CHECK_MAGIC_METHOD])dnl
198m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199m4_require([_LT_CMD_OLD_ARCHIVE])dnl
200m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201m4_require([_LT_WITH_SYSROOT])dnl
202
203_LT_CONFIG_LIBTOOL_INIT([
204# See if we are running on zsh, and set the options which allow our
205# commands through without removal of \ escapes INIT.
206if test -n "\${ZSH_VERSION+set}" ; then
207 setopt NO_GLOB_SUBST
208fi
209])
210if test -n "${ZSH_VERSION+set}" ; then
211 setopt NO_GLOB_SUBST
212fi
213
214_LT_CHECK_OBJDIR
215
216m4_require([_LT_TAG_COMPILER])dnl
217
218case $host_os in
219aix3*)
220 # AIX sometimes has problems with the GCC collect2 program. For some
221 # reason, if we set the COLLECT_NAMES environment variable, the problems
222 # vanish in a puff of smoke.
223 if test "X${COLLECT_NAMES+set}" != Xset; then
224 COLLECT_NAMES=
225 export COLLECT_NAMES
226 fi
227 ;;
228esac
229
230# Global variables:
231ofile=libtool
232can_build_shared=yes
233
234# All known linkers require a `.a' archive for static linking (except MSVC,
235# which needs '.lib').
236libext=a
237
238with_gnu_ld="$lt_cv_prog_gnu_ld"
239
240old_CC="$CC"
241old_CFLAGS="$CFLAGS"
242
243# Set sane defaults for various variables
244test -z "$CC" && CC=cc
245test -z "$LTCC" && LTCC=$CC
246test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247test -z "$LD" && LD=ld
248test -z "$ac_objext" && ac_objext=o
249
250_LT_CC_BASENAME([$compiler])
251
252# Only perform the check for file, if the check method requires it
253test -z "$MAGIC_CMD" && MAGIC_CMD=file
254case $deplibs_check_method in
255file_magic*)
256 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257 _LT_PATH_MAGIC
258 fi
259 ;;
260esac
261
262# Use C for the default configuration in the libtool script
263LT_SUPPORTED_TAG([CC])
264_LT_LANG_C_CONFIG
265_LT_LANG_DEFAULT_CONFIG
266_LT_CONFIG_COMMANDS
267])# _LT_SETUP
268
269
270# _LT_PREPARE_SED_QUOTE_VARS
271# --------------------------
272# Define a few sed substitution that help us do robust quoting.
273m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
274[# Backslashify metacharacters that are still active within
275# double-quoted strings.
276sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277
278# Same as above, but do not quote variable references.
279double_quote_subst='s/\([["`\\]]\)/\\\1/g'
280
281# Sed substitution to delay expansion of an escaped shell variable in a
282# double_quote_subst'ed string.
283delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284
285# Sed substitution to delay expansion of an escaped single quote.
286delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
287
288# Sed substitution to avoid accidental globbing in evaled expressions
289no_glob_subst='s/\*/\\\*/g'
290])
291
292# _LT_PROG_LTMAIN
293# ---------------
294# Note that this code is called both from `configure', and `config.status'
295# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
296# `config.status' has no value for ac_aux_dir unless we are using Automake,
297# so we pass a copy along to make sure it has a sensible value anyway.
298m4_defun([_LT_PROG_LTMAIN],
299[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301ltmain="$ac_aux_dir/ltmain.sh"
302])# _LT_PROG_LTMAIN
303
304
305
306# So that we can recreate a full libtool script including additional
307# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308# in macros and then make a single call at the end using the `libtool'
309# label.
310
311
312# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313# ----------------------------------------
314# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315m4_define([_LT_CONFIG_LIBTOOL_INIT],
316[m4_ifval([$1],
317 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318 [$1
319])])])
320
321# Initialize.
322m4_define([_LT_OUTPUT_LIBTOOL_INIT])
323
324
325# _LT_CONFIG_LIBTOOL([COMMANDS])
326# ------------------------------
327# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328m4_define([_LT_CONFIG_LIBTOOL],
329[m4_ifval([$1],
330 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331 [$1
332])])])
333
334# Initialize.
335m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336
337
338# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339# -----------------------------------------------------
340m4_defun([_LT_CONFIG_SAVE_COMMANDS],
341[_LT_CONFIG_LIBTOOL([$1])
342_LT_CONFIG_LIBTOOL_INIT([$2])
343])
344
345
346# _LT_FORMAT_COMMENT([COMMENT])
347# -----------------------------
348# Add leading comment marks to the start of each line, and a trailing
349# full-stop to the whole comment if one is not present already.
350m4_define([_LT_FORMAT_COMMENT],
351[m4_ifval([$1], [
352m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354)])
355
356
357
358
359
360# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361# -------------------------------------------------------------------
362# CONFIGNAME is the name given to the value in the libtool script.
363# VARNAME is the (base) name used in the configure script.
364# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365# VARNAME. Any other value will be used directly.
366m4_define([_LT_DECL],
367[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369 [m4_ifval([$1], [$1], [$2])])
370 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371 m4_ifval([$4],
372 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373 lt_dict_add_subkey([lt_decl_dict], [$2],
374 [tagged?], [m4_ifval([$5], [yes], [no])])])
375])
376
377
378# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379# --------------------------------------------------------
380m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381
382
383# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384# ------------------------------------------------
385m4_define([lt_decl_tag_varnames],
386[_lt_decl_filter([tagged?], [yes], $@)])
387
388
389# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390# ---------------------------------------------------------
391m4_define([_lt_decl_filter],
392[m4_case([$#],
393 [0], [m4_fatal([$0: too few arguments: $#])],
394 [1], [m4_fatal([$0: too few arguments: $#: $1])],
395 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
398])
399
400
401# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402# --------------------------------------------------
403m4_define([lt_decl_quote_varnames],
404[_lt_decl_filter([value], [1], $@)])
405
406
407# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408# ---------------------------------------------------
409m4_define([lt_decl_dquote_varnames],
410[_lt_decl_filter([value], [2], $@)])
411
412
413# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414# ---------------------------------------------------
415m4_define([lt_decl_varnames_tagged],
416[m4_assert([$# <= 2])dnl
417_$0(m4_quote(m4_default([$1], [[, ]])),
418 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420m4_define([_lt_decl_varnames_tagged],
421[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422
423
424# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425# ------------------------------------------------
426m4_define([lt_decl_all_varnames],
427[_$0(m4_quote(m4_default([$1], [[, ]])),
428 m4_if([$2], [],
429 m4_quote(lt_decl_varnames),
430 m4_quote(m4_shift($@))))[]dnl
431])
432m4_define([_lt_decl_all_varnames],
433[lt_join($@, lt_decl_varnames_tagged([$1],
434 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
435])
436
437
438# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439# ------------------------------------
440# Quote a variable value, and forward it to `config.status' so that its
441# declaration there will have the same value as in `configure'. VARNAME
442# must have a single quote delimited value for this to work.
443m4_define([_LT_CONFIG_STATUS_DECLARE],
444[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445
446
447# _LT_CONFIG_STATUS_DECLARATIONS
448# ------------------------------
449# We delimit libtool config variables with single quotes, so when
450# we write them to config.status, we have to be sure to quote all
451# embedded single quotes properly. In configure, this macro expands
452# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453#
454# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458
459
460# _LT_LIBTOOL_TAGS
461# ----------------
462# Output comment and list of tags supported by the script
463m4_defun([_LT_LIBTOOL_TAGS],
464[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465available_tags="_LT_TAGS"dnl
466])
467
468
469# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470# -----------------------------------
471# Extract the dictionary values for VARNAME (optionally with TAG) and
472# expand to a commented shell variable setting:
473#
474# # Some comment about what VAR is for.
475# visible_name=$lt_internal_name
476m4_define([_LT_LIBTOOL_DECLARE],
477[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478 [description])))[]dnl
479m4_pushdef([_libtool_name],
480 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482 [0], [_libtool_name=[$]$1],
483 [1], [_libtool_name=$lt_[]$1],
484 [2], [_libtool_name=$lt_[]$1],
485 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487])
488
489
490# _LT_LIBTOOL_CONFIG_VARS
491# -----------------------
492# Produce commented declarations of non-tagged libtool config variables
493# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
495# section) are produced by _LT_LIBTOOL_TAG_VARS.
496m4_defun([_LT_LIBTOOL_CONFIG_VARS],
497[m4_foreach([_lt_var],
498 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500
501
502# _LT_LIBTOOL_TAG_VARS(TAG)
503# -------------------------
504m4_define([_LT_LIBTOOL_TAG_VARS],
505[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507
508
509# _LT_TAGVAR(VARNAME, [TAGNAME])
510# ------------------------------
511m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512
513
514# _LT_CONFIG_COMMANDS
515# -------------------
516# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
517# variables for single and double quote escaping we saved from calls
518# to _LT_DECL, we can put quote escaped variables declarations
519# into `config.status', and then the shell code to quote escape them in
520# for loops in `config.status'. Finally, any additional code accumulated
521# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522m4_defun([_LT_CONFIG_COMMANDS],
523[AC_PROVIDE_IFELSE([LT_OUTPUT],
524 dnl If the libtool generation code has been placed in $CONFIG_LT,
525 dnl instead of duplicating it all over again into config.status,
526 dnl then we will have config.status run $CONFIG_LT later, so it
527 dnl needs to know what name is stored there:
528 [AC_CONFIG_COMMANDS([libtool],
529 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530 dnl If the libtool generation code is destined for config.status,
531 dnl expand the accumulated commands and init code now:
532 [AC_CONFIG_COMMANDS([libtool],
533 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534])#_LT_CONFIG_COMMANDS
535
536
537# Initialize.
538m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539[
540
541# The HP-UX ksh and POSIX shell print the target directory to stdout
542# if CDPATH is set.
543(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544
545sed_quote_subst='$sed_quote_subst'
546double_quote_subst='$double_quote_subst'
547delay_variable_subst='$delay_variable_subst'
548_LT_CONFIG_STATUS_DECLARATIONS
549LTCC='$LTCC'
550LTCFLAGS='$LTCFLAGS'
551compiler='$compiler_DEFAULT'
552
553# A function that is used when there is no print builtin or printf.
554func_fallback_echo ()
555{
556 eval 'cat <<_LTECHO_EOF
557\$[]1
558_LTECHO_EOF'
559}
560
561# Quote evaled strings.
562for var in lt_decl_all_varnames([[ \
563]], lt_decl_quote_varnames); do
564 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565 *[[\\\\\\\`\\"\\\$]]*)
566 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567 ;;
568 *)
569 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570 ;;
571 esac
572done
573
574# Double-quote double-evaled strings.
575for var in lt_decl_all_varnames([[ \
576]], lt_decl_dquote_varnames); do
577 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578 *[[\\\\\\\`\\"\\\$]]*)
579 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580 ;;
581 *)
582 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583 ;;
584 esac
585done
586
587_LT_OUTPUT_LIBTOOL_INIT
588])
589
590# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
591# ------------------------------------
592# Generate a child script FILE with all initialization necessary to
593# reuse the environment learned by the parent script, and make the
594# file executable. If COMMENT is supplied, it is inserted after the
595# `#!' sequence but before initialization text begins. After this
596# macro, additional text can be appended to FILE to form the body of
597# the child script. The macro ends with non-zero status if the
598# file could not be fully written (such as if the disk is full).
599m4_ifdef([AS_INIT_GENERATED],
600[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
601[m4_defun([_LT_GENERATED_FILE_INIT],
602[m4_require([AS_PREPARE])]dnl
603[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
604[lt_write_fail=0
605cat >$1 <<_ASEOF || lt_write_fail=1
606#! $SHELL
607# Generated by $as_me.
608$2
609SHELL=\${CONFIG_SHELL-$SHELL}
610export SHELL
611_ASEOF
612cat >>$1 <<\_ASEOF || lt_write_fail=1
613AS_SHELL_SANITIZE
614_AS_PREPARE
615exec AS_MESSAGE_FD>&1
616_ASEOF
617test $lt_write_fail = 0 && chmod +x $1[]dnl
618m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619
620# LT_OUTPUT
621# ---------
622# This macro allows early generation of the libtool script (before
623# AC_OUTPUT is called), incase it is used in configure for compilation
624# tests.
625AC_DEFUN([LT_OUTPUT],
626[: ${CONFIG_LT=./config.lt}
627AC_MSG_NOTICE([creating $CONFIG_LT])
628_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
629[# Run this file to recreate a libtool stub with the current configuration.])
630
631cat >>"$CONFIG_LT" <<\_LTEOF
632lt_cl_silent=false
633exec AS_MESSAGE_LOG_FD>>config.log
634{
635 echo
636 AS_BOX([Running $as_me.])
637} >&AS_MESSAGE_LOG_FD
638
639lt_cl_help="\
640\`$as_me' creates a local libtool stub from the current configuration,
641for use in further configure time tests before the real libtool is
642generated.
643
644Usage: $[0] [[OPTIONS]]
645
646 -h, --help print this help, then exit
647 -V, --version print version number, then exit
648 -q, --quiet do not print progress messages
649 -d, --debug don't remove temporary files
650
651Report bugs to <bug-libtool@gnu.org>."
652
653lt_cl_version="\
654m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656configured by $[0], generated by m4_PACKAGE_STRING.
657
658Copyright (C) 2011 Free Software Foundation, Inc.
659This config.lt script is free software; the Free Software Foundation
660gives unlimited permision to copy, distribute and modify it."
661
662while test $[#] != 0
663do
664 case $[1] in
665 --version | --v* | -V )
666 echo "$lt_cl_version"; exit 0 ;;
667 --help | --h* | -h )
668 echo "$lt_cl_help"; exit 0 ;;
669 --debug | --d* | -d )
670 debug=: ;;
671 --quiet | --q* | --silent | --s* | -q )
672 lt_cl_silent=: ;;
673
674 -*) AC_MSG_ERROR([unrecognized option: $[1]
675Try \`$[0] --help' for more information.]) ;;
676
677 *) AC_MSG_ERROR([unrecognized argument: $[1]
678Try \`$[0] --help' for more information.]) ;;
679 esac
680 shift
681done
682
683if $lt_cl_silent; then
684 exec AS_MESSAGE_FD>/dev/null
685fi
686_LTEOF
687
688cat >>"$CONFIG_LT" <<_LTEOF
689_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690_LTEOF
691
692cat >>"$CONFIG_LT" <<\_LTEOF
693AC_MSG_NOTICE([creating $ofile])
694_LT_OUTPUT_LIBTOOL_COMMANDS
695AS_EXIT(0)
696_LTEOF
697chmod +x "$CONFIG_LT"
698
699# configure is writing to config.log, but config.lt does its own redirection,
700# appending to config.log, which fails on DOS, as config.log is still kept
701# open by configure. Here we exec the FD to /dev/null, effectively closing
702# config.log, so it can be properly (re)opened and appended to by config.lt.
703lt_cl_success=:
704test "$silent" = yes &&
705 lt_config_lt_args="$lt_config_lt_args --quiet"
706exec AS_MESSAGE_LOG_FD>/dev/null
707$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
708exec AS_MESSAGE_LOG_FD>>config.log
709$lt_cl_success || AS_EXIT(1)
710])# LT_OUTPUT
711
712
713# _LT_CONFIG(TAG)
714# ---------------
715# If TAG is the built-in tag, create an initial libtool script with a
716# default configuration from the untagged config vars. Otherwise add code
717# to config.status for appending the configuration named by TAG from the
718# matching tagged config vars.
719m4_defun([_LT_CONFIG],
720[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721_LT_CONFIG_SAVE_COMMANDS([
722 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723 m4_if(_LT_TAG, [C], [
724 # See if we are running on zsh, and set the options which allow our
725 # commands through without removal of \ escapes.
726 if test -n "${ZSH_VERSION+set}" ; then
727 setopt NO_GLOB_SUBST
728 fi
729
730 cfgfile="${ofile}T"
731 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732 $RM "$cfgfile"
733
734 cat <<_LT_EOF >> "$cfgfile"
735#! $SHELL
736
737# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741#
742_LT_COPYING
743_LT_LIBTOOL_TAGS
744
745# ### BEGIN LIBTOOL CONFIG
746_LT_LIBTOOL_CONFIG_VARS
747_LT_LIBTOOL_TAG_VARS
748# ### END LIBTOOL CONFIG
749
750_LT_EOF
751
752 case $host_os in
753 aix3*)
754 cat <<\_LT_EOF >> "$cfgfile"
755# AIX sometimes has problems with the GCC collect2 program. For some
756# reason, if we set the COLLECT_NAMES environment variable, the problems
757# vanish in a puff of smoke.
758if test "X${COLLECT_NAMES+set}" != Xset; then
759 COLLECT_NAMES=
760 export COLLECT_NAMES
761fi
762_LT_EOF
763 ;;
764 esac
765
766 _LT_PROG_LTMAIN
767
768 # We use sed instead of cat because bash on DJGPP gets confused if
769 # if finds mixed CR/LF and LF-only lines. Since sed operates in
770 # text mode, it properly converts lines to CR/LF. This bash problem
771 # is reportedly fixed, but why not run on old versions too?
772 sed '$q' "$ltmain" >> "$cfgfile" \
773 || (rm -f "$cfgfile"; exit 1)
774
775 _LT_PROG_REPLACE_SHELLFNS
776
777 mv -f "$cfgfile" "$ofile" ||
778 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779 chmod +x "$ofile"
780],
781[cat <<_LT_EOF >> "$ofile"
782
783dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784dnl in a comment (ie after a #).
785# ### BEGIN LIBTOOL TAG CONFIG: $1
786_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787# ### END LIBTOOL TAG CONFIG: $1
788_LT_EOF
789])dnl /m4_if
790],
791[m4_if([$1], [], [
792 PACKAGE='$PACKAGE'
793 VERSION='$VERSION'
794 TIMESTAMP='$TIMESTAMP'
795 RM='$RM'
796 ofile='$ofile'], [])
797])dnl /_LT_CONFIG_SAVE_COMMANDS
798])# _LT_CONFIG
799
800
801# LT_SUPPORTED_TAG(TAG)
802# ---------------------
803# Trace this macro to discover what tags are supported by the libtool
804# --tag option, using:
805# autoconf --trace 'LT_SUPPORTED_TAG:$1'
806AC_DEFUN([LT_SUPPORTED_TAG], [])
807
808
809# C support is built-in for now
810m4_define([_LT_LANG_C_enabled], [])
811m4_define([_LT_TAGS], [])
812
813
814# LT_LANG(LANG)
815# -------------
816# Enable libtool support for the given language if not already enabled.
817AC_DEFUN([LT_LANG],
818[AC_BEFORE([$0], [LT_OUTPUT])dnl
819m4_case([$1],
820 [C], [_LT_LANG(C)],
821 [C++], [_LT_LANG(CXX)],
822 [Go], [_LT_LANG(GO)],
823 [Java], [_LT_LANG(GCJ)],
824 [Fortran 77], [_LT_LANG(F77)],
825 [Fortran], [_LT_LANG(FC)],
826 [Windows Resource], [_LT_LANG(RC)],
827 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828 [_LT_LANG($1)],
829 [m4_fatal([$0: unsupported language: "$1"])])])dnl
830])# LT_LANG
831
832
833# _LT_LANG(LANGNAME)
834# ------------------
835m4_defun([_LT_LANG],
836[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837 [LT_SUPPORTED_TAG([$1])dnl
838 m4_append([_LT_TAGS], [$1 ])dnl
839 m4_define([_LT_LANG_]$1[_enabled], [])dnl
840 _LT_LANG_$1_CONFIG($1)])dnl
841])# _LT_LANG
842
843
844m4_ifndef([AC_PROG_GO], [
845# NOTE: This macro has been submitted for inclusion into #
846# GNU Autoconf as AC_PROG_GO. When it is available in #
847# a released version of Autoconf we should remove this #
848# macro and use it instead. #
849m4_defun([AC_PROG_GO],
850[AC_LANG_PUSH(Go)dnl
851AC_ARG_VAR([GOC], [Go compiler command])dnl
852AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853_AC_ARG_VAR_LDFLAGS()dnl
854AC_CHECK_TOOL(GOC, gccgo)
855if test -z "$GOC"; then
856 if test -n "$ac_tool_prefix"; then
857 AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858 fi
859fi
860if test -z "$GOC"; then
861 AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862fi
863])#m4_defun
864])#m4_ifndef
865
866
867# _LT_LANG_DEFAULT_CONFIG
868# -----------------------
869m4_defun([_LT_LANG_DEFAULT_CONFIG],
870[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871 [LT_LANG(CXX)],
872 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873
874AC_PROVIDE_IFELSE([AC_PROG_F77],
875 [LT_LANG(F77)],
876 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877
878AC_PROVIDE_IFELSE([AC_PROG_FC],
879 [LT_LANG(FC)],
880 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881
882dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883dnl pulling things in needlessly.
884AC_PROVIDE_IFELSE([AC_PROG_GCJ],
885 [LT_LANG(GCJ)],
886 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887 [LT_LANG(GCJ)],
888 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889 [LT_LANG(GCJ)],
890 [m4_ifdef([AC_PROG_GCJ],
891 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892 m4_ifdef([A][M_PROG_GCJ],
893 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894 m4_ifdef([LT_PROG_GCJ],
895 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896
897AC_PROVIDE_IFELSE([AC_PROG_GO],
898 [LT_LANG(GO)],
899 [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900
901AC_PROVIDE_IFELSE([LT_PROG_RC],
902 [LT_LANG(RC)],
903 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904])# _LT_LANG_DEFAULT_CONFIG
905
906# Obsolete macros:
907AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
911AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912dnl aclocal-1.4 backwards compatibility:
913dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914dnl AC_DEFUN([AC_LIBTOOL_F77], [])
915dnl AC_DEFUN([AC_LIBTOOL_FC], [])
916dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
917dnl AC_DEFUN([AC_LIBTOOL_RC], [])
918
919
920# _LT_TAG_COMPILER
921# ----------------
922m4_defun([_LT_TAG_COMPILER],
923[AC_REQUIRE([AC_PROG_CC])dnl
924
925_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929
930# If no C compiler was specified, use CC.
931LTCC=${LTCC-"$CC"}
932
933# If no C compiler flags were specified, use CFLAGS.
934LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935
936# Allow CC to be a program name with arguments.
937compiler=$CC
938])# _LT_TAG_COMPILER
939
940
941# _LT_COMPILER_BOILERPLATE
942# ------------------------
943# Check for compiler boilerplate output or warnings with
944# the simple compiler test code.
945m4_defun([_LT_COMPILER_BOILERPLATE],
946[m4_require([_LT_DECL_SED])dnl
947ac_outfile=conftest.$ac_objext
948echo "$lt_simple_compile_test_code" >conftest.$ac_ext
949eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950_lt_compiler_boilerplate=`cat conftest.err`
951$RM conftest*
952])# _LT_COMPILER_BOILERPLATE
953
954
955# _LT_LINKER_BOILERPLATE
956# ----------------------
957# Check for linker boilerplate output or warnings with
958# the simple link test code.
959m4_defun([_LT_LINKER_BOILERPLATE],
960[m4_require([_LT_DECL_SED])dnl
961ac_outfile=conftest.$ac_objext
962echo "$lt_simple_link_test_code" >conftest.$ac_ext
963eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964_lt_linker_boilerplate=`cat conftest.err`
965$RM -r conftest*
966])# _LT_LINKER_BOILERPLATE
967
968# _LT_REQUIRED_DARWIN_CHECKS
969# -------------------------
970m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971 case $host_os in
972 rhapsody* | darwin*)
973 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975 AC_CHECK_TOOL([LIPO], [lipo], [:])
976 AC_CHECK_TOOL([OTOOL], [otool], [:])
977 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978 _LT_DECL([], [DSYMUTIL], [1],
979 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980 _LT_DECL([], [NMEDIT], [1],
981 [Tool to change global to local symbols on Mac OS X])
982 _LT_DECL([], [LIPO], [1],
983 [Tool to manipulate fat objects and archives on Mac OS X])
984 _LT_DECL([], [OTOOL], [1],
985 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986 _LT_DECL([], [OTOOL64], [1],
987 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988
989 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990 [lt_cv_apple_cc_single_mod=no
991 if test -z "${LT_MULTI_MODULE}"; then
992 # By default we will add the -single_module flag. You can override
993 # by either setting the environment variable LT_MULTI_MODULE
994 # non-empty at configure time, or by adding -multi_module to the
995 # link flags.
996 rm -rf libconftest.dylib*
997 echo "int foo(void){return 1;}" > conftest.c
998 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002 _lt_result=$?
1003 # If there is a non-empty error log, and "single_module"
1004 # appears in it, assume the flag caused a linker warning
1005 if test -s conftest.err && $GREP single_module conftest.err; then
1006 cat conftest.err >&AS_MESSAGE_LOG_FD
1007 # Otherwise, if the output was created with a 0 exit code from
1008 # the compiler, it worked.
1009 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010 lt_cv_apple_cc_single_mod=yes
1011 else
1012 cat conftest.err >&AS_MESSAGE_LOG_FD
1013 fi
1014 rm -rf libconftest.dylib*
1015 rm -f conftest.*
1016 fi])
1017
1018 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019 [lt_cv_ld_exported_symbols_list],
1020 [lt_cv_ld_exported_symbols_list=no
1021 save_LDFLAGS=$LDFLAGS
1022 echo "_main" > conftest.sym
1023 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025 [lt_cv_ld_exported_symbols_list=yes],
1026 [lt_cv_ld_exported_symbols_list=no])
1027 LDFLAGS="$save_LDFLAGS"
1028 ])
1029
1030 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1031 [lt_cv_ld_force_load=no
1032 cat > conftest.c << _LT_EOF
1033int forced_loaded() { return 2;}
1034_LT_EOF
1035 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1036 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1037 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1038 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1039 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1040 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1041 cat > conftest.c << _LT_EOF
1042int main() { return 0;}
1043_LT_EOF
1044 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1045 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1046 _lt_result=$?
1047 if test -s conftest.err && $GREP force_load conftest.err; then
1048 cat conftest.err >&AS_MESSAGE_LOG_FD
1049 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1050 lt_cv_ld_force_load=yes
1051 else
1052 cat conftest.err >&AS_MESSAGE_LOG_FD
1053 fi
1054 rm -f conftest.err libconftest.a conftest conftest.c
1055 rm -rf conftest.dSYM
1056 ])
1057 case $host_os in
1058 rhapsody* | darwin1.[[012]])
1059 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060 darwin1.*)
1061 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062 darwin*) # darwin 5.x on
1063 # if running on 10.5 or later, the deployment target defaults
1064 # to the OS version, if on x86, and 10.4, the deployment
1065 # target defaults to 10.4. Don't you love it?
1066 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069 10.[[012]]*)
1070 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071 10.*)
1072 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073 esac
1074 ;;
1075 esac
1076 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077 _lt_dar_single_mod='$single_module'
1078 fi
1079 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081 else
1082 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083 fi
1084 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085 _lt_dsymutil='~$DSYMUTIL $lib || :'
1086 else
1087 _lt_dsymutil=
1088 fi
1089 ;;
1090 esac
1091])
1092
1093
1094# _LT_DARWIN_LINKER_FEATURES([TAG])
1095# ---------------------------------
1096# Checks for linker and compiler features on darwin
1097m4_defun([_LT_DARWIN_LINKER_FEATURES],
1098[
1099 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101 _LT_TAGVAR(hardcode_direct, $1)=no
1102 _LT_TAGVAR(hardcode_automatic, $1)=yes
1103 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1104 if test "$lt_cv_ld_force_load" = "yes"; then
1105 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1106 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108 else
1109 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110 fi
1111 _LT_TAGVAR(link_all_deplibs, $1)=yes
1112 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113 case $cc_basename in
1114 ifort*) _lt_dar_can_shared=yes ;;
1115 *) _lt_dar_can_shared=$GCC ;;
1116 esac
1117 if test "$_lt_dar_can_shared" = "yes"; then
1118 output_verbose_link_cmd=func_echo_all
1119 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1120 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1122 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1123 m4_if([$1], [CXX],
1124[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1126 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1127 fi
1128],[])
1129 else
1130 _LT_TAGVAR(ld_shlibs, $1)=no
1131 fi
1132])
1133
1134# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135# ----------------------------------
1136# Links a minimal program and checks the executable
1137# for the system default hardcoded library path. In most cases,
1138# this is /usr/lib:/lib, but when the MPI compilers are used
1139# the location of the communication and MPI libs are included too.
1140# If we don't find anything, use the default library path according
1141# to the aix ld manual.
1142# Store the results from the different compilers for each TAGNAME.
1143# Allow to override them for all tags through lt_cv_aix_libpath.
1144m4_defun([_LT_SYS_MODULE_PATH_AIX],
1145[m4_require([_LT_DECL_SED])dnl
1146if test "${lt_cv_aix_libpath+set}" = set; then
1147 aix_libpath=$lt_cv_aix_libpath
1148else
1149 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150 [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151 lt_aix_libpath_sed='[
1152 /Import File Strings/,/^$/ {
1153 /^0/ {
1154 s/^0 *\([^ ]*\) *$/\1/
1155 p
1156 }
1157 }]'
1158 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159 # Check for a 64-bit object if we didn't find anything.
1160 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162 fi],[])
1163 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165 fi
1166 ])
1167 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168fi
1169])# _LT_SYS_MODULE_PATH_AIX
1170
1171
1172# _LT_SHELL_INIT(ARG)
1173# -------------------
1174m4_define([_LT_SHELL_INIT],
1175[m4_divert_text([M4SH-INIT], [$1
1176])])# _LT_SHELL_INIT
1177
1178
1179
1180# _LT_PROG_ECHO_BACKSLASH
1181# -----------------------
1182# Find how we can fake an echo command that does not interpret backslash.
1183# In particular, with Autoconf 2.60 or later we add some code to the start
1184# of the generated configure script which will find a shell with a builtin
1185# printf (which we can use as an echo command).
1186m4_defun([_LT_PROG_ECHO_BACKSLASH],
1187[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1188ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1189ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190
1191AC_MSG_CHECKING([how to print strings])
1192# Test print first, because it will be a builtin if present.
1193if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1194 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1195 ECHO='print -r --'
1196elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1197 ECHO='printf %s\n'
1198else
1199 # Use this function as a fallback that always works.
1200 func_fallback_echo ()
1201 {
1202 eval 'cat <<_LTECHO_EOF
1203$[]1
1204_LTECHO_EOF'
1205 }
1206 ECHO='func_fallback_echo'
1207fi
1208
1209# func_echo_all arg...
1210# Invoke $ECHO with all args, space-separated.
1211func_echo_all ()
1212{
1213 $ECHO "$*"
1214}
1215
1216case "$ECHO" in
1217 printf*) AC_MSG_RESULT([printf]) ;;
1218 print*) AC_MSG_RESULT([print -r]) ;;
1219 *) AC_MSG_RESULT([cat]) ;;
1220esac
1221
1222m4_ifdef([_AS_DETECT_SUGGESTED],
1223[_AS_DETECT_SUGGESTED([
1224 test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1225 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1226 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1227 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1228 PATH=/empty FPATH=/empty; export PATH FPATH
1229 test "X`printf %s $ECHO`" = "X$ECHO" \
1230 || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231
1232_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1233_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234])# _LT_PROG_ECHO_BACKSLASH
1235
1236
1237# _LT_WITH_SYSROOT
1238# ----------------
1239AC_DEFUN([_LT_WITH_SYSROOT],
1240[AC_MSG_CHECKING([for sysroot])
1241AC_ARG_WITH([sysroot],
1242[ --with-sysroot[=DIR] Search for dependent libraries within DIR
1243 (or the compiler's sysroot if not specified).],
1244[], [with_sysroot=no])
1245
1246dnl lt_sysroot will always be passed unquoted. We quote it here
1247dnl in case the user passed a directory name.
1248lt_sysroot=
1249case ${with_sysroot} in #(
1250 yes)
1251 if test "$GCC" = yes; then
1252 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253 fi
1254 ;; #(
1255 /*)
1256 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257 ;; #(
1258 no|'')
1259 ;; #(
1260 *)
1261 AC_MSG_RESULT([${with_sysroot}])
1262 AC_MSG_ERROR([The sysroot must be an absolute path.])
1263 ;;
1264esac
1265
1266 AC_MSG_RESULT([${lt_sysroot:-no}])
1267_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268[dependent libraries, and in which our libraries should be installed.])])
1269
1270# _LT_ENABLE_LOCK
1271# ---------------
1272m4_defun([_LT_ENABLE_LOCK],
1273[AC_ARG_ENABLE([libtool-lock],
1274 [AS_HELP_STRING([--disable-libtool-lock],
1275 [avoid locking (might break parallel builds)])])
1276test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277
1278# Some flags need to be propagated to the compiler or linker for good
1279# libtool support.
1280case $host in
1281ia64-*-hpux*)
1282 # Find out which ABI we are using.
1283 echo 'int i;' > conftest.$ac_ext
1284 if AC_TRY_EVAL(ac_compile); then
1285 case `/usr/bin/file conftest.$ac_objext` in
1286 *ELF-32*)
1287 HPUX_IA64_MODE="32"
1288 ;;
1289 *ELF-64*)
1290 HPUX_IA64_MODE="64"
1291 ;;
1292 esac
1293 fi
1294 rm -rf conftest*
1295 ;;
1296*-*-irix6*)
1297 # Find out which ABI we are using.
1298 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299 if AC_TRY_EVAL(ac_compile); then
1300 if test "$lt_cv_prog_gnu_ld" = yes; then
1301 case `/usr/bin/file conftest.$ac_objext` in
1302 *32-bit*)
1303 LD="${LD-ld} -melf32bsmip"
1304 ;;
1305 *N32*)
1306 LD="${LD-ld} -melf32bmipn32"
1307 ;;
1308 *64-bit*)
1309 LD="${LD-ld} -melf64bmip"
1310 ;;
1311 esac
1312 else
1313 case `/usr/bin/file conftest.$ac_objext` in
1314 *32-bit*)
1315 LD="${LD-ld} -32"
1316 ;;
1317 *N32*)
1318 LD="${LD-ld} -n32"
1319 ;;
1320 *64-bit*)
1321 LD="${LD-ld} -64"
1322 ;;
1323 esac
1324 fi
1325 fi
1326 rm -rf conftest*
1327 ;;
1328
1329x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1330s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1331 # Find out which ABI we are using.
1332 echo 'int i;' > conftest.$ac_ext
1333 if AC_TRY_EVAL(ac_compile); then
1334 case `/usr/bin/file conftest.o` in
1335 *32-bit*)
1336 case $host in
1337 x86_64-*kfreebsd*-gnu)
1338 LD="${LD-ld} -m elf_i386_fbsd"
1339 ;;
1340 x86_64-*linux*)
1341 LD="${LD-ld} -m elf_i386"
1342 ;;
1343 ppc64-*linux*|powerpc64-*linux*)
1344 LD="${LD-ld} -m elf32ppclinux"
1345 ;;
1346 s390x-*linux*)
1347 LD="${LD-ld} -m elf_s390"
1348 ;;
1349 sparc64-*linux*)
1350 LD="${LD-ld} -m elf32_sparc"
1351 ;;
1352 esac
1353 ;;
1354 *64-bit*)
1355 case $host in
1356 x86_64-*kfreebsd*-gnu)
1357 LD="${LD-ld} -m elf_x86_64_fbsd"
1358 ;;
1359 x86_64-*linux*)
1360 LD="${LD-ld} -m elf_x86_64"
1361 ;;
1362 ppc*-*linux*|powerpc*-*linux*)
1363 LD="${LD-ld} -m elf64ppc"
1364 ;;
1365 s390*-*linux*|s390*-*tpf*)
1366 LD="${LD-ld} -m elf64_s390"
1367 ;;
1368 sparc*-*linux*)
1369 LD="${LD-ld} -m elf64_sparc"
1370 ;;
1371 esac
1372 ;;
1373 esac
1374 fi
1375 rm -rf conftest*
1376 ;;
1377
1378*-*-sco3.2v5*)
1379 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1380 SAVE_CFLAGS="$CFLAGS"
1381 CFLAGS="$CFLAGS -belf"
1382 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1383 [AC_LANG_PUSH(C)
1384 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1385 AC_LANG_POP])
1386 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1387 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1388 CFLAGS="$SAVE_CFLAGS"
1389 fi
1390 ;;
1391*-*solaris*)
1392 # Find out which ABI we are using.
1393 echo 'int i;' > conftest.$ac_ext
1394 if AC_TRY_EVAL(ac_compile); then
1395 case `/usr/bin/file conftest.o` in
1396 *64-bit*)
1397 case $lt_cv_prog_gnu_ld in
1398 yes*)
1399 case $host in
1400 i?86-*-solaris*)
1401 LD="${LD-ld} -m elf_x86_64"
1402 ;;
1403 sparc*-*-solaris*)
1404 LD="${LD-ld} -m elf64_sparc"
1405 ;;
1406 esac
1407 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
1408 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1409 LD="${LD-ld}_sol2"
1410 fi
1411 ;;
1412 *)
1413 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1414 LD="${LD-ld} -64"
1415 fi
1416 ;;
1417 esac
1418 ;;
1419 esac
1420 fi
1421 rm -rf conftest*
1422 ;;
1423esac
1424
1425need_locks="$enable_libtool_lock"
1426])# _LT_ENABLE_LOCK
1427
1428
1429# _LT_PROG_AR
1430# -----------
1431m4_defun([_LT_PROG_AR],
1432[AC_CHECK_TOOLS(AR, [ar], false)
1433: ${AR=ar}
1434: ${AR_FLAGS=cru}
1435_LT_DECL([], [AR], [1], [The archiver])
1436_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1437
1438AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1439 [lt_cv_ar_at_file=no
1440 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1441 [echo conftest.$ac_objext > conftest.lst
1442 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1443 AC_TRY_EVAL([lt_ar_try])
1444 if test "$ac_status" -eq 0; then
1445 # Ensure the archiver fails upon bogus file names.
1446 rm -f conftest.$ac_objext libconftest.a
1447 AC_TRY_EVAL([lt_ar_try])
1448 if test "$ac_status" -ne 0; then
1449 lt_cv_ar_at_file=@
1450 fi
1451 fi
1452 rm -f conftest.* libconftest.a
1453 ])
1454 ])
1455
1456if test "x$lt_cv_ar_at_file" = xno; then
1457 archiver_list_spec=
1458else
1459 archiver_list_spec=$lt_cv_ar_at_file
1460fi
1461_LT_DECL([], [archiver_list_spec], [1],
1462 [How to feed a file listing to the archiver])
1463])# _LT_PROG_AR
1464
1465
1466# _LT_CMD_OLD_ARCHIVE
1467# -------------------
1468m4_defun([_LT_CMD_OLD_ARCHIVE],
1469[_LT_PROG_AR
1470
1471AC_CHECK_TOOL(STRIP, strip, :)
1472test -z "$STRIP" && STRIP=:
1473_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1474
1475AC_CHECK_TOOL(RANLIB, ranlib, :)
1476test -z "$RANLIB" && RANLIB=:
1477_LT_DECL([], [RANLIB], [1],
1478 [Commands used to install an old-style archive])
1479
1480# Determine commands to create old-style static archives.
1481old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1482old_postinstall_cmds='chmod 644 $oldlib'
1483old_postuninstall_cmds=
1484
1485if test -n "$RANLIB"; then
1486 case $host_os in
1487 openbsd*)
1488 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1489 ;;
1490 *)
1491 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1492 ;;
1493 esac
1494 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1495fi
1496
1497case $host_os in
1498 darwin*)
1499 lock_old_archive_extraction=yes ;;
1500 *)
1501 lock_old_archive_extraction=no ;;
1502esac
1503_LT_DECL([], [old_postinstall_cmds], [2])
1504_LT_DECL([], [old_postuninstall_cmds], [2])
1505_LT_TAGDECL([], [old_archive_cmds], [2],
1506 [Commands used to build an old-style archive])
1507_LT_DECL([], [lock_old_archive_extraction], [0],
1508 [Whether to use a lock for old archive extraction])
1509])# _LT_CMD_OLD_ARCHIVE
1510
1511
1512# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1513# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1514# ----------------------------------------------------------------
1515# Check whether the given compiler option works
1516AC_DEFUN([_LT_COMPILER_OPTION],
1517[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1518m4_require([_LT_DECL_SED])dnl
1519AC_CACHE_CHECK([$1], [$2],
1520 [$2=no
1521 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1522 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1523 lt_compiler_flag="$3"
1524 # Insert the option either (1) after the last *FLAGS variable, or
1525 # (2) before a word containing "conftest.", or (3) at the end.
1526 # Note that $ac_compile itself does not contain backslashes and begins
1527 # with a dollar sign (not a hyphen), so the echo should work correctly.
1528 # The option is referenced via a variable to avoid confusing sed.
1529 lt_compile=`echo "$ac_compile" | $SED \
1530 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1531 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1532 -e 's:$: $lt_compiler_flag:'`
1533 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1534 (eval "$lt_compile" 2>conftest.err)
1535 ac_status=$?
1536 cat conftest.err >&AS_MESSAGE_LOG_FD
1537 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1538 if (exit $ac_status) && test -s "$ac_outfile"; then
1539 # The compiler can only warn and ignore the option if not recognized
1540 # So say no if there are warnings other than the usual output.
1541 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1542 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1543 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1544 $2=yes
1545 fi
1546 fi
1547 $RM conftest*
1548])
1549
1550if test x"[$]$2" = xyes; then
1551 m4_if([$5], , :, [$5])
1552else
1553 m4_if([$6], , :, [$6])
1554fi
1555])# _LT_COMPILER_OPTION
1556
1557# Old name:
1558AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1559dnl aclocal-1.4 backwards compatibility:
1560dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1561
1562
1563# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1564# [ACTION-SUCCESS], [ACTION-FAILURE])
1565# ----------------------------------------------------
1566# Check whether the given linker option works
1567AC_DEFUN([_LT_LINKER_OPTION],
1568[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1569m4_require([_LT_DECL_SED])dnl
1570AC_CACHE_CHECK([$1], [$2],
1571 [$2=no
1572 save_LDFLAGS="$LDFLAGS"
1573 LDFLAGS="$LDFLAGS $3"
1574 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1575 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1576 # The linker can only warn and ignore the option if not recognized
1577 # So say no if there are warnings
1578 if test -s conftest.err; then
1579 # Append any errors to the config.log.
1580 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1581 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1582 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1583 if diff conftest.exp conftest.er2 >/dev/null; then
1584 $2=yes
1585 fi
1586 else
1587 $2=yes
1588 fi
1589 fi
1590 $RM -r conftest*
1591 LDFLAGS="$save_LDFLAGS"
1592])
1593
1594if test x"[$]$2" = xyes; then
1595 m4_if([$4], , :, [$4])
1596else
1597 m4_if([$5], , :, [$5])
1598fi
1599])# _LT_LINKER_OPTION
1600
1601# Old name:
1602AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1603dnl aclocal-1.4 backwards compatibility:
1604dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1605
1606
1607# LT_CMD_MAX_LEN
1608#---------------
1609AC_DEFUN([LT_CMD_MAX_LEN],
1610[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1611# find the maximum length of command line arguments
1612AC_MSG_CHECKING([the maximum length of command line arguments])
1613AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1614 i=0
1615 teststring="ABCD"
1616
1617 case $build_os in
1618 msdosdjgpp*)
1619 # On DJGPP, this test can blow up pretty badly due to problems in libc
1620 # (any single argument exceeding 2000 bytes causes a buffer overrun
1621 # during glob expansion). Even if it were fixed, the result of this
1622 # check would be larger than it should be.
1623 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1624 ;;
1625
1626 gnu*)
1627 # Under GNU Hurd, this test is not required because there is
1628 # no limit to the length of command line arguments.
1629 # Libtool will interpret -1 as no limit whatsoever
1630 lt_cv_sys_max_cmd_len=-1;
1631 ;;
1632
1633 cygwin* | mingw* | cegcc*)
1634 # On Win9x/ME, this test blows up -- it succeeds, but takes
1635 # about 5 minutes as the teststring grows exponentially.
1636 # Worse, since 9x/ME are not pre-emptively multitasking,
1637 # you end up with a "frozen" computer, even though with patience
1638 # the test eventually succeeds (with a max line length of 256k).
1639 # Instead, let's just punt: use the minimum linelength reported by
1640 # all of the supported platforms: 8192 (on NT/2K/XP).
1641 lt_cv_sys_max_cmd_len=8192;
1642 ;;
1643
1644 mint*)
1645 # On MiNT this can take a long time and run out of memory.
1646 lt_cv_sys_max_cmd_len=8192;
1647 ;;
1648
1649 amigaos*)
1650 # On AmigaOS with pdksh, this test takes hours, literally.
1651 # So we just punt and use a minimum line length of 8192.
1652 lt_cv_sys_max_cmd_len=8192;
1653 ;;
1654
1655 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1656 # This has been around since 386BSD, at least. Likely further.
1657 if test -x /sbin/sysctl; then
1658 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1659 elif test -x /usr/sbin/sysctl; then
1660 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1661 else
1662 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1663 fi
1664 # And add a safety zone
1665 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1666 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1667 ;;
1668
1669 interix*)
1670 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1671 lt_cv_sys_max_cmd_len=196608
1672 ;;
1673
1674 os2*)
1675 # The test takes a long time on OS/2.
1676 lt_cv_sys_max_cmd_len=8192
1677 ;;
1678
1679 osf*)
1680 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1681 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1682 # nice to cause kernel panics so lets avoid the loop below.
1683 # First set a reasonable default.
1684 lt_cv_sys_max_cmd_len=16384
1685 #
1686 if test -x /sbin/sysconfig; then
1687 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1688 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1689 esac
1690 fi
1691 ;;
1692 sco3.2v5*)
1693 lt_cv_sys_max_cmd_len=102400
1694 ;;
1695 sysv5* | sco5v6* | sysv4.2uw2*)
1696 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1697 if test -n "$kargmax"; then
1698 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1699 else
1700 lt_cv_sys_max_cmd_len=32768
1701 fi
1702 ;;
1703 *)
1704 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1705 if test -n "$lt_cv_sys_max_cmd_len"; then
1706 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1707 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1708 else
1709 # Make teststring a little bigger before we do anything with it.
1710 # a 1K string should be a reasonable start.
1711 for i in 1 2 3 4 5 6 7 8 ; do
1712 teststring=$teststring$teststring
1713 done
1714 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1715 # If test is not a shell built-in, we'll probably end up computing a
1716 # maximum length that is only half of the actual maximum length, but
1717 # we can't tell.
1718 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1719 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1720 test $i != 17 # 1/2 MB should be enough
1721 do
1722 i=`expr $i + 1`
1723 teststring=$teststring$teststring
1724 done
1725 # Only check the string length outside the loop.
1726 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1727 teststring=
1728 # Add a significant safety factor because C++ compilers can tack on
1729 # massive amounts of additional arguments before passing them to the
1730 # linker. It appears as though 1/2 is a usable value.
1731 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1732 fi
1733 ;;
1734 esac
1735])
1736if test -n $lt_cv_sys_max_cmd_len ; then
1737 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1738else
1739 AC_MSG_RESULT(none)
1740fi
1741max_cmd_len=$lt_cv_sys_max_cmd_len
1742_LT_DECL([], [max_cmd_len], [0],
1743 [What is the maximum length of a command?])
1744])# LT_CMD_MAX_LEN
1745
1746# Old name:
1747AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1748dnl aclocal-1.4 backwards compatibility:
1749dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1750
1751
1752# _LT_HEADER_DLFCN
1753# ----------------
1754m4_defun([_LT_HEADER_DLFCN],
1755[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1756])# _LT_HEADER_DLFCN
1757
1758
1759# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1760# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1761# ----------------------------------------------------------------
1762m4_defun([_LT_TRY_DLOPEN_SELF],
1763[m4_require([_LT_HEADER_DLFCN])dnl
1764if test "$cross_compiling" = yes; then :
1765 [$4]
1766else
1767 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1768 lt_status=$lt_dlunknown
1769 cat > conftest.$ac_ext <<_LT_EOF
1770[#line $LINENO "configure"
1771#include "confdefs.h"
1772
1773#if HAVE_DLFCN_H
1774#include <dlfcn.h>
1775#endif
1776
1777#include <stdio.h>
1778
1779#ifdef RTLD_GLOBAL
1780# define LT_DLGLOBAL RTLD_GLOBAL
1781#else
1782# ifdef DL_GLOBAL
1783# define LT_DLGLOBAL DL_GLOBAL
1784# else
1785# define LT_DLGLOBAL 0
1786# endif
1787#endif
1788
1789/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1790 find out it does not work in some platform. */
1791#ifndef LT_DLLAZY_OR_NOW
1792# ifdef RTLD_LAZY
1793# define LT_DLLAZY_OR_NOW RTLD_LAZY
1794# else
1795# ifdef DL_LAZY
1796# define LT_DLLAZY_OR_NOW DL_LAZY
1797# else
1798# ifdef RTLD_NOW
1799# define LT_DLLAZY_OR_NOW RTLD_NOW
1800# else
1801# ifdef DL_NOW
1802# define LT_DLLAZY_OR_NOW DL_NOW
1803# else
1804# define LT_DLLAZY_OR_NOW 0
1805# endif
1806# endif
1807# endif
1808# endif
1809#endif
1810
1811/* When -fvisbility=hidden is used, assume the code has been annotated
1812 correspondingly for the symbols needed. */
1813#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1814int fnord () __attribute__((visibility("default")));
1815#endif
1816
1817int fnord () { return 42; }
1818int main ()
1819{
1820 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1821 int status = $lt_dlunknown;
1822
1823 if (self)
1824 {
1825 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1826 else
1827 {
1828 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1829 else puts (dlerror ());
1830 }
1831 /* dlclose (self); */
1832 }
1833 else
1834 puts (dlerror ());
1835
1836 return status;
1837}]
1838_LT_EOF
1839 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1840 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1841 lt_status=$?
1842 case x$lt_status in
1843 x$lt_dlno_uscore) $1 ;;
1844 x$lt_dlneed_uscore) $2 ;;
1845 x$lt_dlunknown|x*) $3 ;;
1846 esac
1847 else :
1848 # compilation failed
1849 $3
1850 fi
1851fi
1852rm -fr conftest*
1853])# _LT_TRY_DLOPEN_SELF
1854
1855
1856# LT_SYS_DLOPEN_SELF
1857# ------------------
1858AC_DEFUN([LT_SYS_DLOPEN_SELF],
1859[m4_require([_LT_HEADER_DLFCN])dnl
1860if test "x$enable_dlopen" != xyes; then
1861 enable_dlopen=unknown
1862 enable_dlopen_self=unknown
1863 enable_dlopen_self_static=unknown
1864else
1865 lt_cv_dlopen=no
1866 lt_cv_dlopen_libs=
1867
1868 case $host_os in
1869 beos*)
1870 lt_cv_dlopen="load_add_on"
1871 lt_cv_dlopen_libs=
1872 lt_cv_dlopen_self=yes
1873 ;;
1874
1875 mingw* | pw32* | cegcc*)
1876 lt_cv_dlopen="LoadLibrary"
1877 lt_cv_dlopen_libs=
1878 ;;
1879
1880 cygwin*)
1881 lt_cv_dlopen="dlopen"
1882 lt_cv_dlopen_libs=
1883 ;;
1884
1885 darwin*)
1886 # if libdl is installed we need to link against it
1887 AC_CHECK_LIB([dl], [dlopen],
1888 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1889 lt_cv_dlopen="dyld"
1890 lt_cv_dlopen_libs=
1891 lt_cv_dlopen_self=yes
1892 ])
1893 ;;
1894
1895 *)
1896 AC_CHECK_FUNC([shl_load],
1897 [lt_cv_dlopen="shl_load"],
1898 [AC_CHECK_LIB([dld], [shl_load],
1899 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1900 [AC_CHECK_FUNC([dlopen],
1901 [lt_cv_dlopen="dlopen"],
1902 [AC_CHECK_LIB([dl], [dlopen],
1903 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1904 [AC_CHECK_LIB([svld], [dlopen],
1905 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1906 [AC_CHECK_LIB([dld], [dld_link],
1907 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1908 ])
1909 ])
1910 ])
1911 ])
1912 ])
1913 ;;
1914 esac
1915
1916 if test "x$lt_cv_dlopen" != xno; then
1917 enable_dlopen=yes
1918 else
1919 enable_dlopen=no
1920 fi
1921
1922 case $lt_cv_dlopen in
1923 dlopen)
1924 save_CPPFLAGS="$CPPFLAGS"
1925 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1926
1927 save_LDFLAGS="$LDFLAGS"
1928 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1929
1930 save_LIBS="$LIBS"
1931 LIBS="$lt_cv_dlopen_libs $LIBS"
1932
1933 AC_CACHE_CHECK([whether a program can dlopen itself],
1934 lt_cv_dlopen_self, [dnl
1935 _LT_TRY_DLOPEN_SELF(
1936 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1937 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1938 ])
1939
1940 if test "x$lt_cv_dlopen_self" = xyes; then
1941 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1942 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1943 lt_cv_dlopen_self_static, [dnl
1944 _LT_TRY_DLOPEN_SELF(
1945 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1946 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1947 ])
1948 fi
1949
1950 CPPFLAGS="$save_CPPFLAGS"
1951 LDFLAGS="$save_LDFLAGS"
1952 LIBS="$save_LIBS"
1953 ;;
1954 esac
1955
1956 case $lt_cv_dlopen_self in
1957 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1958 *) enable_dlopen_self=unknown ;;
1959 esac
1960
1961 case $lt_cv_dlopen_self_static in
1962 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1963 *) enable_dlopen_self_static=unknown ;;
1964 esac
1965fi
1966_LT_DECL([dlopen_support], [enable_dlopen], [0],
1967 [Whether dlopen is supported])
1968_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1969 [Whether dlopen of programs is supported])
1970_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1971 [Whether dlopen of statically linked programs is supported])
1972])# LT_SYS_DLOPEN_SELF
1973
1974# Old name:
1975AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1976dnl aclocal-1.4 backwards compatibility:
1977dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1978
1979
1980# _LT_COMPILER_C_O([TAGNAME])
1981# ---------------------------
1982# Check to see if options -c and -o are simultaneously supported by compiler.
1983# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1984m4_defun([_LT_COMPILER_C_O],
1985[m4_require([_LT_DECL_SED])dnl
1986m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1987m4_require([_LT_TAG_COMPILER])dnl
1988AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1989 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1990 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1991 $RM -r conftest 2>/dev/null
1992 mkdir conftest
1993 cd conftest
1994 mkdir out
1995 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1996
1997 lt_compiler_flag="-o out/conftest2.$ac_objext"
1998 # Insert the option either (1) after the last *FLAGS variable, or
1999 # (2) before a word containing "conftest.", or (3) at the end.
2000 # Note that $ac_compile itself does not contain backslashes and begins
2001 # with a dollar sign (not a hyphen), so the echo should work correctly.
2002 lt_compile=`echo "$ac_compile" | $SED \
2003 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2004 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2005 -e 's:$: $lt_compiler_flag:'`
2006 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2007 (eval "$lt_compile" 2>out/conftest.err)
2008 ac_status=$?
2009 cat out/conftest.err >&AS_MESSAGE_LOG_FD
2010 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2011 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2012 then
2013 # The compiler can only warn and ignore the option if not recognized
2014 # So say no if there are warnings
2015 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2016 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2017 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2018 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2019 fi
2020 fi
2021 chmod u+w . 2>&AS_MESSAGE_LOG_FD
2022 $RM conftest*
2023 # SGI C++ compiler will create directory out/ii_files/ for
2024 # template instantiation
2025 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2026 $RM out/* && rmdir out
2027 cd ..
2028 $RM -r conftest
2029 $RM conftest*
2030])
2031_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2032 [Does compiler simultaneously support -c and -o options?])
2033])# _LT_COMPILER_C_O
2034
2035
2036# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2037# ----------------------------------
2038# Check to see if we can do hard links to lock some files if needed
2039m4_defun([_LT_COMPILER_FILE_LOCKS],
2040[m4_require([_LT_ENABLE_LOCK])dnl
2041m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2042_LT_COMPILER_C_O([$1])
2043
2044hard_links="nottested"
2045if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2046 # do not overwrite the value of need_locks provided by the user
2047 AC_MSG_CHECKING([if we can lock with hard links])
2048 hard_links=yes
2049 $RM conftest*
2050 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2051 touch conftest.a
2052 ln conftest.a conftest.b 2>&5 || hard_links=no
2053 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2054 AC_MSG_RESULT([$hard_links])
2055 if test "$hard_links" = no; then
2056 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2057 need_locks=warn
2058 fi
2059else
2060 need_locks=no
2061fi
2062_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2063])# _LT_COMPILER_FILE_LOCKS
2064
2065
2066# _LT_CHECK_OBJDIR
2067# ----------------
2068m4_defun([_LT_CHECK_OBJDIR],
2069[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2070[rm -f .libs 2>/dev/null
2071mkdir .libs 2>/dev/null
2072if test -d .libs; then
2073 lt_cv_objdir=.libs
2074else
2075 # MS-DOS does not allow filenames that begin with a dot.
2076 lt_cv_objdir=_libs
2077fi
2078rmdir .libs 2>/dev/null])
2079objdir=$lt_cv_objdir
2080_LT_DECL([], [objdir], [0],
2081 [The name of the directory that contains temporary libtool files])dnl
2082m4_pattern_allow([LT_OBJDIR])dnl
2083AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2084 [Define to the sub-directory in which libtool stores uninstalled libraries.])
2085])# _LT_CHECK_OBJDIR
2086
2087
2088# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2089# --------------------------------------
2090# Check hardcoding attributes.
2091m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2092[AC_MSG_CHECKING([how to hardcode library paths into programs])
2093_LT_TAGVAR(hardcode_action, $1)=
2094if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2095 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2096 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2097
2098 # We can hardcode non-existent directories.
2099 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2100 # If the only mechanism to avoid hardcoding is shlibpath_var, we
2101 # have to relink, otherwise we might link with an installed library
2102 # when we should be linking with a yet-to-be-installed one
2103 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2104 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2105 # Linking always hardcodes the temporary library directory.
2106 _LT_TAGVAR(hardcode_action, $1)=relink
2107 else
2108 # We can link without hardcoding, and we can hardcode nonexisting dirs.
2109 _LT_TAGVAR(hardcode_action, $1)=immediate
2110 fi
2111else
2112 # We cannot hardcode anything, or else we can only hardcode existing
2113 # directories.
2114 _LT_TAGVAR(hardcode_action, $1)=unsupported
2115fi
2116AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2117
2118if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2119 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2120 # Fast installation is not supported
2121 enable_fast_install=no
2122elif test "$shlibpath_overrides_runpath" = yes ||
2123 test "$enable_shared" = no; then
2124 # Fast installation is not necessary
2125 enable_fast_install=needless
2126fi
2127_LT_TAGDECL([], [hardcode_action], [0],
2128 [How to hardcode a shared library path into an executable])
2129])# _LT_LINKER_HARDCODE_LIBPATH
2130
2131
2132# _LT_CMD_STRIPLIB
2133# ----------------
2134m4_defun([_LT_CMD_STRIPLIB],
2135[m4_require([_LT_DECL_EGREP])
2136striplib=
2137old_striplib=
2138AC_MSG_CHECKING([whether stripping libraries is possible])
2139if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2140 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2141 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2142 AC_MSG_RESULT([yes])
2143else
2144# FIXME - insert some real tests, host_os isn't really good enough
2145 case $host_os in
2146 darwin*)
2147 if test -n "$STRIP" ; then
2148 striplib="$STRIP -x"
2149 old_striplib="$STRIP -S"
2150 AC_MSG_RESULT([yes])
2151 else
2152 AC_MSG_RESULT([no])
2153 fi
2154 ;;
2155 *)
2156 AC_MSG_RESULT([no])
2157 ;;
2158 esac
2159fi
2160_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2161_LT_DECL([], [striplib], [1])
2162])# _LT_CMD_STRIPLIB
2163
2164
2165# _LT_SYS_DYNAMIC_LINKER([TAG])
2166# -----------------------------
2167# PORTME Fill in your ld.so characteristics
2168m4_defun([_LT_SYS_DYNAMIC_LINKER],
2169[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2170m4_require([_LT_DECL_EGREP])dnl
2171m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2172m4_require([_LT_DECL_OBJDUMP])dnl
2173m4_require([_LT_DECL_SED])dnl
2174m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2175AC_MSG_CHECKING([dynamic linker characteristics])
2176m4_if([$1],
2177 [], [
2178if test "$GCC" = yes; then
2179 case $host_os in
2180 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2181 *) lt_awk_arg="/^libraries:/" ;;
2182 esac
2183 case $host_os in
2184 mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2185 *) lt_sed_strip_eq="s,=/,/,g" ;;
2186 esac
2187 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2188 case $lt_search_path_spec in
2189 *\;*)
2190 # if the path contains ";" then we assume it to be the separator
2191 # otherwise default to the standard path separator (i.e. ":") - it is
2192 # assumed that no part of a normal pathname contains ";" but that should
2193 # okay in the real world where ";" in dirpaths is itself problematic.
2194 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2195 ;;
2196 *)
2197 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2198 ;;
2199 esac
2200 # Ok, now we have the path, separated by spaces, we can step through it
2201 # and add multilib dir if necessary.
2202 lt_tmp_lt_search_path_spec=
2203 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2204 for lt_sys_path in $lt_search_path_spec; do
2205 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2206 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2207 else
2208 test -d "$lt_sys_path" && \
2209 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2210 fi
2211 done
2212 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2213BEGIN {RS=" "; FS="/|\n";} {
2214 lt_foo="";
2215 lt_count=0;
2216 for (lt_i = NF; lt_i > 0; lt_i--) {
2217 if ($lt_i != "" && $lt_i != ".") {
2218 if ($lt_i == "..") {
2219 lt_count++;
2220 } else {
2221 if (lt_count == 0) {
2222 lt_foo="/" $lt_i lt_foo;
2223 } else {
2224 lt_count--;
2225 }
2226 }
2227 }
2228 }
2229 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2230 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2231}'`
2232 # AWK program above erroneously prepends '/' to C:/dos/paths
2233 # for these hosts.
2234 case $host_os in
2235 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2236 $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2237 esac
2238 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2239else
2240 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2241fi])
2242library_names_spec=
2243libname_spec='lib$name'
2244soname_spec=
2245shrext_cmds=".so"
2246postinstall_cmds=
2247postuninstall_cmds=
2248finish_cmds=
2249finish_eval=
2250shlibpath_var=
2251shlibpath_overrides_runpath=unknown
2252version_type=none
2253dynamic_linker="$host_os ld.so"
2254sys_lib_dlsearch_path_spec="/lib /usr/lib"
2255need_lib_prefix=unknown
2256hardcode_into_libs=no
2257
2258# when you set need_version to no, make sure it does not cause -set_version
2259# flags to be left without arguments
2260need_version=unknown
2261
2262case $host_os in
2263aix3*)
2264 version_type=linux # correct to gnu/linux during the next big refactor
2265 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2266 shlibpath_var=LIBPATH
2267
2268 # AIX 3 has no versioning support, so we append a major version to the name.
2269 soname_spec='${libname}${release}${shared_ext}$major'
2270 ;;
2271
2272aix[[4-9]]*)
2273 version_type=linux # correct to gnu/linux during the next big refactor
2274 need_lib_prefix=no
2275 need_version=no
2276 hardcode_into_libs=yes
2277 if test "$host_cpu" = ia64; then
2278 # AIX 5 supports IA64
2279 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2280 shlibpath_var=LD_LIBRARY_PATH
2281 else
2282 # With GCC up to 2.95.x, collect2 would create an import file
2283 # for dependence libraries. The import file would start with
2284 # the line `#! .'. This would cause the generated library to
2285 # depend on `.', always an invalid library. This was fixed in
2286 # development snapshots of GCC prior to 3.0.
2287 case $host_os in
2288 aix4 | aix4.[[01]] | aix4.[[01]].*)
2289 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2290 echo ' yes '
2291 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2292 :
2293 else
2294 can_build_shared=no
2295 fi
2296 ;;
2297 esac
2298 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2299 # soname into executable. Probably we can add versioning support to
2300 # collect2, so additional links can be useful in future.
2301 if test "$aix_use_runtimelinking" = yes; then
2302 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2303 # instead of lib<name>.a to let people know that these are not
2304 # typical AIX shared libraries.
2305 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2306 else
2307 # We preserve .a as extension for shared libraries through AIX4.2
2308 # and later when we are not doing run time linking.
2309 library_names_spec='${libname}${release}.a $libname.a'
2310 soname_spec='${libname}${release}${shared_ext}$major'
2311 fi
2312 shlibpath_var=LIBPATH
2313 fi
2314 ;;
2315
2316amigaos*)
2317 case $host_cpu in
2318 powerpc)
2319 # Since July 2007 AmigaOS4 officially supports .so libraries.
2320 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2321 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2322 ;;
2323 m68k)
2324 library_names_spec='$libname.ixlibrary $libname.a'
2325 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2326 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2327 ;;
2328 esac
2329 ;;
2330
2331beos*)
2332 library_names_spec='${libname}${shared_ext}'
2333 dynamic_linker="$host_os ld.so"
2334 shlibpath_var=LIBRARY_PATH
2335 ;;
2336
2337bsdi[[45]]*)
2338 version_type=linux # correct to gnu/linux during the next big refactor
2339 need_version=no
2340 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2341 soname_spec='${libname}${release}${shared_ext}$major'
2342 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2343 shlibpath_var=LD_LIBRARY_PATH
2344 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2345 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2346 # the default ld.so.conf also contains /usr/contrib/lib and
2347 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2348 # libtool to hard-code these into programs
2349 ;;
2350
2351cygwin* | mingw* | pw32* | cegcc*)
2352 version_type=windows
2353 shrext_cmds=".dll"
2354 need_version=no
2355 need_lib_prefix=no
2356
2357 case $GCC,$cc_basename in
2358 yes,*)
2359 # gcc
2360 library_names_spec='$libname.dll.a'
2361 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2362 postinstall_cmds='base_file=`basename \${file}`~
2363 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2364 dldir=$destdir/`dirname \$dlpath`~
2365 test -d \$dldir || mkdir -p \$dldir~
2366 $install_prog $dir/$dlname \$dldir/$dlname~
2367 chmod a+x \$dldir/$dlname~
2368 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2369 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2370 fi'
2371 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2372 dlpath=$dir/\$dldll~
2373 $RM \$dlpath'
2374 shlibpath_overrides_runpath=yes
2375
2376 case $host_os in
2377 cygwin*)
2378 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2379 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2380m4_if([$1], [],[
2381 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2382 ;;
2383 mingw* | cegcc*)
2384 # MinGW DLLs use traditional 'lib' prefix
2385 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2386 ;;
2387 pw32*)
2388 # pw32 DLLs use 'pw' prefix rather than 'lib'
2389 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2390 ;;
2391 esac
2392 dynamic_linker='Win32 ld.exe'
2393 ;;
2394
2395 *,cl*)
2396 # Native MSVC
2397 libname_spec='$name'
2398 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2399 library_names_spec='${libname}.dll.lib'
2400
2401 case $build_os in
2402 mingw*)
2403 sys_lib_search_path_spec=
2404 lt_save_ifs=$IFS
2405 IFS=';'
2406 for lt_path in $LIB
2407 do
2408 IFS=$lt_save_ifs
2409 # Let DOS variable expansion print the short 8.3 style file name.
2410 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2411 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2412 done
2413 IFS=$lt_save_ifs
2414 # Convert to MSYS style.
2415 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2416 ;;
2417 cygwin*)
2418 # Convert to unix form, then to dos form, then back to unix form
2419 # but this time dos style (no spaces!) so that the unix form looks
2420 # like /cygdrive/c/PROGRA~1:/cygdr...
2421 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2422 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2423 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2424 ;;
2425 *)
2426 sys_lib_search_path_spec="$LIB"
2427 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2428 # It is most probably a Windows format PATH.
2429 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2430 else
2431 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2432 fi
2433 # FIXME: find the short name or the path components, as spaces are
2434 # common. (e.g. "Program Files" -> "PROGRA~1")
2435 ;;
2436 esac
2437
2438 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2439 postinstall_cmds='base_file=`basename \${file}`~
2440 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2441 dldir=$destdir/`dirname \$dlpath`~
2442 test -d \$dldir || mkdir -p \$dldir~
2443 $install_prog $dir/$dlname \$dldir/$dlname'
2444 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2445 dlpath=$dir/\$dldll~
2446 $RM \$dlpath'
2447 shlibpath_overrides_runpath=yes
2448 dynamic_linker='Win32 link.exe'
2449 ;;
2450
2451 *)
2452 # Assume MSVC wrapper
2453 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2454 dynamic_linker='Win32 ld.exe'
2455 ;;
2456 esac
2457 # FIXME: first we should search . and the directory the executable is in
2458 shlibpath_var=PATH
2459 ;;
2460
2461darwin* | rhapsody*)
2462 dynamic_linker="$host_os dyld"
2463 version_type=darwin
2464 need_lib_prefix=no
2465 need_version=no
2466 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2467 soname_spec='${libname}${release}${major}$shared_ext'
2468 shlibpath_overrides_runpath=yes
2469 shlibpath_var=DYLD_LIBRARY_PATH
2470 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2471m4_if([$1], [],[
2472 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2473 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2474 ;;
2475
2476dgux*)
2477 version_type=linux # correct to gnu/linux during the next big refactor
2478 need_lib_prefix=no
2479 need_version=no
2480 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2481 soname_spec='${libname}${release}${shared_ext}$major'
2482 shlibpath_var=LD_LIBRARY_PATH
2483 ;;
2484
2485freebsd* | dragonfly*)
2486 # DragonFly does not have aout. When/if they implement a new
2487 # versioning mechanism, adjust this.
2488 if test -x /usr/bin/objformat; then
2489 objformat=`/usr/bin/objformat`
2490 else
2491 case $host_os in
2492 freebsd[[23]].*) objformat=aout ;;
2493 *) objformat=elf ;;
2494 esac
2495 fi
2496 version_type=freebsd-$objformat
2497 case $version_type in
2498 freebsd-elf*)
2499 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2500 need_version=no
2501 need_lib_prefix=no
2502 ;;
2503 freebsd-*)
2504 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2505 need_version=yes
2506 ;;
2507 esac
2508 shlibpath_var=LD_LIBRARY_PATH
2509 case $host_os in
2510 freebsd2.*)
2511 shlibpath_overrides_runpath=yes
2512 ;;
2513 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2514 shlibpath_overrides_runpath=yes
2515 hardcode_into_libs=yes
2516 ;;
2517 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2518 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2519 shlibpath_overrides_runpath=no
2520 hardcode_into_libs=yes
2521 ;;
2522 *) # from 4.6 on, and DragonFly
2523 shlibpath_overrides_runpath=yes
2524 hardcode_into_libs=yes
2525 ;;
2526 esac
2527 ;;
2528
2529gnu*)
2530 version_type=linux # correct to gnu/linux during the next big refactor
2531 need_lib_prefix=no
2532 need_version=no
2533 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2534 soname_spec='${libname}${release}${shared_ext}$major'
2535 shlibpath_var=LD_LIBRARY_PATH
2536 shlibpath_overrides_runpath=no
2537 hardcode_into_libs=yes
2538 ;;
2539
2540haiku*)
2541 version_type=linux # correct to gnu/linux during the next big refactor
2542 need_lib_prefix=no
2543 need_version=no
2544 dynamic_linker="$host_os runtime_loader"
2545 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2546 soname_spec='${libname}${release}${shared_ext}$major'
2547 shlibpath_var=LIBRARY_PATH
2548 shlibpath_overrides_runpath=yes
2549 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2550 hardcode_into_libs=yes
2551 ;;
2552
2553hpux9* | hpux10* | hpux11*)
2554 # Give a soname corresponding to the major version so that dld.sl refuses to
2555 # link against other versions.
2556 version_type=sunos
2557 need_lib_prefix=no
2558 need_version=no
2559 case $host_cpu in
2560 ia64*)
2561 shrext_cmds='.so'
2562 hardcode_into_libs=yes
2563 dynamic_linker="$host_os dld.so"
2564 shlibpath_var=LD_LIBRARY_PATH
2565 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2566 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2567 soname_spec='${libname}${release}${shared_ext}$major'
2568 if test "X$HPUX_IA64_MODE" = X32; then
2569 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2570 else
2571 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2572 fi
2573 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2574 ;;
2575 hppa*64*)
2576 shrext_cmds='.sl'
2577 hardcode_into_libs=yes
2578 dynamic_linker="$host_os dld.sl"
2579 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2580 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2581 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2582 soname_spec='${libname}${release}${shared_ext}$major'
2583 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2584 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2585 ;;
2586 *)
2587 shrext_cmds='.sl'
2588 dynamic_linker="$host_os dld.sl"
2589 shlibpath_var=SHLIB_PATH
2590 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2591 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2592 soname_spec='${libname}${release}${shared_ext}$major'
2593 ;;
2594 esac
2595 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2596 postinstall_cmds='chmod 555 $lib'
2597 # or fails outright, so override atomically:
2598 install_override_mode=555
2599 ;;
2600
2601interix[[3-9]]*)
2602 version_type=linux # correct to gnu/linux during the next big refactor
2603 need_lib_prefix=no
2604 need_version=no
2605 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2606 soname_spec='${libname}${release}${shared_ext}$major'
2607 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2608 shlibpath_var=LD_LIBRARY_PATH
2609 shlibpath_overrides_runpath=no
2610 hardcode_into_libs=yes
2611 ;;
2612
2613irix5* | irix6* | nonstopux*)
2614 case $host_os in
2615 nonstopux*) version_type=nonstopux ;;
2616 *)
2617 if test "$lt_cv_prog_gnu_ld" = yes; then
2618 version_type=linux # correct to gnu/linux during the next big refactor
2619 else
2620 version_type=irix
2621 fi ;;
2622 esac
2623 need_lib_prefix=no
2624 need_version=no
2625 soname_spec='${libname}${release}${shared_ext}$major'
2626 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2627 case $host_os in
2628 irix5* | nonstopux*)
2629 libsuff= shlibsuff=
2630 ;;
2631 *)
2632 case $LD in # libtool.m4 will add one of these switches to LD
2633 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2634 libsuff= shlibsuff= libmagic=32-bit;;
2635 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2636 libsuff=32 shlibsuff=N32 libmagic=N32;;
2637 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2638 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2639 *) libsuff= shlibsuff= libmagic=never-match;;
2640 esac
2641 ;;
2642 esac
2643 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2644 shlibpath_overrides_runpath=no
2645 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2646 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2647 hardcode_into_libs=yes
2648 ;;
2649
2650# No shared lib support for Linux oldld, aout, or coff.
2651linux*oldld* | linux*aout* | linux*coff*)
2652 dynamic_linker=no
2653 ;;
2654
2655# This must be glibc/ELF.
2656linux* | k*bsd*-gnu | kopensolaris*-gnu)
2657 version_type=linux # correct to gnu/linux during the next big refactor
2658 need_lib_prefix=no
2659 need_version=no
2660 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2661 soname_spec='${libname}${release}${shared_ext}$major'
2662 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2663 shlibpath_var=LD_LIBRARY_PATH
2664 shlibpath_overrides_runpath=no
2665
2666 # Some binutils ld are patched to set DT_RUNPATH
2667 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2668 [lt_cv_shlibpath_overrides_runpath=no
2669 save_LDFLAGS=$LDFLAGS
2670 save_libdir=$libdir
2671 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2672 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2673 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2674 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2675 [lt_cv_shlibpath_overrides_runpath=yes])])
2676 LDFLAGS=$save_LDFLAGS
2677 libdir=$save_libdir
2678 ])
2679 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2680
2681 # This implies no fast_install, which is unacceptable.
2682 # Some rework will be needed to allow for fast_install
2683 # before this can be enabled.
2684 hardcode_into_libs=yes
2685
2686 # Append ld.so.conf contents to the search path
2687 if test -f /etc/ld.so.conf; then
2688 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2689 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2690 fi
2691
2692 # We used to test for /lib/ld.so.1 and disable shared libraries on
2693 # powerpc, because MkLinux only supported shared libraries with the
2694 # GNU dynamic linker. Since this was broken with cross compilers,
2695 # most powerpc-linux boxes support dynamic linking these days and
2696 # people can always --disable-shared, the test was removed, and we
2697 # assume the GNU/Linux dynamic linker is in use.
2698 dynamic_linker='GNU/Linux ld.so'
2699 ;;
2700
2701netbsd*)
2702 version_type=sunos
2703 need_lib_prefix=no
2704 need_version=no
2705 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2706 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2707 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2708 dynamic_linker='NetBSD (a.out) ld.so'
2709 else
2710 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2711 soname_spec='${libname}${release}${shared_ext}$major'
2712 dynamic_linker='NetBSD ld.elf_so'
2713 fi
2714 shlibpath_var=LD_LIBRARY_PATH
2715 shlibpath_overrides_runpath=yes
2716 hardcode_into_libs=yes
2717 ;;
2718
2719newsos6)
2720 version_type=linux # correct to gnu/linux during the next big refactor
2721 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2722 shlibpath_var=LD_LIBRARY_PATH
2723 shlibpath_overrides_runpath=yes
2724 ;;
2725
2726*nto* | *qnx*)
2727 version_type=qnx
2728 need_lib_prefix=no
2729 need_version=no
2730 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2731 soname_spec='${libname}${release}${shared_ext}$major'
2732 shlibpath_var=LD_LIBRARY_PATH
2733 shlibpath_overrides_runpath=no
2734 hardcode_into_libs=yes
2735 dynamic_linker='ldqnx.so'
2736 ;;
2737
2738openbsd*)
2739 version_type=sunos
2740 sys_lib_dlsearch_path_spec="/usr/lib"
2741 need_lib_prefix=no
2742 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2743 case $host_os in
2744 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2745 *) need_version=no ;;
2746 esac
2747 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2748 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2749 shlibpath_var=LD_LIBRARY_PATH
2750 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2751 case $host_os in
2752 openbsd2.[[89]] | openbsd2.[[89]].*)
2753 shlibpath_overrides_runpath=no
2754 ;;
2755 *)
2756 shlibpath_overrides_runpath=yes
2757 ;;
2758 esac
2759 else
2760 shlibpath_overrides_runpath=yes
2761 fi
2762 ;;
2763
2764os2*)
2765 libname_spec='$name'
2766 shrext_cmds=".dll"
2767 need_lib_prefix=no
2768 library_names_spec='$libname${shared_ext} $libname.a'
2769 dynamic_linker='OS/2 ld.exe'
2770 shlibpath_var=LIBPATH
2771 ;;
2772
2773osf3* | osf4* | osf5*)
2774 version_type=osf
2775 need_lib_prefix=no
2776 need_version=no
2777 soname_spec='${libname}${release}${shared_ext}$major'
2778 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2779 shlibpath_var=LD_LIBRARY_PATH
2780 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2781 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2782 ;;
2783
2784rdos*)
2785 dynamic_linker=no
2786 ;;
2787
2788solaris*)
2789 version_type=linux # correct to gnu/linux during the next big refactor
2790 need_lib_prefix=no
2791 need_version=no
2792 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2793 soname_spec='${libname}${release}${shared_ext}$major'
2794 shlibpath_var=LD_LIBRARY_PATH
2795 shlibpath_overrides_runpath=yes
2796 hardcode_into_libs=yes
2797 # ldd complains unless libraries are executable
2798 postinstall_cmds='chmod +x $lib'
2799 ;;
2800
2801sunos4*)
2802 version_type=sunos
2803 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2804 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2805 shlibpath_var=LD_LIBRARY_PATH
2806 shlibpath_overrides_runpath=yes
2807 if test "$with_gnu_ld" = yes; then
2808 need_lib_prefix=no
2809 fi
2810 need_version=yes
2811 ;;
2812
2813sysv4 | sysv4.3*)
2814 version_type=linux # correct to gnu/linux during the next big refactor
2815 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2816 soname_spec='${libname}${release}${shared_ext}$major'
2817 shlibpath_var=LD_LIBRARY_PATH
2818 case $host_vendor in
2819 sni)
2820 shlibpath_overrides_runpath=no
2821 need_lib_prefix=no
2822 runpath_var=LD_RUN_PATH
2823 ;;
2824 siemens)
2825 need_lib_prefix=no
2826 ;;
2827 motorola)
2828 need_lib_prefix=no
2829 need_version=no
2830 shlibpath_overrides_runpath=no
2831 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2832 ;;
2833 esac
2834 ;;
2835
2836sysv4*MP*)
2837 if test -d /usr/nec ;then
2838 version_type=linux # correct to gnu/linux during the next big refactor
2839 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2840 soname_spec='$libname${shared_ext}.$major'
2841 shlibpath_var=LD_LIBRARY_PATH
2842 fi
2843 ;;
2844
2845sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2846 version_type=freebsd-elf
2847 need_lib_prefix=no
2848 need_version=no
2849 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2850 soname_spec='${libname}${release}${shared_ext}$major'
2851 shlibpath_var=LD_LIBRARY_PATH
2852 shlibpath_overrides_runpath=yes
2853 hardcode_into_libs=yes
2854 if test "$with_gnu_ld" = yes; then
2855 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2856 else
2857 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2858 case $host_os in
2859 sco3.2v5*)
2860 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2861 ;;
2862 esac
2863 fi
2864 sys_lib_dlsearch_path_spec='/usr/lib'
2865 ;;
2866
2867tpf*)
2868 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2869 version_type=linux # correct to gnu/linux during the next big refactor
2870 need_lib_prefix=no
2871 need_version=no
2872 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2873 shlibpath_var=LD_LIBRARY_PATH
2874 shlibpath_overrides_runpath=no
2875 hardcode_into_libs=yes
2876 ;;
2877
2878uts4*)
2879 version_type=linux # correct to gnu/linux during the next big refactor
2880 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2881 soname_spec='${libname}${release}${shared_ext}$major'
2882 shlibpath_var=LD_LIBRARY_PATH
2883 ;;
2884
2885*)
2886 dynamic_linker=no
2887 ;;
2888esac
2889AC_MSG_RESULT([$dynamic_linker])
2890test "$dynamic_linker" = no && can_build_shared=no
2891
2892variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2893if test "$GCC" = yes; then
2894 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2895fi
2896
2897if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2898 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2899fi
2900if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2901 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2902fi
2903
2904_LT_DECL([], [variables_saved_for_relink], [1],
2905 [Variables whose values should be saved in libtool wrapper scripts and
2906 restored at link time])
2907_LT_DECL([], [need_lib_prefix], [0],
2908 [Do we need the "lib" prefix for modules?])
2909_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2910_LT_DECL([], [version_type], [0], [Library versioning type])
2911_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
2912_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2913_LT_DECL([], [shlibpath_overrides_runpath], [0],
2914 [Is shlibpath searched before the hard-coded library search path?])
2915_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2916_LT_DECL([], [library_names_spec], [1],
2917 [[List of archive names. First name is the real one, the rest are links.
2918 The last name is the one that the linker finds with -lNAME]])
2919_LT_DECL([], [soname_spec], [1],
2920 [[The coded name of the library, if different from the real name]])
2921_LT_DECL([], [install_override_mode], [1],
2922 [Permission mode override for installation of shared libraries])
2923_LT_DECL([], [postinstall_cmds], [2],
2924 [Command to use after installation of a shared archive])
2925_LT_DECL([], [postuninstall_cmds], [2],
2926 [Command to use after uninstallation of a shared archive])
2927_LT_DECL([], [finish_cmds], [2],
2928 [Commands used to finish a libtool library installation in a directory])
2929_LT_DECL([], [finish_eval], [1],
2930 [[As "finish_cmds", except a single script fragment to be evaled but
2931 not shown]])
2932_LT_DECL([], [hardcode_into_libs], [0],
2933 [Whether we should hardcode library paths into libraries])
2934_LT_DECL([], [sys_lib_search_path_spec], [2],
2935 [Compile-time system search path for libraries])
2936_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2937 [Run-time system search path for libraries])
2938])# _LT_SYS_DYNAMIC_LINKER
2939
2940
2941# _LT_PATH_TOOL_PREFIX(TOOL)
2942# --------------------------
2943# find a file program which can recognize shared library
2944AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2945[m4_require([_LT_DECL_EGREP])dnl
2946AC_MSG_CHECKING([for $1])
2947AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2948[case $MAGIC_CMD in
2949[[\\/*] | ?:[\\/]*])
2950 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2951 ;;
2952*)
2953 lt_save_MAGIC_CMD="$MAGIC_CMD"
2954 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2955dnl $ac_dummy forces splitting on constant user-supplied paths.
2956dnl POSIX.2 word splitting is done only on the output of word expansions,
2957dnl not every word. This closes a longstanding sh security hole.
2958 ac_dummy="m4_if([$2], , $PATH, [$2])"
2959 for ac_dir in $ac_dummy; do
2960 IFS="$lt_save_ifs"
2961 test -z "$ac_dir" && ac_dir=.
2962 if test -f $ac_dir/$1; then
2963 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2964 if test -n "$file_magic_test_file"; then
2965 case $deplibs_check_method in
2966 "file_magic "*)
2967 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2968 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2969 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2970 $EGREP "$file_magic_regex" > /dev/null; then
2971 :
2972 else
2973 cat <<_LT_EOF 1>&2
2974
2975*** Warning: the command libtool uses to detect shared libraries,
2976*** $file_magic_cmd, produces output that libtool cannot recognize.
2977*** The result is that libtool may fail to recognize shared libraries
2978*** as such. This will affect the creation of libtool libraries that
2979*** depend on shared libraries, but programs linked with such libtool
2980*** libraries will work regardless of this problem. Nevertheless, you
2981*** may want to report the problem to your system manager and/or to
2982*** bug-libtool@gnu.org
2983
2984_LT_EOF
2985 fi ;;
2986 esac
2987 fi
2988 break
2989 fi
2990 done
2991 IFS="$lt_save_ifs"
2992 MAGIC_CMD="$lt_save_MAGIC_CMD"
2993 ;;
2994esac])
2995MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2996if test -n "$MAGIC_CMD"; then
2997 AC_MSG_RESULT($MAGIC_CMD)
2998else
2999 AC_MSG_RESULT(no)
3000fi
3001_LT_DECL([], [MAGIC_CMD], [0],
3002 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3003])# _LT_PATH_TOOL_PREFIX
3004
3005# Old name:
3006AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3007dnl aclocal-1.4 backwards compatibility:
3008dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3009
3010
3011# _LT_PATH_MAGIC
3012# --------------
3013# find a file program which can recognize a shared library
3014m4_defun([_LT_PATH_MAGIC],
3015[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3016if test -z "$lt_cv_path_MAGIC_CMD"; then
3017 if test -n "$ac_tool_prefix"; then
3018 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3019 else
3020 MAGIC_CMD=:
3021 fi
3022fi
3023])# _LT_PATH_MAGIC
3024
3025
3026# LT_PATH_LD
3027# ----------
3028# find the pathname to the GNU or non-GNU linker
3029AC_DEFUN([LT_PATH_LD],
3030[AC_REQUIRE([AC_PROG_CC])dnl
3031AC_REQUIRE([AC_CANONICAL_HOST])dnl
3032AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3033m4_require([_LT_DECL_SED])dnl
3034m4_require([_LT_DECL_EGREP])dnl
3035m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3036
3037AC_ARG_WITH([gnu-ld],
3038 [AS_HELP_STRING([--with-gnu-ld],
3039 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3040 [test "$withval" = no || with_gnu_ld=yes],
3041 [with_gnu_ld=no])dnl
3042
3043ac_prog=ld
3044if test "$GCC" = yes; then
3045 # Check if gcc -print-prog-name=ld gives a path.
3046 AC_MSG_CHECKING([for ld used by $CC])
3047 case $host in
3048 *-*-mingw*)
3049 # gcc leaves a trailing carriage return which upsets mingw
3050 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3051 *)
3052 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3053 esac
3054 case $ac_prog in
3055 # Accept absolute paths.
3056 [[\\/]]* | ?:[[\\/]]*)
3057 re_direlt='/[[^/]][[^/]]*/\.\./'
3058 # Canonicalize the pathname of ld
3059 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3060 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3061 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3062 done
3063 test -z "$LD" && LD="$ac_prog"
3064 ;;
3065 "")
3066 # If it fails, then pretend we aren't using GCC.
3067 ac_prog=ld
3068 ;;
3069 *)
3070 # If it is relative, then search for the first ld in PATH.
3071 with_gnu_ld=unknown
3072 ;;
3073 esac
3074elif test "$with_gnu_ld" = yes; then
3075 AC_MSG_CHECKING([for GNU ld])
3076else
3077 AC_MSG_CHECKING([for non-GNU ld])
3078fi
3079AC_CACHE_VAL(lt_cv_path_LD,
3080[if test -z "$LD"; then
3081 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3082 for ac_dir in $PATH; do
3083 IFS="$lt_save_ifs"
3084 test -z "$ac_dir" && ac_dir=.
3085 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3086 lt_cv_path_LD="$ac_dir/$ac_prog"
3087 # Check to see if the program is GNU ld. I'd rather use --version,
3088 # but apparently some variants of GNU ld only accept -v.
3089 # Break only if it was the GNU/non-GNU ld that we prefer.
3090 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3091 *GNU* | *'with BFD'*)
3092 test "$with_gnu_ld" != no && break
3093 ;;
3094 *)
3095 test "$with_gnu_ld" != yes && break
3096 ;;
3097 esac
3098 fi
3099 done
3100 IFS="$lt_save_ifs"
3101else
3102 lt_cv_path_LD="$LD" # Let the user override the test with a path.
3103fi])
3104LD="$lt_cv_path_LD"
3105if test -n "$LD"; then
3106 AC_MSG_RESULT($LD)
3107else
3108 AC_MSG_RESULT(no)
3109fi
3110test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3111_LT_PATH_LD_GNU
3112AC_SUBST([LD])
3113
3114_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3115])# LT_PATH_LD
3116
3117# Old names:
3118AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3119AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3120dnl aclocal-1.4 backwards compatibility:
3121dnl AC_DEFUN([AM_PROG_LD], [])
3122dnl AC_DEFUN([AC_PROG_LD], [])
3123
3124
3125# _LT_PATH_LD_GNU
3126#- --------------
3127m4_defun([_LT_PATH_LD_GNU],
3128[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3129[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3130case `$LD -v 2>&1 </dev/null` in
3131*GNU* | *'with BFD'*)
3132 lt_cv_prog_gnu_ld=yes
3133 ;;
3134*)
3135 lt_cv_prog_gnu_ld=no
3136 ;;
3137esac])
3138with_gnu_ld=$lt_cv_prog_gnu_ld
3139])# _LT_PATH_LD_GNU
3140
3141
3142# _LT_CMD_RELOAD
3143# --------------
3144# find reload flag for linker
3145# -- PORTME Some linkers may need a different reload flag.
3146m4_defun([_LT_CMD_RELOAD],
3147[AC_CACHE_CHECK([for $LD option to reload object files],
3148 lt_cv_ld_reload_flag,
3149 [lt_cv_ld_reload_flag='-r'])
3150reload_flag=$lt_cv_ld_reload_flag
3151case $reload_flag in
3152"" | " "*) ;;
3153*) reload_flag=" $reload_flag" ;;
3154esac
3155reload_cmds='$LD$reload_flag -o $output$reload_objs'
3156case $host_os in
3157 cygwin* | mingw* | pw32* | cegcc*)
3158 if test "$GCC" != yes; then
3159 reload_cmds=false
3160 fi
3161 ;;
3162 darwin*)
3163 if test "$GCC" = yes; then
3164 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3165 else
3166 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3167 fi
3168 ;;
3169esac
3170_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3171_LT_TAGDECL([], [reload_cmds], [2])dnl
3172])# _LT_CMD_RELOAD
3173
3174
3175# _LT_CHECK_MAGIC_METHOD
3176# ----------------------
3177# how to check for library dependencies
3178# -- PORTME fill in with the dynamic library characteristics
3179m4_defun([_LT_CHECK_MAGIC_METHOD],
3180[m4_require([_LT_DECL_EGREP])
3181m4_require([_LT_DECL_OBJDUMP])
3182AC_CACHE_CHECK([how to recognize dependent libraries],
3183lt_cv_deplibs_check_method,
3184[lt_cv_file_magic_cmd='$MAGIC_CMD'
3185lt_cv_file_magic_test_file=
3186lt_cv_deplibs_check_method='unknown'
3187# Need to set the preceding variable on all platforms that support
3188# interlibrary dependencies.
3189# 'none' -- dependencies not supported.
3190# `unknown' -- same as none, but documents that we really don't know.
3191# 'pass_all' -- all dependencies passed with no checks.
3192# 'test_compile' -- check by making test program.
3193# 'file_magic [[regex]]' -- check by looking for files in library path
3194# which responds to the $file_magic_cmd with a given extended regex.
3195# If you have `file' or equivalent on your system and you're not sure
3196# whether `pass_all' will *always* work, you probably want this one.
3197
3198case $host_os in
3199aix[[4-9]]*)
3200 lt_cv_deplibs_check_method=pass_all
3201 ;;
3202
3203beos*)
3204 lt_cv_deplibs_check_method=pass_all
3205 ;;
3206
3207bsdi[[45]]*)
3208 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3209 lt_cv_file_magic_cmd='/usr/bin/file -L'
3210 lt_cv_file_magic_test_file=/shlib/libc.so
3211 ;;
3212
3213cygwin*)
3214 # func_win32_libid is a shell function defined in ltmain.sh
3215 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3216 lt_cv_file_magic_cmd='func_win32_libid'
3217 ;;
3218
3219mingw* | pw32*)
3220 # Base MSYS/MinGW do not provide the 'file' command needed by
3221 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3222 # unless we find 'file', for example because we are cross-compiling.
3223 # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3224 if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3225 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3226 lt_cv_file_magic_cmd='func_win32_libid'
3227 else
3228 # Keep this pattern in sync with the one in func_win32_libid.
3229 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3230 lt_cv_file_magic_cmd='$OBJDUMP -f'
3231 fi
3232 ;;
3233
3234cegcc*)
3235 # use the weaker test based on 'objdump'. See mingw*.
3236 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3237 lt_cv_file_magic_cmd='$OBJDUMP -f'
3238 ;;
3239
3240darwin* | rhapsody*)
3241 lt_cv_deplibs_check_method=pass_all
3242 ;;
3243
3244freebsd* | dragonfly*)
3245 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3246 case $host_cpu in
3247 i*86 )
3248 # Not sure whether the presence of OpenBSD here was a mistake.
3249 # Let's accept both of them until this is cleared up.
3250 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3251 lt_cv_file_magic_cmd=/usr/bin/file
3252 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3253 ;;
3254 esac
3255 else
3256 lt_cv_deplibs_check_method=pass_all
3257 fi
3258 ;;
3259
3260gnu*)
3261 lt_cv_deplibs_check_method=pass_all
3262 ;;
3263
3264haiku*)
3265 lt_cv_deplibs_check_method=pass_all
3266 ;;
3267
3268hpux10.20* | hpux11*)
3269 lt_cv_file_magic_cmd=/usr/bin/file
3270 case $host_cpu in
3271 ia64*)
3272 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3273 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3274 ;;
3275 hppa*64*)
3276 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3277 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3278 ;;
3279 *)
3280 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3281 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3282 ;;
3283 esac
3284 ;;
3285
3286interix[[3-9]]*)
3287 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3288 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3289 ;;
3290
3291irix5* | irix6* | nonstopux*)
3292 case $LD in
3293 *-32|*"-32 ") libmagic=32-bit;;
3294 *-n32|*"-n32 ") libmagic=N32;;
3295 *-64|*"-64 ") libmagic=64-bit;;
3296 *) libmagic=never-match;;
3297 esac
3298 lt_cv_deplibs_check_method=pass_all
3299 ;;
3300
3301# This must be glibc/ELF.
3302linux* | k*bsd*-gnu | kopensolaris*-gnu)
3303 lt_cv_deplibs_check_method=pass_all
3304 ;;
3305
3306netbsd*)
3307 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3308 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3309 else
3310 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3311 fi
3312 ;;
3313
3314newos6*)
3315 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3316 lt_cv_file_magic_cmd=/usr/bin/file
3317 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3318 ;;
3319
3320*nto* | *qnx*)
3321 lt_cv_deplibs_check_method=pass_all
3322 ;;
3323
3324openbsd*)
3325 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3326 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3327 else
3328 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3329 fi
3330 ;;
3331
3332osf3* | osf4* | osf5*)
3333 lt_cv_deplibs_check_method=pass_all
3334 ;;
3335
3336rdos*)
3337 lt_cv_deplibs_check_method=pass_all
3338 ;;
3339
3340solaris*)
3341 lt_cv_deplibs_check_method=pass_all
3342 ;;
3343
3344sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3345 lt_cv_deplibs_check_method=pass_all
3346 ;;
3347
3348sysv4 | sysv4.3*)
3349 case $host_vendor in
3350 motorola)
3351 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3352 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3353 ;;
3354 ncr)
3355 lt_cv_deplibs_check_method=pass_all
3356 ;;
3357 sequent)
3358 lt_cv_file_magic_cmd='/bin/file'
3359 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3360 ;;
3361 sni)
3362 lt_cv_file_magic_cmd='/bin/file'
3363 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3364 lt_cv_file_magic_test_file=/lib/libc.so
3365 ;;
3366 siemens)
3367 lt_cv_deplibs_check_method=pass_all
3368 ;;
3369 pc)
3370 lt_cv_deplibs_check_method=pass_all
3371 ;;
3372 esac
3373 ;;
3374
3375tpf*)
3376 lt_cv_deplibs_check_method=pass_all
3377 ;;
3378esac
3379])
3380
3381file_magic_glob=
3382want_nocaseglob=no
3383if test "$build" = "$host"; then
3384 case $host_os in
3385 mingw* | pw32*)
3386 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3387 want_nocaseglob=yes
3388 else
3389 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3390 fi
3391 ;;
3392 esac
3393fi
3394
3395file_magic_cmd=$lt_cv_file_magic_cmd
3396deplibs_check_method=$lt_cv_deplibs_check_method
3397test -z "$deplibs_check_method" && deplibs_check_method=unknown
3398
3399_LT_DECL([], [deplibs_check_method], [1],
3400 [Method to check whether dependent libraries are shared objects])
3401_LT_DECL([], [file_magic_cmd], [1],
3402 [Command to use when deplibs_check_method = "file_magic"])
3403_LT_DECL([], [file_magic_glob], [1],
3404 [How to find potential files when deplibs_check_method = "file_magic"])
3405_LT_DECL([], [want_nocaseglob], [1],
3406 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3407])# _LT_CHECK_MAGIC_METHOD
3408
3409
3410# LT_PATH_NM
3411# ----------
3412# find the pathname to a BSD- or MS-compatible name lister
3413AC_DEFUN([LT_PATH_NM],
3414[AC_REQUIRE([AC_PROG_CC])dnl
3415AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3416[if test -n "$NM"; then
3417 # Let the user override the test.
3418 lt_cv_path_NM="$NM"
3419else
3420 lt_nm_to_check="${ac_tool_prefix}nm"
3421 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3422 lt_nm_to_check="$lt_nm_to_check nm"
3423 fi
3424 for lt_tmp_nm in $lt_nm_to_check; do
3425 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3426 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3427 IFS="$lt_save_ifs"
3428 test -z "$ac_dir" && ac_dir=.
3429 tmp_nm="$ac_dir/$lt_tmp_nm"
3430 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3431 # Check to see if the nm accepts a BSD-compat flag.
3432 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3433 # nm: unknown option "B" ignored
3434 # Tru64's nm complains that /dev/null is an invalid object file
3435 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3436 */dev/null* | *'Invalid file or object type'*)
3437 lt_cv_path_NM="$tmp_nm -B"
3438 break
3439 ;;
3440 *)
3441 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3442 */dev/null*)
3443 lt_cv_path_NM="$tmp_nm -p"
3444 break
3445 ;;
3446 *)
3447 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3448 continue # so that we can try to find one that supports BSD flags
3449 ;;
3450 esac
3451 ;;
3452 esac
3453 fi
3454 done
3455 IFS="$lt_save_ifs"
3456 done
3457 : ${lt_cv_path_NM=no}
3458fi])
3459if test "$lt_cv_path_NM" != "no"; then
3460 NM="$lt_cv_path_NM"
3461else
3462 # Didn't find any BSD compatible name lister, look for dumpbin.
3463 if test -n "$DUMPBIN"; then :
3464 # Let the user override the test.
3465 else
3466 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3467 case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3468 *COFF*)
3469 DUMPBIN="$DUMPBIN -symbols"
3470 ;;
3471 *)
3472 DUMPBIN=:
3473 ;;
3474 esac
3475 fi
3476 AC_SUBST([DUMPBIN])
3477 if test "$DUMPBIN" != ":"; then
3478 NM="$DUMPBIN"
3479 fi
3480fi
3481test -z "$NM" && NM=nm
3482AC_SUBST([NM])
3483_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3484
3485AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3486 [lt_cv_nm_interface="BSD nm"
3487 echo "int some_variable = 0;" > conftest.$ac_ext
3488 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3489 (eval "$ac_compile" 2>conftest.err)
3490 cat conftest.err >&AS_MESSAGE_LOG_FD
3491 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3492 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3493 cat conftest.err >&AS_MESSAGE_LOG_FD
3494 (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3495 cat conftest.out >&AS_MESSAGE_LOG_FD
3496 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3497 lt_cv_nm_interface="MS dumpbin"
3498 fi
3499 rm -f conftest*])
3500])# LT_PATH_NM
3501
3502# Old names:
3503AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3504AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3505dnl aclocal-1.4 backwards compatibility:
3506dnl AC_DEFUN([AM_PROG_NM], [])
3507dnl AC_DEFUN([AC_PROG_NM], [])
3508
3509# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3510# --------------------------------
3511# how to determine the name of the shared library
3512# associated with a specific link library.
3513# -- PORTME fill in with the dynamic library characteristics
3514m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3515[m4_require([_LT_DECL_EGREP])
3516m4_require([_LT_DECL_OBJDUMP])
3517m4_require([_LT_DECL_DLLTOOL])
3518AC_CACHE_CHECK([how to associate runtime and link libraries],
3519lt_cv_sharedlib_from_linklib_cmd,
3520[lt_cv_sharedlib_from_linklib_cmd='unknown'
3521
3522case $host_os in
3523cygwin* | mingw* | pw32* | cegcc*)
3524 # two different shell functions defined in ltmain.sh
3525 # decide which to use based on capabilities of $DLLTOOL
3526 case `$DLLTOOL --help 2>&1` in
3527 *--identify-strict*)
3528 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3529 ;;
3530 *)
3531 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3532 ;;
3533 esac
3534 ;;
3535*)
3536 # fallback: assume linklib IS sharedlib
3537 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3538 ;;
3539esac
3540])
3541sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3542test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3543
3544_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3545 [Command to associate shared and link libraries])
3546])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3547
3548
3549# _LT_PATH_MANIFEST_TOOL
3550# ----------------------
3551# locate the manifest tool
3552m4_defun([_LT_PATH_MANIFEST_TOOL],
3553[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3554test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3555AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3556 [lt_cv_path_mainfest_tool=no
3557 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3558 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3559 cat conftest.err >&AS_MESSAGE_LOG_FD
3560 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3561 lt_cv_path_mainfest_tool=yes
3562 fi
3563 rm -f conftest*])
3564if test "x$lt_cv_path_mainfest_tool" != xyes; then
3565 MANIFEST_TOOL=:
3566fi
3567_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3568])# _LT_PATH_MANIFEST_TOOL
3569
3570
3571# LT_LIB_M
3572# --------
3573# check for math library
3574AC_DEFUN([LT_LIB_M],
3575[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3576LIBM=
3577case $host in
3578*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3579 # These system don't have libm, or don't need it
3580 ;;
3581*-ncr-sysv4.3*)
3582 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3583 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3584 ;;
3585*)
3586 AC_CHECK_LIB(m, cos, LIBM="-lm")
3587 ;;
3588esac
3589AC_SUBST([LIBM])
3590])# LT_LIB_M
3591
3592# Old name:
3593AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3594dnl aclocal-1.4 backwards compatibility:
3595dnl AC_DEFUN([AC_CHECK_LIBM], [])
3596
3597
3598# _LT_COMPILER_NO_RTTI([TAGNAME])
3599# -------------------------------
3600m4_defun([_LT_COMPILER_NO_RTTI],
3601[m4_require([_LT_TAG_COMPILER])dnl
3602
3603_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3604
3605if test "$GCC" = yes; then
3606 case $cc_basename in
3607 nvcc*)
3608 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3609 *)
3610 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3611 esac
3612
3613 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3614 lt_cv_prog_compiler_rtti_exceptions,
3615 [-fno-rtti -fno-exceptions], [],
3616 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3617fi
3618_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3619 [Compiler flag to turn off builtin functions])
3620])# _LT_COMPILER_NO_RTTI
3621
3622
3623# _LT_CMD_GLOBAL_SYMBOLS
3624# ----------------------
3625m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3626[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3627AC_REQUIRE([AC_PROG_CC])dnl
3628AC_REQUIRE([AC_PROG_AWK])dnl
3629AC_REQUIRE([LT_PATH_NM])dnl
3630AC_REQUIRE([LT_PATH_LD])dnl
3631m4_require([_LT_DECL_SED])dnl
3632m4_require([_LT_DECL_EGREP])dnl
3633m4_require([_LT_TAG_COMPILER])dnl
3634
3635# Check for command to grab the raw symbol name followed by C symbol from nm.
3636AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3637AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3638[
3639# These are sane defaults that work on at least a few old systems.
3640# [They come from Ultrix. What could be older than Ultrix?!! ;)]
3641
3642# Character class describing NM global symbol codes.
3643symcode='[[BCDEGRST]]'
3644
3645# Regexp to match symbols that can be accessed directly from C.
3646sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3647
3648# Define system-specific variables.
3649case $host_os in
3650aix*)
3651 symcode='[[BCDT]]'
3652 ;;
3653cygwin* | mingw* | pw32* | cegcc*)
3654 symcode='[[ABCDGISTW]]'
3655 ;;
3656hpux*)
3657 if test "$host_cpu" = ia64; then
3658 symcode='[[ABCDEGRST]]'
3659 fi
3660 ;;
3661irix* | nonstopux*)
3662 symcode='[[BCDEGRST]]'
3663 ;;
3664osf*)
3665 symcode='[[BCDEGQRST]]'
3666 ;;
3667solaris*)
3668 symcode='[[BDRT]]'
3669 ;;
3670sco3.2v5*)
3671 symcode='[[DT]]'
3672 ;;
3673sysv4.2uw2*)
3674 symcode='[[DT]]'
3675 ;;
3676sysv5* | sco5v6* | unixware* | OpenUNIX*)
3677 symcode='[[ABDT]]'
3678 ;;
3679sysv4)
3680 symcode='[[DFNSTU]]'
3681 ;;
3682esac
3683
3684# If we're using GNU nm, then use its standard symbol codes.
3685case `$NM -V 2>&1` in
3686*GNU* | *'with BFD'*)
3687 symcode='[[ABCDGIRSTW]]' ;;
3688esac
3689
3690# Transform an extracted symbol line into a proper C declaration.
3691# Some systems (esp. on ia64) link data and code symbols differently,
3692# so use this general approach.
3693lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3694
3695# Transform an extracted symbol line into symbol name and symbol address
3696lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3697lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
3698
3699# Handle CRLF in mingw tool chain
3700opt_cr=
3701case $build_os in
3702mingw*)
3703 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3704 ;;
3705esac
3706
3707# Try without a prefix underscore, then with it.
3708for ac_symprfx in "" "_"; do
3709
3710 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3711 symxfrm="\\1 $ac_symprfx\\2 \\2"
3712
3713 # Write the raw and C identifiers.
3714 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3715 # Fake it for dumpbin and say T for any non-static function
3716 # and D for any global variable.
3717 # Also find C++ and __fastcall symbols from MSVC++,
3718 # which start with @ or ?.
3719 lt_cv_sys_global_symbol_pipe="$AWK ['"\
3720" {last_section=section; section=\$ 3};"\
3721" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3722" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3723" \$ 0!~/External *\|/{next};"\
3724" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3725" {if(hide[section]) next};"\
3726" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3727" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3728" s[1]~/^[@?]/{print s[1], s[1]; next};"\
3729" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3730" ' prfx=^$ac_symprfx]"
3731 else
3732 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3733 fi
3734 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3735
3736 # Check to see that the pipe works correctly.
3737 pipe_works=no
3738
3739 rm -f conftest*
3740 cat > conftest.$ac_ext <<_LT_EOF
3741#ifdef __cplusplus
3742extern "C" {
3743#endif
3744char nm_test_var;
3745void nm_test_func(void);
3746void nm_test_func(void){}
3747#ifdef __cplusplus
3748}
3749#endif
3750int main(){nm_test_var='a';nm_test_func();return(0);}
3751_LT_EOF
3752
3753 if AC_TRY_EVAL(ac_compile); then
3754 # Now try to grab the symbols.
3755 nlist=conftest.nm
3756 if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3757 # Try sorting and uniquifying the output.
3758 if sort "$nlist" | uniq > "$nlist"T; then
3759 mv -f "$nlist"T "$nlist"
3760 else
3761 rm -f "$nlist"T
3762 fi
3763
3764 # Make sure that we snagged all the symbols we need.
3765 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3766 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3767 cat <<_LT_EOF > conftest.$ac_ext
3768/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3769#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3770/* DATA imports from DLLs on WIN32 con't be const, because runtime
3771 relocations are performed -- see ld's documentation on pseudo-relocs. */
3772# define LT@&t@_DLSYM_CONST
3773#elif defined(__osf__)
3774/* This system does not cope well with relocations in const data. */
3775# define LT@&t@_DLSYM_CONST
3776#else
3777# define LT@&t@_DLSYM_CONST const
3778#endif
3779
3780#ifdef __cplusplus
3781extern "C" {
3782#endif
3783
3784_LT_EOF
3785 # Now generate the symbol file.
3786 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3787
3788 cat <<_LT_EOF >> conftest.$ac_ext
3789
3790/* The mapping between symbol names and symbols. */
3791LT@&t@_DLSYM_CONST struct {
3792 const char *name;
3793 void *address;
3794}
3795lt__PROGRAM__LTX_preloaded_symbols[[]] =
3796{
3797 { "@PROGRAM@", (void *) 0 },
3798_LT_EOF
3799 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3800 cat <<\_LT_EOF >> conftest.$ac_ext
3801 {0, (void *) 0}
3802};
3803
3804/* This works around a problem in FreeBSD linker */
3805#ifdef FREEBSD_WORKAROUND
3806static const void *lt_preloaded_setup() {
3807 return lt__PROGRAM__LTX_preloaded_symbols;
3808}
3809#endif
3810
3811#ifdef __cplusplus
3812}
3813#endif
3814_LT_EOF
3815 # Now try linking the two files.
3816 mv conftest.$ac_objext conftstm.$ac_objext
3817 lt_globsym_save_LIBS=$LIBS
3818 lt_globsym_save_CFLAGS=$CFLAGS
3819 LIBS="conftstm.$ac_objext"
3820 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3821 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3822 pipe_works=yes
3823 fi
3824 LIBS=$lt_globsym_save_LIBS
3825 CFLAGS=$lt_globsym_save_CFLAGS
3826 else
3827 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3828 fi
3829 else
3830 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3831 fi
3832 else
3833 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3834 fi
3835 else
3836 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3837 cat conftest.$ac_ext >&5
3838 fi
3839 rm -rf conftest* conftst*
3840
3841 # Do not use the global_symbol_pipe unless it works.
3842 if test "$pipe_works" = yes; then
3843 break
3844 else
3845 lt_cv_sys_global_symbol_pipe=
3846 fi
3847done
3848])
3849if test -z "$lt_cv_sys_global_symbol_pipe"; then
3850 lt_cv_sys_global_symbol_to_cdecl=
3851fi
3852if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3853 AC_MSG_RESULT(failed)
3854else
3855 AC_MSG_RESULT(ok)
3856fi
3857
3858# Response file support.
3859if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3860 nm_file_list_spec='@'
3861elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3862 nm_file_list_spec='@'
3863fi
3864
3865_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3866 [Take the output of nm and produce a listing of raw symbols and C names])
3867_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3868 [Transform the output of nm in a proper C declaration])
3869_LT_DECL([global_symbol_to_c_name_address],
3870 [lt_cv_sys_global_symbol_to_c_name_address], [1],
3871 [Transform the output of nm in a C name address pair])
3872_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3873 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3874 [Transform the output of nm in a C name address pair when lib prefix is needed])
3875_LT_DECL([], [nm_file_list_spec], [1],
3876 [Specify filename containing input files for $NM])
3877]) # _LT_CMD_GLOBAL_SYMBOLS
3878
3879
3880# _LT_COMPILER_PIC([TAGNAME])
3881# ---------------------------
3882m4_defun([_LT_COMPILER_PIC],
3883[m4_require([_LT_TAG_COMPILER])dnl
3884_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3885_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3886_LT_TAGVAR(lt_prog_compiler_static, $1)=
3887
3888m4_if([$1], [CXX], [
3889 # C++ specific cases for pic, static, wl, etc.
3890 if test "$GXX" = yes; then
3891 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3892 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3893
3894 case $host_os in
3895 aix*)
3896 # All AIX code is PIC.
3897 if test "$host_cpu" = ia64; then
3898 # AIX 5 now supports IA64 processor
3899 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3900 fi
3901 ;;
3902
3903 amigaos*)
3904 case $host_cpu in
3905 powerpc)
3906 # see comment about AmigaOS4 .so support
3907 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3908 ;;
3909 m68k)
3910 # FIXME: we need at least 68020 code to build shared libraries, but
3911 # adding the `-m68020' flag to GCC prevents building anything better,
3912 # like `-m68040'.
3913 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3914 ;;
3915 esac
3916 ;;
3917
3918 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3919 # PIC is the default for these OSes.
3920 ;;
3921 mingw* | cygwin* | os2* | pw32* | cegcc*)
3922 # This hack is so that the source file can tell whether it is being
3923 # built for inclusion in a dll (and should export symbols for example).
3924 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3925 # (--disable-auto-import) libraries
3926 m4_if([$1], [GCJ], [],
3927 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3928 ;;
3929 darwin* | rhapsody*)
3930 # PIC is the default on this platform
3931 # Common symbols not allowed in MH_DYLIB files
3932 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3933 ;;
3934 *djgpp*)
3935 # DJGPP does not support shared libraries at all
3936 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3937 ;;
3938 haiku*)
3939 # PIC is the default for Haiku.
3940 # The "-static" flag exists, but is broken.
3941 _LT_TAGVAR(lt_prog_compiler_static, $1)=
3942 ;;
3943 interix[[3-9]]*)
3944 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3945 # Instead, we relocate shared libraries at runtime.
3946 ;;
3947 sysv4*MP*)
3948 if test -d /usr/nec; then
3949 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3950 fi
3951 ;;
3952 hpux*)
3953 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3954 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
3955 # sets the default TLS model and affects inlining.
3956 case $host_cpu in
3957 hppa*64*)
3958 ;;
3959 *)
3960 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3961 ;;
3962 esac
3963 ;;
3964 *qnx* | *nto*)
3965 # QNX uses GNU C++, but need to define -shared option too, otherwise
3966 # it will coredump.
3967 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3968 ;;
3969 *)
3970 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3971 ;;
3972 esac
3973 else
3974 case $host_os in
3975 aix[[4-9]]*)
3976 # All AIX code is PIC.
3977 if test "$host_cpu" = ia64; then
3978 # AIX 5 now supports IA64 processor
3979 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3980 else
3981 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3982 fi
3983 ;;
3984 chorus*)
3985 case $cc_basename in
3986 cxch68*)
3987 # Green Hills C++ Compiler
3988 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
3989 ;;
3990 esac
3991 ;;
3992 mingw* | cygwin* | os2* | pw32* | cegcc*)
3993 # This hack is so that the source file can tell whether it is being
3994 # built for inclusion in a dll (and should export symbols for example).
3995 m4_if([$1], [GCJ], [],
3996 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3997 ;;
3998 dgux*)
3999 case $cc_basename in
4000 ec++*)
4001 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4002 ;;
4003 ghcx*)
4004 # Green Hills C++ Compiler
4005 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4006 ;;
4007 *)
4008 ;;
4009 esac
4010 ;;
4011 freebsd* | dragonfly*)
4012 # FreeBSD uses GNU C++
4013 ;;
4014 hpux9* | hpux10* | hpux11*)
4015 case $cc_basename in
4016 CC*)
4017 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4018 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4019 if test "$host_cpu" != ia64; then
4020 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4021 fi
4022 ;;
4023 aCC*)
4024 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4025 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4026 case $host_cpu in
4027 hppa*64*|ia64*)
4028 # +Z the default
4029 ;;
4030 *)
4031 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4032 ;;
4033 esac
4034 ;;
4035 *)
4036 ;;
4037 esac
4038 ;;
4039 interix*)
4040 # This is c89, which is MS Visual C++ (no shared libs)
4041 # Anyone wants to do a port?
4042 ;;
4043 irix5* | irix6* | nonstopux*)
4044 case $cc_basename in
4045 CC*)
4046 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4047 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4048 # CC pic flag -KPIC is the default.
4049 ;;
4050 *)
4051 ;;
4052 esac
4053 ;;
4054 linux* | k*bsd*-gnu | kopensolaris*-gnu)
4055 case $cc_basename in
4056 KCC*)
4057 # KAI C++ Compiler
4058 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4059 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4060 ;;
4061 ecpc* )
4062 # old Intel C++ for x86_64 which still supported -KPIC.
4063 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4064 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4065 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4066 ;;
4067 icpc* )
4068 # Intel C++, used to be incompatible with GCC.
4069 # ICC 10 doesn't accept -KPIC any more.
4070 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4071 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4072 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4073 ;;
4074 pgCC* | pgcpp*)
4075 # Portland Group C++ compiler
4076 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4077 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4078 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4079 ;;
4080 cxx*)
4081 # Compaq C++
4082 # Make sure the PIC flag is empty. It appears that all Alpha
4083 # Linux and Compaq Tru64 Unix objects are PIC.
4084 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4085 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4086 ;;
4087 xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4088 # IBM XL 8.0, 9.0 on PPC and BlueGene
4089 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4090 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4091 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4092 ;;
4093 *)
4094 case `$CC -V 2>&1 | sed 5q` in
4095 *Sun\ C*)
4096 # Sun C++ 5.9
4097 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4098 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4099 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4100 ;;
4101 esac
4102 ;;
4103 esac
4104 ;;
4105 lynxos*)
4106 ;;
4107 m88k*)
4108 ;;
4109 mvs*)
4110 case $cc_basename in
4111 cxx*)
4112 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4113 ;;
4114 *)
4115 ;;
4116 esac
4117 ;;
4118 netbsd*)
4119 ;;
4120 *qnx* | *nto*)
4121 # QNX uses GNU C++, but need to define -shared option too, otherwise
4122 # it will coredump.
4123 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4124 ;;
4125 osf3* | osf4* | osf5*)
4126 case $cc_basename in
4127 KCC*)
4128 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4129 ;;
4130 RCC*)
4131 # Rational C++ 2.4.1
4132 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4133 ;;
4134 cxx*)
4135 # Digital/Compaq C++
4136 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4137 # Make sure the PIC flag is empty. It appears that all Alpha
4138 # Linux and Compaq Tru64 Unix objects are PIC.
4139 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4140 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4141 ;;
4142 *)
4143 ;;
4144 esac
4145 ;;
4146 psos*)
4147 ;;
4148 solaris*)
4149 case $cc_basename in
4150 CC* | sunCC*)
4151 # Sun C++ 4.2, 5.x and Centerline C++
4152 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4153 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4154 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4155 ;;
4156 gcx*)
4157 # Green Hills C++ Compiler
4158 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4159 ;;
4160 *)
4161 ;;
4162 esac
4163 ;;
4164 sunos4*)
4165 case $cc_basename in
4166 CC*)
4167 # Sun C++ 4.x
4168 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4169 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4170 ;;
4171 lcc*)
4172 # Lucid
4173 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4174 ;;
4175 *)
4176 ;;
4177 esac
4178 ;;
4179 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4180 case $cc_basename in
4181 CC*)
4182 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4183 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4184 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4185 ;;
4186 esac
4187 ;;
4188 tandem*)
4189 case $cc_basename in
4190 NCC*)
4191 # NonStop-UX NCC 3.20
4192 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4193 ;;
4194 *)
4195 ;;
4196 esac
4197 ;;
4198 vxworks*)
4199 ;;
4200 *)
4201 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4202 ;;
4203 esac
4204 fi
4205],
4206[
4207 if test "$GCC" = yes; then
4208 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4209 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4210
4211 case $host_os in
4212 aix*)
4213 # All AIX code is PIC.
4214 if test "$host_cpu" = ia64; then
4215 # AIX 5 now supports IA64 processor
4216 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4217 fi
4218 ;;
4219
4220 amigaos*)
4221 case $host_cpu in
4222 powerpc)
4223 # see comment about AmigaOS4 .so support
4224 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4225 ;;
4226 m68k)
4227 # FIXME: we need at least 68020 code to build shared libraries, but
4228 # adding the `-m68020' flag to GCC prevents building anything better,
4229 # like `-m68040'.
4230 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4231 ;;
4232 esac
4233 ;;
4234
4235 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4236 # PIC is the default for these OSes.
4237 ;;
4238
4239 mingw* | cygwin* | pw32* | os2* | cegcc*)
4240 # This hack is so that the source file can tell whether it is being
4241 # built for inclusion in a dll (and should export symbols for example).
4242 # Although the cygwin gcc ignores -fPIC, still need this for old-style
4243 # (--disable-auto-import) libraries
4244 m4_if([$1], [GCJ], [],
4245 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4246 ;;
4247
4248 darwin* | rhapsody*)
4249 # PIC is the default on this platform
4250 # Common symbols not allowed in MH_DYLIB files
4251 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4252 ;;
4253
4254 haiku*)
4255 # PIC is the default for Haiku.
4256 # The "-static" flag exists, but is broken.
4257 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4258 ;;
4259
4260 hpux*)
4261 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4262 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
4263 # sets the default TLS model and affects inlining.
4264 case $host_cpu in
4265 hppa*64*)
4266 # +Z the default
4267 ;;
4268 *)
4269 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4270 ;;
4271 esac
4272 ;;
4273
4274 interix[[3-9]]*)
4275 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4276 # Instead, we relocate shared libraries at runtime.
4277 ;;
4278
4279 msdosdjgpp*)
4280 # Just because we use GCC doesn't mean we suddenly get shared libraries
4281 # on systems that don't support them.
4282 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4283 enable_shared=no
4284 ;;
4285
4286 *nto* | *qnx*)
4287 # QNX uses GNU C++, but need to define -shared option too, otherwise
4288 # it will coredump.
4289 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4290 ;;
4291
4292 sysv4*MP*)
4293 if test -d /usr/nec; then
4294 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4295 fi
4296 ;;
4297
4298 *)
4299 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4300 ;;
4301 esac
4302
4303 case $cc_basename in
4304 nvcc*) # Cuda Compiler Driver 2.2
4305 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4306 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4307 _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4308 fi
4309 ;;
4310 esac
4311 else
4312 # PORTME Check for flag to pass linker flags through the system compiler.
4313 case $host_os in
4314 aix*)
4315 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4316 if test "$host_cpu" = ia64; then
4317 # AIX 5 now supports IA64 processor
4318 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4319 else
4320 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4321 fi
4322 ;;
4323
4324 mingw* | cygwin* | pw32* | os2* | cegcc*)
4325 # This hack is so that the source file can tell whether it is being
4326 # built for inclusion in a dll (and should export symbols for example).
4327 m4_if([$1], [GCJ], [],
4328 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4329 ;;
4330
4331 hpux9* | hpux10* | hpux11*)
4332 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4333 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4334 # not for PA HP-UX.
4335 case $host_cpu in
4336 hppa*64*|ia64*)
4337 # +Z the default
4338 ;;
4339 *)
4340 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4341 ;;
4342 esac
4343 # Is there a better lt_prog_compiler_static that works with the bundled CC?
4344 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4345 ;;
4346
4347 irix5* | irix6* | nonstopux*)
4348 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4349 # PIC (with -KPIC) is the default.
4350 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4351 ;;
4352
4353 linux* | k*bsd*-gnu | kopensolaris*-gnu)
4354 case $cc_basename in
4355 # old Intel for x86_64 which still supported -KPIC.
4356 ecc*)
4357 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4358 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4359 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4360 ;;
4361 # icc used to be incompatible with GCC.
4362 # ICC 10 doesn't accept -KPIC any more.
4363 icc* | ifort*)
4364 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4365 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4366 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4367 ;;
4368 # Lahey Fortran 8.1.
4369 lf95*)
4370 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4371 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4372 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4373 ;;
4374 nagfor*)
4375 # NAG Fortran compiler
4376 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4377 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4378 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4379 ;;
4380 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4381 # Portland Group compilers (*not* the Pentium gcc compiler,
4382 # which looks to be a dead project)
4383 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4384 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4385 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4386 ;;
4387 ccc*)
4388 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4389 # All Alpha code is PIC.
4390 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4391 ;;
4392 xl* | bgxl* | bgf* | mpixl*)
4393 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4394 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4395 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4396 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4397 ;;
4398 *)
4399 case `$CC -V 2>&1 | sed 5q` in
4400 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4401 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4402 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4403 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4404 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4405 ;;
4406 *Sun\ F* | *Sun*Fortran*)
4407 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4408 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4409 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4410 ;;
4411 *Sun\ C*)
4412 # Sun C 5.9
4413 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4414 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4415 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4416 ;;
4417 *Intel*\ [[CF]]*Compiler*)
4418 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4419 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4420 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4421 ;;
4422 *Portland\ Group*)
4423 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4424 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4425 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4426 ;;
4427 esac
4428 ;;
4429 esac
4430 ;;
4431
4432 newsos6)
4433 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4434 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4435 ;;
4436
4437 *nto* | *qnx*)
4438 # QNX uses GNU C++, but need to define -shared option too, otherwise
4439 # it will coredump.
4440 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4441 ;;
4442
4443 osf3* | osf4* | osf5*)
4444 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4445 # All OSF/1 code is PIC.
4446 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4447 ;;
4448
4449 rdos*)
4450 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4451 ;;
4452
4453 solaris*)
4454 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4455 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4456 case $cc_basename in
4457 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4458 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4459 *)
4460 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4461 esac
4462 ;;
4463
4464 sunos4*)
4465 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4466 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4467 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4468 ;;
4469
4470 sysv4 | sysv4.2uw2* | sysv4.3*)
4471 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4472 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4473 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4474 ;;
4475
4476 sysv4*MP*)
4477 if test -d /usr/nec ;then
4478 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4479 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4480 fi
4481 ;;
4482
4483 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4484 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4485 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4486 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4487 ;;
4488
4489 unicos*)
4490 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4491 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4492 ;;
4493
4494 uts4*)
4495 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4496 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4497 ;;
4498
4499 *)
4500 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4501 ;;
4502 esac
4503 fi
4504])
4505case $host_os in
4506 # For platforms which do not support PIC, -DPIC is meaningless:
4507 *djgpp*)
4508 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4509 ;;
4510 *)
4511 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4512 ;;
4513esac
4514
4515AC_CACHE_CHECK([for $compiler option to produce PIC],
4516 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4517 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4518_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4519
4520#
4521# Check to make sure the PIC flag actually works.
4522#
4523if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4524 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4525 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4526 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4527 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4528 "" | " "*) ;;
4529 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4530 esac],
4531 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4532 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4533fi
4534_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4535 [Additional compiler flags for building library objects])
4536
4537_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4538 [How to pass a linker flag through the compiler])
4539#
4540# Check to make sure the static flag actually works.
4541#
4542wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4543_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4544 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4545 $lt_tmp_static_flag,
4546 [],
4547 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4548_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4549 [Compiler flag to prevent dynamic linking])
4550])# _LT_COMPILER_PIC
4551
4552
4553# _LT_LINKER_SHLIBS([TAGNAME])
4554# ----------------------------
4555# See if the linker supports building shared libraries.
4556m4_defun([_LT_LINKER_SHLIBS],
4557[AC_REQUIRE([LT_PATH_LD])dnl
4558AC_REQUIRE([LT_PATH_NM])dnl
4559m4_require([_LT_PATH_MANIFEST_TOOL])dnl
4560m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4561m4_require([_LT_DECL_EGREP])dnl
4562m4_require([_LT_DECL_SED])dnl
4563m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4564m4_require([_LT_TAG_COMPILER])dnl
4565AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4566m4_if([$1], [CXX], [
4567 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4568 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4569 case $host_os in
4570 aix[[4-9]]*)
4571 # If we're using GNU nm, then we don't want the "-C" option.
4572 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4573 # Also, AIX nm treats weak defined symbols like other global defined
4574 # symbols, whereas GNU nm marks them as "W".
4575 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4576 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4577 else
4578 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4579 fi
4580 ;;
4581 pw32*)
4582 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4583 ;;
4584 cygwin* | mingw* | cegcc*)
4585 case $cc_basename in
4586 cl*)
4587 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4588 ;;
4589 *)
4590 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4591 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4592 ;;
4593 esac
4594 ;;
4595 *)
4596 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4597 ;;
4598 esac
4599], [
4600 runpath_var=
4601 _LT_TAGVAR(allow_undefined_flag, $1)=
4602 _LT_TAGVAR(always_export_symbols, $1)=no
4603 _LT_TAGVAR(archive_cmds, $1)=
4604 _LT_TAGVAR(archive_expsym_cmds, $1)=
4605 _LT_TAGVAR(compiler_needs_object, $1)=no
4606 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4607 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4608 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4609 _LT_TAGVAR(hardcode_automatic, $1)=no
4610 _LT_TAGVAR(hardcode_direct, $1)=no
4611 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4612 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4613 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4614 _LT_TAGVAR(hardcode_minus_L, $1)=no
4615 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4616 _LT_TAGVAR(inherit_rpath, $1)=no
4617 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4618 _LT_TAGVAR(module_cmds, $1)=
4619 _LT_TAGVAR(module_expsym_cmds, $1)=
4620 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4621 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4622 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4623 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4624 # include_expsyms should be a list of space-separated symbols to be *always*
4625 # included in the symbol list
4626 _LT_TAGVAR(include_expsyms, $1)=
4627 # exclude_expsyms can be an extended regexp of symbols to exclude
4628 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4629 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4630 # as well as any symbol that contains `d'.
4631 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4632 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4633 # platforms (ab)use it in PIC code, but their linkers get confused if
4634 # the symbol is explicitly referenced. Since portable code cannot
4635 # rely on this symbol name, it's probably fine to never include it in
4636 # preloaded symbol tables.
4637 # Exclude shared library initialization/finalization symbols.
4638dnl Note also adjust exclude_expsyms for C++ above.
4639 extract_expsyms_cmds=
4640
4641 case $host_os in
4642 cygwin* | mingw* | pw32* | cegcc*)
4643 # FIXME: the MSVC++ port hasn't been tested in a loooong time
4644 # When not using gcc, we currently assume that we are using
4645 # Microsoft Visual C++.
4646 if test "$GCC" != yes; then
4647 with_gnu_ld=no
4648 fi
4649 ;;
4650 interix*)
4651 # we just hope/assume this is gcc and not c89 (= MSVC++)
4652 with_gnu_ld=yes
4653 ;;
4654 openbsd*)
4655 with_gnu_ld=no
4656 ;;
4657 esac
4658
4659 _LT_TAGVAR(ld_shlibs, $1)=yes
4660
4661 # On some targets, GNU ld is compatible enough with the native linker
4662 # that we're better off using the native interface for both.
4663 lt_use_gnu_ld_interface=no
4664 if test "$with_gnu_ld" = yes; then
4665 case $host_os in
4666 aix*)
4667 # The AIX port of GNU ld has always aspired to compatibility
4668 # with the native linker. However, as the warning in the GNU ld
4669 # block says, versions before 2.19.5* couldn't really create working
4670 # shared libraries, regardless of the interface used.
4671 case `$LD -v 2>&1` in
4672 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4673 *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4674 *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4675 *)
4676 lt_use_gnu_ld_interface=yes
4677 ;;
4678 esac
4679 ;;
4680 *)
4681 lt_use_gnu_ld_interface=yes
4682 ;;
4683 esac
4684 fi
4685
4686 if test "$lt_use_gnu_ld_interface" = yes; then
4687 # If archive_cmds runs LD, not CC, wlarc should be empty
4688 wlarc='${wl}'
4689
4690 # Set some defaults for GNU ld with shared library support. These
4691 # are reset later if shared libraries are not supported. Putting them
4692 # here allows them to be overridden if necessary.
4693 runpath_var=LD_RUN_PATH
4694 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4695 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4696 # ancient GNU ld didn't support --whole-archive et. al.
4697 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4698 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4699 else
4700 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4701 fi
4702 supports_anon_versioning=no
4703 case `$LD -v 2>&1` in
4704 *GNU\ gold*) supports_anon_versioning=yes ;;
4705 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4706 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4707 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4708 *\ 2.11.*) ;; # other 2.11 versions
4709 *) supports_anon_versioning=yes ;;
4710 esac
4711
4712 # See if GNU ld supports shared libraries.
4713 case $host_os in
4714 aix[[3-9]]*)
4715 # On AIX/PPC, the GNU linker is very broken
4716 if test "$host_cpu" != ia64; then
4717 _LT_TAGVAR(ld_shlibs, $1)=no
4718 cat <<_LT_EOF 1>&2
4719
4720*** Warning: the GNU linker, at least up to release 2.19, is reported
4721*** to be unable to reliably create shared libraries on AIX.
4722*** Therefore, libtool is disabling shared libraries support. If you
4723*** really care for shared libraries, you may want to install binutils
4724*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4725*** You will then need to restart the configuration process.
4726
4727_LT_EOF
4728 fi
4729 ;;
4730
4731 amigaos*)
4732 case $host_cpu in
4733 powerpc)
4734 # see comment about AmigaOS4 .so support
4735 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4736 _LT_TAGVAR(archive_expsym_cmds, $1)=''
4737 ;;
4738 m68k)
4739 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4740 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4741 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4742 ;;
4743 esac
4744 ;;
4745
4746 beos*)
4747 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4748 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4749 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4750 # support --undefined. This deserves some investigation. FIXME
4751 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4752 else
4753 _LT_TAGVAR(ld_shlibs, $1)=no
4754 fi
4755 ;;
4756
4757 cygwin* | mingw* | pw32* | cegcc*)
4758 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4759 # as there is no search path for DLLs.
4760 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4761 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4762 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4763 _LT_TAGVAR(always_export_symbols, $1)=no
4764 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4765 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4766 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4767
4768 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4769 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4770 # If the export-symbols file already is a .def file (1st line
4771 # is EXPORTS), use it as is; otherwise, prepend...
4772 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4773 cp $export_symbols $output_objdir/$soname.def;
4774 else
4775 echo EXPORTS > $output_objdir/$soname.def;
4776 cat $export_symbols >> $output_objdir/$soname.def;
4777 fi~
4778 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4779 else
4780 _LT_TAGVAR(ld_shlibs, $1)=no
4781 fi
4782 ;;
4783
4784 haiku*)
4785 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4786 _LT_TAGVAR(link_all_deplibs, $1)=yes
4787 ;;
4788
4789 interix[[3-9]]*)
4790 _LT_TAGVAR(hardcode_direct, $1)=no
4791 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4792 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4793 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4794 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4795 # Instead, shared libraries are loaded at an image base (0x10000000 by
4796 # default) and relocated if they conflict, which is a slow very memory
4797 # consuming and fragmenting process. To avoid this, we pick a random,
4798 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4799 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
4800 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4801 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4802 ;;
4803
4804 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4805 tmp_diet=no
4806 if test "$host_os" = linux-dietlibc; then
4807 case $cc_basename in
4808 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
4809 esac
4810 fi
4811 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4812 && test "$tmp_diet" = no
4813 then
4814 tmp_addflag=' $pic_flag'
4815 tmp_sharedflag='-shared'
4816 case $cc_basename,$host_cpu in
4817 pgcc*) # Portland Group C compiler
4818 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4819 tmp_addflag=' $pic_flag'
4820 ;;
4821 pgf77* | pgf90* | pgf95* | pgfortran*)
4822 # Portland Group f77 and f90 compilers
4823 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4824 tmp_addflag=' $pic_flag -Mnomain' ;;
4825 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
4826 tmp_addflag=' -i_dynamic' ;;
4827 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
4828 tmp_addflag=' -i_dynamic -nofor_main' ;;
4829 ifc* | ifort*) # Intel Fortran compiler
4830 tmp_addflag=' -nofor_main' ;;
4831 lf95*) # Lahey Fortran 8.1
4832 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4833 tmp_sharedflag='--shared' ;;
4834 xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4835 tmp_sharedflag='-qmkshrobj'
4836 tmp_addflag= ;;
4837 nvcc*) # Cuda Compiler Driver 2.2
4838 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4839 _LT_TAGVAR(compiler_needs_object, $1)=yes
4840 ;;
4841 esac
4842 case `$CC -V 2>&1 | sed 5q` in
4843 *Sun\ C*) # Sun C 5.9
4844 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4845 _LT_TAGVAR(compiler_needs_object, $1)=yes
4846 tmp_sharedflag='-G' ;;
4847 *Sun\ F*) # Sun Fortran 8.3
4848 tmp_sharedflag='-G' ;;
4849 esac
4850 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4851
4852 if test "x$supports_anon_versioning" = xyes; then
4853 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4854 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4855 echo "local: *; };" >> $output_objdir/$libname.ver~
4856 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4857 fi
4858
4859 case $cc_basename in
4860 xlf* | bgf* | bgxlf* | mpixlf*)
4861 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4862 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4863 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4864 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4865 if test "x$supports_anon_versioning" = xyes; then
4866 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4867 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4868 echo "local: *; };" >> $output_objdir/$libname.ver~
4869 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4870 fi
4871 ;;
4872 esac
4873 else
4874 _LT_TAGVAR(ld_shlibs, $1)=no
4875 fi
4876 ;;
4877
4878 netbsd*)
4879 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4880 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4881 wlarc=
4882 else
4883 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4884 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4885 fi
4886 ;;
4887
4888 solaris*)
4889 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4890 _LT_TAGVAR(ld_shlibs, $1)=no
4891 cat <<_LT_EOF 1>&2
4892
4893*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4894*** create shared libraries on Solaris systems. Therefore, libtool
4895*** is disabling shared libraries support. We urge you to upgrade GNU
4896*** binutils to release 2.9.1 or newer. Another option is to modify
4897*** your PATH or compiler configuration so that the native linker is
4898*** used, and then restart.
4899
4900_LT_EOF
4901 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4902 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4903 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4904 else
4905 _LT_TAGVAR(ld_shlibs, $1)=no
4906 fi
4907 ;;
4908
4909 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4910 case `$LD -v 2>&1` in
4911 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4912 _LT_TAGVAR(ld_shlibs, $1)=no
4913 cat <<_LT_EOF 1>&2
4914
4915*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4916*** reliably create shared libraries on SCO systems. Therefore, libtool
4917*** is disabling shared libraries support. We urge you to upgrade GNU
4918*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
4919*** your PATH or compiler configuration so that the native linker is
4920*** used, and then restart.
4921
4922_LT_EOF
4923 ;;
4924 *)
4925 # For security reasons, it is highly recommended that you always
4926 # use absolute paths for naming shared libraries, and exclude the
4927 # DT_RUNPATH tag from executables and libraries. But doing so
4928 # requires that you compile everything twice, which is a pain.
4929 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4930 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4931 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4932 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4933 else
4934 _LT_TAGVAR(ld_shlibs, $1)=no
4935 fi
4936 ;;
4937 esac
4938 ;;
4939
4940 sunos4*)
4941 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4942 wlarc=
4943 _LT_TAGVAR(hardcode_direct, $1)=yes
4944 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4945 ;;
4946
4947 *)
4948 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4949 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4950 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4951 else
4952 _LT_TAGVAR(ld_shlibs, $1)=no
4953 fi
4954 ;;
4955 esac
4956
4957 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4958 runpath_var=
4959 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4960 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4961 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4962 fi
4963 else
4964 # PORTME fill in a description of your system's linker (not GNU ld)
4965 case $host_os in
4966 aix3*)
4967 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4968 _LT_TAGVAR(always_export_symbols, $1)=yes
4969 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
4970 # Note: this linker hardcodes the directories in LIBPATH if there
4971 # are no directories specified by -L.
4972 _LT_TAGVAR(hardcode_minus_L, $1)=yes
4973 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4974 # Neither direct hardcoding nor static linking is supported with a
4975 # broken collect2.
4976 _LT_TAGVAR(hardcode_direct, $1)=unsupported
4977 fi
4978 ;;
4979
4980 aix[[4-9]]*)
4981 if test "$host_cpu" = ia64; then
4982 # On IA64, the linker does run time linking by default, so we don't
4983 # have to do anything special.
4984 aix_use_runtimelinking=no
4985 exp_sym_flag='-Bexport'
4986 no_entry_flag=""
4987 else
4988 # If we're using GNU nm, then we don't want the "-C" option.
4989 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4990 # Also, AIX nm treats weak defined symbols like other global
4991 # defined symbols, whereas GNU nm marks them as "W".
4992 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4993 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4994 else
4995 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4996 fi
4997 aix_use_runtimelinking=no
4998
4999 # Test if we are trying to use run time linking or normal
5000 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5001 # need to do runtime linking.
5002 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5003 for ld_flag in $LDFLAGS; do
5004 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5005 aix_use_runtimelinking=yes
5006 break
5007 fi
5008 done
5009 ;;
5010 esac
5011
5012 exp_sym_flag='-bexport'
5013 no_entry_flag='-bnoentry'
5014 fi
5015
5016 # When large executables or shared objects are built, AIX ld can
5017 # have problems creating the table of contents. If linking a library
5018 # or program results in "error TOC overflow" add -mminimal-toc to
5019 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5020 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5021
5022 _LT_TAGVAR(archive_cmds, $1)=''
5023 _LT_TAGVAR(hardcode_direct, $1)=yes
5024 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5025 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5026 _LT_TAGVAR(link_all_deplibs, $1)=yes
5027 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5028
5029 if test "$GCC" = yes; then
5030 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5031 # We only want to do this on AIX 4.2 and lower, the check
5032 # below for broken collect2 doesn't work under 4.3+
5033 collect2name=`${CC} -print-prog-name=collect2`
5034 if test -f "$collect2name" &&
5035 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5036 then
5037 # We have reworked collect2
5038 :
5039 else
5040 # We have old collect2
5041 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5042 # It fails to find uninstalled libraries when the uninstalled
5043 # path is not listed in the libpath. Setting hardcode_minus_L
5044 # to unsupported forces relinking
5045 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5046 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5047 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5048 fi
5049 ;;
5050 esac
5051 shared_flag='-shared'
5052 if test "$aix_use_runtimelinking" = yes; then
5053 shared_flag="$shared_flag "'${wl}-G'
5054 fi
5055 else
5056 # not using gcc
5057 if test "$host_cpu" = ia64; then
5058 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5059 # chokes on -Wl,-G. The following line is correct:
5060 shared_flag='-G'
5061 else
5062 if test "$aix_use_runtimelinking" = yes; then
5063 shared_flag='${wl}-G'
5064 else
5065 shared_flag='${wl}-bM:SRE'
5066 fi
5067 fi
5068 fi
5069
5070 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5071 # It seems that -bexpall does not export symbols beginning with
5072 # underscore (_), so it is better to generate a list of symbols to export.
5073 _LT_TAGVAR(always_export_symbols, $1)=yes
5074 if test "$aix_use_runtimelinking" = yes; then
5075 # Warning - without using the other runtime loading flags (-brtl),
5076 # -berok will link without error, but may produce a broken library.
5077 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5078 # Determine the default libpath from the value encoded in an
5079 # empty executable.
5080 _LT_SYS_MODULE_PATH_AIX([$1])
5081 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5082 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5083 else
5084 if test "$host_cpu" = ia64; then
5085 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5086 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5087 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5088 else
5089 # Determine the default libpath from the value encoded in an
5090 # empty executable.
5091 _LT_SYS_MODULE_PATH_AIX([$1])
5092 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5093 # Warning - without using the other run time loading flags,
5094 # -berok will link without error, but may produce a broken library.
5095 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5096 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5097 if test "$with_gnu_ld" = yes; then
5098 # We only use this code for GNU lds that support --whole-archive.
5099 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5100 else
5101 # Exported symbols can be pulled into shared objects from archives
5102 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5103 fi
5104 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5105 # This is similar to how AIX traditionally builds its shared libraries.
5106 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5107 fi
5108 fi
5109 ;;
5110
5111 amigaos*)
5112 case $host_cpu in
5113 powerpc)
5114 # see comment about AmigaOS4 .so support
5115 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5116 _LT_TAGVAR(archive_expsym_cmds, $1)=''
5117 ;;
5118 m68k)
5119 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5120 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5121 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5122 ;;
5123 esac
5124 ;;
5125
5126 bsdi[[45]]*)
5127 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5128 ;;
5129
5130 cygwin* | mingw* | pw32* | cegcc*)
5131 # When not using gcc, we currently assume that we are using
5132 # Microsoft Visual C++.
5133 # hardcode_libdir_flag_spec is actually meaningless, as there is
5134 # no search path for DLLs.
5135 case $cc_basename in
5136 cl*)
5137 # Native MSVC
5138 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5139 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5140 _LT_TAGVAR(always_export_symbols, $1)=yes
5141 _LT_TAGVAR(file_list_spec, $1)='@'
5142 # Tell ltmain to make .lib files, not .a files.
5143 libext=lib
5144 # Tell ltmain to make .dll files, not .so files.
5145 shrext_cmds=".dll"
5146 # FIXME: Setting linknames here is a bad hack.
5147 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5148 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5149 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5150 else
5151 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5152 fi~
5153 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5154 linknames='
5155 # The linker will not automatically build a static lib if we build a DLL.
5156 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5157 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5158 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5159 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5160 # Don't use ranlib
5161 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5162 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5163 lt_tool_outputfile="@TOOL_OUTPUT@"~
5164 case $lt_outputfile in
5165 *.exe|*.EXE) ;;
5166 *)
5167 lt_outputfile="$lt_outputfile.exe"
5168 lt_tool_outputfile="$lt_tool_outputfile.exe"
5169 ;;
5170 esac~
5171 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5172 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5173 $RM "$lt_outputfile.manifest";
5174 fi'
5175 ;;
5176 *)
5177 # Assume MSVC wrapper
5178 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5179 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5180 # Tell ltmain to make .lib files, not .a files.
5181 libext=lib
5182 # Tell ltmain to make .dll files, not .so files.
5183 shrext_cmds=".dll"
5184 # FIXME: Setting linknames here is a bad hack.
5185 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5186 # The linker will automatically build a .lib file if we build a DLL.
5187 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5188 # FIXME: Should let the user specify the lib program.
5189 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5190 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5191 ;;
5192 esac
5193 ;;
5194
5195 darwin* | rhapsody*)
5196 _LT_DARWIN_LINKER_FEATURES($1)
5197 ;;
5198
5199 dgux*)
5200 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5201 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5202 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5203 ;;
5204
5205 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5206 # support. Future versions do this automatically, but an explicit c++rt0.o
5207 # does not break anything, and helps significantly (at the cost of a little
5208 # extra space).
5209 freebsd2.2*)
5210 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5211 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5212 _LT_TAGVAR(hardcode_direct, $1)=yes
5213 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5214 ;;
5215
5216 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5217 freebsd2.*)
5218 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5219 _LT_TAGVAR(hardcode_direct, $1)=yes
5220 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5221 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5222 ;;
5223
5224 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5225 freebsd* | dragonfly*)
5226 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5227 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5228 _LT_TAGVAR(hardcode_direct, $1)=yes
5229 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5230 ;;
5231
5232 hpux9*)
5233 if test "$GCC" = yes; then
5234 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5235 else
5236 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5237 fi
5238 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5239 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5240 _LT_TAGVAR(hardcode_direct, $1)=yes
5241
5242 # hardcode_minus_L: Not really in the search PATH,
5243 # but as the default location of the library.
5244 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5245 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5246 ;;
5247
5248 hpux10*)
5249 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5250 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5251 else
5252 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5253 fi
5254 if test "$with_gnu_ld" = no; then
5255 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5256 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5257 _LT_TAGVAR(hardcode_direct, $1)=yes
5258 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5259 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5260 # hardcode_minus_L: Not really in the search PATH,
5261 # but as the default location of the library.
5262 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5263 fi
5264 ;;
5265
5266 hpux11*)
5267 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5268 case $host_cpu in
5269 hppa*64*)
5270 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5271 ;;
5272 ia64*)
5273 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5274 ;;
5275 *)
5276 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5277 ;;
5278 esac
5279 else
5280 case $host_cpu in
5281 hppa*64*)
5282 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5283 ;;
5284 ia64*)
5285 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5286 ;;
5287 *)
5288 m4_if($1, [], [
5289 # Older versions of the 11.00 compiler do not understand -b yet
5290 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5291 _LT_LINKER_OPTION([if $CC understands -b],
5292 _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5293 [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5294 [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5295 [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5296 ;;
5297 esac
5298 fi
5299 if test "$with_gnu_ld" = no; then
5300 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5301 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5302
5303 case $host_cpu in
5304 hppa*64*|ia64*)
5305 _LT_TAGVAR(hardcode_direct, $1)=no
5306 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5307 ;;
5308 *)
5309 _LT_TAGVAR(hardcode_direct, $1)=yes
5310 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5311 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5312
5313 # hardcode_minus_L: Not really in the search PATH,
5314 # but as the default location of the library.
5315 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5316 ;;
5317 esac
5318 fi
5319 ;;
5320
5321 irix5* | irix6* | nonstopux*)
5322 if test "$GCC" = yes; then
5323 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5324 # Try to use the -exported_symbol ld option, if it does not
5325 # work, assume that -exports_file does not work either and
5326 # implicitly export all symbols.
5327 # This should be the same for all languages, so no per-tag cache variable.
5328 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5329 [lt_cv_irix_exported_symbol],
5330 [save_LDFLAGS="$LDFLAGS"
5331 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5332 AC_LINK_IFELSE(
5333 [AC_LANG_SOURCE(
5334 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5335 [C++], [[int foo (void) { return 0; }]],
5336 [Fortran 77], [[
5337 subroutine foo
5338 end]],
5339 [Fortran], [[
5340 subroutine foo
5341 end]])])],
5342 [lt_cv_irix_exported_symbol=yes],
5343 [lt_cv_irix_exported_symbol=no])
5344 LDFLAGS="$save_LDFLAGS"])
5345 if test "$lt_cv_irix_exported_symbol" = yes; then
5346 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
5347 fi
5348 else
5349 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5350 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
5351 fi
5352 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5353 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5354 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5355 _LT_TAGVAR(inherit_rpath, $1)=yes
5356 _LT_TAGVAR(link_all_deplibs, $1)=yes
5357 ;;
5358
5359 netbsd*)
5360 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5361 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
5362 else
5363 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
5364 fi
5365 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5366 _LT_TAGVAR(hardcode_direct, $1)=yes
5367 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5368 ;;
5369
5370 newsos6)
5371 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5372 _LT_TAGVAR(hardcode_direct, $1)=yes
5373 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5374 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5375 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5376 ;;
5377
5378 *nto* | *qnx*)
5379 ;;
5380
5381 openbsd*)
5382 if test -f /usr/libexec/ld.so; then
5383 _LT_TAGVAR(hardcode_direct, $1)=yes
5384 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5385 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5386 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5387 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5388 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5389 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5390 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5391 else
5392 case $host_os in
5393 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5394 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5395 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5396 ;;
5397 *)
5398 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5399 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5400 ;;
5401 esac
5402 fi
5403 else
5404 _LT_TAGVAR(ld_shlibs, $1)=no
5405 fi
5406 ;;
5407
5408 os2*)
5409 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5410 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5411 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5412 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5413 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5414 ;;
5415
5416 osf3*)
5417 if test "$GCC" = yes; then
5418 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5419 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5420 else
5421 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5422 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5423 fi
5424 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5425 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5426 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5427 ;;
5428
5429 osf4* | osf5*) # as osf3* with the addition of -msym flag
5430 if test "$GCC" = yes; then
5431 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5432 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5433 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5434 else
5435 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5436 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5437 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5438 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
5439
5440 # Both c and cxx compiler support -rpath directly
5441 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5442 fi
5443 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5444 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5445 ;;
5446
5447 solaris*)
5448 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5449 if test "$GCC" = yes; then
5450 wlarc='${wl}'
5451 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5452 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5453 $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5454 else
5455 case `$CC -V 2>&1` in
5456 *"Compilers 5.0"*)
5457 wlarc=''
5458 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5459 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5460 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5461 ;;
5462 *)
5463 wlarc='${wl}'
5464 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5465 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5466 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5467 ;;
5468 esac
5469 fi
5470 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5471 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5472 case $host_os in
5473 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5474 *)
5475 # The compiler driver will combine and reorder linker options,
5476 # but understands `-z linker_flag'. GCC discards it without `$wl',
5477 # but is careful enough not to reorder.
5478 # Supported since Solaris 2.6 (maybe 2.5.1?)
5479 if test "$GCC" = yes; then
5480 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5481 else
5482 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5483 fi
5484 ;;
5485 esac
5486 _LT_TAGVAR(link_all_deplibs, $1)=yes
5487 ;;
5488
5489 sunos4*)
5490 if test "x$host_vendor" = xsequent; then
5491 # Use $CC to link under sequent, because it throws in some extra .o
5492 # files that make .init and .fini sections work.
5493 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5494 else
5495 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5496 fi
5497 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5498 _LT_TAGVAR(hardcode_direct, $1)=yes
5499 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5500 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5501 ;;
5502
5503 sysv4)
5504 case $host_vendor in
5505 sni)
5506 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5507 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5508 ;;
5509 siemens)
5510 ## LD is ld it makes a PLAMLIB
5511 ## CC just makes a GrossModule.
5512 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5513 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5514 _LT_TAGVAR(hardcode_direct, $1)=no
5515 ;;
5516 motorola)
5517 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5518 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5519 ;;
5520 esac
5521 runpath_var='LD_RUN_PATH'
5522 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5523 ;;
5524
5525 sysv4.3*)
5526 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5527 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5528 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5529 ;;
5530
5531 sysv4*MP*)
5532 if test -d /usr/nec; then
5533 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5534 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5535 runpath_var=LD_RUN_PATH
5536 hardcode_runpath_var=yes
5537 _LT_TAGVAR(ld_shlibs, $1)=yes
5538 fi
5539 ;;
5540
5541 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5542 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5543 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5544 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5545 runpath_var='LD_RUN_PATH'
5546
5547 if test "$GCC" = yes; then
5548 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5549 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5550 else
5551 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5552 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5553 fi
5554 ;;
5555
5556 sysv5* | sco3.2v5* | sco5v6*)
5557 # Note: We can NOT use -z defs as we might desire, because we do not
5558 # link with -lc, and that would cause any symbols used from libc to
5559 # always be unresolved, which means just about no library would
5560 # ever link correctly. If we're not using GNU ld we use -z text
5561 # though, which does catch some bad symbols but isn't as heavy-handed
5562 # as -z defs.
5563 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5564 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5565 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5566 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5567 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5568 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5569 _LT_TAGVAR(link_all_deplibs, $1)=yes
5570 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5571 runpath_var='LD_RUN_PATH'
5572
5573 if test "$GCC" = yes; then
5574 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5575 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5576 else
5577 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5578 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5579 fi
5580 ;;
5581
5582 uts4*)
5583 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5584 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5585 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5586 ;;
5587
5588 *)
5589 _LT_TAGVAR(ld_shlibs, $1)=no
5590 ;;
5591 esac
5592
5593 if test x$host_vendor = xsni; then
5594 case $host in
5595 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5596 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5597 ;;
5598 esac
5599 fi
5600 fi
5601])
5602AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5603test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5604
5605_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5606
5607_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5608_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5609_LT_DECL([], [extract_expsyms_cmds], [2],
5610 [The commands to extract the exported symbol list from a shared archive])
5611
5612#
5613# Do we need to explicitly link libc?
5614#
5615case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5616x|xyes)
5617 # Assume -lc should be added
5618 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5619
5620 if test "$enable_shared" = yes && test "$GCC" = yes; then
5621 case $_LT_TAGVAR(archive_cmds, $1) in
5622 *'~'*)
5623 # FIXME: we may have to deal with multi-command sequences.
5624 ;;
5625 '$CC '*)
5626 # Test whether the compiler implicitly links with -lc since on some
5627 # systems, -lgcc has to come before -lc. If gcc already passes -lc
5628 # to ld, don't add -lc before -lgcc.
5629 AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5630 [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5631 [$RM conftest*
5632 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5633
5634 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5635 soname=conftest
5636 lib=conftest
5637 libobjs=conftest.$ac_objext
5638 deplibs=
5639 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5640 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5641 compiler_flags=-v
5642 linker_flags=-v
5643 verstring=
5644 output_objdir=.
5645 libname=conftest
5646 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5647 _LT_TAGVAR(allow_undefined_flag, $1)=
5648 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5649 then
5650 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5651 else
5652 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5653 fi
5654 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5655 else
5656 cat conftest.err 1>&5
5657 fi
5658 $RM conftest*
5659 ])
5660 _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5661 ;;
5662 esac
5663 fi
5664 ;;
5665esac
5666
5667_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5668 [Whether or not to add -lc for building shared libraries])
5669_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5670 [enable_shared_with_static_runtimes], [0],
5671 [Whether or not to disallow shared libs when runtime libs are static])
5672_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5673 [Compiler flag to allow reflexive dlopens])
5674_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5675 [Compiler flag to generate shared objects directly from archives])
5676_LT_TAGDECL([], [compiler_needs_object], [1],
5677 [Whether the compiler copes with passing no objects directly])
5678_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5679 [Create an old-style archive from a shared archive])
5680_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5681 [Create a temporary old-style archive to link instead of a shared archive])
5682_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5683_LT_TAGDECL([], [archive_expsym_cmds], [2])
5684_LT_TAGDECL([], [module_cmds], [2],
5685 [Commands used to build a loadable module if different from building
5686 a shared archive.])
5687_LT_TAGDECL([], [module_expsym_cmds], [2])
5688_LT_TAGDECL([], [with_gnu_ld], [1],
5689 [Whether we are building with GNU ld or not])
5690_LT_TAGDECL([], [allow_undefined_flag], [1],
5691 [Flag that allows shared libraries with undefined symbols to be built])
5692_LT_TAGDECL([], [no_undefined_flag], [1],
5693 [Flag that enforces no undefined symbols])
5694_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5695 [Flag to hardcode $libdir into a binary during linking.
5696 This must work even if $libdir does not exist])
5697_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5698 [Whether we need a single "-rpath" flag with a separated argument])
5699_LT_TAGDECL([], [hardcode_direct], [0],
5700 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5701 DIR into the resulting binary])
5702_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5703 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5704 DIR into the resulting binary and the resulting library dependency is
5705 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5706 library is relocated])
5707_LT_TAGDECL([], [hardcode_minus_L], [0],
5708 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5709 into the resulting binary])
5710_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5711 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5712 into the resulting binary])
5713_LT_TAGDECL([], [hardcode_automatic], [0],
5714 [Set to "yes" if building a shared library automatically hardcodes DIR
5715 into the library and all subsequent libraries and executables linked
5716 against it])
5717_LT_TAGDECL([], [inherit_rpath], [0],
5718 [Set to yes if linker adds runtime paths of dependent libraries
5719 to runtime path list])
5720_LT_TAGDECL([], [link_all_deplibs], [0],
5721 [Whether libtool must link a program against all its dependency libraries])
5722_LT_TAGDECL([], [always_export_symbols], [0],
5723 [Set to "yes" if exported symbols are required])
5724_LT_TAGDECL([], [export_symbols_cmds], [2],
5725 [The commands to list exported symbols])
5726_LT_TAGDECL([], [exclude_expsyms], [1],
5727 [Symbols that should not be listed in the preloaded symbols])
5728_LT_TAGDECL([], [include_expsyms], [1],
5729 [Symbols that must always be exported])
5730_LT_TAGDECL([], [prelink_cmds], [2],
5731 [Commands necessary for linking programs (against libraries) with templates])
5732_LT_TAGDECL([], [postlink_cmds], [2],
5733 [Commands necessary for finishing linking programs])
5734_LT_TAGDECL([], [file_list_spec], [1],
5735 [Specify filename containing input files])
5736dnl FIXME: Not yet implemented
5737dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5738dnl [Compiler flag to generate thread safe objects])
5739])# _LT_LINKER_SHLIBS
5740
5741
5742# _LT_LANG_C_CONFIG([TAG])
5743# ------------------------
5744# Ensure that the configuration variables for a C compiler are suitably
5745# defined. These variables are subsequently used by _LT_CONFIG to write
5746# the compiler configuration to `libtool'.
5747m4_defun([_LT_LANG_C_CONFIG],
5748[m4_require([_LT_DECL_EGREP])dnl
5749lt_save_CC="$CC"
5750AC_LANG_PUSH(C)
5751
5752# Source file extension for C test sources.
5753ac_ext=c
5754
5755# Object file extension for compiled C test sources.
5756objext=o
5757_LT_TAGVAR(objext, $1)=$objext
5758
5759# Code to be used in simple compile tests
5760lt_simple_compile_test_code="int some_variable = 0;"
5761
5762# Code to be used in simple link tests
5763lt_simple_link_test_code='int main(){return(0);}'
5764
5765_LT_TAG_COMPILER
5766# Save the default compiler, since it gets overwritten when the other
5767# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5768compiler_DEFAULT=$CC
5769
5770# save warnings/boilerplate of simple test code
5771_LT_COMPILER_BOILERPLATE
5772_LT_LINKER_BOILERPLATE
5773
5774if test -n "$compiler"; then
5775 _LT_COMPILER_NO_RTTI($1)
5776 _LT_COMPILER_PIC($1)
5777 _LT_COMPILER_C_O($1)
5778 _LT_COMPILER_FILE_LOCKS($1)
5779 _LT_LINKER_SHLIBS($1)
5780 _LT_SYS_DYNAMIC_LINKER($1)
5781 _LT_LINKER_HARDCODE_LIBPATH($1)
5782 LT_SYS_DLOPEN_SELF
5783 _LT_CMD_STRIPLIB
5784
5785 # Report which library types will actually be built
5786 AC_MSG_CHECKING([if libtool supports shared libraries])
5787 AC_MSG_RESULT([$can_build_shared])
5788
5789 AC_MSG_CHECKING([whether to build shared libraries])
5790 test "$can_build_shared" = "no" && enable_shared=no
5791
5792 # On AIX, shared libraries and static libraries use the same namespace, and
5793 # are all built from PIC.
5794 case $host_os in
5795 aix3*)
5796 test "$enable_shared" = yes && enable_static=no
5797 if test -n "$RANLIB"; then
5798 archive_cmds="$archive_cmds~\$RANLIB \$lib"
5799 postinstall_cmds='$RANLIB $lib'
5800 fi
5801 ;;
5802
5803 aix[[4-9]]*)
5804 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5805 test "$enable_shared" = yes && enable_static=no
5806 fi
5807 ;;
5808 esac
5809 AC_MSG_RESULT([$enable_shared])
5810
5811 AC_MSG_CHECKING([whether to build static libraries])
5812 # Make sure either enable_shared or enable_static is yes.
5813 test "$enable_shared" = yes || enable_static=yes
5814 AC_MSG_RESULT([$enable_static])
5815
5816 _LT_CONFIG($1)
5817fi
5818AC_LANG_POP
5819CC="$lt_save_CC"
5820])# _LT_LANG_C_CONFIG
5821
5822
5823# _LT_LANG_CXX_CONFIG([TAG])
5824# --------------------------
5825# Ensure that the configuration variables for a C++ compiler are suitably
5826# defined. These variables are subsequently used by _LT_CONFIG to write
5827# the compiler configuration to `libtool'.
5828m4_defun([_LT_LANG_CXX_CONFIG],
5829[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5830m4_require([_LT_DECL_EGREP])dnl
5831m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5832if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5833 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5834 (test "X$CXX" != "Xg++"))) ; then
5835 AC_PROG_CXXCPP
5836else
5837 _lt_caught_CXX_error=yes
5838fi
5839
5840AC_LANG_PUSH(C++)
5841_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5842_LT_TAGVAR(allow_undefined_flag, $1)=
5843_LT_TAGVAR(always_export_symbols, $1)=no
5844_LT_TAGVAR(archive_expsym_cmds, $1)=
5845_LT_TAGVAR(compiler_needs_object, $1)=no
5846_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5847_LT_TAGVAR(hardcode_direct, $1)=no
5848_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5849_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5850_LT_TAGVAR(hardcode_libdir_separator, $1)=
5851_LT_TAGVAR(hardcode_minus_L, $1)=no
5852_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5853_LT_TAGVAR(hardcode_automatic, $1)=no
5854_LT_TAGVAR(inherit_rpath, $1)=no
5855_LT_TAGVAR(module_cmds, $1)=
5856_LT_TAGVAR(module_expsym_cmds, $1)=
5857_LT_TAGVAR(link_all_deplibs, $1)=unknown
5858_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5859_LT_TAGVAR(reload_flag, $1)=$reload_flag
5860_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5861_LT_TAGVAR(no_undefined_flag, $1)=
5862_LT_TAGVAR(whole_archive_flag_spec, $1)=
5863_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5864
5865# Source file extension for C++ test sources.
5866ac_ext=cpp
5867
5868# Object file extension for compiled C++ test sources.
5869objext=o
5870_LT_TAGVAR(objext, $1)=$objext
5871
5872# No sense in running all these tests if we already determined that
5873# the CXX compiler isn't working. Some variables (like enable_shared)
5874# are currently assumed to apply to all compilers on this platform,
5875# and will be corrupted by setting them based on a non-working compiler.
5876if test "$_lt_caught_CXX_error" != yes; then
5877 # Code to be used in simple compile tests
5878 lt_simple_compile_test_code="int some_variable = 0;"
5879
5880 # Code to be used in simple link tests
5881 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5882
5883 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5884 _LT_TAG_COMPILER
5885
5886 # save warnings/boilerplate of simple test code
5887 _LT_COMPILER_BOILERPLATE
5888 _LT_LINKER_BOILERPLATE
5889
5890 # Allow CC to be a program name with arguments.
5891 lt_save_CC=$CC
5892 lt_save_CFLAGS=$CFLAGS
5893 lt_save_LD=$LD
5894 lt_save_GCC=$GCC
5895 GCC=$GXX
5896 lt_save_with_gnu_ld=$with_gnu_ld
5897 lt_save_path_LD=$lt_cv_path_LD
5898 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5899 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5900 else
5901 $as_unset lt_cv_prog_gnu_ld
5902 fi
5903 if test -n "${lt_cv_path_LDCXX+set}"; then
5904 lt_cv_path_LD=$lt_cv_path_LDCXX
5905 else
5906 $as_unset lt_cv_path_LD
5907 fi
5908 test -z "${LDCXX+set}" || LD=$LDCXX
5909 CC=${CXX-"c++"}
5910 CFLAGS=$CXXFLAGS
5911 compiler=$CC
5912 _LT_TAGVAR(compiler, $1)=$CC
5913 _LT_CC_BASENAME([$compiler])
5914
5915 if test -n "$compiler"; then
5916 # We don't want -fno-exception when compiling C++ code, so set the
5917 # no_builtin_flag separately
5918 if test "$GXX" = yes; then
5919 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5920 else
5921 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5922 fi
5923
5924 if test "$GXX" = yes; then
5925 # Set up default GNU C++ configuration
5926
5927 LT_PATH_LD
5928
5929 # Check if GNU C++ uses GNU ld as the underlying linker, since the
5930 # archiving commands below assume that GNU ld is being used.
5931 if test "$with_gnu_ld" = yes; then
5932 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5933 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5934
5935 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5936 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5937
5938 # If archive_cmds runs LD, not CC, wlarc should be empty
5939 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5940 # investigate it a little bit more. (MM)
5941 wlarc='${wl}'
5942
5943 # ancient GNU ld didn't support --whole-archive et. al.
5944 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5945 $GREP 'no-whole-archive' > /dev/null; then
5946 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5947 else
5948 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5949 fi
5950 else
5951 with_gnu_ld=no
5952 wlarc=
5953
5954 # A generic and very simple default shared library creation
5955 # command for GNU C++ for the case where it uses the native
5956 # linker, instead of GNU ld. If possible, this setting should
5957 # overridden to take advantage of the native linker features on
5958 # the platform it is being used on.
5959 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5960 fi
5961
5962 # Commands to make compiler produce verbose output that lists
5963 # what "hidden" libraries, object files and flags are used when
5964 # linking a shared library.
5965 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5966
5967 else
5968 GXX=no
5969 with_gnu_ld=no
5970 wlarc=
5971 fi
5972
5973 # PORTME: fill in a description of your system's C++ link characteristics
5974 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5975 _LT_TAGVAR(ld_shlibs, $1)=yes
5976 case $host_os in
5977 aix3*)
5978 # FIXME: insert proper C++ library support
5979 _LT_TAGVAR(ld_shlibs, $1)=no
5980 ;;
5981 aix[[4-9]]*)
5982 if test "$host_cpu" = ia64; then
5983 # On IA64, the linker does run time linking by default, so we don't
5984 # have to do anything special.
5985 aix_use_runtimelinking=no
5986 exp_sym_flag='-Bexport'
5987 no_entry_flag=""
5988 else
5989 aix_use_runtimelinking=no
5990
5991 # Test if we are trying to use run time linking or normal
5992 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5993 # need to do runtime linking.
5994 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5995 for ld_flag in $LDFLAGS; do
5996 case $ld_flag in
5997 *-brtl*)
5998 aix_use_runtimelinking=yes
5999 break
6000 ;;
6001 esac
6002 done
6003 ;;
6004 esac
6005
6006 exp_sym_flag='-bexport'
6007 no_entry_flag='-bnoentry'
6008 fi
6009
6010 # When large executables or shared objects are built, AIX ld can
6011 # have problems creating the table of contents. If linking a library
6012 # or program results in "error TOC overflow" add -mminimal-toc to
6013 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
6014 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6015
6016 _LT_TAGVAR(archive_cmds, $1)=''
6017 _LT_TAGVAR(hardcode_direct, $1)=yes
6018 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6019 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6020 _LT_TAGVAR(link_all_deplibs, $1)=yes
6021 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6022
6023 if test "$GXX" = yes; then
6024 case $host_os in aix4.[[012]]|aix4.[[012]].*)
6025 # We only want to do this on AIX 4.2 and lower, the check
6026 # below for broken collect2 doesn't work under 4.3+
6027 collect2name=`${CC} -print-prog-name=collect2`
6028 if test -f "$collect2name" &&
6029 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6030 then
6031 # We have reworked collect2
6032 :
6033 else
6034 # We have old collect2
6035 _LT_TAGVAR(hardcode_direct, $1)=unsupported
6036 # It fails to find uninstalled libraries when the uninstalled
6037 # path is not listed in the libpath. Setting hardcode_minus_L
6038 # to unsupported forces relinking
6039 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6040 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6041 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6042 fi
6043 esac
6044 shared_flag='-shared'
6045 if test "$aix_use_runtimelinking" = yes; then
6046 shared_flag="$shared_flag "'${wl}-G'
6047 fi
6048 else
6049 # not using gcc
6050 if test "$host_cpu" = ia64; then
6051 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6052 # chokes on -Wl,-G. The following line is correct:
6053 shared_flag='-G'
6054 else
6055 if test "$aix_use_runtimelinking" = yes; then
6056 shared_flag='${wl}-G'
6057 else
6058 shared_flag='${wl}-bM:SRE'
6059 fi
6060 fi
6061 fi
6062
6063 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6064 # It seems that -bexpall does not export symbols beginning with
6065 # underscore (_), so it is better to generate a list of symbols to
6066 # export.
6067 _LT_TAGVAR(always_export_symbols, $1)=yes
6068 if test "$aix_use_runtimelinking" = yes; then
6069 # Warning - without using the other runtime loading flags (-brtl),
6070 # -berok will link without error, but may produce a broken library.
6071 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6072 # Determine the default libpath from the value encoded in an empty
6073 # executable.
6074 _LT_SYS_MODULE_PATH_AIX([$1])
6075 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6076
6077 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6078 else
6079 if test "$host_cpu" = ia64; then
6080 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6081 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6082 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
6083 else
6084 # Determine the default libpath from the value encoded in an
6085 # empty executable.
6086 _LT_SYS_MODULE_PATH_AIX([$1])
6087 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6088 # Warning - without using the other run time loading flags,
6089 # -berok will link without error, but may produce a broken library.
6090 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6091 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6092 if test "$with_gnu_ld" = yes; then
6093 # We only use this code for GNU lds that support --whole-archive.
6094 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6095 else
6096 # Exported symbols can be pulled into shared objects from archives
6097 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6098 fi
6099 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6100 # This is similar to how AIX traditionally builds its shared
6101 # libraries.
6102 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6103 fi
6104 fi
6105 ;;
6106
6107 beos*)
6108 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6109 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6110 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6111 # support --undefined. This deserves some investigation. FIXME
6112 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6113 else
6114 _LT_TAGVAR(ld_shlibs, $1)=no
6115 fi
6116 ;;
6117
6118 chorus*)
6119 case $cc_basename in
6120 *)
6121 # FIXME: insert proper C++ library support
6122 _LT_TAGVAR(ld_shlibs, $1)=no
6123 ;;
6124 esac
6125 ;;
6126
6127 cygwin* | mingw* | pw32* | cegcc*)
6128 case $GXX,$cc_basename in
6129 ,cl* | no,cl*)
6130 # Native MSVC
6131 # hardcode_libdir_flag_spec is actually meaningless, as there is
6132 # no search path for DLLs.
6133 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6134 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6135 _LT_TAGVAR(always_export_symbols, $1)=yes
6136 _LT_TAGVAR(file_list_spec, $1)='@'
6137 # Tell ltmain to make .lib files, not .a files.
6138 libext=lib
6139 # Tell ltmain to make .dll files, not .so files.
6140 shrext_cmds=".dll"
6141 # FIXME: Setting linknames here is a bad hack.
6142 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6143 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6144 $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6145 else
6146 $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6147 fi~
6148 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6149 linknames='
6150 # The linker will not automatically build a static lib if we build a DLL.
6151 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6152 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6153 # Don't use ranlib
6154 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6155 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6156 lt_tool_outputfile="@TOOL_OUTPUT@"~
6157 case $lt_outputfile in
6158 *.exe|*.EXE) ;;
6159 *)
6160 lt_outputfile="$lt_outputfile.exe"
6161 lt_tool_outputfile="$lt_tool_outputfile.exe"
6162 ;;
6163 esac~
6164 func_to_tool_file "$lt_outputfile"~
6165 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6166 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6167 $RM "$lt_outputfile.manifest";
6168 fi'
6169 ;;
6170 *)
6171 # g++
6172 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6173 # as there is no search path for DLLs.
6174 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6175 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6176 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6177 _LT_TAGVAR(always_export_symbols, $1)=no
6178 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6179
6180 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6181 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6182 # If the export-symbols file already is a .def file (1st line
6183 # is EXPORTS), use it as is; otherwise, prepend...
6184 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6185 cp $export_symbols $output_objdir/$soname.def;
6186 else
6187 echo EXPORTS > $output_objdir/$soname.def;
6188 cat $export_symbols >> $output_objdir/$soname.def;
6189 fi~
6190 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6191 else
6192 _LT_TAGVAR(ld_shlibs, $1)=no
6193 fi
6194 ;;
6195 esac
6196 ;;
6197 darwin* | rhapsody*)
6198 _LT_DARWIN_LINKER_FEATURES($1)
6199 ;;
6200
6201 dgux*)
6202 case $cc_basename in
6203 ec++*)
6204 # FIXME: insert proper C++ library support
6205 _LT_TAGVAR(ld_shlibs, $1)=no
6206 ;;
6207 ghcx*)
6208 # Green Hills C++ Compiler
6209 # FIXME: insert proper C++ library support
6210 _LT_TAGVAR(ld_shlibs, $1)=no
6211 ;;
6212 *)
6213 # FIXME: insert proper C++ library support
6214 _LT_TAGVAR(ld_shlibs, $1)=no
6215 ;;
6216 esac
6217 ;;
6218
6219 freebsd2.*)
6220 # C++ shared libraries reported to be fairly broken before
6221 # switch to ELF
6222 _LT_TAGVAR(ld_shlibs, $1)=no
6223 ;;
6224
6225 freebsd-elf*)
6226 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6227 ;;
6228
6229 freebsd* | dragonfly*)
6230 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6231 # conventions
6232 _LT_TAGVAR(ld_shlibs, $1)=yes
6233 ;;
6234
6235 gnu*)
6236 ;;
6237
6238 haiku*)
6239 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6240 _LT_TAGVAR(link_all_deplibs, $1)=yes
6241 ;;
6242
6243 hpux9*)
6244 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6245 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6246 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6247 _LT_TAGVAR(hardcode_direct, $1)=yes
6248 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6249 # but as the default
6250 # location of the library.
6251
6252 case $cc_basename in
6253 CC*)
6254 # FIXME: insert proper C++ library support
6255 _LT_TAGVAR(ld_shlibs, $1)=no
6256 ;;
6257 aCC*)
6258 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6259 # Commands to make compiler produce verbose output that lists
6260 # what "hidden" libraries, object files and flags are used when
6261 # linking a shared library.
6262 #
6263 # There doesn't appear to be a way to prevent this compiler from
6264 # explicitly linking system object files so we need to strip them
6265 # from the output so that they don't get included in the library
6266 # dependencies.
6267 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6268 ;;
6269 *)
6270 if test "$GXX" = yes; then
6271 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6272 else
6273 # FIXME: insert proper C++ library support
6274 _LT_TAGVAR(ld_shlibs, $1)=no
6275 fi
6276 ;;
6277 esac
6278 ;;
6279
6280 hpux10*|hpux11*)
6281 if test $with_gnu_ld = no; then
6282 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6283 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6284
6285 case $host_cpu in
6286 hppa*64*|ia64*)
6287 ;;
6288 *)
6289 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6290 ;;
6291 esac
6292 fi
6293 case $host_cpu in
6294 hppa*64*|ia64*)
6295 _LT_TAGVAR(hardcode_direct, $1)=no
6296 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6297 ;;
6298 *)
6299 _LT_TAGVAR(hardcode_direct, $1)=yes
6300 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6301 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6302 # but as the default
6303 # location of the library.
6304 ;;
6305 esac
6306
6307 case $cc_basename in
6308 CC*)
6309 # FIXME: insert proper C++ library support
6310 _LT_TAGVAR(ld_shlibs, $1)=no
6311 ;;
6312 aCC*)
6313 case $host_cpu in
6314 hppa*64*)
6315 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6316 ;;
6317 ia64*)
6318 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6319 ;;
6320 *)
6321 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6322 ;;
6323 esac
6324 # Commands to make compiler produce verbose output that lists
6325 # what "hidden" libraries, object files and flags are used when
6326 # linking a shared library.
6327 #
6328 # There doesn't appear to be a way to prevent this compiler from
6329 # explicitly linking system object files so we need to strip them
6330 # from the output so that they don't get included in the library
6331 # dependencies.
6332 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6333 ;;
6334 *)
6335 if test "$GXX" = yes; then
6336 if test $with_gnu_ld = no; then
6337 case $host_cpu in
6338 hppa*64*)
6339 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6340 ;;
6341 ia64*)
6342 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6343 ;;
6344 *)
6345 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6346 ;;
6347 esac
6348 fi
6349 else
6350 # FIXME: insert proper C++ library support
6351 _LT_TAGVAR(ld_shlibs, $1)=no
6352 fi
6353 ;;
6354 esac
6355 ;;
6356
6357 interix[[3-9]]*)
6358 _LT_TAGVAR(hardcode_direct, $1)=no
6359 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6360 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6361 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6362 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6363 # Instead, shared libraries are loaded at an image base (0x10000000 by
6364 # default) and relocated if they conflict, which is a slow very memory
6365 # consuming and fragmenting process. To avoid this, we pick a random,
6366 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6367 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
6368 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6369 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6370 ;;
6371 irix5* | irix6*)
6372 case $cc_basename in
6373 CC*)
6374 # SGI C++
6375 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6376
6377 # Archives containing C++ object files must be created using
6378 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
6379 # necessary to make sure instantiated templates are included
6380 # in the archive.
6381 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6382 ;;
6383 *)
6384 if test "$GXX" = yes; then
6385 if test "$with_gnu_ld" = no; then
6386 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6387 else
6388 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
6389 fi
6390 fi
6391 _LT_TAGVAR(link_all_deplibs, $1)=yes
6392 ;;
6393 esac
6394 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6395 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6396 _LT_TAGVAR(inherit_rpath, $1)=yes
6397 ;;
6398
6399 linux* | k*bsd*-gnu | kopensolaris*-gnu)
6400 case $cc_basename in
6401 KCC*)
6402 # Kuck and Associates, Inc. (KAI) C++ Compiler
6403
6404 # KCC will only create a shared library if the output file
6405 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6406 # to its proper name (with version) after linking.
6407 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6408 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
6409 # Commands to make compiler produce verbose output that lists
6410 # what "hidden" libraries, object files and flags are used when
6411 # linking a shared library.
6412 #
6413 # There doesn't appear to be a way to prevent this compiler from
6414 # explicitly linking system object files so we need to strip them
6415 # from the output so that they don't get included in the library
6416 # dependencies.
6417 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6418
6419 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6420 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6421
6422 # Archives containing C++ object files must be created using
6423 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6424 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6425 ;;
6426 icpc* | ecpc* )
6427 # Intel C++
6428 with_gnu_ld=yes
6429 # version 8.0 and above of icpc choke on multiply defined symbols
6430 # if we add $predep_objects and $postdep_objects, however 7.1 and
6431 # earlier do not add the objects themselves.
6432 case `$CC -V 2>&1` in
6433 *"Version 7."*)
6434 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6435 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6436 ;;
6437 *) # Version 8.0 or newer
6438 tmp_idyn=
6439 case $host_cpu in
6440 ia64*) tmp_idyn=' -i_dynamic';;
6441 esac
6442 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6443 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6444 ;;
6445 esac
6446 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6447 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6448 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6449 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6450 ;;
6451 pgCC* | pgcpp*)
6452 # Portland Group C++ compiler
6453 case `$CC -V` in
6454 *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6455 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6456 rm -rf $tpldir~
6457 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6458 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6459 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6460 rm -rf $tpldir~
6461 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6462 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6463 $RANLIB $oldlib'
6464 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6465 rm -rf $tpldir~
6466 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6467 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6468 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6469 rm -rf $tpldir~
6470 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6471 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
6472 ;;
6473 *) # Version 6 and above use weak symbols
6474 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6475 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
6476 ;;
6477 esac
6478
6479 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6480 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6481 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
6482 ;;
6483 cxx*)
6484 # Compaq C++
6485 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6486 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
6487
6488 runpath_var=LD_RUN_PATH
6489 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6490 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6491
6492 # Commands to make compiler produce verbose output that lists
6493 # what "hidden" libraries, object files and flags are used when
6494 # linking a shared library.
6495 #
6496 # There doesn't appear to be a way to prevent this compiler from
6497 # explicitly linking system object files so we need to strip them
6498 # from the output so that they don't get included in the library
6499 # dependencies.
6500 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
6501 ;;
6502 xl* | mpixl* | bgxl*)
6503 # IBM XL 8.0 on PPC, with GNU ld
6504 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6505 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6506 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6507 if test "x$supports_anon_versioning" = xyes; then
6508 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6509 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6510 echo "local: *; };" >> $output_objdir/$libname.ver~
6511 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6512 fi
6513 ;;
6514 *)
6515 case `$CC -V 2>&1 | sed 5q` in
6516 *Sun\ C*)
6517 # Sun C++ 5.9
6518 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6519 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6520 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
6521 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6522 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
6523 _LT_TAGVAR(compiler_needs_object, $1)=yes
6524
6525 # Not sure whether something based on
6526 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6527 # would be better.
6528 output_verbose_link_cmd='func_echo_all'
6529
6530 # Archives containing C++ object files must be created using
6531 # "CC -xar", where "CC" is the Sun C++ compiler. This is
6532 # necessary to make sure instantiated templates are included
6533 # in the archive.
6534 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6535 ;;
6536 esac
6537 ;;
6538 esac
6539 ;;
6540
6541 lynxos*)
6542 # FIXME: insert proper C++ library support
6543 _LT_TAGVAR(ld_shlibs, $1)=no
6544 ;;
6545
6546 m88k*)
6547 # FIXME: insert proper C++ library support
6548 _LT_TAGVAR(ld_shlibs, $1)=no
6549 ;;
6550
6551 mvs*)
6552 case $cc_basename in
6553 cxx*)
6554 # FIXME: insert proper C++ library support
6555 _LT_TAGVAR(ld_shlibs, $1)=no
6556 ;;
6557 *)
6558 # FIXME: insert proper C++ library support
6559 _LT_TAGVAR(ld_shlibs, $1)=no
6560 ;;
6561 esac
6562 ;;
6563
6564 netbsd*)
6565 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6566 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6567 wlarc=
6568 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6569 _LT_TAGVAR(hardcode_direct, $1)=yes
6570 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6571 fi
6572 # Workaround some broken pre-1.5 toolchains
6573 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6574 ;;
6575
6576 *nto* | *qnx*)
6577 _LT_TAGVAR(ld_shlibs, $1)=yes
6578 ;;
6579
6580 openbsd2*)
6581 # C++ shared libraries are fairly broken
6582 _LT_TAGVAR(ld_shlibs, $1)=no
6583 ;;
6584
6585 openbsd*)
6586 if test -f /usr/libexec/ld.so; then
6587 _LT_TAGVAR(hardcode_direct, $1)=yes
6588 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6589 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6590 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6591 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6592 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6593 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6594 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6595 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6596 fi
6597 output_verbose_link_cmd=func_echo_all
6598 else
6599 _LT_TAGVAR(ld_shlibs, $1)=no
6600 fi
6601 ;;
6602
6603 osf3* | osf4* | osf5*)
6604 case $cc_basename in
6605 KCC*)
6606 # Kuck and Associates, Inc. (KAI) C++ Compiler
6607
6608 # KCC will only create a shared library if the output file
6609 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6610 # to its proper name (with version) after linking.
6611 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6612
6613 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6614 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6615
6616 # Archives containing C++ object files must be created using
6617 # the KAI C++ compiler.
6618 case $host in
6619 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6620 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6621 esac
6622 ;;
6623 RCC*)
6624 # Rational C++ 2.4.1
6625 # FIXME: insert proper C++ library support
6626 _LT_TAGVAR(ld_shlibs, $1)=no
6627 ;;
6628 cxx*)
6629 case $host in
6630 osf3*)
6631 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6632 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6633 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6634 ;;
6635 *)
6636 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6637 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6638 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6639 echo "-hidden">> $lib.exp~
6640 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
6641 $RM $lib.exp'
6642 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6643 ;;
6644 esac
6645
6646 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6647
6648 # Commands to make compiler produce verbose output that lists
6649 # what "hidden" libraries, object files and flags are used when
6650 # linking a shared library.
6651 #
6652 # There doesn't appear to be a way to prevent this compiler from
6653 # explicitly linking system object files so we need to strip them
6654 # from the output so that they don't get included in the library
6655 # dependencies.
6656 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6657 ;;
6658 *)
6659 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6660 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6661 case $host in
6662 osf3*)
6663 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6664 ;;
6665 *)
6666 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6667 ;;
6668 esac
6669
6670 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6671 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6672
6673 # Commands to make compiler produce verbose output that lists
6674 # what "hidden" libraries, object files and flags are used when
6675 # linking a shared library.
6676 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6677
6678 else
6679 # FIXME: insert proper C++ library support
6680 _LT_TAGVAR(ld_shlibs, $1)=no
6681 fi
6682 ;;
6683 esac
6684 ;;
6685
6686 psos*)
6687 # FIXME: insert proper C++ library support
6688 _LT_TAGVAR(ld_shlibs, $1)=no
6689 ;;
6690
6691 sunos4*)
6692 case $cc_basename in
6693 CC*)
6694 # Sun C++ 4.x
6695 # FIXME: insert proper C++ library support
6696 _LT_TAGVAR(ld_shlibs, $1)=no
6697 ;;
6698 lcc*)
6699 # Lucid
6700 # FIXME: insert proper C++ library support
6701 _LT_TAGVAR(ld_shlibs, $1)=no
6702 ;;
6703 *)
6704 # FIXME: insert proper C++ library support
6705 _LT_TAGVAR(ld_shlibs, $1)=no
6706 ;;
6707 esac
6708 ;;
6709
6710 solaris*)
6711 case $cc_basename in
6712 CC* | sunCC*)
6713 # Sun C++ 4.2, 5.x and Centerline C++
6714 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6715 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6716 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6717 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6718 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6719
6720 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6721 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6722 case $host_os in
6723 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6724 *)
6725 # The compiler driver will combine and reorder linker options,
6726 # but understands `-z linker_flag'.
6727 # Supported since Solaris 2.6 (maybe 2.5.1?)
6728 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6729 ;;
6730 esac
6731 _LT_TAGVAR(link_all_deplibs, $1)=yes
6732
6733 output_verbose_link_cmd='func_echo_all'
6734
6735 # Archives containing C++ object files must be created using
6736 # "CC -xar", where "CC" is the Sun C++ compiler. This is
6737 # necessary to make sure instantiated templates are included
6738 # in the archive.
6739 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6740 ;;
6741 gcx*)
6742 # Green Hills C++ Compiler
6743 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6744
6745 # The C++ compiler must be used to create the archive.
6746 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6747 ;;
6748 *)
6749 # GNU C++ compiler with Solaris linker
6750 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6751 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6752 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6753 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6754 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6755 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6756
6757 # Commands to make compiler produce verbose output that lists
6758 # what "hidden" libraries, object files and flags are used when
6759 # linking a shared library.
6760 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6761 else
6762 # g++ 2.7 appears to require `-G' NOT `-shared' on this
6763 # platform.
6764 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6765 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6766 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6767
6768 # Commands to make compiler produce verbose output that lists
6769 # what "hidden" libraries, object files and flags are used when
6770 # linking a shared library.
6771 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6772 fi
6773
6774 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6775 case $host_os in
6776 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6777 *)
6778 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6779 ;;
6780 esac
6781 fi
6782 ;;
6783 esac
6784 ;;
6785
6786 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6787 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6788 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6789 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6790 runpath_var='LD_RUN_PATH'
6791
6792 case $cc_basename in
6793 CC*)
6794 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6795 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6796 ;;
6797 *)
6798 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6799 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6800 ;;
6801 esac
6802 ;;
6803
6804 sysv5* | sco3.2v5* | sco5v6*)
6805 # Note: We can NOT use -z defs as we might desire, because we do not
6806 # link with -lc, and that would cause any symbols used from libc to
6807 # always be unresolved, which means just about no library would
6808 # ever link correctly. If we're not using GNU ld we use -z text
6809 # though, which does catch some bad symbols but isn't as heavy-handed
6810 # as -z defs.
6811 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6812 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6813 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6814 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6815 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6816 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6817 _LT_TAGVAR(link_all_deplibs, $1)=yes
6818 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6819 runpath_var='LD_RUN_PATH'
6820
6821 case $cc_basename in
6822 CC*)
6823 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6824 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6825 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6826 '"$_LT_TAGVAR(old_archive_cmds, $1)"
6827 _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6828 '"$_LT_TAGVAR(reload_cmds, $1)"
6829 ;;
6830 *)
6831 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6832 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6833 ;;
6834 esac
6835 ;;
6836
6837 tandem*)
6838 case $cc_basename in
6839 NCC*)
6840 # NonStop-UX NCC 3.20
6841 # FIXME: insert proper C++ library support
6842 _LT_TAGVAR(ld_shlibs, $1)=no
6843 ;;
6844 *)
6845 # FIXME: insert proper C++ library support
6846 _LT_TAGVAR(ld_shlibs, $1)=no
6847 ;;
6848 esac
6849 ;;
6850
6851 vxworks*)
6852 # FIXME: insert proper C++ library support
6853 _LT_TAGVAR(ld_shlibs, $1)=no
6854 ;;
6855
6856 *)
6857 # FIXME: insert proper C++ library support
6858 _LT_TAGVAR(ld_shlibs, $1)=no
6859 ;;
6860 esac
6861
6862 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6863 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6864
6865 _LT_TAGVAR(GCC, $1)="$GXX"
6866 _LT_TAGVAR(LD, $1)="$LD"
6867
6868 ## CAVEAT EMPTOR:
6869 ## There is no encapsulation within the following macros, do not change
6870 ## the running order or otherwise move them around unless you know exactly
6871 ## what you are doing...
6872 _LT_SYS_HIDDEN_LIBDEPS($1)
6873 _LT_COMPILER_PIC($1)
6874 _LT_COMPILER_C_O($1)
6875 _LT_COMPILER_FILE_LOCKS($1)
6876 _LT_LINKER_SHLIBS($1)
6877 _LT_SYS_DYNAMIC_LINKER($1)
6878 _LT_LINKER_HARDCODE_LIBPATH($1)
6879
6880 _LT_CONFIG($1)
6881 fi # test -n "$compiler"
6882
6883 CC=$lt_save_CC
6884 CFLAGS=$lt_save_CFLAGS
6885 LDCXX=$LD
6886 LD=$lt_save_LD
6887 GCC=$lt_save_GCC
6888 with_gnu_ld=$lt_save_with_gnu_ld
6889 lt_cv_path_LDCXX=$lt_cv_path_LD
6890 lt_cv_path_LD=$lt_save_path_LD
6891 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6892 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6893fi # test "$_lt_caught_CXX_error" != yes
6894
6895AC_LANG_POP
6896])# _LT_LANG_CXX_CONFIG
6897
6898
6899# _LT_FUNC_STRIPNAME_CNF
6900# ----------------------
6901# func_stripname_cnf prefix suffix name
6902# strip PREFIX and SUFFIX off of NAME.
6903# PREFIX and SUFFIX must not contain globbing or regex special
6904# characters, hashes, percent signs, but SUFFIX may contain a leading
6905# dot (in which case that matches only a dot).
6906#
6907# This function is identical to the (non-XSI) version of func_stripname,
6908# except this one can be used by m4 code that may be executed by configure,
6909# rather than the libtool script.
6910m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6911AC_REQUIRE([_LT_DECL_SED])
6912AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6913func_stripname_cnf ()
6914{
6915 case ${2} in
6916 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6917 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6918 esac
6919} # func_stripname_cnf
6920])# _LT_FUNC_STRIPNAME_CNF
6921
6922# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6923# ---------------------------------
6924# Figure out "hidden" library dependencies from verbose
6925# compiler output when linking a shared library.
6926# Parse the compiler output and extract the necessary
6927# objects, libraries and library flags.
6928m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6929[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6930AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6931# Dependencies to place before and after the object being linked:
6932_LT_TAGVAR(predep_objects, $1)=
6933_LT_TAGVAR(postdep_objects, $1)=
6934_LT_TAGVAR(predeps, $1)=
6935_LT_TAGVAR(postdeps, $1)=
6936_LT_TAGVAR(compiler_lib_search_path, $1)=
6937
6938dnl we can't use the lt_simple_compile_test_code here,
6939dnl because it contains code intended for an executable,
6940dnl not a library. It's possible we should let each
6941dnl tag define a new lt_????_link_test_code variable,
6942dnl but it's only used here...
6943m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6944int a;
6945void foo (void) { a = 0; }
6946_LT_EOF
6947], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6948class Foo
6949{
6950public:
6951 Foo (void) { a = 0; }
6952private:
6953 int a;
6954};
6955_LT_EOF
6956], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6957 subroutine foo
6958 implicit none
6959 integer*4 a
6960 a=0
6961 return
6962 end
6963_LT_EOF
6964], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6965 subroutine foo
6966 implicit none
6967 integer a
6968 a=0
6969 return
6970 end
6971_LT_EOF
6972], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6973public class foo {
6974 private int a;
6975 public void bar (void) {
6976 a = 0;
6977 }
6978};
6979_LT_EOF
6980], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6981package foo
6982func foo() {
6983}
6984_LT_EOF
6985])
6986
6987_lt_libdeps_save_CFLAGS=$CFLAGS
6988case "$CC $CFLAGS " in #(
6989*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6990*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6991*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
6992esac
6993
6994dnl Parse the compiler output and extract the necessary
6995dnl objects, libraries and library flags.
6996if AC_TRY_EVAL(ac_compile); then
6997 # Parse the compiler output and extract the necessary
6998 # objects, libraries and library flags.
6999
7000 # Sentinel used to keep track of whether or not we are before
7001 # the conftest object file.
7002 pre_test_object_deps_done=no
7003
7004 for p in `eval "$output_verbose_link_cmd"`; do
7005 case ${prev}${p} in
7006
7007 -L* | -R* | -l*)
7008 # Some compilers place space between "-{L,R}" and the path.
7009 # Remove the space.
7010 if test $p = "-L" ||
7011 test $p = "-R"; then
7012 prev=$p
7013 continue
7014 fi
7015
7016 # Expand the sysroot to ease extracting the directories later.
7017 if test -z "$prev"; then
7018 case $p in
7019 -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7020 -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7021 -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7022 esac
7023 fi
7024 case $p in
7025 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7026 esac
7027 if test "$pre_test_object_deps_done" = no; then
7028 case ${prev} in
7029 -L | -R)
7030 # Internal compiler library paths should come after those
7031 # provided the user. The postdeps already come after the
7032 # user supplied libs so there is no need to process them.
7033 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7034 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7035 else
7036 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7037 fi
7038 ;;
7039 # The "-l" case would never come before the object being
7040 # linked, so don't bother handling this case.
7041 esac
7042 else
7043 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7044 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7045 else
7046 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7047 fi
7048 fi
7049 prev=
7050 ;;
7051
7052 *.lto.$objext) ;; # Ignore GCC LTO objects
7053 *.$objext)
7054 # This assumes that the test object file only shows up
7055 # once in the compiler output.
7056 if test "$p" = "conftest.$objext"; then
7057 pre_test_object_deps_done=yes
7058 continue
7059 fi
7060
7061 if test "$pre_test_object_deps_done" = no; then
7062 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7063 _LT_TAGVAR(predep_objects, $1)="$p"
7064 else
7065 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7066 fi
7067 else
7068 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7069 _LT_TAGVAR(postdep_objects, $1)="$p"
7070 else
7071 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7072 fi
7073 fi
7074 ;;
7075
7076 *) ;; # Ignore the rest.
7077
7078 esac
7079 done
7080
7081 # Clean up.
7082 rm -f a.out a.exe
7083else
7084 echo "libtool.m4: error: problem compiling $1 test program"
7085fi
7086
7087$RM -f confest.$objext
7088CFLAGS=$_lt_libdeps_save_CFLAGS
7089
7090# PORTME: override above test on systems where it is broken
7091m4_if([$1], [CXX],
7092[case $host_os in
7093interix[[3-9]]*)
7094 # Interix 3.5 installs completely hosed .la files for C++, so rather than
7095 # hack all around it, let's just trust "g++" to DTRT.
7096 _LT_TAGVAR(predep_objects,$1)=
7097 _LT_TAGVAR(postdep_objects,$1)=
7098 _LT_TAGVAR(postdeps,$1)=
7099 ;;
7100
7101linux*)
7102 case `$CC -V 2>&1 | sed 5q` in
7103 *Sun\ C*)
7104 # Sun C++ 5.9
7105
7106 # The more standards-conforming stlport4 library is
7107 # incompatible with the Cstd library. Avoid specifying
7108 # it if it's in CXXFLAGS. Ignore libCrun as
7109 # -library=stlport4 depends on it.
7110 case " $CXX $CXXFLAGS " in
7111 *" -library=stlport4 "*)
7112 solaris_use_stlport4=yes
7113 ;;
7114 esac
7115
7116 if test "$solaris_use_stlport4" != yes; then
7117 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7118 fi
7119 ;;
7120 esac
7121 ;;
7122
7123solaris*)
7124 case $cc_basename in
7125 CC* | sunCC*)
7126 # The more standards-conforming stlport4 library is
7127 # incompatible with the Cstd library. Avoid specifying
7128 # it if it's in CXXFLAGS. Ignore libCrun as
7129 # -library=stlport4 depends on it.
7130 case " $CXX $CXXFLAGS " in
7131 *" -library=stlport4 "*)
7132 solaris_use_stlport4=yes
7133 ;;
7134 esac
7135
7136 # Adding this requires a known-good setup of shared libraries for
7137 # Sun compiler versions before 5.6, else PIC objects from an old
7138 # archive will be linked into the output, leading to subtle bugs.
7139 if test "$solaris_use_stlport4" != yes; then
7140 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7141 fi
7142 ;;
7143 esac
7144 ;;
7145esac
7146])
7147
7148case " $_LT_TAGVAR(postdeps, $1) " in
7149*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7150esac
7151 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7152if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7153 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7154fi
7155_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7156 [The directories searched by this compiler when creating a shared library])
7157_LT_TAGDECL([], [predep_objects], [1],
7158 [Dependencies to place before and after the objects being linked to
7159 create a shared library])
7160_LT_TAGDECL([], [postdep_objects], [1])
7161_LT_TAGDECL([], [predeps], [1])
7162_LT_TAGDECL([], [postdeps], [1])
7163_LT_TAGDECL([], [compiler_lib_search_path], [1],
7164 [The library search path used internally by the compiler when linking
7165 a shared library])
7166])# _LT_SYS_HIDDEN_LIBDEPS
7167
7168
7169# _LT_LANG_F77_CONFIG([TAG])
7170# --------------------------
7171# Ensure that the configuration variables for a Fortran 77 compiler are
7172# suitably defined. These variables are subsequently used by _LT_CONFIG
7173# to write the compiler configuration to `libtool'.
7174m4_defun([_LT_LANG_F77_CONFIG],
7175[AC_LANG_PUSH(Fortran 77)
7176if test -z "$F77" || test "X$F77" = "Xno"; then
7177 _lt_disable_F77=yes
7178fi
7179
7180_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7181_LT_TAGVAR(allow_undefined_flag, $1)=
7182_LT_TAGVAR(always_export_symbols, $1)=no
7183_LT_TAGVAR(archive_expsym_cmds, $1)=
7184_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7185_LT_TAGVAR(hardcode_direct, $1)=no
7186_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7187_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7188_LT_TAGVAR(hardcode_libdir_separator, $1)=
7189_LT_TAGVAR(hardcode_minus_L, $1)=no
7190_LT_TAGVAR(hardcode_automatic, $1)=no
7191_LT_TAGVAR(inherit_rpath, $1)=no
7192_LT_TAGVAR(module_cmds, $1)=
7193_LT_TAGVAR(module_expsym_cmds, $1)=
7194_LT_TAGVAR(link_all_deplibs, $1)=unknown
7195_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7196_LT_TAGVAR(reload_flag, $1)=$reload_flag
7197_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7198_LT_TAGVAR(no_undefined_flag, $1)=
7199_LT_TAGVAR(whole_archive_flag_spec, $1)=
7200_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7201
7202# Source file extension for f77 test sources.
7203ac_ext=f
7204
7205# Object file extension for compiled f77 test sources.
7206objext=o
7207_LT_TAGVAR(objext, $1)=$objext
7208
7209# No sense in running all these tests if we already determined that
7210# the F77 compiler isn't working. Some variables (like enable_shared)
7211# are currently assumed to apply to all compilers on this platform,
7212# and will be corrupted by setting them based on a non-working compiler.
7213if test "$_lt_disable_F77" != yes; then
7214 # Code to be used in simple compile tests
7215 lt_simple_compile_test_code="\
7216 subroutine t
7217 return
7218 end
7219"
7220
7221 # Code to be used in simple link tests
7222 lt_simple_link_test_code="\
7223 program t
7224 end
7225"
7226
7227 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7228 _LT_TAG_COMPILER
7229
7230 # save warnings/boilerplate of simple test code
7231 _LT_COMPILER_BOILERPLATE
7232 _LT_LINKER_BOILERPLATE
7233
7234 # Allow CC to be a program name with arguments.
7235 lt_save_CC="$CC"
7236 lt_save_GCC=$GCC
7237 lt_save_CFLAGS=$CFLAGS
7238 CC=${F77-"f77"}
7239 CFLAGS=$FFLAGS
7240 compiler=$CC
7241 _LT_TAGVAR(compiler, $1)=$CC
7242 _LT_CC_BASENAME([$compiler])
7243 GCC=$G77
7244 if test -n "$compiler"; then
7245 AC_MSG_CHECKING([if libtool supports shared libraries])
7246 AC_MSG_RESULT([$can_build_shared])
7247
7248 AC_MSG_CHECKING([whether to build shared libraries])
7249 test "$can_build_shared" = "no" && enable_shared=no
7250
7251 # On AIX, shared libraries and static libraries use the same namespace, and
7252 # are all built from PIC.
7253 case $host_os in
7254 aix3*)
7255 test "$enable_shared" = yes && enable_static=no
7256 if test -n "$RANLIB"; then
7257 archive_cmds="$archive_cmds~\$RANLIB \$lib"
7258 postinstall_cmds='$RANLIB $lib'
7259 fi
7260 ;;
7261 aix[[4-9]]*)
7262 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7263 test "$enable_shared" = yes && enable_static=no
7264 fi
7265 ;;
7266 esac
7267 AC_MSG_RESULT([$enable_shared])
7268
7269 AC_MSG_CHECKING([whether to build static libraries])
7270 # Make sure either enable_shared or enable_static is yes.
7271 test "$enable_shared" = yes || enable_static=yes
7272 AC_MSG_RESULT([$enable_static])
7273
7274 _LT_TAGVAR(GCC, $1)="$G77"
7275 _LT_TAGVAR(LD, $1)="$LD"
7276
7277 ## CAVEAT EMPTOR:
7278 ## There is no encapsulation within the following macros, do not change
7279 ## the running order or otherwise move them around unless you know exactly
7280 ## what you are doing...
7281 _LT_COMPILER_PIC($1)
7282 _LT_COMPILER_C_O($1)
7283 _LT_COMPILER_FILE_LOCKS($1)
7284 _LT_LINKER_SHLIBS($1)
7285 _LT_SYS_DYNAMIC_LINKER($1)
7286 _LT_LINKER_HARDCODE_LIBPATH($1)
7287
7288 _LT_CONFIG($1)
7289 fi # test -n "$compiler"
7290
7291 GCC=$lt_save_GCC
7292 CC="$lt_save_CC"
7293 CFLAGS="$lt_save_CFLAGS"
7294fi # test "$_lt_disable_F77" != yes
7295
7296AC_LANG_POP
7297])# _LT_LANG_F77_CONFIG
7298
7299
7300# _LT_LANG_FC_CONFIG([TAG])
7301# -------------------------
7302# Ensure that the configuration variables for a Fortran compiler are
7303# suitably defined. These variables are subsequently used by _LT_CONFIG
7304# to write the compiler configuration to `libtool'.
7305m4_defun([_LT_LANG_FC_CONFIG],
7306[AC_LANG_PUSH(Fortran)
7307
7308if test -z "$FC" || test "X$FC" = "Xno"; then
7309 _lt_disable_FC=yes
7310fi
7311
7312_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7313_LT_TAGVAR(allow_undefined_flag, $1)=
7314_LT_TAGVAR(always_export_symbols, $1)=no
7315_LT_TAGVAR(archive_expsym_cmds, $1)=
7316_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7317_LT_TAGVAR(hardcode_direct, $1)=no
7318_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7319_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7320_LT_TAGVAR(hardcode_libdir_separator, $1)=
7321_LT_TAGVAR(hardcode_minus_L, $1)=no
7322_LT_TAGVAR(hardcode_automatic, $1)=no
7323_LT_TAGVAR(inherit_rpath, $1)=no
7324_LT_TAGVAR(module_cmds, $1)=
7325_LT_TAGVAR(module_expsym_cmds, $1)=
7326_LT_TAGVAR(link_all_deplibs, $1)=unknown
7327_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7328_LT_TAGVAR(reload_flag, $1)=$reload_flag
7329_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7330_LT_TAGVAR(no_undefined_flag, $1)=
7331_LT_TAGVAR(whole_archive_flag_spec, $1)=
7332_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7333
7334# Source file extension for fc test sources.
7335ac_ext=${ac_fc_srcext-f}
7336
7337# Object file extension for compiled fc test sources.
7338objext=o
7339_LT_TAGVAR(objext, $1)=$objext
7340
7341# No sense in running all these tests if we already determined that
7342# the FC compiler isn't working. Some variables (like enable_shared)
7343# are currently assumed to apply to all compilers on this platform,
7344# and will be corrupted by setting them based on a non-working compiler.
7345if test "$_lt_disable_FC" != yes; then
7346 # Code to be used in simple compile tests
7347 lt_simple_compile_test_code="\
7348 subroutine t
7349 return
7350 end
7351"
7352
7353 # Code to be used in simple link tests
7354 lt_simple_link_test_code="\
7355 program t
7356 end
7357"
7358
7359 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7360 _LT_TAG_COMPILER
7361
7362 # save warnings/boilerplate of simple test code
7363 _LT_COMPILER_BOILERPLATE
7364 _LT_LINKER_BOILERPLATE
7365
7366 # Allow CC to be a program name with arguments.
7367 lt_save_CC="$CC"
7368 lt_save_GCC=$GCC
7369 lt_save_CFLAGS=$CFLAGS
7370 CC=${FC-"f95"}
7371 CFLAGS=$FCFLAGS
7372 compiler=$CC
7373 GCC=$ac_cv_fc_compiler_gnu
7374
7375 _LT_TAGVAR(compiler, $1)=$CC
7376 _LT_CC_BASENAME([$compiler])
7377
7378 if test -n "$compiler"; then
7379 AC_MSG_CHECKING([if libtool supports shared libraries])
7380 AC_MSG_RESULT([$can_build_shared])
7381
7382 AC_MSG_CHECKING([whether to build shared libraries])
7383 test "$can_build_shared" = "no" && enable_shared=no
7384
7385 # On AIX, shared libraries and static libraries use the same namespace, and
7386 # are all built from PIC.
7387 case $host_os in
7388 aix3*)
7389 test "$enable_shared" = yes && enable_static=no
7390 if test -n "$RANLIB"; then
7391 archive_cmds="$archive_cmds~\$RANLIB \$lib"
7392 postinstall_cmds='$RANLIB $lib'
7393 fi
7394 ;;
7395 aix[[4-9]]*)
7396 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7397 test "$enable_shared" = yes && enable_static=no
7398 fi
7399 ;;
7400 esac
7401 AC_MSG_RESULT([$enable_shared])
7402
7403 AC_MSG_CHECKING([whether to build static libraries])
7404 # Make sure either enable_shared or enable_static is yes.
7405 test "$enable_shared" = yes || enable_static=yes
7406 AC_MSG_RESULT([$enable_static])
7407
7408 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7409 _LT_TAGVAR(LD, $1)="$LD"
7410
7411 ## CAVEAT EMPTOR:
7412 ## There is no encapsulation within the following macros, do not change
7413 ## the running order or otherwise move them around unless you know exactly
7414 ## what you are doing...
7415 _LT_SYS_HIDDEN_LIBDEPS($1)
7416 _LT_COMPILER_PIC($1)
7417 _LT_COMPILER_C_O($1)
7418 _LT_COMPILER_FILE_LOCKS($1)
7419 _LT_LINKER_SHLIBS($1)
7420 _LT_SYS_DYNAMIC_LINKER($1)
7421 _LT_LINKER_HARDCODE_LIBPATH($1)
7422
7423 _LT_CONFIG($1)
7424 fi # test -n "$compiler"
7425
7426 GCC=$lt_save_GCC
7427 CC=$lt_save_CC
7428 CFLAGS=$lt_save_CFLAGS
7429fi # test "$_lt_disable_FC" != yes
7430
7431AC_LANG_POP
7432])# _LT_LANG_FC_CONFIG
7433
7434
7435# _LT_LANG_GCJ_CONFIG([TAG])
7436# --------------------------
7437# Ensure that the configuration variables for the GNU Java Compiler compiler
7438# are suitably defined. These variables are subsequently used by _LT_CONFIG
7439# to write the compiler configuration to `libtool'.
7440m4_defun([_LT_LANG_GCJ_CONFIG],
7441[AC_REQUIRE([LT_PROG_GCJ])dnl
7442AC_LANG_SAVE
7443
7444# Source file extension for Java test sources.
7445ac_ext=java
7446
7447# Object file extension for compiled Java test sources.
7448objext=o
7449_LT_TAGVAR(objext, $1)=$objext
7450
7451# Code to be used in simple compile tests
7452lt_simple_compile_test_code="class foo {}"
7453
7454# Code to be used in simple link tests
7455lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7456
7457# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7458_LT_TAG_COMPILER
7459
7460# save warnings/boilerplate of simple test code
7461_LT_COMPILER_BOILERPLATE
7462_LT_LINKER_BOILERPLATE
7463
7464# Allow CC to be a program name with arguments.
7465lt_save_CC=$CC
7466lt_save_CFLAGS=$CFLAGS
7467lt_save_GCC=$GCC
7468GCC=yes
7469CC=${GCJ-"gcj"}
7470CFLAGS=$GCJFLAGS
7471compiler=$CC
7472_LT_TAGVAR(compiler, $1)=$CC
7473_LT_TAGVAR(LD, $1)="$LD"
7474_LT_CC_BASENAME([$compiler])
7475
7476# GCJ did not exist at the time GCC didn't implicitly link libc in.
7477_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7478
7479_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7480_LT_TAGVAR(reload_flag, $1)=$reload_flag
7481_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7482
7483if test -n "$compiler"; then
7484 _LT_COMPILER_NO_RTTI($1)
7485 _LT_COMPILER_PIC($1)
7486 _LT_COMPILER_C_O($1)
7487 _LT_COMPILER_FILE_LOCKS($1)
7488 _LT_LINKER_SHLIBS($1)
7489 _LT_LINKER_HARDCODE_LIBPATH($1)
7490
7491 _LT_CONFIG($1)
7492fi
7493
7494AC_LANG_RESTORE
7495
7496GCC=$lt_save_GCC
7497CC=$lt_save_CC
7498CFLAGS=$lt_save_CFLAGS
7499])# _LT_LANG_GCJ_CONFIG
7500
7501
7502# _LT_LANG_GO_CONFIG([TAG])
7503# --------------------------
7504# Ensure that the configuration variables for the GNU Go compiler
7505# are suitably defined. These variables are subsequently used by _LT_CONFIG
7506# to write the compiler configuration to `libtool'.
7507m4_defun([_LT_LANG_GO_CONFIG],
7508[AC_REQUIRE([LT_PROG_GO])dnl
7509AC_LANG_SAVE
7510
7511# Source file extension for Go test sources.
7512ac_ext=go
7513
7514# Object file extension for compiled Go test sources.
7515objext=o
7516_LT_TAGVAR(objext, $1)=$objext
7517
7518# Code to be used in simple compile tests
7519lt_simple_compile_test_code="package main; func main() { }"
7520
7521# Code to be used in simple link tests
7522lt_simple_link_test_code='package main; func main() { }'
7523
7524# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7525_LT_TAG_COMPILER
7526
7527# save warnings/boilerplate of simple test code
7528_LT_COMPILER_BOILERPLATE
7529_LT_LINKER_BOILERPLATE
7530
7531# Allow CC to be a program name with arguments.
7532lt_save_CC=$CC
7533lt_save_CFLAGS=$CFLAGS
7534lt_save_GCC=$GCC
7535GCC=yes
7536CC=${GOC-"gccgo"}
7537CFLAGS=$GOFLAGS
7538compiler=$CC
7539_LT_TAGVAR(compiler, $1)=$CC
7540_LT_TAGVAR(LD, $1)="$LD"
7541_LT_CC_BASENAME([$compiler])
7542
7543# Go did not exist at the time GCC didn't implicitly link libc in.
7544_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7545
7546_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7547_LT_TAGVAR(reload_flag, $1)=$reload_flag
7548_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7549
7550if test -n "$compiler"; then
7551 _LT_COMPILER_NO_RTTI($1)
7552 _LT_COMPILER_PIC($1)
7553 _LT_COMPILER_C_O($1)
7554 _LT_COMPILER_FILE_LOCKS($1)
7555 _LT_LINKER_SHLIBS($1)
7556 _LT_LINKER_HARDCODE_LIBPATH($1)
7557
7558 _LT_CONFIG($1)
7559fi
7560
7561AC_LANG_RESTORE
7562
7563GCC=$lt_save_GCC
7564CC=$lt_save_CC
7565CFLAGS=$lt_save_CFLAGS
7566])# _LT_LANG_GO_CONFIG
7567
7568
7569# _LT_LANG_RC_CONFIG([TAG])
7570# -------------------------
7571# Ensure that the configuration variables for the Windows resource compiler
7572# are suitably defined. These variables are subsequently used by _LT_CONFIG
7573# to write the compiler configuration to `libtool'.
7574m4_defun([_LT_LANG_RC_CONFIG],
7575[AC_REQUIRE([LT_PROG_RC])dnl
7576AC_LANG_SAVE
7577
7578# Source file extension for RC test sources.
7579ac_ext=rc
7580
7581# Object file extension for compiled RC test sources.
7582objext=o
7583_LT_TAGVAR(objext, $1)=$objext
7584
7585# Code to be used in simple compile tests
7586lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7587
7588# Code to be used in simple link tests
7589lt_simple_link_test_code="$lt_simple_compile_test_code"
7590
7591# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7592_LT_TAG_COMPILER
7593
7594# save warnings/boilerplate of simple test code
7595_LT_COMPILER_BOILERPLATE
7596_LT_LINKER_BOILERPLATE
7597
7598# Allow CC to be a program name with arguments.
7599lt_save_CC="$CC"
7600lt_save_CFLAGS=$CFLAGS
7601lt_save_GCC=$GCC
7602GCC=
7603CC=${RC-"windres"}
7604CFLAGS=
7605compiler=$CC
7606_LT_TAGVAR(compiler, $1)=$CC
7607_LT_CC_BASENAME([$compiler])
7608_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7609
7610if test -n "$compiler"; then
7611 :
7612 _LT_CONFIG($1)
7613fi
7614
7615GCC=$lt_save_GCC
7616AC_LANG_RESTORE
7617CC=$lt_save_CC
7618CFLAGS=$lt_save_CFLAGS
7619])# _LT_LANG_RC_CONFIG
7620
7621
7622# LT_PROG_GCJ
7623# -----------
7624AC_DEFUN([LT_PROG_GCJ],
7625[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7626 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7627 [AC_CHECK_TOOL(GCJ, gcj,)
7628 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7629 AC_SUBST(GCJFLAGS)])])[]dnl
7630])
7631
7632# Old name:
7633AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7634dnl aclocal-1.4 backwards compatibility:
7635dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7636
7637
7638# LT_PROG_GO
7639# ----------
7640AC_DEFUN([LT_PROG_GO],
7641[AC_CHECK_TOOL(GOC, gccgo,)
7642])
7643
7644
7645# LT_PROG_RC
7646# ----------
7647AC_DEFUN([LT_PROG_RC],
7648[AC_CHECK_TOOL(RC, windres,)
7649])
7650
7651# Old name:
7652AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7653dnl aclocal-1.4 backwards compatibility:
7654dnl AC_DEFUN([LT_AC_PROG_RC], [])
7655
7656
7657# _LT_DECL_EGREP
7658# --------------
7659# If we don't have a new enough Autoconf to choose the best grep
7660# available, choose the one first in the user's PATH.
7661m4_defun([_LT_DECL_EGREP],
7662[AC_REQUIRE([AC_PROG_EGREP])dnl
7663AC_REQUIRE([AC_PROG_FGREP])dnl
7664test -z "$GREP" && GREP=grep
7665_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7666_LT_DECL([], [EGREP], [1], [An ERE matcher])
7667_LT_DECL([], [FGREP], [1], [A literal string matcher])
7668dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7669AC_SUBST([GREP])
7670])
7671
7672
7673# _LT_DECL_OBJDUMP
7674# --------------
7675# If we don't have a new enough Autoconf to choose the best objdump
7676# available, choose the one first in the user's PATH.
7677m4_defun([_LT_DECL_OBJDUMP],
7678[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7679test -z "$OBJDUMP" && OBJDUMP=objdump
7680_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7681AC_SUBST([OBJDUMP])
7682])
7683
7684# _LT_DECL_DLLTOOL
7685# ----------------
7686# Ensure DLLTOOL variable is set.
7687m4_defun([_LT_DECL_DLLTOOL],
7688[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7689test -z "$DLLTOOL" && DLLTOOL=dlltool
7690_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7691AC_SUBST([DLLTOOL])
7692])
7693
7694# _LT_DECL_SED
7695# ------------
7696# Check for a fully-functional sed program, that truncates
7697# as few characters as possible. Prefer GNU sed if found.
7698m4_defun([_LT_DECL_SED],
7699[AC_PROG_SED
7700test -z "$SED" && SED=sed
7701Xsed="$SED -e 1s/^X//"
7702_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7703_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7704 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7705])# _LT_DECL_SED
7706
7707m4_ifndef([AC_PROG_SED], [
7708# NOTE: This macro has been submitted for inclusion into #
7709# GNU Autoconf as AC_PROG_SED. When it is available in #
7710# a released version of Autoconf we should remove this #
7711# macro and use it instead. #
7712
7713m4_defun([AC_PROG_SED],
7714[AC_MSG_CHECKING([for a sed that does not truncate output])
7715AC_CACHE_VAL(lt_cv_path_SED,
7716[# Loop through the user's path and test for sed and gsed.
7717# Then use that list of sed's as ones to test for truncation.
7718as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7719for as_dir in $PATH
7720do
7721 IFS=$as_save_IFS
7722 test -z "$as_dir" && as_dir=.
7723 for lt_ac_prog in sed gsed; do
7724 for ac_exec_ext in '' $ac_executable_extensions; do
7725 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7726 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7727 fi
7728 done
7729 done
7730done
7731IFS=$as_save_IFS
7732lt_ac_max=0
7733lt_ac_count=0
7734# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7735# along with /bin/sed that truncates output.
7736for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7737 test ! -f $lt_ac_sed && continue
7738 cat /dev/null > conftest.in
7739 lt_ac_count=0
7740 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7741 # Check for GNU sed and select it if it is found.
7742 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7743 lt_cv_path_SED=$lt_ac_sed
7744 break
7745 fi
7746 while true; do
7747 cat conftest.in conftest.in >conftest.tmp
7748 mv conftest.tmp conftest.in
7749 cp conftest.in conftest.nl
7750 echo >>conftest.nl
7751 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7752 cmp -s conftest.out conftest.nl || break
7753 # 10000 chars as input seems more than enough
7754 test $lt_ac_count -gt 10 && break
7755 lt_ac_count=`expr $lt_ac_count + 1`
7756 if test $lt_ac_count -gt $lt_ac_max; then
7757 lt_ac_max=$lt_ac_count
7758 lt_cv_path_SED=$lt_ac_sed
7759 fi
7760 done
7761done
7762])
7763SED=$lt_cv_path_SED
7764AC_SUBST([SED])
7765AC_MSG_RESULT([$SED])
7766])#AC_PROG_SED
7767])#m4_ifndef
7768
7769# Old name:
7770AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7771dnl aclocal-1.4 backwards compatibility:
7772dnl AC_DEFUN([LT_AC_PROG_SED], [])
7773
7774
7775# _LT_CHECK_SHELL_FEATURES
7776# ------------------------
7777# Find out whether the shell is Bourne or XSI compatible,
7778# or has some other useful features.
7779m4_defun([_LT_CHECK_SHELL_FEATURES],
7780[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7781# Try some XSI features
7782xsi_shell=no
7783( _lt_dummy="a/b/c"
7784 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7785 = c,a/b,b/c, \
7786 && eval 'test $(( 1 + 1 )) -eq 2 \
7787 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7788 && xsi_shell=yes
7789AC_MSG_RESULT([$xsi_shell])
7790_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7791
7792AC_MSG_CHECKING([whether the shell understands "+="])
7793lt_shell_append=no
7794( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7795 >/dev/null 2>&1 \
7796 && lt_shell_append=yes
7797AC_MSG_RESULT([$lt_shell_append])
7798_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7799
7800if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7801 lt_unset=unset
7802else
7803 lt_unset=false
7804fi
7805_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7806
7807# test EBCDIC or ASCII
7808case `echo X|tr X '\101'` in
7809 A) # ASCII based system
7810 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7811 lt_SP2NL='tr \040 \012'
7812 lt_NL2SP='tr \015\012 \040\040'
7813 ;;
7814 *) # EBCDIC based system
7815 lt_SP2NL='tr \100 \n'
7816 lt_NL2SP='tr \r\n \100\100'
7817 ;;
7818esac
7819_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7820_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7821])# _LT_CHECK_SHELL_FEATURES
7822
7823
7824# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7825# ------------------------------------------------------
7826# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7827# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7828m4_defun([_LT_PROG_FUNCTION_REPLACE],
7829[dnl {
7830sed -e '/^$1 ()$/,/^} # $1 /c\
7831$1 ()\
7832{\
7833m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
7834} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7835 && mv -f "$cfgfile.tmp" "$cfgfile" \
7836 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7837test 0 -eq $? || _lt_function_replace_fail=:
7838])
7839
7840
7841# _LT_PROG_REPLACE_SHELLFNS
7842# -------------------------
7843# Replace existing portable implementations of several shell functions with
7844# equivalent extended shell implementations where those features are available..
7845m4_defun([_LT_PROG_REPLACE_SHELLFNS],
7846[if test x"$xsi_shell" = xyes; then
7847 _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7848 case ${1} in
7849 */*) func_dirname_result="${1%/*}${2}" ;;
7850 * ) func_dirname_result="${3}" ;;
7851 esac])
7852
7853 _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7854 func_basename_result="${1##*/}"])
7855
7856 _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7857 case ${1} in
7858 */*) func_dirname_result="${1%/*}${2}" ;;
7859 * ) func_dirname_result="${3}" ;;
7860 esac
7861 func_basename_result="${1##*/}"])
7862
7863 _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7864 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7865 # positional parameters, so assign one to ordinary parameter first.
7866 func_stripname_result=${3}
7867 func_stripname_result=${func_stripname_result#"${1}"}
7868 func_stripname_result=${func_stripname_result%"${2}"}])
7869
7870 _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7871 func_split_long_opt_name=${1%%=*}
7872 func_split_long_opt_arg=${1#*=}])
7873
7874 _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7875 func_split_short_opt_arg=${1#??}
7876 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7877
7878 _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7879 case ${1} in
7880 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7881 *) func_lo2o_result=${1} ;;
7882 esac])
7883
7884 _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
7885
7886 _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
7887
7888 _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
7889fi
7890
7891if test x"$lt_shell_append" = xyes; then
7892 _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
7893
7894 _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7895 func_quote_for_eval "${2}"
7896dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7897 eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7898
7899 # Save a `func_append' function call where possible by direct use of '+='
7900 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7901 && mv -f "$cfgfile.tmp" "$cfgfile" \
7902 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7903 test 0 -eq $? || _lt_function_replace_fail=:
7904else
7905 # Save a `func_append' function call even when '+=' is not available
7906 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7907 && mv -f "$cfgfile.tmp" "$cfgfile" \
7908 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7909 test 0 -eq $? || _lt_function_replace_fail=:
7910fi
7911
7912if test x"$_lt_function_replace_fail" = x":"; then
7913 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7914fi
7915])
7916
7917# _LT_PATH_CONVERSION_FUNCTIONS
7918# -----------------------------
7919# Determine which file name conversion functions should be used by
7920# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
7921# for certain cross-compile configurations and native mingw.
7922m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7923[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7924AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7925AC_MSG_CHECKING([how to convert $build file names to $host format])
7926AC_CACHE_VAL(lt_cv_to_host_file_cmd,
7927[case $host in
7928 *-*-mingw* )
7929 case $build in
7930 *-*-mingw* ) # actually msys
7931 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7932 ;;
7933 *-*-cygwin* )
7934 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7935 ;;
7936 * ) # otherwise, assume *nix
7937 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7938 ;;
7939 esac
7940 ;;
7941 *-*-cygwin* )
7942 case $build in
7943 *-*-mingw* ) # actually msys
7944 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7945 ;;
7946 *-*-cygwin* )
7947 lt_cv_to_host_file_cmd=func_convert_file_noop
7948 ;;
7949 * ) # otherwise, assume *nix
7950 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7951 ;;
7952 esac
7953 ;;
7954 * ) # unhandled hosts (and "normal" native builds)
7955 lt_cv_to_host_file_cmd=func_convert_file_noop
7956 ;;
7957esac
7958])
7959to_host_file_cmd=$lt_cv_to_host_file_cmd
7960AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7961_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7962 [0], [convert $build file names to $host format])dnl
7963
7964AC_MSG_CHECKING([how to convert $build file names to toolchain format])
7965AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7966[#assume ordinary cross tools, or native build.
7967lt_cv_to_tool_file_cmd=func_convert_file_noop
7968case $host in
7969 *-*-mingw* )
7970 case $build in
7971 *-*-mingw* ) # actually msys
7972 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7973 ;;
7974 esac
7975 ;;
7976esac
7977])
7978to_tool_file_cmd=$lt_cv_to_tool_file_cmd
7979AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7980_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7981 [0], [convert $build files to toolchain format])dnl
7982])# _LT_PATH_CONVERSION_FUNCTIONS
7983
7984# Helper functions for option handling. -*- Autoconf -*-
7985#
7986# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
7987# Inc.
7988# Written by Gary V. Vaughan, 2004
7989#
7990# This file is free software; the Free Software Foundation gives
7991# unlimited permission to copy and/or distribute it, with or without
7992# modifications, as long as this notice is preserved.
7993
7994# serial 7 ltoptions.m4
7995
7996# This is to help aclocal find these macros, as it can't see m4_define.
7997AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7998
7999
8000# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8001# ------------------------------------------
8002m4_define([_LT_MANGLE_OPTION],
8003[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8004
8005
8006# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8007# ---------------------------------------
8008# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8009# matching handler defined, dispatch to it. Other OPTION-NAMEs are
8010# saved as a flag.
8011m4_define([_LT_SET_OPTION],
8012[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8013m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8014 _LT_MANGLE_DEFUN([$1], [$2]),
8015 [m4_warning([Unknown $1 option `$2'])])[]dnl
8016])
8017
8018
8019# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8020# ------------------------------------------------------------
8021# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8022m4_define([_LT_IF_OPTION],
8023[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8024
8025
8026# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8027# -------------------------------------------------------
8028# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8029# are set.
8030m4_define([_LT_UNLESS_OPTIONS],
8031[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8032 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8033 [m4_define([$0_found])])])[]dnl
8034m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8035])[]dnl
8036])
8037
8038
8039# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8040# ----------------------------------------
8041# OPTION-LIST is a space-separated list of Libtool options associated
8042# with MACRO-NAME. If any OPTION has a matching handler declared with
8043# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8044# the unknown option and exit.
8045m4_defun([_LT_SET_OPTIONS],
8046[# Set options
8047m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8048 [_LT_SET_OPTION([$1], _LT_Option)])
8049
8050m4_if([$1],[LT_INIT],[
8051 dnl
8052 dnl Simply set some default values (i.e off) if boolean options were not
8053 dnl specified:
8054 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8055 ])
8056 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8057 ])
8058 dnl
8059 dnl If no reference was made to various pairs of opposing options, then
8060 dnl we run the default mode handler for the pair. For example, if neither
8061 dnl `shared' nor `disable-shared' was passed, we enable building of shared
8062 dnl archives by default:
8063 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8064 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8065 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8066 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8067 [_LT_ENABLE_FAST_INSTALL])
8068 ])
8069])# _LT_SET_OPTIONS
8070
8071
8072
8073# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8074# -----------------------------------------
8075m4_define([_LT_MANGLE_DEFUN],
8076[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8077
8078
8079# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8080# -----------------------------------------------
8081m4_define([LT_OPTION_DEFINE],
8082[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8083])# LT_OPTION_DEFINE
8084
8085
8086# dlopen
8087# ------
8088LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8089])
8090
8091AU_DEFUN([AC_LIBTOOL_DLOPEN],
8092[_LT_SET_OPTION([LT_INIT], [dlopen])
8093AC_DIAGNOSE([obsolete],
8094[$0: Remove this warning and the call to _LT_SET_OPTION when you
8095put the `dlopen' option into LT_INIT's first parameter.])
8096])
8097
8098dnl aclocal-1.4 backwards compatibility:
8099dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8100
8101
8102# win32-dll
8103# ---------
8104# Declare package support for building win32 dll's.
8105LT_OPTION_DEFINE([LT_INIT], [win32-dll],
8106[enable_win32_dll=yes
8107
8108case $host in
8109*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8110 AC_CHECK_TOOL(AS, as, false)
8111 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8112 AC_CHECK_TOOL(OBJDUMP, objdump, false)
8113 ;;
8114esac
8115
8116test -z "$AS" && AS=as
8117_LT_DECL([], [AS], [1], [Assembler program])dnl
8118
8119test -z "$DLLTOOL" && DLLTOOL=dlltool
8120_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8121
8122test -z "$OBJDUMP" && OBJDUMP=objdump
8123_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8124])# win32-dll
8125
8126AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8127[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8128_LT_SET_OPTION([LT_INIT], [win32-dll])
8129AC_DIAGNOSE([obsolete],
8130[$0: Remove this warning and the call to _LT_SET_OPTION when you
8131put the `win32-dll' option into LT_INIT's first parameter.])
8132])
8133
8134dnl aclocal-1.4 backwards compatibility:
8135dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8136
8137
8138# _LT_ENABLE_SHARED([DEFAULT])
8139# ----------------------------
8140# implement the --enable-shared flag, and supports the `shared' and
8141# `disable-shared' LT_INIT options.
8142# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8143m4_define([_LT_ENABLE_SHARED],
8144[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8145AC_ARG_ENABLE([shared],
8146 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8147 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8148 [p=${PACKAGE-default}
8149 case $enableval in
8150 yes) enable_shared=yes ;;
8151 no) enable_shared=no ;;
8152 *)
8153 enable_shared=no
8154 # Look at the argument we got. We use all the common list separators.
8155 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8156 for pkg in $enableval; do
8157 IFS="$lt_save_ifs"
8158 if test "X$pkg" = "X$p"; then
8159 enable_shared=yes
8160 fi
8161 done
8162 IFS="$lt_save_ifs"
8163 ;;
8164 esac],
8165 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8166
8167 _LT_DECL([build_libtool_libs], [enable_shared], [0],
8168 [Whether or not to build shared libraries])
8169])# _LT_ENABLE_SHARED
8170
8171LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8172LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8173
8174# Old names:
8175AC_DEFUN([AC_ENABLE_SHARED],
8176[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8177])
8178
8179AC_DEFUN([AC_DISABLE_SHARED],
8180[_LT_SET_OPTION([LT_INIT], [disable-shared])
8181])
8182
8183AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8184AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8185
8186dnl aclocal-1.4 backwards compatibility:
8187dnl AC_DEFUN([AM_ENABLE_SHARED], [])
8188dnl AC_DEFUN([AM_DISABLE_SHARED], [])
8189
8190
8191
8192# _LT_ENABLE_STATIC([DEFAULT])
8193# ----------------------------
8194# implement the --enable-static flag, and support the `static' and
8195# `disable-static' LT_INIT options.
8196# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8197m4_define([_LT_ENABLE_STATIC],
8198[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8199AC_ARG_ENABLE([static],
8200 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8201 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8202 [p=${PACKAGE-default}
8203 case $enableval in
8204 yes) enable_static=yes ;;
8205 no) enable_static=no ;;
8206 *)
8207 enable_static=no
8208 # Look at the argument we got. We use all the common list separators.
8209 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8210 for pkg in $enableval; do
8211 IFS="$lt_save_ifs"
8212 if test "X$pkg" = "X$p"; then
8213 enable_static=yes
8214 fi
8215 done
8216 IFS="$lt_save_ifs"
8217 ;;
8218 esac],
8219 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8220
8221 _LT_DECL([build_old_libs], [enable_static], [0],
8222 [Whether or not to build static libraries])
8223])# _LT_ENABLE_STATIC
8224
8225LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8226LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8227
8228# Old names:
8229AC_DEFUN([AC_ENABLE_STATIC],
8230[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8231])
8232
8233AC_DEFUN([AC_DISABLE_STATIC],
8234[_LT_SET_OPTION([LT_INIT], [disable-static])
8235])
8236
8237AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8238AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8239
8240dnl aclocal-1.4 backwards compatibility:
8241dnl AC_DEFUN([AM_ENABLE_STATIC], [])
8242dnl AC_DEFUN([AM_DISABLE_STATIC], [])
8243
8244
8245
8246# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8247# ----------------------------------
8248# implement the --enable-fast-install flag, and support the `fast-install'
8249# and `disable-fast-install' LT_INIT options.
8250# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
8251m4_define([_LT_ENABLE_FAST_INSTALL],
8252[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8253AC_ARG_ENABLE([fast-install],
8254 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8255 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8256 [p=${PACKAGE-default}
8257 case $enableval in
8258 yes) enable_fast_install=yes ;;
8259 no) enable_fast_install=no ;;
8260 *)
8261 enable_fast_install=no
8262 # Look at the argument we got. We use all the common list separators.
8263 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8264 for pkg in $enableval; do
8265 IFS="$lt_save_ifs"
8266 if test "X$pkg" = "X$p"; then
8267 enable_fast_install=yes
8268 fi
8269 done
8270 IFS="$lt_save_ifs"
8271 ;;
8272 esac],
8273 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8274
8275_LT_DECL([fast_install], [enable_fast_install], [0],
8276 [Whether or not to optimize for fast installation])dnl
8277])# _LT_ENABLE_FAST_INSTALL
8278
8279LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8280LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8281
8282# Old names:
8283AU_DEFUN([AC_ENABLE_FAST_INSTALL],
8284[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8285AC_DIAGNOSE([obsolete],
8286[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8287the `fast-install' option into LT_INIT's first parameter.])
8288])
8289
8290AU_DEFUN([AC_DISABLE_FAST_INSTALL],
8291[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8292AC_DIAGNOSE([obsolete],
8293[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8294the `disable-fast-install' option into LT_INIT's first parameter.])
8295])
8296
8297dnl aclocal-1.4 backwards compatibility:
8298dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8299dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8300
8301
8302# _LT_WITH_PIC([MODE])
8303# --------------------
8304# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8305# LT_INIT options.
8306# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
8307m4_define([_LT_WITH_PIC],
8308[AC_ARG_WITH([pic],
8309 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8310 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8311 [lt_p=${PACKAGE-default}
8312 case $withval in
8313 yes|no) pic_mode=$withval ;;
8314 *)
8315 pic_mode=default
8316 # Look at the argument we got. We use all the common list separators.
8317 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8318 for lt_pkg in $withval; do
8319 IFS="$lt_save_ifs"
8320 if test "X$lt_pkg" = "X$lt_p"; then
8321 pic_mode=yes
8322 fi
8323 done
8324 IFS="$lt_save_ifs"
8325 ;;
8326 esac],
8327 [pic_mode=default])
8328
8329test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8330
8331_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8332])# _LT_WITH_PIC
8333
8334LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8335LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8336
8337# Old name:
8338AU_DEFUN([AC_LIBTOOL_PICMODE],
8339[_LT_SET_OPTION([LT_INIT], [pic-only])
8340AC_DIAGNOSE([obsolete],
8341[$0: Remove this warning and the call to _LT_SET_OPTION when you
8342put the `pic-only' option into LT_INIT's first parameter.])
8343])
8344
8345dnl aclocal-1.4 backwards compatibility:
8346dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8347
8348
8349m4_define([_LTDL_MODE], [])
8350LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8351 [m4_define([_LTDL_MODE], [nonrecursive])])
8352LT_OPTION_DEFINE([LTDL_INIT], [recursive],
8353 [m4_define([_LTDL_MODE], [recursive])])
8354LT_OPTION_DEFINE([LTDL_INIT], [subproject],
8355 [m4_define([_LTDL_MODE], [subproject])])
8356
8357m4_define([_LTDL_TYPE], [])
8358LT_OPTION_DEFINE([LTDL_INIT], [installable],
8359 [m4_define([_LTDL_TYPE], [installable])])
8360LT_OPTION_DEFINE([LTDL_INIT], [convenience],
8361 [m4_define([_LTDL_TYPE], [convenience])])
8362
8363# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
8364#
8365# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8366# Written by Gary V. Vaughan, 2004
8367#
8368# This file is free software; the Free Software Foundation gives
8369# unlimited permission to copy and/or distribute it, with or without
8370# modifications, as long as this notice is preserved.
8371
8372# serial 6 ltsugar.m4
8373
8374# This is to help aclocal find these macros, as it can't see m4_define.
8375AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8376
8377
8378# lt_join(SEP, ARG1, [ARG2...])
8379# -----------------------------
8380# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8381# associated separator.
8382# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8383# versions in m4sugar had bugs.
8384m4_define([lt_join],
8385[m4_if([$#], [1], [],
8386 [$#], [2], [[$2]],
8387 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8388m4_define([_lt_join],
8389[m4_if([$#$2], [2], [],
8390 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8391
8392
8393# lt_car(LIST)
8394# lt_cdr(LIST)
8395# ------------
8396# Manipulate m4 lists.
8397# These macros are necessary as long as will still need to support
8398# Autoconf-2.59 which quotes differently.
8399m4_define([lt_car], [[$1]])
8400m4_define([lt_cdr],
8401[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8402 [$#], 1, [],
8403 [m4_dquote(m4_shift($@))])])
8404m4_define([lt_unquote], $1)
8405
8406
8407# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8408# ------------------------------------------
8409# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8410# Note that neither SEPARATOR nor STRING are expanded; they are appended
8411# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8412# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8413# than defined and empty).
8414#
8415# This macro is needed until we can rely on Autoconf 2.62, since earlier
8416# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8417m4_define([lt_append],
8418[m4_define([$1],
8419 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8420
8421
8422
8423# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8424# ----------------------------------------------------------
8425# Produce a SEP delimited list of all paired combinations of elements of
8426# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
8427# has the form PREFIXmINFIXSUFFIXn.
8428# Needed until we can rely on m4_combine added in Autoconf 2.62.
8429m4_define([lt_combine],
8430[m4_if(m4_eval([$# > 3]), [1],
8431 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8432[[m4_foreach([_Lt_prefix], [$2],
8433 [m4_foreach([_Lt_suffix],
8434 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8435 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8436
8437
8438# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8439# -----------------------------------------------------------------------
8440# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8441# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8442m4_define([lt_if_append_uniq],
8443[m4_ifdef([$1],
8444 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8445 [lt_append([$1], [$2], [$3])$4],
8446 [$5])],
8447 [lt_append([$1], [$2], [$3])$4])])
8448
8449
8450# lt_dict_add(DICT, KEY, VALUE)
8451# -----------------------------
8452m4_define([lt_dict_add],
8453[m4_define([$1($2)], [$3])])
8454
8455
8456# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8457# --------------------------------------------
8458m4_define([lt_dict_add_subkey],
8459[m4_define([$1($2:$3)], [$4])])
8460
8461
8462# lt_dict_fetch(DICT, KEY, [SUBKEY])
8463# ----------------------------------
8464m4_define([lt_dict_fetch],
8465[m4_ifval([$3],
8466 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8467 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8468
8469
8470# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8471# -----------------------------------------------------------------
8472m4_define([lt_if_dict_fetch],
8473[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8474 [$5],
8475 [$6])])
8476
8477
8478# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8479# --------------------------------------------------------------
8480m4_define([lt_dict_filter],
8481[m4_if([$5], [], [],
8482 [lt_join(m4_quote(m4_default([$4], [[, ]])),
8483 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8484 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8485])
8486
8487# ltversion.m4 -- version numbers -*- Autoconf -*-
8488#
8489# Copyright (C) 2004 Free Software Foundation, Inc.
8490# Written by Scott James Remnant, 2004
8491#
8492# This file is free software; the Free Software Foundation gives
8493# unlimited permission to copy and/or distribute it, with or without
8494# modifications, as long as this notice is preserved.
8495
8496# @configure_input@
8497
8498# serial 3337 ltversion.m4
8499# This file is part of GNU Libtool
8500
8501m4_define([LT_PACKAGE_VERSION], [2.4.2])
8502m4_define([LT_PACKAGE_REVISION], [1.3337])
8503
8504AC_DEFUN([LTVERSION_VERSION],
8505[macro_version='2.4.2'
8506macro_revision='1.3337'
8507_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8508_LT_DECL(, macro_revision, 0)
8509])
8510
8511# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
8512#
8513# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8514# Written by Scott James Remnant, 2004.
8515#
8516# This file is free software; the Free Software Foundation gives
8517# unlimited permission to copy and/or distribute it, with or without
8518# modifications, as long as this notice is preserved.
8519
8520# serial 5 lt~obsolete.m4
8521
8522# These exist entirely to fool aclocal when bootstrapping libtool.
8523#
8524# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8525# which have later been changed to m4_define as they aren't part of the
8526# exported API, or moved to Autoconf or Automake where they belong.
8527#
8528# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
8529# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8530# using a macro with the same name in our local m4/libtool.m4 it'll
8531# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8532# and doesn't know about Autoconf macros at all.)
8533#
8534# So we provide this file, which has a silly filename so it's always
8535# included after everything else. This provides aclocal with the
8536# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8537# because those macros already exist, or will be overwritten later.
8538# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8539#
8540# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8541# Yes, that means every name once taken will need to remain here until
8542# we give up compatibility with versions before 1.7, at which point
8543# we need to keep only those names which we still refer to.
8544
8545# This is to help aclocal find these macros, as it can't see m4_define.
8546AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8547
8548m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8549m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
8550m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8551m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
8552m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8553m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
8554m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
8555m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8556m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
8557m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
8558m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
8559m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8560m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8561m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8562m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8563m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8564m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
8565m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8566m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8567m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
8568m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
8569m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8570m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8571m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8572m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8573m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8574m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8575m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8576m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
8577m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
8578m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
8579m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8580m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8581m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
8582m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
8583m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8584m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8585m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
8586m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8587m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
8588m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
8589m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
8590m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8591m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8592m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8593m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8594m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8595m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8596m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8597m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8598m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8599m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8600m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
8601m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
8602m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
8603m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
8604m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
8605m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
8606m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
8607m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
8608m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
8609
8610# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
8611# Foundation, Inc.
8612#
8613# This file is free software; the Free Software Foundation
8614# gives unlimited permission to copy and/or distribute it,
8615# with or without modifications, as long as this notice is preserved.
8616
8617# serial 1
8618
8619# AM_AUTOMAKE_VERSION(VERSION)
8620# ----------------------------
8621# Automake X.Y traces this macro to ensure aclocal.m4 has been
8622# generated from the m4 files accompanying Automake X.Y.
8623# (This private macro should not be called outside this file.)
8624AC_DEFUN([AM_AUTOMAKE_VERSION],
8625[am__api_version='1.11'
8626dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8627dnl require some minimum version. Point them to the right macro.
8628m4_if([$1], [1.11.2], [],
8629 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8630])
8631
8632# _AM_AUTOCONF_VERSION(VERSION)
8633# -----------------------------
8634# aclocal traces this macro to find the Autoconf version.
8635# This is a private macro too. Using m4_define simplifies
8636# the logic in aclocal, which can simply ignore this definition.
8637m4_define([_AM_AUTOCONF_VERSION], [])
8638
8639# AM_SET_CURRENT_AUTOMAKE_VERSION
8640# -------------------------------
8641# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8642# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8643AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8644[AM_AUTOMAKE_VERSION([1.11.2])dnl
8645m4_ifndef([AC_AUTOCONF_VERSION],
8646 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8647_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8648
8649# AM_AUX_DIR_EXPAND -*- Autoconf -*-
8650
8651# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
8652#
8653# This file is free software; the Free Software Foundation
8654# gives unlimited permission to copy and/or distribute it,
8655# with or without modifications, as long as this notice is preserved.
8656
8657# serial 1
8658
8659# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8660# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
8661# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
8662#
8663# Of course, Automake must honor this variable whenever it calls a
8664# tool from the auxiliary directory. The problem is that $srcdir (and
8665# therefore $ac_aux_dir as well) can be either absolute or relative,
8666# depending on how configure is run. This is pretty annoying, since
8667# it makes $ac_aux_dir quite unusable in subdirectories: in the top
8668# source directory, any form will work fine, but in subdirectories a
8669# relative path needs to be adjusted first.
8670#
8671# $ac_aux_dir/missing
8672# fails when called from a subdirectory if $ac_aux_dir is relative
8673# $top_srcdir/$ac_aux_dir/missing
8674# fails if $ac_aux_dir is absolute,
8675# fails when called from a subdirectory in a VPATH build with
8676# a relative $ac_aux_dir
8677#
8678# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8679# are both prefixed by $srcdir. In an in-source build this is usually
8680# harmless because $srcdir is `.', but things will broke when you
8681# start a VPATH build or use an absolute $srcdir.
8682#
8683# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8684# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
8685# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8686# and then we would define $MISSING as
8687# MISSING="\${SHELL} $am_aux_dir/missing"
8688# This will work as long as MISSING is not called from configure, because
8689# unfortunately $(top_srcdir) has no meaning in configure.
8690# However there are other variables, like CC, which are often used in
8691# configure, and could therefore not use this "fixed" $ac_aux_dir.
8692#
8693# Another solution, used here, is to always expand $ac_aux_dir to an
8694# absolute PATH. The drawback is that using absolute paths prevent a
8695# configured tree to be moved without reconfiguration.
8696
8697AC_DEFUN([AM_AUX_DIR_EXPAND],
8698[dnl Rely on autoconf to set up CDPATH properly.
8699AC_PREREQ([2.50])dnl
8700# expand $ac_aux_dir to an absolute path
8701am_aux_dir=`cd $ac_aux_dir && pwd`
8702])
8703
8704# AM_CONDITIONAL -*- Autoconf -*-
8705
8706# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
8707# Free Software Foundation, Inc.
8708#
8709# This file is free software; the Free Software Foundation
8710# gives unlimited permission to copy and/or distribute it,
8711# with or without modifications, as long as this notice is preserved.
8712
8713# serial 9
8714
8715# AM_CONDITIONAL(NAME, SHELL-CONDITION)
8716# -------------------------------------
8717# Define a conditional.
8718AC_DEFUN([AM_CONDITIONAL],
8719[AC_PREREQ(2.52)dnl
8720 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
8721 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8722AC_SUBST([$1_TRUE])dnl
8723AC_SUBST([$1_FALSE])dnl
8724_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8725_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8726m4_define([_AM_COND_VALUE_$1], [$2])dnl
8727if $2; then
8728 $1_TRUE=
8729 $1_FALSE='#'
8730else
8731 $1_TRUE='#'
8732 $1_FALSE=
8733fi
8734AC_CONFIG_COMMANDS_PRE(
8735[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8736 AC_MSG_ERROR([[conditional "$1" was never defined.
8737Usually this means the macro was only invoked conditionally.]])
8738fi])])
8739
8740# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
8741# 2010, 2011 Free Software Foundation, Inc.
8742#
8743# This file is free software; the Free Software Foundation
8744# gives unlimited permission to copy and/or distribute it,
8745# with or without modifications, as long as this notice is preserved.
8746
8747# serial 12
8748
8749# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
8750# written in clear, in which case automake, when reading aclocal.m4,
8751# will think it sees a *use*, and therefore will trigger all it's
8752# C support machinery. Also note that it means that autoscan, seeing
8753# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8754
8755
8756# _AM_DEPENDENCIES(NAME)
8757# ----------------------
8758# See how the compiler implements dependency checking.
8759# NAME is "CC", "CXX", "GCJ", or "OBJC".
8760# We try a few techniques and use that to set a single cache variable.
8761#
8762# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8763# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8764# dependency, and given that the user is not expected to run this macro,
8765# just rely on AC_PROG_CC.
8766AC_DEFUN([_AM_DEPENDENCIES],
8767[AC_REQUIRE([AM_SET_DEPDIR])dnl
8768AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8769AC_REQUIRE([AM_MAKE_INCLUDE])dnl
8770AC_REQUIRE([AM_DEP_TRACK])dnl
8771
8772ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
8773 [$1], CXX, [depcc="$CXX" am_compiler_list=],
8774 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8775 [$1], UPC, [depcc="$UPC" am_compiler_list=],
8776 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
8777 [depcc="$$1" am_compiler_list=])
8778
8779AC_CACHE_CHECK([dependency style of $depcc],
8780 [am_cv_$1_dependencies_compiler_type],
8781[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8782 # We make a subdir and do the tests there. Otherwise we can end up
8783 # making bogus files that we don't know about and never remove. For
8784 # instance it was reported that on HP-UX the gcc test will end up
8785 # making a dummy file named `D' -- because `-MD' means `put the output
8786 # in D'.
8787 rm -rf conftest.dir
8788 mkdir conftest.dir
8789 # Copy depcomp to subdir because otherwise we won't find it if we're
8790 # using a relative directory.
8791 cp "$am_depcomp" conftest.dir
8792 cd conftest.dir
8793 # We will build objects and dependencies in a subdirectory because
8794 # it helps to detect inapplicable dependency modes. For instance
8795 # both Tru64's cc and ICC support -MD to output dependencies as a
8796 # side effect of compilation, but ICC will put the dependencies in
8797 # the current directory while Tru64 will put them in the object
8798 # directory.
8799 mkdir sub
8800
8801 am_cv_$1_dependencies_compiler_type=none
8802 if test "$am_compiler_list" = ""; then
8803 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
8804 fi
8805 am__universal=false
8806 m4_case([$1], [CC],
8807 [case " $depcc " in #(
8808 *\ -arch\ *\ -arch\ *) am__universal=true ;;
8809 esac],
8810 [CXX],
8811 [case " $depcc " in #(
8812 *\ -arch\ *\ -arch\ *) am__universal=true ;;
8813 esac])
8814
8815 for depmode in $am_compiler_list; do
8816 # Setup a source with many dependencies, because some compilers
8817 # like to wrap large dependency lists on column 80 (with \), and
8818 # we should not choose a depcomp mode which is confused by this.
8819 #
8820 # We need to recreate these files for each test, as the compiler may
8821 # overwrite some of them when testing with obscure command lines.
8822 # This happens at least with the AIX C compiler.
8823 : > sub/conftest.c
8824 for i in 1 2 3 4 5 6; do
8825 echo '#include "conftst'$i'.h"' >> sub/conftest.c
8826 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
8827 # Solaris 8's {/usr,}/bin/sh.
8828 touch sub/conftst$i.h
8829 done
8830 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8831
8832 # We check with `-c' and `-o' for the sake of the "dashmstdout"
8833 # mode. It turns out that the SunPro C++ compiler does not properly
8834 # handle `-M -o', and we need to detect this. Also, some Intel
8835 # versions had trouble with output in subdirs
8836 am__obj=sub/conftest.${OBJEXT-o}
8837 am__minus_obj="-o $am__obj"
8838 case $depmode in
8839 gcc)
8840 # This depmode causes a compiler race in universal mode.
8841 test "$am__universal" = false || continue
8842 ;;
8843 nosideeffect)
8844 # after this tag, mechanisms are not by side-effect, so they'll
8845 # only be used when explicitly requested
8846 if test "x$enable_dependency_tracking" = xyes; then
8847 continue
8848 else
8849 break
8850 fi
8851 ;;
8852 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
8853 # This compiler won't grok `-c -o', but also, the minuso test has
8854 # not run yet. These depmodes are late enough in the game, and
8855 # so weak that their functioning should not be impacted.
8856 am__obj=conftest.${OBJEXT-o}
8857 am__minus_obj=
8858 ;;
8859 none) break ;;
8860 esac
8861 if depmode=$depmode \
8862 source=sub/conftest.c object=$am__obj \
8863 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8864 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
8865 >/dev/null 2>conftest.err &&
8866 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
8867 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8868 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
8869 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
8870 # icc doesn't choke on unknown options, it will just issue warnings
8871 # or remarks (even with -Werror). So we grep stderr for any message
8872 # that says an option was ignored or not supported.
8873 # When given -MP, icc 7.0 and 7.1 complain thusly:
8874 # icc: Command line warning: ignoring option '-M'; no argument required
8875 # The diagnosis changed in icc 8.0:
8876 # icc: Command line remark: option '-MP' not supported
8877 if (grep 'ignoring option' conftest.err ||
8878 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
8879 am_cv_$1_dependencies_compiler_type=$depmode
8880 break
8881 fi
8882 fi
8883 done
8884
8885 cd ..
8886 rm -rf conftest.dir
8887else
8888 am_cv_$1_dependencies_compiler_type=none
8889fi
8890])
8891AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
8892AM_CONDITIONAL([am__fastdep$1], [
8893 test "x$enable_dependency_tracking" != xno \
8894 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
8895])
8896
8897
8898# AM_SET_DEPDIR
8899# -------------
8900# Choose a directory name for dependency files.
8901# This macro is AC_REQUIREd in _AM_DEPENDENCIES
8902AC_DEFUN([AM_SET_DEPDIR],
8903[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
8904AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
8905])
8906
8907
8908# AM_DEP_TRACK
8909# ------------
8910AC_DEFUN([AM_DEP_TRACK],
8911[AC_ARG_ENABLE(dependency-tracking,
8912[ --disable-dependency-tracking speeds up one-time build
8913 --enable-dependency-tracking do not reject slow dependency extractors])
8914if test "x$enable_dependency_tracking" != xno; then
8915 am_depcomp="$ac_aux_dir/depcomp"
8916 AMDEPBACKSLASH='\'
8917 am__nodep='_no'
8918fi
8919AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
8920AC_SUBST([AMDEPBACKSLASH])dnl
8921_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
8922AC_SUBST([am__nodep])dnl
8923_AM_SUBST_NOTMAKE([am__nodep])dnl
8924])
8925
8926# Generate code to set up dependency tracking. -*- Autoconf -*-
8927
8928# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
8929# Free Software Foundation, Inc.
8930#
8931# This file is free software; the Free Software Foundation
8932# gives unlimited permission to copy and/or distribute it,
8933# with or without modifications, as long as this notice is preserved.
8934
8935#serial 5
8936
8937# _AM_OUTPUT_DEPENDENCY_COMMANDS
8938# ------------------------------
8939AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
8940[{
8941 # Autoconf 2.62 quotes --file arguments for eval, but not when files
8942 # are listed without --file. Let's play safe and only enable the eval
8943 # if we detect the quoting.
8944 case $CONFIG_FILES in
8945 *\'*) eval set x "$CONFIG_FILES" ;;
8946 *) set x $CONFIG_FILES ;;
8947 esac
8948 shift
8949 for mf
8950 do
8951 # Strip MF so we end up with the name of the file.
8952 mf=`echo "$mf" | sed -e 's/:.*$//'`
8953 # Check whether this is an Automake generated Makefile or not.
8954 # We used to match only the files named `Makefile.in', but
8955 # some people rename them; so instead we look at the file content.
8956 # Grep'ing the first line is not enough: some people post-process
8957 # each Makefile.in and add a new line on top of each file to say so.
8958 # Grep'ing the whole file is not good either: AIX grep has a line
8959 # limit of 2048, but all sed's we know have understand at least 4000.
8960 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
8961 dirpart=`AS_DIRNAME("$mf")`
8962 else
8963 continue
8964 fi
8965 # Extract the definition of DEPDIR, am__include, and am__quote
8966 # from the Makefile without running `make'.
8967 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
8968 test -z "$DEPDIR" && continue
8969 am__include=`sed -n 's/^am__include = //p' < "$mf"`
8970 test -z "am__include" && continue
8971 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
8972 # When using ansi2knr, U may be empty or an underscore; expand it
8973 U=`sed -n 's/^U = //p' < "$mf"`
8974 # Find all dependency output files, they are included files with
8975 # $(DEPDIR) in their names. We invoke sed twice because it is the
8976 # simplest approach to changing $(DEPDIR) to its actual value in the
8977 # expansion.
8978 for file in `sed -n "
8979 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
8980 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
8981 # Make sure the directory exists.
8982 test -f "$dirpart/$file" && continue
8983 fdir=`AS_DIRNAME(["$file"])`
8984 AS_MKDIR_P([$dirpart/$fdir])
8985 # echo "creating $dirpart/$file"
8986 echo '# dummy' > "$dirpart/$file"
8987 done
8988 done
8989}
8990])# _AM_OUTPUT_DEPENDENCY_COMMANDS
8991
8992
8993# AM_OUTPUT_DEPENDENCY_COMMANDS
8994# -----------------------------
8995# This macro should only be invoked once -- use via AC_REQUIRE.
8996#
8997# This code is only required when automatic dependency tracking
8998# is enabled. FIXME. This creates each `.P' file that we will
8999# need in order to bootstrap the dependency handling code.
9000AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9001[AC_CONFIG_COMMANDS([depfiles],
9002 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9003 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
9004])
9005
9006# Do all the work for Automake. -*- Autoconf -*-
9007
9008# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
9009# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
9010#
9011# This file is free software; the Free Software Foundation
9012# gives unlimited permission to copy and/or distribute it,
9013# with or without modifications, as long as this notice is preserved.
9014
9015# serial 16
9016
9017# This macro actually does too much. Some checks are only needed if
9018# your package does certain things. But this isn't really a big deal.
9019
9020# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9021# AM_INIT_AUTOMAKE([OPTIONS])
9022# -----------------------------------------------
9023# The call with PACKAGE and VERSION arguments is the old style
9024# call (pre autoconf-2.50), which is being phased out. PACKAGE
9025# and VERSION should now be passed to AC_INIT and removed from
9026# the call to AM_INIT_AUTOMAKE.
9027# We support both call styles for the transition. After
9028# the next Automake release, Autoconf can make the AC_INIT
9029# arguments mandatory, and then we can depend on a new Autoconf
9030# release and drop the old call support.
9031AC_DEFUN([AM_INIT_AUTOMAKE],
9032[AC_PREREQ([2.62])dnl
9033dnl Autoconf wants to disallow AM_ names. We explicitly allow
9034dnl the ones we care about.
9035m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9036AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9037AC_REQUIRE([AC_PROG_INSTALL])dnl
9038if test "`cd $srcdir && pwd`" != "`pwd`"; then
9039 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9040 # is not polluted with repeated "-I."
9041 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9042 # test to see if srcdir already configured
9043 if test -f $srcdir/config.status; then
9044 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9045 fi
9046fi
9047
9048# test whether we have cygpath
9049if test -z "$CYGPATH_W"; then
9050 if (cygpath --version) >/dev/null 2>/dev/null; then
9051 CYGPATH_W='cygpath -w'
9052 else
9053 CYGPATH_W=echo
9054 fi
9055fi
9056AC_SUBST([CYGPATH_W])
9057
9058# Define the identity of the package.
9059dnl Distinguish between old-style and new-style calls.
9060m4_ifval([$2],
9061[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9062 AC_SUBST([PACKAGE], [$1])dnl
9063 AC_SUBST([VERSION], [$2])],
9064[_AM_SET_OPTIONS([$1])dnl
9065dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9066m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
9067 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9068 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9069 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
9070
9071_AM_IF_OPTION([no-define],,
9072[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
9073 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
9074
9075# Some tools Automake needs.
9076AC_REQUIRE([AM_SANITY_CHECK])dnl
9077AC_REQUIRE([AC_ARG_PROGRAM])dnl
9078AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
9079AM_MISSING_PROG(AUTOCONF, autoconf)
9080AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
9081AM_MISSING_PROG(AUTOHEADER, autoheader)
9082AM_MISSING_PROG(MAKEINFO, makeinfo)
9083AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9084AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9085AC_REQUIRE([AM_PROG_MKDIR_P])dnl
9086# We need awk for the "check" target. The system "awk" is bad on
9087# some platforms.
9088AC_REQUIRE([AC_PROG_AWK])dnl
9089AC_REQUIRE([AC_PROG_MAKE_SET])dnl
9090AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9091_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9092 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9093 [_AM_PROG_TAR([v7])])])
9094_AM_IF_OPTION([no-dependencies],,
9095[AC_PROVIDE_IFELSE([AC_PROG_CC],
9096 [_AM_DEPENDENCIES(CC)],
9097 [define([AC_PROG_CC],
9098 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
9099AC_PROVIDE_IFELSE([AC_PROG_CXX],
9100 [_AM_DEPENDENCIES(CXX)],
9101 [define([AC_PROG_CXX],
9102 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
9103AC_PROVIDE_IFELSE([AC_PROG_OBJC],
9104 [_AM_DEPENDENCIES(OBJC)],
9105 [define([AC_PROG_OBJC],
9106 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
9107])
9108_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
9109dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
9110dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
9111dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
9112AC_CONFIG_COMMANDS_PRE(dnl
9113[m4_provide_if([_AM_COMPILER_EXEEXT],
9114 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9115])
9116
9117dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
9118dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9119dnl mangled by Autoconf and run in a shell conditional statement.
9120m4_define([_AC_COMPILER_EXEEXT],
9121m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9122
9123
9124# When config.status generates a header, we must update the stamp-h file.
9125# This file resides in the same directory as the config header
9126# that is generated. The stamp files are numbered to have different names.
9127
9128# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9129# loop where config.status creates the headers, so we can generate
9130# our stamp files there.
9131AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9132[# Compute $1's index in $config_headers.
9133_am_arg=$1
9134_am_stamp_count=1
9135for _am_header in $config_headers :; do
9136 case $_am_header in
9137 $_am_arg | $_am_arg:* )
9138 break ;;
9139 * )
9140 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9141 esac
9142done
9143echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9144
9145# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
9146# Inc.
9147#
9148# This file is free software; the Free Software Foundation
9149# gives unlimited permission to copy and/or distribute it,
9150# with or without modifications, as long as this notice is preserved.
9151
9152# serial 1
9153
9154# AM_PROG_INSTALL_SH
9155# ------------------
9156# Define $install_sh.
9157AC_DEFUN([AM_PROG_INSTALL_SH],
9158[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9159if test x"${install_sh}" != xset; then
9160 case $am_aux_dir in
9161 *\ * | *\ *)
9162 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9163 *)
9164 install_sh="\${SHELL} $am_aux_dir/install-sh"
9165 esac
9166fi
9167AC_SUBST(install_sh)])
9168
9169# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
9170#
9171# This file is free software; the Free Software Foundation
9172# gives unlimited permission to copy and/or distribute it,
9173# with or without modifications, as long as this notice is preserved.
9174
9175# serial 2
9176
9177# Check whether the underlying file-system supports filenames
9178# with a leading dot. For instance MS-DOS doesn't.
9179AC_DEFUN([AM_SET_LEADING_DOT],
9180[rm -rf .tst 2>/dev/null
9181mkdir .tst 2>/dev/null
9182if test -d .tst; then
9183 am__leading_dot=.
9184else
9185 am__leading_dot=_
9186fi
9187rmdir .tst 2>/dev/null
9188AC_SUBST([am__leading_dot])])
9189
9190# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
9191# From Jim Meyering
9192
9193# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
9194# 2011 Free Software Foundation, Inc.
9195#
9196# This file is free software; the Free Software Foundation
9197# gives unlimited permission to copy and/or distribute it,
9198# with or without modifications, as long as this notice is preserved.
9199
9200# serial 5
9201
9202# AM_MAINTAINER_MODE([DEFAULT-MODE])
9203# ----------------------------------
9204# Control maintainer-specific portions of Makefiles.
9205# Default is to disable them, unless `enable' is passed literally.
9206# For symmetry, `disable' may be passed as well. Anyway, the user
9207# can override the default with the --enable/--disable switch.
9208AC_DEFUN([AM_MAINTAINER_MODE],
9209[m4_case(m4_default([$1], [disable]),
9210 [enable], [m4_define([am_maintainer_other], [disable])],
9211 [disable], [m4_define([am_maintainer_other], [enable])],
9212 [m4_define([am_maintainer_other], [enable])
9213 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
9214AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
9215 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
9216 AC_ARG_ENABLE([maintainer-mode],
9217[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
9218 (and sometimes confusing) to the casual installer],
9219 [USE_MAINTAINER_MODE=$enableval],
9220 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
9221 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
9222 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
9223 MAINT=$MAINTAINER_MODE_TRUE
9224 AC_SUBST([MAINT])dnl
9225]
9226)
9227
9228AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
9229
9230# Check to see how 'make' treats includes. -*- Autoconf -*-
9231
9232# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
9233#
9234# This file is free software; the Free Software Foundation
9235# gives unlimited permission to copy and/or distribute it,
9236# with or without modifications, as long as this notice is preserved.
9237
9238# serial 4
9239
9240# AM_MAKE_INCLUDE()
9241# -----------------
9242# Check to see how make treats includes.
9243AC_DEFUN([AM_MAKE_INCLUDE],
9244[am_make=${MAKE-make}
9245cat > confinc << 'END'
9246am__doit:
9247 @echo this is the am__doit target
9248.PHONY: am__doit
9249END
9250# If we don't find an include directive, just comment out the code.
9251AC_MSG_CHECKING([for style of include used by $am_make])
9252am__include="#"
9253am__quote=
9254_am_result=none
9255# First try GNU make style include.
9256echo "include confinc" > confmf
9257# Ignore all kinds of additional output from `make'.
9258case `$am_make -s -f confmf 2> /dev/null` in #(
9259*the\ am__doit\ target*)
9260 am__include=include
9261 am__quote=
9262 _am_result=GNU
9263 ;;
9264esac
9265# Now try BSD make style include.
9266if test "$am__include" = "#"; then
9267 echo '.include "confinc"' > confmf
9268 case `$am_make -s -f confmf 2> /dev/null` in #(
9269 *the\ am__doit\ target*)
9270 am__include=.include
9271 am__quote="\""
9272 _am_result=BSD
9273 ;;
9274 esac
9275fi
9276AC_SUBST([am__include])
9277AC_SUBST([am__quote])
9278AC_MSG_RESULT([$_am_result])
9279rm -f confinc confmf
9280])
9281
9282# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
9283
9284# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
9285# Free Software Foundation, Inc.
9286#
9287# This file is free software; the Free Software Foundation
9288# gives unlimited permission to copy and/or distribute it,
9289# with or without modifications, as long as this notice is preserved.
9290
9291# serial 6
9292
9293# AM_MISSING_PROG(NAME, PROGRAM)
9294# ------------------------------
9295AC_DEFUN([AM_MISSING_PROG],
9296[AC_REQUIRE([AM_MISSING_HAS_RUN])
9297$1=${$1-"${am_missing_run}$2"}
9298AC_SUBST($1)])
9299
9300
9301# AM_MISSING_HAS_RUN
9302# ------------------
9303# Define MISSING if not defined so far and test if it supports --run.
9304# If it does, set am_missing_run to use it, otherwise, to nothing.
9305AC_DEFUN([AM_MISSING_HAS_RUN],
9306[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9307AC_REQUIRE_AUX_FILE([missing])dnl
9308if test x"${MISSING+set}" != xset; then
9309 case $am_aux_dir in
9310 *\ * | *\ *)
9311 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
9312 *)
9313 MISSING="\${SHELL} $am_aux_dir/missing" ;;
9314 esac
9315fi
9316# Use eval to expand $SHELL
9317if eval "$MISSING --run true"; then
9318 am_missing_run="$MISSING --run "
9319else
9320 am_missing_run=
9321 AC_MSG_WARN([`missing' script is too old or missing])
9322fi
9323])
9324
9325# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
9326# Inc.
9327#
9328# This file is free software; the Free Software Foundation
9329# gives unlimited permission to copy and/or distribute it,
9330# with or without modifications, as long as this notice is preserved.
9331
9332# serial 1
9333
9334# AM_PROG_MKDIR_P
9335# ---------------
9336# Check for `mkdir -p'.
9337AC_DEFUN([AM_PROG_MKDIR_P],
9338[AC_PREREQ([2.60])dnl
9339AC_REQUIRE([AC_PROG_MKDIR_P])dnl
9340dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
9341dnl while keeping a definition of mkdir_p for backward compatibility.
9342dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
9343dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
9344dnl Makefile.ins that do not define MKDIR_P, so we do our own
9345dnl adjustment using top_builddir (which is defined more often than
9346dnl MKDIR_P).
9347AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
9348case $mkdir_p in
9349 [[\\/$]]* | ?:[[\\/]]*) ;;
9350 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
9351esac
9352])
9353
9354# Helper functions for option handling. -*- Autoconf -*-
9355
9356# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
9357# Foundation, Inc.
9358#
9359# This file is free software; the Free Software Foundation
9360# gives unlimited permission to copy and/or distribute it,
9361# with or without modifications, as long as this notice is preserved.
9362
9363# serial 5
9364
9365# _AM_MANGLE_OPTION(NAME)
9366# -----------------------
9367AC_DEFUN([_AM_MANGLE_OPTION],
9368[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
9369
9370# _AM_SET_OPTION(NAME)
9371# --------------------
9372# Set option NAME. Presently that only means defining a flag for this option.
9373AC_DEFUN([_AM_SET_OPTION],
9374[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
9375
9376# _AM_SET_OPTIONS(OPTIONS)
9377# ------------------------
9378# OPTIONS is a space-separated list of Automake options.
9379AC_DEFUN([_AM_SET_OPTIONS],
9380[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
9381
9382# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
9383# -------------------------------------------
9384# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9385AC_DEFUN([_AM_IF_OPTION],
9386[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
9387
9388# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006
9389# Free Software Foundation, Inc.
9390#
9391# This file is free software; the Free Software Foundation
9392# gives unlimited permission to copy and/or distribute it,
9393# with or without modifications, as long as this notice is preserved.
9394
9395# serial 5
9396
9397AC_DEFUN([AM_C_PROTOTYPES],
9398[AC_REQUIRE([AC_C_PROTOTYPES])
9399AC_DIAGNOSE([obsolete],
9400 [$0: automatic de-ANSI-fication support is deprecated])
9401if test "$ac_cv_prog_cc_stdc" != no; then
9402 U= ANSI2KNR=
9403else
9404 U=_ ANSI2KNR=./ansi2knr
9405fi
9406# Ensure some checks needed by ansi2knr itself.
9407AC_REQUIRE([AC_HEADER_STDC])
9408AC_CHECK_HEADERS([string.h])
9409AC_SUBST([U])dnl
9410AC_SUBST([ANSI2KNR])dnl
9411_AM_SUBST_NOTMAKE([ANSI2KNR])dnl
9412])
9413
9414AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
9415
9416# Check to make sure that the build environment is sane. -*- Autoconf -*-
9417
9418# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
9419# Free Software Foundation, Inc.
9420#
9421# This file is free software; the Free Software Foundation
9422# gives unlimited permission to copy and/or distribute it,
9423# with or without modifications, as long as this notice is preserved.
9424
9425# serial 5
9426
9427# AM_SANITY_CHECK
9428# ---------------
9429AC_DEFUN([AM_SANITY_CHECK],
9430[AC_MSG_CHECKING([whether build environment is sane])
9431# Just in case
9432sleep 1
9433echo timestamp > conftest.file
9434# Reject unsafe characters in $srcdir or the absolute working directory
9435# name. Accept space and tab only in the latter.
9436am_lf='
9437'
9438case `pwd` in
9439 *[[\\\"\#\$\&\'\`$am_lf]]*)
9440 AC_MSG_ERROR([unsafe absolute working directory name]);;
9441esac
9442case $srcdir in
9443 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
9444 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
9445esac
9446
9447# Do `set' in a subshell so we don't clobber the current shell's
9448# arguments. Must try -L first in case configure is actually a
9449# symlink; some systems play weird games with the mod time of symlinks
9450# (eg FreeBSD returns the mod time of the symlink's containing
9451# directory).
9452if (
9453 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9454 if test "$[*]" = "X"; then
9455 # -L didn't work.
9456 set X `ls -t "$srcdir/configure" conftest.file`
9457 fi
9458 rm -f conftest.file
9459 if test "$[*]" != "X $srcdir/configure conftest.file" \
9460 && test "$[*]" != "X conftest.file $srcdir/configure"; then
9461
9462 # If neither matched, then we have a broken ls. This can happen
9463 # if, for instance, CONFIG_SHELL is bash and it inherits a
9464 # broken ls alias from the environment. This has actually
9465 # happened. Such a system could not be considered "sane".
9466 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
9467alias in your environment])
9468 fi
9469
9470 test "$[2]" = conftest.file
9471 )
9472then
9473 # Ok.
9474 :
9475else
9476 AC_MSG_ERROR([newly created file is older than distributed files!
9477Check your system clock])
9478fi
9479AC_MSG_RESULT(yes)])
9480
9481# Copyright (C) 2009 Free Software Foundation, Inc.
9482#
9483# This file is free software; the Free Software Foundation
9484# gives unlimited permission to copy and/or distribute it,
9485# with or without modifications, as long as this notice is preserved.
9486
9487# serial 1
9488
9489# AM_SILENT_RULES([DEFAULT])
9490# --------------------------
9491# Enable less verbose build rules; with the default set to DEFAULT
9492# (`yes' being less verbose, `no' or empty being verbose).
9493AC_DEFUN([AM_SILENT_RULES],
9494[AC_ARG_ENABLE([silent-rules],
9495[ --enable-silent-rules less verbose build output (undo: `make V=1')
9496 --disable-silent-rules verbose build output (undo: `make V=0')])
9497case $enable_silent_rules in
9498yes) AM_DEFAULT_VERBOSITY=0;;
9499no) AM_DEFAULT_VERBOSITY=1;;
9500*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9501esac
9502AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9503AM_BACKSLASH='\'
9504AC_SUBST([AM_BACKSLASH])dnl
9505_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9506])
9507
9508# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
9509#
9510# This file is free software; the Free Software Foundation
9511# gives unlimited permission to copy and/or distribute it,
9512# with or without modifications, as long as this notice is preserved.
9513
9514# serial 1
9515
9516# AM_PROG_INSTALL_STRIP
9517# ---------------------
9518# One issue with vendor `install' (even GNU) is that you can't
9519# specify the program used to strip binaries. This is especially
9520# annoying in cross-compiling environments, where the build's strip
9521# is unlikely to handle the host's binaries.
9522# Fortunately install-sh will honor a STRIPPROG variable, so we
9523# always use install-sh in `make install-strip', and initialize
9524# STRIPPROG with the value of the STRIP variable (set by the user).
9525AC_DEFUN([AM_PROG_INSTALL_STRIP],
9526[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9527# Installed binaries are usually stripped using `strip' when the user
9528# run `make install-strip'. However `strip' might not be the right
9529# tool to use in cross-compilation environments, therefore Automake
9530# will honor the `STRIP' environment variable to overrule this program.
9531dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9532if test "$cross_compiling" != no; then
9533 AC_CHECK_TOOL([STRIP], [strip], :)
9534fi
9535INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9536AC_SUBST([INSTALL_STRIP_PROGRAM])])
9537
9538# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
9539#
9540# This file is free software; the Free Software Foundation
9541# gives unlimited permission to copy and/or distribute it,
9542# with or without modifications, as long as this notice is preserved.
9543
9544# serial 3
9545
9546# _AM_SUBST_NOTMAKE(VARIABLE)
9547# ---------------------------
9548# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9549# This macro is traced by Automake.
9550AC_DEFUN([_AM_SUBST_NOTMAKE])
9551
9552# AM_SUBST_NOTMAKE(VARIABLE)
9553# --------------------------
9554# Public sister of _AM_SUBST_NOTMAKE.
9555AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9556
9557# Check how to create a tarball. -*- Autoconf -*-
9558
9559# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
9560#
9561# This file is free software; the Free Software Foundation
9562# gives unlimited permission to copy and/or distribute it,
9563# with or without modifications, as long as this notice is preserved.
9564
9565# serial 2
9566
9567# _AM_PROG_TAR(FORMAT)
9568# --------------------
9569# Check how to create a tarball in format FORMAT.
9570# FORMAT should be one of `v7', `ustar', or `pax'.
9571#
9572# Substitute a variable $(am__tar) that is a command
9573# writing to stdout a FORMAT-tarball containing the directory
9574# $tardir.
9575# tardir=directory && $(am__tar) > result.tar
9576#
9577# Substitute a variable $(am__untar) that extract such
9578# a tarball read from stdin.
9579# $(am__untar) < result.tar
9580AC_DEFUN([_AM_PROG_TAR],
9581[# Always define AMTAR for backward compatibility.
9582AM_MISSING_PROG([AMTAR], [tar])
9583m4_if([$1], [v7],
9584 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9585 [m4_case([$1], [ustar],, [pax],,
9586 [m4_fatal([Unknown tar format])])
9587AC_MSG_CHECKING([how to create a $1 tar archive])
9588# Loop over all known methods to create a tar archive until one works.
9589_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9590_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9591# Do not fold the above two line into one, because Tru64 sh and
9592# Solaris sh will not grok spaces in the rhs of `-'.
9593for _am_tool in $_am_tools
9594do
9595 case $_am_tool in
9596 gnutar)
9597 for _am_tar in tar gnutar gtar;
9598 do
9599 AM_RUN_LOG([$_am_tar --version]) && break
9600 done
9601 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9602 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9603 am__untar="$_am_tar -xf -"
9604 ;;
9605 plaintar)
9606 # Must skip GNU tar: if it does not support --format= it doesn't create
9607 # ustar tarball either.
9608 (tar --version) >/dev/null 2>&1 && continue
9609 am__tar='tar chf - "$$tardir"'
9610 am__tar_='tar chf - "$tardir"'
9611 am__untar='tar xf -'
9612 ;;
9613 pax)
9614 am__tar='pax -L -x $1 -w "$$tardir"'
9615 am__tar_='pax -L -x $1 -w "$tardir"'
9616 am__untar='pax -r'
9617 ;;
9618 cpio)
9619 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9620 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9621 am__untar='cpio -i -H $1 -d'
9622 ;;
9623 none)
9624 am__tar=false
9625 am__tar_=false
9626 am__untar=false
9627 ;;
9628 esac
9629
9630 # If the value was cached, stop now. We just wanted to have am__tar
9631 # and am__untar set.
9632 test -n "${am_cv_prog_tar_$1}" && break
9633
9634 # tar/untar a dummy directory, and stop if the command works
9635 rm -rf conftest.dir
9636 mkdir conftest.dir
9637 echo GrepMe > conftest.dir/file
9638 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9639 rm -rf conftest.dir
9640 if test -s conftest.tar; then
9641 AM_RUN_LOG([$am__untar <conftest.tar])
9642 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9643 fi
9644done
9645rm -rf conftest.dir
9646
9647AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9648AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9649AC_SUBST([am__tar])
9650AC_SUBST([am__untar])
9651]) # _AM_PROG_TAR
9652
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.1 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.1
new file mode 100644
index 0000000..60b33cf
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.1
@@ -0,0 +1,36 @@
1.TH ANSI2KNR 1 "19 Jan 1996"
2.SH NAME
3ansi2knr \- convert ANSI C to Kernighan & Ritchie C
4.SH SYNOPSIS
5.I ansi2knr
6[--varargs] input_file [output_file]
7.SH DESCRIPTION
8If no output_file is supplied, output goes to stdout.
9.br
10There are no error messages.
11.sp
12.I ansi2knr
13recognizes function definitions by seeing a non-keyword identifier at the left
14margin, followed by a left parenthesis, with a right parenthesis as the last
15character on the line, and with a left brace as the first token on the
16following line (ignoring possible intervening comments). It will recognize a
17multi-line header provided that no intervening line ends with a left or right
18brace or a semicolon. These algorithms ignore whitespace and comments, except
19that the function name must be the first thing on the line.
20.sp
21The following constructs will confuse it:
22.br
23 - Any other construct that starts at the left margin and follows the
24above syntax (such as a macro or function call).
25.br
26 - Some macros that tinker with the syntax of the function header.
27.sp
28The --varargs switch is obsolete, and is recognized only for
29backwards compatibility. The present version of
30.I ansi2knr
31will always attempt to convert a ... argument to va_alist and va_dcl.
32.SH AUTHOR
33L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
34continues to maintain the current version; most of the code in the current
35version is his work. ansi2knr also includes contributions by Francois
36Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.c
new file mode 100644
index 0000000..cfcb4da
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ansi2knr.c
@@ -0,0 +1,739 @@
1/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
2
3/*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/
4/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
5
6/*
7ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
8WARRANTY. No author or distributor accepts responsibility to anyone for the
9consequences of using it or for whether it serves any particular purpose or
10works at all, unless he says so in writing. Refer to the GNU General Public
11License (the "GPL") for full details.
12
13Everyone is granted permission to copy, modify and redistribute ansi2knr,
14but only under the conditions described in the GPL. A copy of this license
15is supposed to have been given to you along with ansi2knr so you can know
16your rights and responsibilities. It should be in a file named COPYLEFT,
17or, if there is no file named COPYLEFT, a file named COPYING. Among other
18things, the copyright notice and this notice must be preserved on all
19copies.
20
21We explicitly state here what we believe is already implied by the GPL: if
22the ansi2knr program is distributed as a separate set of sources and a
23separate executable file which are aggregated on a storage medium together
24with another program, this in itself does not bring the other program under
25the GPL, nor does the mere fact that such a program or the procedures for
26constructing it invoke the ansi2knr executable bring any other part of the
27program under the GPL.
28*/
29
30/*
31 * Usage:
32 ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
33 * --filename provides the file name for the #line directive in the output,
34 * overriding input_file (if present).
35 * If no input_file is supplied, input is read from stdin.
36 * If no output_file is supplied, output goes to stdout.
37 * There are no error messages.
38 *
39 * ansi2knr recognizes function definitions by seeing a non-keyword
40 * identifier at the left margin, followed by a left parenthesis, with a
41 * right parenthesis as the last character on the line, and with a left
42 * brace as the first token on the following line (ignoring possible
43 * intervening comments and/or preprocessor directives), except that a line
44 * consisting of only
45 * identifier1(identifier2)
46 * will not be considered a function definition unless identifier2 is
47 * the word "void", and a line consisting of
48 * identifier1(identifier2, <<arbitrary>>)
49 * will not be considered a function definition.
50 * ansi2knr will recognize a multi-line header provided that no intervening
51 * line ends with a left or right brace or a semicolon. These algorithms
52 * ignore whitespace, comments, and preprocessor directives, except that
53 * the function name must be the first thing on the line. The following
54 * constructs will confuse it:
55 * - Any other construct that starts at the left margin and
56 * follows the above syntax (such as a macro or function call).
57 * - Some macros that tinker with the syntax of function headers.
58 */
59
60/*
61 * The original and principal author of ansi2knr is L. Peter Deutsch
62 * <ghost@aladdin.com>. Other authors are noted in the change history
63 * that follows (in reverse chronological order):
64
65 lpd 2000-04-12 backs out Eggert's changes because of bugs:
66 - concatlits didn't declare the type of its bufend argument;
67 - concatlits didn't recognize when it was inside a comment;
68 - scanstring could scan backward past the beginning of the string; when
69 - the check for \ + newline in scanstring was unnecessary.
70
71 2000-03-05 Paul Eggert <eggert@twinsun.com>
72
73 Add support for concatenated string literals.
74 * ansi2knr.c (concatlits): New decl.
75 (main): Invoke concatlits to concatenate string literals.
76 (scanstring): Handle backslash-newline correctly. Work with
77 character constants. Fix bug when scanning backwards through
78 backslash-quote. Check for unterminated strings.
79 (convert1): Parse character constants, too.
80 (appendline, concatlits): New functions.
81 * ansi2knr.1: Document this.
82
83 lpd 1999-08-17 added code to allow preprocessor directives
84 wherever comments are allowed
85 lpd 1999-04-12 added minor fixes from Pavel Roskin
86 <pavel_roskin@geocities.com> for clean compilation with
87 gcc -W -Wall
88 lpd 1999-03-22 added hack to recognize lines consisting of
89 identifier1(identifier2, xxx) as *not* being procedures
90 lpd 1999-02-03 made indentation of preprocessor commands consistent
91 lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an
92 endless loop; quoted strings within an argument list
93 confused the parser
94 lpd 1999-01-24 added a check for write errors on the output,
95 suggested by Jim Meyering <meyering@ascend.com>
96 lpd 1998-11-09 added further hack to recognize identifier(void)
97 as being a procedure
98 lpd 1998-10-23 added hack to recognize lines consisting of
99 identifier1(identifier2) as *not* being procedures
100 lpd 1997-12-08 made input_file optional; only closes input and/or
101 output file if not stdin or stdout respectively; prints
102 usage message on stderr rather than stdout; adds
103 --filename switch (changes suggested by
104 <ceder@lysator.liu.se>)
105 lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with
106 compilers that don't understand void, as suggested by
107 Tom Lane
108 lpd 1996-01-15 changed to require that the first non-comment token
109 on the line following a function header be a left brace,
110 to reduce sensitivity to macros, as suggested by Tom Lane
111 <tgl@sss.pgh.pa.us>
112 lpd 1995-06-22 removed #ifndefs whose sole purpose was to define
113 undefined preprocessor symbols as 0; changed all #ifdefs
114 for configuration symbols to #ifs
115 lpd 1995-04-05 changed copyright notice to make it clear that
116 including ansi2knr in a program does not bring the entire
117 program under the GPL
118 lpd 1994-12-18 added conditionals for systems where ctype macros
119 don't handle 8-bit characters properly, suggested by
120 Francois Pinard <pinard@iro.umontreal.ca>;
121 removed --varargs switch (this is now the default)
122 lpd 1994-10-10 removed CONFIG_BROKETS conditional
123 lpd 1994-07-16 added some conditionals to help GNU `configure',
124 suggested by Francois Pinard <pinard@iro.umontreal.ca>;
125 properly erase prototype args in function parameters,
126 contributed by Jim Avera <jima@netcom.com>;
127 correct error in writeblanks (it shouldn't erase EOLs)
128 lpd 1989-xx-xx original version
129 */
130
131/* Most of the conditionals here are to make ansi2knr work with */
132/* or without the GNU configure machinery. */
133
134#if HAVE_CONFIG_H
135# include <config.h>
136#endif
137
138#include <stdio.h>
139#include <ctype.h>
140
141#if HAVE_CONFIG_H
142
143/*
144 For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
145 This will define HAVE_CONFIG_H and so, activate the following lines.
146 */
147
148# if STDC_HEADERS || HAVE_STRING_H
149# include <string.h>
150# else
151# include <strings.h>
152# endif
153
154#else /* not HAVE_CONFIG_H */
155
156/* Otherwise do it the hard way */
157
158# ifdef BSD
159# include <strings.h>
160# else
161# ifdef VMS
162 extern int strlen(), strncmp();
163# else
164# include <string.h>
165# endif
166# endif
167
168#endif /* not HAVE_CONFIG_H */
169
170#if STDC_HEADERS
171# include <stdlib.h>
172#else
173/*
174 malloc and free should be declared in stdlib.h,
175 but if you've got a K&R compiler, they probably aren't.
176 */
177# ifdef MSDOS
178# include <malloc.h>
179# else
180# ifdef VMS
181 extern char *malloc();
182 extern void free();
183# else
184 extern char *malloc();
185 extern int free();
186# endif
187# endif
188
189#endif
190
191/* Define NULL (for *very* old compilers). */
192#ifndef NULL
193# define NULL (0)
194#endif
195
196/*
197 * The ctype macros don't always handle 8-bit characters correctly.
198 * Compensate for this here.
199 */
200#ifdef isascii
201# undef HAVE_ISASCII /* just in case */
202# define HAVE_ISASCII 1
203#else
204#endif
205#if STDC_HEADERS || !HAVE_ISASCII
206# define is_ascii(c) 1
207#else
208# define is_ascii(c) isascii(c)
209#endif
210
211#define is_space(c) (is_ascii(c) && isspace(c))
212#define is_alpha(c) (is_ascii(c) && isalpha(c))
213#define is_alnum(c) (is_ascii(c) && isalnum(c))
214
215/* Scanning macros */
216#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
217#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
218
219/* Forward references */
220char *ppdirforward();
221char *ppdirbackward();
222char *skipspace();
223char *scanstring();
224int writeblanks();
225int test1();
226int convert1();
227
228/* The main program */
229int
230main(argc, argv)
231 int argc;
232 char *argv[];
233{ FILE *in = stdin;
234 FILE *out = stdout;
235 char *filename = 0;
236 char *program_name = argv[0];
237 char *output_name = 0;
238#define bufsize 5000 /* arbitrary size */
239 char *buf;
240 char *line;
241 char *more;
242 char *usage =
243 "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
244 /*
245 * In previous versions, ansi2knr recognized a --varargs switch.
246 * If this switch was supplied, ansi2knr would attempt to convert
247 * a ... argument to va_alist and va_dcl; if this switch was not
248 * supplied, ansi2knr would simply drop any such arguments.
249 * Now, ansi2knr always does this conversion, and we only
250 * check for this switch for backward compatibility.
251 */
252 int convert_varargs = 1;
253 int output_error;
254
255 while ( argc > 1 && argv[1][0] == '-' ) {
256 if ( !strcmp(argv[1], "--varargs") ) {
257 convert_varargs = 1;
258 argc--;
259 argv++;
260 continue;
261 }
262 if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
263 filename = argv[2];
264 argc -= 2;
265 argv += 2;
266 continue;
267 }
268 fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name,
269 argv[1]);
270 fprintf(stderr, usage);
271 exit(1);
272 }
273 switch ( argc )
274 {
275 default:
276 fprintf(stderr, usage);
277 exit(0);
278 case 3:
279 output_name = argv[2];
280 out = fopen(output_name, "w");
281 if ( out == NULL ) {
282 fprintf(stderr, "%s: Cannot open output file %s\n",
283 program_name, output_name);
284 exit(1);
285 }
286 /* falls through */
287 case 2:
288 in = fopen(argv[1], "r");
289 if ( in == NULL ) {
290 fprintf(stderr, "%s: Cannot open input file %s\n",
291 program_name, argv[1]);
292 exit(1);
293 }
294 if ( filename == 0 )
295 filename = argv[1];
296 /* falls through */
297 case 1:
298 break;
299 }
300 if ( filename )
301 fprintf(out, "#line 1 \"%s\"\n", filename);
302 buf = malloc(bufsize);
303 if ( buf == NULL )
304 {
305 fprintf(stderr, "Unable to allocate read buffer!\n");
306 exit(1);
307 }
308 line = buf;
309 while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
310 {
311test: line += strlen(line);
312 switch ( test1(buf) )
313 {
314 case 2: /* a function header */
315 convert1(buf, out, 1, convert_varargs);
316 break;
317 case 1: /* a function */
318 /* Check for a { at the start of the next line. */
319 more = ++line;
320f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
321 goto wl;
322 if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
323 goto wl;
324 switch ( *skipspace(ppdirforward(more), 1) )
325 {
326 case '{':
327 /* Definitely a function header. */
328 convert1(buf, out, 0, convert_varargs);
329 fputs(more, out);
330 break;
331 case 0:
332 /* The next line was blank or a comment: */
333 /* keep scanning for a non-comment. */
334 line += strlen(line);
335 goto f;
336 default:
337 /* buf isn't a function header, but */
338 /* more might be. */
339 fputs(buf, out);
340 strcpy(buf, more);
341 line = buf;
342 goto test;
343 }
344 break;
345 case -1: /* maybe the start of a function */
346 if ( line != buf + (bufsize - 1) ) /* overflow check */
347 continue;
348 /* falls through */
349 default: /* not a function */
350wl: fputs(buf, out);
351 break;
352 }
353 line = buf;
354 }
355 if ( line != buf )
356 fputs(buf, out);
357 free(buf);
358 if ( output_name ) {
359 output_error = ferror(out);
360 output_error |= fclose(out);
361 } else { /* out == stdout */
362 fflush(out);
363 output_error = ferror(out);
364 }
365 if ( output_error ) {
366 fprintf(stderr, "%s: error writing to %s\n", program_name,
367 (output_name ? output_name : "stdout"));
368 exit(1);
369 }
370 if ( in != stdin )
371 fclose(in);
372 return 0;
373}
374
375/*
376 * Skip forward or backward over one or more preprocessor directives.
377 */
378char *
379ppdirforward(p)
380 char *p;
381{
382 for (; *p == '#'; ++p) {
383 for (; *p != '\r' && *p != '\n'; ++p)
384 if (*p == 0)
385 return p;
386 if (*p == '\r' && p[1] == '\n')
387 ++p;
388 }
389 return p;
390}
391char *
392ppdirbackward(p, limit)
393 char *p;
394 char *limit;
395{
396 char *np = p;
397
398 for (;; p = --np) {
399 if (*np == '\n' && np[-1] == '\r')
400 --np;
401 for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
402 if (np[-1] == 0)
403 return np;
404 if (*np != '#')
405 return p;
406 }
407}
408
409/*
410 * Skip over whitespace, comments, and preprocessor directives,
411 * in either direction.
412 */
413char *
414skipspace(p, dir)
415 char *p;
416 int dir; /* 1 for forward, -1 for backward */
417{
418 for ( ; ; ) {
419 while ( is_space(*p) )
420 p += dir;
421 if ( !(*p == '/' && p[dir] == '*') )
422 break;
423 p += dir; p += dir;
424 while ( !(*p == '*' && p[dir] == '/') ) {
425 if ( *p == 0 )
426 return p; /* multi-line comment?? */
427 p += dir;
428 }
429 p += dir; p += dir;
430 }
431 return p;
432}
433
434/* Scan over a quoted string, in either direction. */
435char *
436scanstring(p, dir)
437 char *p;
438 int dir;
439{
440 for (p += dir; ; p += dir)
441 if (*p == '"' && p[-dir] != '\\')
442 return p + dir;
443}
444
445/*
446 * Write blanks over part of a string.
447 * Don't overwrite end-of-line characters.
448 */
449int
450writeblanks(start, end)
451 char *start;
452 char *end;
453{ char *p;
454 for ( p = start; p < end; p++ )
455 if ( *p != '\r' && *p != '\n' )
456 *p = ' ';
457 return 0;
458}
459
460/*
461 * Test whether the string in buf is a function definition.
462 * The string may contain and/or end with a newline.
463 * Return as follows:
464 * 0 - definitely not a function definition;
465 * 1 - definitely a function definition;
466 * 2 - definitely a function prototype (NOT USED);
467 * -1 - may be the beginning of a function definition,
468 * append another line and look again.
469 * The reason we don't attempt to convert function prototypes is that
470 * Ghostscript's declaration-generating macros look too much like
471 * prototypes, and confuse the algorithms.
472 */
473int
474test1(buf)
475 char *buf;
476{ char *p = buf;
477 char *bend;
478 char *endfn;
479 int contin;
480
481 if ( !isidfirstchar(*p) )
482 return 0; /* no name at left margin */
483 bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
484 switch ( *bend )
485 {
486 case ';': contin = 0 /*2*/; break;
487 case ')': contin = 1; break;
488 case '{': return 0; /* not a function */
489 case '}': return 0; /* not a function */
490 default: contin = -1;
491 }
492 while ( isidchar(*p) )
493 p++;
494 endfn = p;
495 p = skipspace(p, 1);
496 if ( *p++ != '(' )
497 return 0; /* not a function */
498 p = skipspace(p, 1);
499 if ( *p == ')' )
500 return 0; /* no parameters */
501 /* Check that the apparent function name isn't a keyword. */
502 /* We only need to check for keywords that could be followed */
503 /* by a left parenthesis (which, unfortunately, is most of them). */
504 { static char *words[] =
505 { "asm", "auto", "case", "char", "const", "double",
506 "extern", "float", "for", "if", "int", "long",
507 "register", "return", "short", "signed", "sizeof",
508 "static", "switch", "typedef", "unsigned",
509 "void", "volatile", "while", 0
510 };
511 char **key = words;
512 char *kp;
513 unsigned len = endfn - buf;
514
515 while ( (kp = *key) != 0 )
516 { if ( strlen(kp) == len && !strncmp(kp, buf, len) )
517 return 0; /* name is a keyword */
518 key++;
519 }
520 }
521 {
522 char *id = p;
523 int len;
524 /*
525 * Check for identifier1(identifier2) and not
526 * identifier1(void), or identifier1(identifier2, xxxx).
527 */
528
529 while ( isidchar(*p) )
530 p++;
531 len = p - id;
532 p = skipspace(p, 1);
533 if (*p == ',' ||
534 (*p == ')' && (len != 4 || strncmp(id, "void", 4)))
535 )
536 return 0; /* not a function */
537 }
538 /*
539 * If the last significant character was a ), we need to count
540 * parentheses, because it might be part of a formal parameter
541 * that is a procedure.
542 */
543 if (contin > 0) {
544 int level = 0;
545
546 for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1))
547 level += (*p == '(' ? 1 : *p == ')' ? -1 : 0);
548 if (level > 0)
549 contin = -1;
550 }
551 return contin;
552}
553
554/* Convert a recognized function definition or header to K&R syntax. */
555int
556convert1(buf, out, header, convert_varargs)
557 char *buf;
558 FILE *out;
559 int header; /* Boolean */
560 int convert_varargs; /* Boolean */
561{ char *endfn;
562 char *p;
563 /*
564 * The breaks table contains pointers to the beginning and end
565 * of each argument.
566 */
567 char **breaks;
568 unsigned num_breaks = 2; /* for testing */
569 char **btop;
570 char **bp;
571 char **ap;
572 char *vararg = 0;
573
574 /* Pre-ANSI implementations don't agree on whether strchr */
575 /* is called strchr or index, so we open-code it here. */
576 for ( endfn = buf; *(endfn++) != '('; )
577 ;
578top: p = endfn;
579 breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
580 if ( breaks == NULL )
581 { /* Couldn't allocate break table, give up */
582 fprintf(stderr, "Unable to allocate break table!\n");
583 fputs(buf, out);
584 return -1;
585 }
586 btop = breaks + num_breaks * 2 - 2;
587 bp = breaks;
588 /* Parse the argument list */
589 do
590 { int level = 0;
591 char *lp = NULL;
592 char *rp = NULL;
593 char *end = NULL;
594
595 if ( bp >= btop )
596 { /* Filled up break table. */
597 /* Allocate a bigger one and start over. */
598 free((char *)breaks);
599 num_breaks <<= 1;
600 goto top;
601 }
602 *bp++ = p;
603 /* Find the end of the argument */
604 for ( ; end == NULL; p++ )
605 { switch(*p)
606 {
607 case ',':
608 if ( !level ) end = p;
609 break;
610 case '(':
611 if ( !level ) lp = p;
612 level++;
613 break;
614 case ')':
615 if ( --level < 0 ) end = p;
616 else rp = p;
617 break;
618 case '/':
619 if (p[1] == '*')
620 p = skipspace(p, 1) - 1;
621 break;
622 case '"':
623 p = scanstring(p, 1) - 1;
624 break;
625 default:
626 ;
627 }
628 }
629 /* Erase any embedded prototype parameters. */
630 if ( lp && rp )
631 writeblanks(lp + 1, rp);
632 p--; /* back up over terminator */
633 /* Find the name being declared. */
634 /* This is complicated because of procedure and */
635 /* array modifiers. */
636 for ( ; ; )
637 { p = skipspace(p - 1, -1);
638 switch ( *p )
639 {
640 case ']': /* skip array dimension(s) */
641 case ')': /* skip procedure args OR name */
642 { int level = 1;
643 while ( level )
644 switch ( *--p )
645 {
646 case ']': case ')':
647 level++;
648 break;
649 case '[': case '(':
650 level--;
651 break;
652 case '/':
653 if (p > buf && p[-1] == '*')
654 p = skipspace(p, -1) + 1;
655 break;
656 case '"':
657 p = scanstring(p, -1) + 1;
658 break;
659 default: ;
660 }
661 }
662 if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
663 { /* We found the name being declared */
664 while ( !isidfirstchar(*p) )
665 p = skipspace(p, 1) + 1;
666 goto found;
667 }
668 break;
669 default:
670 goto found;
671 }
672 }
673found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
674 { if ( convert_varargs )
675 { *bp++ = "va_alist";
676 vararg = p-2;
677 }
678 else
679 { p++;
680 if ( bp == breaks + 1 ) /* sole argument */
681 writeblanks(breaks[0], p);
682 else
683 writeblanks(bp[-1] - 1, p);
684 bp--;
685 }
686 }
687 else
688 { while ( isidchar(*p) ) p--;
689 *bp++ = p+1;
690 }
691 p = end;
692 }
693 while ( *p++ == ',' );
694 *bp = p;
695 /* Make a special check for 'void' arglist */
696 if ( bp == breaks+2 )
697 { p = skipspace(breaks[0], 1);
698 if ( !strncmp(p, "void", 4) )
699 { p = skipspace(p+4, 1);
700 if ( p == breaks[2] - 1 )
701 { bp = breaks; /* yup, pretend arglist is empty */
702 writeblanks(breaks[0], p + 1);
703 }
704 }
705 }
706 /* Put out the function name and left parenthesis. */
707 p = buf;
708 while ( p != endfn ) putc(*p, out), p++;
709 /* Put out the declaration. */
710 if ( header )
711 { fputs(");", out);
712 for ( p = breaks[0]; *p; p++ )
713 if ( *p == '\r' || *p == '\n' )
714 putc(*p, out);
715 }
716 else
717 { for ( ap = breaks+1; ap < bp; ap += 2 )
718 { p = *ap;
719 while ( isidchar(*p) )
720 putc(*p, out), p++;
721 if ( ap < bp - 1 )
722 fputs(", ", out);
723 }
724 fputs(") ", out);
725 /* Put out the argument declarations */
726 for ( ap = breaks+2; ap <= bp; ap += 2 )
727 (*ap)[-1] = ';';
728 if ( vararg != 0 )
729 { *vararg = 0;
730 fputs(breaks[0], out); /* any prior args */
731 fputs("va_dcl", out); /* the final arg */
732 fputs(bp[0], out);
733 }
734 else
735 fputs(breaks[0], out);
736 }
737 free((char *)breaks);
738 return 0;
739}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cderror.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cderror.h
new file mode 100644
index 0000000..fb72a51
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cderror.h
@@ -0,0 +1,134 @@
1/*
2 * cderror.h
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * Modified 2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file defines the error and message codes for the cjpeg/djpeg
10 * applications. These strings are not needed as part of the JPEG library
11 * proper.
12 * Edit this file to add new codes, or to translate the message strings to
13 * some other language.
14 */
15
16/*
17 * To define the enum list of message codes, include this file without
18 * defining macro JMESSAGE. To create a message string table, include it
19 * again with a suitable JMESSAGE definition (see jerror.c for an example).
20 */
21#ifndef JMESSAGE
22#ifndef CDERROR_H
23#define CDERROR_H
24/* First time through, define the enum list */
25#define JMAKE_ENUM_LIST
26#else
27/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
28#define JMESSAGE(code,string)
29#endif /* CDERROR_H */
30#endif /* JMESSAGE */
31
32#ifdef JMAKE_ENUM_LIST
33
34typedef enum {
35
36#define JMESSAGE(code,string) code ,
37
38#endif /* JMAKE_ENUM_LIST */
39
40JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
41
42#ifdef BMP_SUPPORTED
43JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
44JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
45JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
46JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
47JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
48JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
49JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image")
50JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
51JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
52JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
53JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
54JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
55#endif /* BMP_SUPPORTED */
56
57#ifdef GIF_SUPPORTED
58JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
59JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
60JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
61JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
62JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
63JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
64JMESSAGE(JTRC_GIF_BADVERSION,
65 "Warning: unexpected GIF version number '%c%c%c'")
66JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
67JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
68JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
69JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
70JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
71JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
72#endif /* GIF_SUPPORTED */
73
74#ifdef PPM_SUPPORTED
75JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
76JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
77JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
78JMESSAGE(JTRC_PGM, "%ux%u PGM image")
79JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
80JMESSAGE(JTRC_PPM, "%ux%u PPM image")
81JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
82#endif /* PPM_SUPPORTED */
83
84#ifdef RLE_SUPPORTED
85JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
86JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
87JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
88JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
89JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
90JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
91JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
92JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
93JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
94JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
95JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
96JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
97JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
98JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
99#endif /* RLE_SUPPORTED */
100
101#ifdef TARGA_SUPPORTED
102JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
103JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
104JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
105JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
106JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
107JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
108#else
109JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
110#endif /* TARGA_SUPPORTED */
111
112JMESSAGE(JERR_BAD_CMAP_FILE,
113 "Color map file is invalid or of unsupported format")
114JMESSAGE(JERR_TOO_MANY_COLORS,
115 "Output file format cannot handle %d colormap entries")
116JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
117#ifdef TARGA_SUPPORTED
118JMESSAGE(JERR_UNKNOWN_FORMAT,
119 "Unrecognized input file format --- perhaps you need -targa")
120#else
121JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
122#endif
123JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
124
125#ifdef JMAKE_ENUM_LIST
126
127 JMSG_LASTADDONCODE
128} ADDON_MESSAGE_CODE;
129
130#undef JMAKE_ENUM_LIST
131#endif /* JMAKE_ENUM_LIST */
132
133/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
134#undef JMESSAGE
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.c
new file mode 100644
index 0000000..89fe633
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.c
@@ -0,0 +1,181 @@
1/*
2 * cdjpeg.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains common support routines used by the IJG application
9 * programs (cjpeg, djpeg, jpegtran).
10 */
11
12#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
13#include <ctype.h> /* to declare isupper(), tolower() */
14#ifdef NEED_SIGNAL_CATCHER
15#include <signal.h> /* to declare signal() */
16#endif
17#ifdef USE_SETMODE
18#include <fcntl.h> /* to declare setmode()'s parameter macros */
19/* If you have setmode() but not <io.h>, just delete this line: */
20#include <io.h> /* to declare setmode() */
21#endif
22
23
24/*
25 * Signal catcher to ensure that temporary files are removed before aborting.
26 * NB: for Amiga Manx C this is actually a global routine named _abort();
27 * we put "#define signal_catcher _abort" in jconfig.h. Talk about bogus...
28 */
29
30#ifdef NEED_SIGNAL_CATCHER
31
32static j_common_ptr sig_cinfo;
33
34void /* must be global for Manx C */
35signal_catcher (int signum)
36{
37 if (sig_cinfo != NULL) {
38 if (sig_cinfo->err != NULL) /* turn off trace output */
39 sig_cinfo->err->trace_level = 0;
40 jpeg_destroy(sig_cinfo); /* clean up memory allocation & temp files */
41 }
42 exit(EXIT_FAILURE);
43}
44
45
46GLOBAL(void)
47enable_signal_catcher (j_common_ptr cinfo)
48{
49 sig_cinfo = cinfo;
50#ifdef SIGINT /* not all systems have SIGINT */
51 signal(SIGINT, signal_catcher);
52#endif
53#ifdef SIGTERM /* not all systems have SIGTERM */
54 signal(SIGTERM, signal_catcher);
55#endif
56}
57
58#endif
59
60
61/*
62 * Optional progress monitor: display a percent-done figure on stderr.
63 */
64
65#ifdef PROGRESS_REPORT
66
67METHODDEF(void)
68progress_monitor (j_common_ptr cinfo)
69{
70 cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress;
71 int total_passes = prog->pub.total_passes + prog->total_extra_passes;
72 int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit);
73
74 if (percent_done != prog->percent_done) {
75 prog->percent_done = percent_done;
76 if (total_passes > 1) {
77 fprintf(stderr, "\rPass %d/%d: %3d%% ",
78 prog->pub.completed_passes + prog->completed_extra_passes + 1,
79 total_passes, percent_done);
80 } else {
81 fprintf(stderr, "\r %3d%% ", percent_done);
82 }
83 fflush(stderr);
84 }
85}
86
87
88GLOBAL(void)
89start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress)
90{
91 /* Enable progress display, unless trace output is on */
92 if (cinfo->err->trace_level == 0) {
93 progress->pub.progress_monitor = progress_monitor;
94 progress->completed_extra_passes = 0;
95 progress->total_extra_passes = 0;
96 progress->percent_done = -1;
97 cinfo->progress = &progress->pub;
98 }
99}
100
101
102GLOBAL(void)
103end_progress_monitor (j_common_ptr cinfo)
104{
105 /* Clear away progress display */
106 if (cinfo->err->trace_level == 0) {
107 fprintf(stderr, "\r \r");
108 fflush(stderr);
109 }
110}
111
112#endif
113
114
115/*
116 * Case-insensitive matching of possibly-abbreviated keyword switches.
117 * keyword is the constant keyword (must be lower case already),
118 * minchars is length of minimum legal abbreviation.
119 */
120
121GLOBAL(boolean)
122keymatch (char * arg, const char * keyword, int minchars)
123{
124 register int ca, ck;
125 register int nmatched = 0;
126
127 while ((ca = *arg++) != '\0') {
128 if ((ck = *keyword++) == '\0')
129 return FALSE; /* arg longer than keyword, no good */
130 if (isupper(ca)) /* force arg to lcase (assume ck is already) */
131 ca = tolower(ca);
132 if (ca != ck)
133 return FALSE; /* no good */
134 nmatched++; /* count matched characters */
135 }
136 /* reached end of argument; fail if it's too short for unique abbrev */
137 if (nmatched < minchars)
138 return FALSE;
139 return TRUE; /* A-OK */
140}
141
142
143/*
144 * Routines to establish binary I/O mode for stdin and stdout.
145 * Non-Unix systems often require some hacking to get out of text mode.
146 */
147
148GLOBAL(FILE *)
149read_stdin (void)
150{
151 FILE * input_file = stdin;
152
153#ifdef USE_SETMODE /* need to hack file mode? */
154 setmode(fileno(stdin), O_BINARY);
155#endif
156#ifdef USE_FDOPEN /* need to re-open in binary mode? */
157 if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
158 fprintf(stderr, "Cannot reopen stdin\n");
159 exit(EXIT_FAILURE);
160 }
161#endif
162 return input_file;
163}
164
165
166GLOBAL(FILE *)
167write_stdout (void)
168{
169 FILE * output_file = stdout;
170
171#ifdef USE_SETMODE /* need to hack file mode? */
172 setmode(fileno(stdout), O_BINARY);
173#endif
174#ifdef USE_FDOPEN /* need to re-open in binary mode? */
175 if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
176 fprintf(stderr, "Cannot reopen stdout\n");
177 exit(EXIT_FAILURE);
178 }
179#endif
180 return output_file;
181}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.h
new file mode 100644
index 0000000..c0d064c
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cdjpeg.h
@@ -0,0 +1,187 @@
1/*
2 * cdjpeg.h
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains common declarations for the sample applications
9 * cjpeg and djpeg. It is NOT used by the core JPEG library.
10 */
11
12#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
13#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
14#include "jinclude.h"
15#include "jpeglib.h"
16#include "jerror.h" /* get library error codes too */
17#include "cderror.h" /* get application-specific error codes */
18
19
20/*
21 * Object interface for cjpeg's source file decoding modules
22 */
23
24typedef struct cjpeg_source_struct * cjpeg_source_ptr;
25
26struct cjpeg_source_struct {
27 JMETHOD(void, start_input, (j_compress_ptr cinfo,
28 cjpeg_source_ptr sinfo));
29 JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
30 cjpeg_source_ptr sinfo));
31 JMETHOD(void, finish_input, (j_compress_ptr cinfo,
32 cjpeg_source_ptr sinfo));
33
34 FILE *input_file;
35
36 JSAMPARRAY buffer;
37 JDIMENSION buffer_height;
38};
39
40
41/*
42 * Object interface for djpeg's output file encoding modules
43 */
44
45typedef struct djpeg_dest_struct * djpeg_dest_ptr;
46
47struct djpeg_dest_struct {
48 /* start_output is called after jpeg_start_decompress finishes.
49 * The color map will be ready at this time, if one is needed.
50 */
51 JMETHOD(void, start_output, (j_decompress_ptr cinfo,
52 djpeg_dest_ptr dinfo));
53 /* Emit the specified number of pixel rows from the buffer. */
54 JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
55 djpeg_dest_ptr dinfo,
56 JDIMENSION rows_supplied));
57 /* Finish up at the end of the image. */
58 JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
59 djpeg_dest_ptr dinfo));
60
61 /* Target file spec; filled in by djpeg.c after object is created. */
62 FILE * output_file;
63
64 /* Output pixel-row buffer. Created by module init or start_output.
65 * Width is cinfo->output_width * cinfo->output_components;
66 * height is buffer_height.
67 */
68 JSAMPARRAY buffer;
69 JDIMENSION buffer_height;
70};
71
72
73/*
74 * cjpeg/djpeg may need to perform extra passes to convert to or from
75 * the source/destination file format. The JPEG library does not know
76 * about these passes, but we'd like them to be counted by the progress
77 * monitor. We use an expanded progress monitor object to hold the
78 * additional pass count.
79 */
80
81struct cdjpeg_progress_mgr {
82 struct jpeg_progress_mgr pub; /* fields known to JPEG library */
83 int completed_extra_passes; /* extra passes completed */
84 int total_extra_passes; /* total extra */
85 /* last printed percentage stored here to avoid multiple printouts */
86 int percent_done;
87};
88
89typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
90
91
92/* Short forms of external names for systems with brain-damaged linkers. */
93
94#ifdef NEED_SHORT_EXTERNAL_NAMES
95#define jinit_read_bmp jIRdBMP
96#define jinit_write_bmp jIWrBMP
97#define jinit_read_gif jIRdGIF
98#define jinit_write_gif jIWrGIF
99#define jinit_read_ppm jIRdPPM
100#define jinit_write_ppm jIWrPPM
101#define jinit_read_rle jIRdRLE
102#define jinit_write_rle jIWrRLE
103#define jinit_read_targa jIRdTarga
104#define jinit_write_targa jIWrTarga
105#define read_quant_tables RdQTables
106#define read_scan_script RdScnScript
107#define set_quality_ratings SetQRates
108#define set_quant_slots SetQSlots
109#define set_sample_factors SetSFacts
110#define read_color_map RdCMap
111#define enable_signal_catcher EnSigCatcher
112#define start_progress_monitor StProgMon
113#define end_progress_monitor EnProgMon
114#define read_stdin RdStdin
115#define write_stdout WrStdout
116#endif /* NEED_SHORT_EXTERNAL_NAMES */
117
118/* Module selection routines for I/O modules. */
119
120EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
121EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
122 boolean is_os2));
123EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
124EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
125EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
126EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
127EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
128EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
129EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
130EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
131
132/* cjpeg support routines (in rdswitch.c) */
133
134EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
135 boolean force_baseline));
136EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
137EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,
138 boolean force_baseline));
139EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
140EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
141
142/* djpeg support routines (in rdcolmap.c) */
143
144EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
145
146/* common support routines (in cdjpeg.c) */
147
148EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
149EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
150 cd_progress_ptr progress));
151EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
152EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
153EXTERN(FILE *) read_stdin JPP((void));
154EXTERN(FILE *) write_stdout JPP((void));
155
156/* miscellaneous useful macros */
157
158#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
159#define READ_BINARY "r"
160#define WRITE_BINARY "w"
161#else
162#ifdef VMS /* VMS is very nonstandard */
163#define READ_BINARY "rb", "ctx=stm"
164#define WRITE_BINARY "wb", "ctx=stm"
165#else /* standard ANSI-compliant case */
166#define READ_BINARY "rb"
167#define WRITE_BINARY "wb"
168#endif
169#endif
170
171#ifndef EXIT_FAILURE /* define exit() codes if not provided */
172#define EXIT_FAILURE 1
173#endif
174#ifndef EXIT_SUCCESS
175#ifdef VMS
176#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
177#else
178#define EXIT_SUCCESS 0
179#endif
180#endif
181#ifndef EXIT_WARNING
182#ifdef VMS
183#define EXIT_WARNING 1 /* VMS is very nonstandard */
184#else
185#define EXIT_WARNING 2
186#endif
187#endif
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/change.log b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/change.log
new file mode 100644
index 0000000..ce71abd
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/change.log
@@ -0,0 +1,346 @@
1CHANGE LOG for Independent JPEG Group's JPEG software
2
3
4Version 8d 15-Jan-2012
5-----------------------
6
7Add cjpeg -rgb option to create RGB JPEG files.
8Using this switch suppresses the conversion from RGB
9colorspace input to the default YCbCr JPEG colorspace.
10This feature allows true lossless JPEG coding of RGB color images.
11The recommended command for this purpose is currently
12cjpeg -rgb -block 1 -arithmetic.
13SmartScale capable decoder (introduced with IJG JPEG 8) required.
14Thank to Michael Koch for the initial suggestion.
15
16Add option to disable the region adjustment in the transupp crop code.
17Thank to Jeffrey Friedl for the suggestion.
18
19Thank to Richard Jones and Edd Dawson for various minor corrections.
20
21Thank to Akim Demaille for configure.ac cleanup.
22
23
24Version 8c 16-Jan-2011
25-----------------------
26
27Add option to compression library and cjpeg (-block N) to use
28different DCT block size.
29All N from 1 to 16 are possible. Default is 8 (baseline format).
30Larger values produce higher compression,
31smaller values produce higher quality.
32SmartScale capable decoder (introduced with IJG JPEG 8) required.
33
34
35Version 8b 16-May-2010
36-----------------------
37
38Repair problem in new memory source manager with corrupt JPEG data.
39Thank to Ted Campbell and Samuel Chun for the report.
40
41Repair problem in Makefile.am test target.
42Thank to anonymous user for the report.
43
44Support MinGW installation with automatic configure.
45Thank to Volker Grabsch for the suggestion.
46
47
48Version 8a 28-Feb-2010
49-----------------------
50
51Writing tables-only datastreams via jpeg_write_tables works again.
52
53Support 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.
54Thank to Brett Blackham for the suggestion.
55
56Improve accuracy in floating point IDCT calculation.
57Thank to Robert Hooke for the hint.
58
59
60Version 8 10-Jan-2010
61----------------------
62
63jpegtran now supports the same -scale option as djpeg for "lossless" resize.
64An implementation of the JPEG SmartScale extension is required for this
65feature. A (draft) specification of the JPEG SmartScale extension is
66available as a contributed document at ITU and ISO. Revision 2 or later
67of the document is required (latest document version is Revision 3).
68The SmartScale extension will enable more features beside lossless resize
69in future implementations, as described in the document (new compression
70options).
71
72Add sanity check in BMP reader module to avoid cjpeg crash for empty input
73image (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).
74
75Add data source and destination managers for read from and write to
76memory buffers. New API functions jpeg_mem_src and jpeg_mem_dest.
77Thank to Roberto Boni from Italy for the suggestion.
78
79
80Version 7 27-Jun-2009
81----------------------
82
83New scaled DCTs implemented.
84djpeg now supports scalings N/8 with all N from 1 to 16.
85cjpeg now supports scalings 8/N with all N from 1 to 16.
86Scaled DCTs with size larger than 8 are now also used for resolving the
87common 2x2 chroma subsampling case without additional spatial resampling.
88Separate spatial resampling for those kind of files is now only necessary
89for N>8 scaling cases.
90Furthermore, separate scaled DCT functions are provided for direct resolving
91of the common asymmetric subsampling cases (2x1 and 1x2) without additional
92spatial resampling.
93
94cjpeg -quality option has been extended for support of separate quality
95settings for luminance and chrominance (or in general, for every provided
96quantization table slot).
97New API function jpeg_default_qtables() and q_scale_factor array in library.
98
99Added -nosmooth option to cjpeg, complementary to djpeg.
100New variable "do_fancy_downsampling" in library, complement to fancy
101upsampling. Fancy upsampling now uses direct DCT scaling with sizes
102larger than 8. The old method is not reversible and has been removed.
103
104Support arithmetic entropy encoding and decoding.
105Added files jaricom.c, jcarith.c, jdarith.c.
106
107Straighten the file structure:
108Removed files jidctred.c, jcphuff.c, jchuff.h, jdphuff.c, jdhuff.h.
109
110jpegtran has a new "lossless" cropping feature.
111
112Implement -perfect option in jpegtran, new API function
113jtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)
114
115Better error messages for jpegtran fopen failure.
116(DP 203_jpegtran_errmsg.dpatch)
117
118Fix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:
119according to Netpbm, the de facto standard implementation of the PNM formats,
120the most significant byte is first. (DP 203_rdppm.dpatch)
121
122Add -raw option to rdjpgcom not to mangle the output.
123(DP 205_rdjpgcom_raw.dpatch)
124
125Make rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)
126
127Add extern "C" to jpeglib.h.
128This avoids the need to put extern "C" { ... } around #include "jpeglib.h"
129in your C++ application. Defining the symbol DONT_USE_EXTERN_C in the
130configuration prevents this. (DP 202_jpeglib.h_c++.dpatch)
131
132
133Version 6b 27-Mar-1998
134-----------------------
135
136jpegtran has new features for lossless image transformations (rotation
137and flipping) as well as "lossless" reduction to grayscale.
138
139jpegtran now copies comments by default; it has a -copy switch to enable
140copying all APPn blocks as well, or to suppress comments. (Formerly it
141always suppressed comments and APPn blocks.) jpegtran now also preserves
142JFIF version and resolution information.
143
144New decompressor library feature: COM and APPn markers found in the input
145file can be saved in memory for later use by the application. (Before,
146you had to code this up yourself with a custom marker processor.)
147
148There is an unused field "void * client_data" now in compress and decompress
149parameter structs; this may be useful in some applications.
150
151JFIF version number information is now saved by the decoder and accepted by
152the encoder. jpegtran uses this to copy the source file's version number,
153to ensure "jpegtran -copy all" won't create bogus files that contain JFXX
154extensions but claim to be version 1.01. Applications that generate their
155own JFXX extension markers also (finally) have a supported way to cause the
156encoder to emit JFIF version number 1.02.
157
158djpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather
159than as unknown APP0 markers.
160
161In -verbose mode, djpeg and rdjpgcom will try to print the contents of
162APP12 markers as text. Some digital cameras store useful text information
163in APP12 markers.
164
165Handling of truncated data streams is more robust: blocks beyond the one in
166which the error occurs will be output as uniform gray, or left unchanged
167if decoding a progressive JPEG. The appearance no longer depends on the
168Huffman tables being used.
169
170Huffman tables are checked for validity much more carefully than before.
171
172To avoid the Unisys LZW patent, djpeg's GIF output capability has been
173changed to produce "uncompressed GIFs", and cjpeg's GIF input capability
174has been removed altogether. We're not happy about it either, but there
175seems to be no good alternative.
176
177The configure script now supports building libjpeg as a shared library
178on many flavors of Unix (all the ones that GNU libtool knows how to
179build shared libraries for). Use "./configure --enable-shared" to
180try this out.
181
182New jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.
183Also, a jconfig file and a build script for Metrowerks CodeWarrior
184on Apple Macintosh. makefile.dj has been updated for DJGPP v2, and there
185are miscellaneous other minor improvements in the makefiles.
186
187jmemmac.c now knows how to create temporary files following Mac System 7
188conventions.
189
190djpeg's -map switch is now able to read raw-format PPM files reliably.
191
192cjpeg -progressive -restart no longer generates any unnecessary DRI markers.
193
194Multiple calls to jpeg_simple_progression for a single JPEG object
195no longer leak memory.
196
197
198Version 6a 7-Feb-96
199--------------------
200
201Library initialization sequence modified to detect version mismatches
202and struct field packing mismatches between library and calling application.
203This change requires applications to be recompiled, but does not require
204any application source code change.
205
206All routine declarations changed to the style "GLOBAL(type) name ...",
207that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the
208routine's return type as an argument. This makes it possible to add
209Microsoft-style linkage keywords to all the routines by changing just
210these macros. Note that any application code that was using these macros
211will have to be changed.
212
213DCT coefficient quantization tables are now stored in normal array order
214rather than zigzag order. Application code that calls jpeg_add_quant_table,
215or otherwise manipulates quantization tables directly, will need to be
216changed. If you need to make such code work with either older or newer
217versions of the library, a test like "#if JPEG_LIB_VERSION >= 61" is
218recommended.
219
220djpeg's trace capability now dumps DQT tables in natural order, not zigzag
221order. This allows the trace output to be made into a "-qtables" file
222more easily.
223
224New system-dependent memory manager module for use on Apple Macintosh.
225
226Fix bug in cjpeg's -smooth option: last one or two scanlines would be
227duplicates of the prior line unless the image height mod 16 was 1 or 2.
228
229Repair minor problems in VMS, BCC, MC6 makefiles.
230
231New configure script based on latest GNU Autoconf.
232
233Correct the list of include files needed by MetroWerks C for ccommand().
234
235Numerous small documentation updates.
236
237
238Version 6 2-Aug-95
239-------------------
240
241Progressive JPEG support: library can read and write full progressive JPEG
242files. A "buffered image" mode supports incremental decoding for on-the-fly
243display of progressive images. Simply recompiling an existing IJG-v5-based
244decoder with v6 should allow it to read progressive files, though of course
245without any special progressive display.
246
247New "jpegtran" application performs lossless transcoding between different
248JPEG formats; primarily, it can be used to convert baseline to progressive
249JPEG and vice versa. In support of jpegtran, the library now allows lossless
250reading and writing of JPEG files as DCT coefficient arrays. This ability
251may be of use in other applications.
252
253Notes for programmers:
254* We changed jpeg_start_decompress() to be able to suspend; this makes all
255decoding modes available to suspending-input applications. However,
256existing applications that use suspending input will need to be changed
257to check the return value from jpeg_start_decompress(). You don't need to
258do anything if you don't use a suspending data source.
259* We changed the interface to the virtual array routines: access_virt_array
260routines now take a count of the number of rows to access this time. The
261last parameter to request_virt_array routines is now interpreted as the
262maximum number of rows that may be accessed at once, but not necessarily
263the height of every access.
264
265
266Version 5b 15-Mar-95
267---------------------
268
269Correct bugs with grayscale images having v_samp_factor > 1.
270
271jpeg_write_raw_data() now supports output suspension.
272
273Correct bugs in "configure" script for case of compiling in
274a directory other than the one containing the source files.
275
276Repair bug in jquant1.c: sometimes didn't use as many colors as it could.
277
278Borland C makefile and jconfig file work under either MS-DOS or OS/2.
279
280Miscellaneous improvements to documentation.
281
282
283Version 5a 7-Dec-94
284--------------------
285
286Changed color conversion roundoff behavior so that grayscale values are
287represented exactly. (This causes test image files to change.)
288
289Make ordered dither use 16x16 instead of 4x4 pattern for a small quality
290improvement.
291
292New configure script based on latest GNU Autoconf.
293Fix configure script to handle CFLAGS correctly.
294Rename *.auto files to *.cfg, so that configure script still works if
295file names have been truncated for DOS.
296
297Fix bug in rdbmp.c: didn't allow for extra data between header and image.
298
299Modify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.
300
301Fix several bugs in rdrle.c.
302
303NEED_SHORT_EXTERNAL_NAMES option was broken.
304
305Revise jerror.h/jerror.c for more flexibility in message table.
306
307Repair oversight in jmemname.c NO_MKTEMP case: file could be there
308but unreadable.
309
310
311Version 5 24-Sep-94
312--------------------
313
314Version 5 represents a nearly complete redesign and rewrite of the IJG
315software. Major user-visible changes include:
316 * Automatic configuration simplifies installation for most Unix systems.
317 * A range of speed vs. image quality tradeoffs are supported.
318 This includes resizing of an image during decompression: scaling down
319 by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.
320 * New programs rdjpgcom and wrjpgcom allow insertion and extraction
321 of text comments in a JPEG file.
322
323The application programmer's interface to the library has changed completely.
324Notable improvements include:
325 * We have eliminated the use of callback routines for handling the
326 uncompressed image data. The application now sees the library as a
327 set of routines that it calls to read or write image data on a
328 scanline-by-scanline basis.
329 * The application image data is represented in a conventional interleaved-
330 pixel format, rather than as a separate array for each color channel.
331 This can save a copying step in many programs.
332 * The handling of compressed data has been cleaned up: the application can
333 supply routines to source or sink the compressed data. It is possible to
334 suspend processing on source/sink buffer overrun, although this is not
335 supported in all operating modes.
336 * All static state has been eliminated from the library, so that multiple
337 instances of compression or decompression can be active concurrently.
338 * JPEG abbreviated datastream formats are supported, ie, quantization and
339 Huffman tables can be stored separately from the image data.
340 * And not only that, but the documentation of the library has improved
341 considerably!
342
343
344The last widely used release before the version 5 rewrite was version 4A of
34518-Feb-93. Change logs before that point have been discarded, since they
346are not of much interest after the rewrite.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.1 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.1
new file mode 100644
index 0000000..18283e5
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.1
@@ -0,0 +1,348 @@
1.TH CJPEG 1 "28 August 2011"
2.SH NAME
3cjpeg \- compress an image file to a JPEG file
4.SH SYNOPSIS
5.B cjpeg
6[
7.I options
8]
9[
10.I filename
11]
12.LP
13.SH DESCRIPTION
14.LP
15.B cjpeg
16compresses the named image file, or the standard input if no file is
17named, and produces a JPEG/JFIF file on the standard output.
18The currently supported input file formats are: PPM (PBMPLUS color
19format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster
20Toolkit format). (RLE is supported only if the URT library is available.)
21.SH OPTIONS
22All switch names may be abbreviated; for example,
23.B \-grayscale
24may be written
25.B \-gray
26or
27.BR \-gr .
28Most of the "basic" switches can be abbreviated to as little as one letter.
29Upper and lower case are equivalent (thus
30.B \-BMP
31is the same as
32.BR \-bmp ).
33British spellings are also accepted (e.g.,
34.BR \-greyscale ),
35though for brevity these are not mentioned below.
36.PP
37The basic switches are:
38.TP
39.BI \-quality " N[,...]"
40Scale quantization tables to adjust image quality. Quality is 0 (worst) to
41100 (best); default is 75. (See below for more info.)
42.TP
43.B \-grayscale
44Create monochrome JPEG file from color input. Be sure to use this switch when
45compressing a grayscale BMP file, because
46.B cjpeg
47isn't bright enough to notice whether a BMP file uses only shades of gray.
48By saying
49.BR \-grayscale ,
50you'll get a smaller JPEG file that takes less time to process.
51.TP
52.B \-rgb
53Create RGB JPEG file.
54Using this switch suppresses the conversion from RGB
55colorspace input to the default YCbCr JPEG colorspace.
56Use this switch in combination with the
57.BI \-block " N"
58switch (see below) for lossless JPEG coding.
59.TP
60.B \-optimize
61Perform optimization of entropy encoding parameters. Without this, default
62encoding parameters are used.
63.B \-optimize
64usually makes the JPEG file a little smaller, but
65.B cjpeg
66runs somewhat slower and needs much more memory. Image quality and speed of
67decompression are unaffected by
68.BR \-optimize .
69.TP
70.B \-progressive
71Create progressive JPEG file (see below).
72.TP
73.BI \-scale " M/N"
74Scale the output image by a factor M/N. Currently supported scale factors are
75M/N with all N from 1 to 16, where M is the destination DCT size, which is 8
76by default (see
77.BI \-block " N"
78switch below).
79.TP
80.B \-targa
81Input file is Targa format. Targa files that contain an "identification"
82field will not be automatically recognized by
83.BR cjpeg ;
84for such files you must specify
85.B \-targa
86to make
87.B cjpeg
88treat the input as Targa format.
89For most Targa files, you won't need this switch.
90.PP
91The
92.B \-quality
93switch lets you trade off compressed file size against quality of the
94reconstructed image: the higher the quality setting, the larger the JPEG file,
95and the closer the output image will be to the original input. Normally you
96want to use the lowest quality setting (smallest file) that decompresses into
97something visually indistinguishable from the original image. For this
98purpose the quality setting should be between 50 and 95; the default of 75 is
99often about right. If you see defects at
100.B \-quality
10175, then go up 5 or 10 counts at a time until you are happy with the output
102image. (The optimal setting will vary from one image to another.)
103.PP
104.B \-quality
105100 will generate a quantization table of all 1's, minimizing loss in the
106quantization step (but there is still information loss in subsampling, as well
107as roundoff error). This setting is mainly of interest for experimental
108purposes. Quality values above about 95 are
109.B not
110recommended for normal use; the compressed file size goes up dramatically for
111hardly any gain in output image quality.
112.PP
113In the other direction, quality values below 50 will produce very small files
114of low image quality. Settings around 5 to 10 might be useful in preparing an
115index of a large image library, for example. Try
116.B \-quality
1172 (or so) for some amusing Cubist effects. (Note: quality
118values below about 25 generate 2-byte quantization tables, which are
119considered optional in the JPEG standard.
120.B cjpeg
121emits a warning message when you give such a quality value, because some
122other JPEG programs may be unable to decode the resulting file. Use
123.B \-baseline
124if you need to ensure compatibility at low quality values.)
125.PP
126The
127.B \-quality
128option has been extended in IJG version 7 for support of separate quality
129settings for luminance and chrominance (or in general, for every provided
130quantization table slot). This feature is useful for high-quality
131applications which cannot accept the damage of color data by coarse
132subsampling settings. You can now easily reduce the color data amount more
133smoothly with finer control without separate subsampling. The resulting file
134is fully compliant with standard JPEG decoders.
135Note that the
136.B \-quality
137ratings refer to the quantization table slots, and that the last value is
138replicated if there are more q-table slots than parameters. The default
139q-table slots are 0 for luminance and 1 for chrominance with default tables as
140given in the JPEG standard. This is compatible with the old behaviour in case
141that only one parameter is given, which is then used for both luminance and
142chrominance (slots 0 and 1). More or custom quantization tables can be set
143with
144.B \-qtables
145and assigned to components with
146.B \-qslots
147parameter (see the "wizard" switches below).
148.B Caution:
149You must explicitly add
150.BI \-sample " 1x1"
151for efficient separate color
152quality selection, since the default value used by library is 2x2!
153.PP
154The
155.B \-progressive
156switch creates a "progressive JPEG" file. In this type of JPEG file, the data
157is stored in multiple scans of increasing quality. If the file is being
158transmitted over a slow communications link, the decoder can use the first
159scan to display a low-quality image very quickly, and can then improve the
160display with each subsequent scan. The final image is exactly equivalent to a
161standard JPEG file of the same quality setting, and the total file size is
162about the same --- often a little smaller.
163.PP
164Switches for advanced users:
165.TP
166.B \-arithmetic
167Use arithmetic coding.
168.B Caution:
169arithmetic coded JPEG is not yet widely implemented, so many decoders will be
170unable to view an arithmetic coded JPEG file at all.
171.TP
172.BI \-block " N"
173Set DCT block size. All N from 1 to 16 are possible.
174Default is 8 (baseline format).
175Larger values produce higher compression,
176smaller values produce higher quality
177(exact DCT stage possible with 1 or 2; with the default quality of 75 and
178default Luminance qtable the DCT+Quantization stage is lossless for N=1).
179.B Caution:
180An implementation of the JPEG SmartScale extension is required for this
181feature. SmartScale enabled JPEG is not yet widely implemented, so many
182decoders will be unable to view a SmartScale extended JPEG file at all.
183.TP
184.B \-dct int
185Use integer DCT method (default).
186.TP
187.B \-dct fast
188Use fast integer DCT (less accurate).
189.TP
190.B \-dct float
191Use floating-point DCT method.
192The float method is very slightly more accurate than the int method, but is
193much slower unless your machine has very fast floating-point hardware. Also
194note that results of the floating-point method may vary slightly across
195machines, while the integer methods should give the same results everywhere.
196The fast integer method is much less accurate than the other two.
197.TP
198.B \-nosmooth
199Don't use high-quality downsampling.
200.TP
201.BI \-restart " N"
202Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
203attached to the number.
204.B \-restart 0
205(the default) means no restart markers.
206.TP
207.BI \-smooth " N"
208Smooth the input image to eliminate dithering noise. N, ranging from 1 to
209100, indicates the strength of smoothing. 0 (the default) means no smoothing.
210.TP
211.BI \-maxmemory " N"
212Set limit for amount of memory to use in processing large images. Value is
213in thousands of bytes, or millions of bytes if "M" is attached to the
214number. For example,
215.B \-max 4m
216selects 4000000 bytes. If more space is needed, temporary files will be used.
217.TP
218.BI \-outfile " name"
219Send output image to the named file, not to standard output.
220.TP
221.B \-verbose
222Enable debug printout. More
223.BR \-v 's
224give more output. Also, version information is printed at startup.
225.TP
226.B \-debug
227Same as
228.BR \-verbose .
229.PP
230The
231.B \-restart
232option inserts extra markers that allow a JPEG decoder to resynchronize after
233a transmission error. Without restart markers, any damage to a compressed
234file will usually ruin the image from the point of the error to the end of the
235image; with restart markers, the damage is usually confined to the portion of
236the image up to the next restart marker. Of course, the restart markers
237occupy extra space. We recommend
238.B \-restart 1
239for images that will be transmitted across unreliable networks such as Usenet.
240.PP
241The
242.B \-smooth
243option filters the input to eliminate fine-scale noise. This is often useful
244when converting dithered images to JPEG: a moderate smoothing factor of 10 to
24550 gets rid of dithering patterns in the input file, resulting in a smaller
246JPEG file and a better-looking image. Too large a smoothing factor will
247visibly blur the image, however.
248.PP
249Switches for wizards:
250.TP
251.B \-baseline
252Force baseline-compatible quantization tables to be generated. This clamps
253quantization values to 8 bits even at low quality settings. (This switch is
254poorly named, since it does not ensure that the output is actually baseline
255JPEG. For example, you can use
256.B \-baseline
257and
258.B \-progressive
259together.)
260.TP
261.BI \-qtables " file"
262Use the quantization tables given in the specified text file.
263.TP
264.BI \-qslots " N[,...]"
265Select which quantization table to use for each color component.
266.TP
267.BI \-sample " HxV[,...]"
268Set JPEG sampling factors for each color component.
269.TP
270.BI \-scans " file"
271Use the scan script given in the specified text file.
272.PP
273The "wizard" switches are intended for experimentation with JPEG. If you
274don't know what you are doing, \fBdon't use them\fR. These switches are
275documented further in the file wizard.txt.
276.SH EXAMPLES
277.LP
278This example compresses the PPM file foo.ppm with a quality factor of
27960 and saves the output as foo.jpg:
280.IP
281.B cjpeg \-quality
282.I 60 foo.ppm
283.B >
284.I foo.jpg
285.SH HINTS
286Color GIF files are not the ideal input for JPEG; JPEG is really intended for
287compressing full-color (24-bit) images. In particular, don't try to convert
288cartoons, line drawings, and other images that have only a few distinct
289colors. GIF works great on these, JPEG does not. If you want to convert a
290GIF to JPEG, you should experiment with
291.BR cjpeg 's
292.B \-quality
293and
294.B \-smooth
295options to get a satisfactory conversion.
296.B \-smooth 10
297or so is often helpful.
298.PP
299Avoid running an image through a series of JPEG compression/decompression
300cycles. Image quality loss will accumulate; after ten or so cycles the image
301may be noticeably worse than it was after one cycle. It's best to use a
302lossless format while manipulating an image, then convert to JPEG format when
303you are ready to file the image away.
304.PP
305The
306.B \-optimize
307option to
308.B cjpeg
309is worth using when you are making a "final" version for posting or archiving.
310It's also a win when you are using low quality settings to make very small
311JPEG files; the percentage improvement is often a lot more than it is on
312larger files. (At present,
313.B \-optimize
314mode is always selected when generating progressive JPEG files.)
315.SH ENVIRONMENT
316.TP
317.B JPEGMEM
318If this environment variable is set, its value is the default memory limit.
319The value is specified as described for the
320.B \-maxmemory
321switch.
322.B JPEGMEM
323overrides the default value specified when the program was compiled, and
324itself is overridden by an explicit
325.BR \-maxmemory .
326.SH SEE ALSO
327.BR djpeg (1),
328.BR jpegtran (1),
329.BR rdjpgcom (1),
330.BR wrjpgcom (1)
331.br
332.BR ppm (5),
333.BR pgm (5)
334.br
335Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
336Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
337.SH AUTHOR
338Independent JPEG Group
339.SH BUGS
340GIF input files are no longer supported, to avoid the Unisys LZW patent.
341(Conversion of GIF files to JPEG is usually a bad idea anyway.)
342.PP
343Not all variants of BMP and Targa file formats are supported.
344.PP
345The
346.B \-targa
347switch is not a bug, it's a feature. (It would be a bug if the Targa format
348designers had not been clueless.)
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.c
new file mode 100644
index 0000000..a999eee
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/cjpeg.c
@@ -0,0 +1,643 @@
1/*
2 * cjpeg.c
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * Modified 2003-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a command-line user interface for the JPEG compressor.
10 * It should work on any system with Unix- or MS-DOS-style command lines.
11 *
12 * Two different command line styles are permitted, depending on the
13 * compile-time switch TWO_FILE_COMMANDLINE:
14 * cjpeg [options] inputfile outputfile
15 * cjpeg [options] [inputfile]
16 * In the second style, output is always to standard output, which you'd
17 * normally redirect to a file or pipe to some other program. Input is
18 * either from a named file or from standard input (typically redirected).
19 * The second style is convenient on Unix but is unhelpful on systems that
20 * don't support pipes. Also, you MUST use the first style if your system
21 * doesn't do binary I/O to stdin/stdout.
22 * To simplify script writing, the "-outfile" switch is provided. The syntax
23 * cjpeg [options] -outfile outputfile inputfile
24 * works regardless of which command line style is used.
25 */
26
27#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
28#include "jversion.h" /* for version message */
29
30#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
31#ifdef __MWERKS__
32#include <SIOUX.h> /* Metrowerks needs this */
33#include <console.h> /* ... and this */
34#endif
35#ifdef THINK_C
36#include <console.h> /* Think declares it here */
37#endif
38#endif
39
40
41/* Create the add-on message string table. */
42
43#define JMESSAGE(code,string) string ,
44
45static const char * const cdjpeg_message_table[] = {
46#include "cderror.h"
47 NULL
48};
49
50
51/*
52 * This routine determines what format the input file is,
53 * and selects the appropriate input-reading module.
54 *
55 * To determine which family of input formats the file belongs to,
56 * we may look only at the first byte of the file, since C does not
57 * guarantee that more than one character can be pushed back with ungetc.
58 * Looking at additional bytes would require one of these approaches:
59 * 1) assume we can fseek() the input file (fails for piped input);
60 * 2) assume we can push back more than one character (works in
61 * some C implementations, but unportable);
62 * 3) provide our own buffering (breaks input readers that want to use
63 * stdio directly, such as the RLE library);
64 * or 4) don't put back the data, and modify the input_init methods to assume
65 * they start reading after the start of file (also breaks RLE library).
66 * #1 is attractive for MS-DOS but is untenable on Unix.
67 *
68 * The most portable solution for file types that can't be identified by their
69 * first byte is to make the user tell us what they are. This is also the
70 * only approach for "raw" file types that contain only arbitrary values.
71 * We presently apply this method for Targa files. Most of the time Targa
72 * files start with 0x00, so we recognize that case. Potentially, however,
73 * a Targa file could start with any byte value (byte 0 is the length of the
74 * seldom-used ID field), so we provide a switch to force Targa input mode.
75 */
76
77static boolean is_targa; /* records user -targa switch */
78
79
80LOCAL(cjpeg_source_ptr)
81select_file_type (j_compress_ptr cinfo, FILE * infile)
82{
83 int c;
84
85 if (is_targa) {
86#ifdef TARGA_SUPPORTED
87 return jinit_read_targa(cinfo);
88#else
89 ERREXIT(cinfo, JERR_TGA_NOTCOMP);
90#endif
91 }
92
93 if ((c = getc(infile)) == EOF)
94 ERREXIT(cinfo, JERR_INPUT_EMPTY);
95 if (ungetc(c, infile) == EOF)
96 ERREXIT(cinfo, JERR_UNGETC_FAILED);
97
98 switch (c) {
99#ifdef BMP_SUPPORTED
100 case 'B':
101 return jinit_read_bmp(cinfo);
102#endif
103#ifdef GIF_SUPPORTED
104 case 'G':
105 return jinit_read_gif(cinfo);
106#endif
107#ifdef PPM_SUPPORTED
108 case 'P':
109 return jinit_read_ppm(cinfo);
110#endif
111#ifdef RLE_SUPPORTED
112 case 'R':
113 return jinit_read_rle(cinfo);
114#endif
115#ifdef TARGA_SUPPORTED
116 case 0x00:
117 return jinit_read_targa(cinfo);
118#endif
119 default:
120 ERREXIT(cinfo, JERR_UNKNOWN_FORMAT);
121 break;
122 }
123
124 return NULL; /* suppress compiler warnings */
125}
126
127
128/*
129 * Argument-parsing code.
130 * The switch parser is designed to be useful with DOS-style command line
131 * syntax, ie, intermixed switches and file names, where only the switches
132 * to the left of a given file name affect processing of that file.
133 * The main program in this file doesn't actually use this capability...
134 */
135
136
137static const char * progname; /* program name for error messages */
138static char * outfilename; /* for -outfile switch */
139
140
141LOCAL(void)
142usage (void)
143/* complain about bad command line */
144{
145 fprintf(stderr, "usage: %s [switches] ", progname);
146#ifdef TWO_FILE_COMMANDLINE
147 fprintf(stderr, "inputfile outputfile\n");
148#else
149 fprintf(stderr, "[inputfile]\n");
150#endif
151
152 fprintf(stderr, "Switches (names may be abbreviated):\n");
153 fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n");
154 fprintf(stderr, " -grayscale Create monochrome JPEG file\n");
155 fprintf(stderr, " -rgb Create RGB JPEG file\n");
156#ifdef ENTROPY_OPT_SUPPORTED
157 fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n");
158#endif
159#ifdef C_PROGRESSIVE_SUPPORTED
160 fprintf(stderr, " -progressive Create progressive JPEG file\n");
161#endif
162#ifdef DCT_SCALING_SUPPORTED
163 fprintf(stderr, " -scale M/N Scale image by fraction M/N, eg, 1/2\n");
164#endif
165#ifdef TARGA_SUPPORTED
166 fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
167#endif
168 fprintf(stderr, "Switches for advanced users:\n");
169#ifdef C_ARITH_CODING_SUPPORTED
170 fprintf(stderr, " -arithmetic Use arithmetic coding\n");
171#endif
172#ifdef DCT_SCALING_SUPPORTED
173 fprintf(stderr, " -block N DCT block size (1..16; default is 8)\n");
174#endif
175#ifdef DCT_ISLOW_SUPPORTED
176 fprintf(stderr, " -dct int Use integer DCT method%s\n",
177 (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
178#endif
179#ifdef DCT_IFAST_SUPPORTED
180 fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
181 (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
182#endif
183#ifdef DCT_FLOAT_SUPPORTED
184 fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
185 (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
186#endif
187 fprintf(stderr, " -nosmooth Don't use high-quality downsampling\n");
188 fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
189#ifdef INPUT_SMOOTHING_SUPPORTED
190 fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)\n");
191#endif
192 fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
193 fprintf(stderr, " -outfile name Specify name for output file\n");
194 fprintf(stderr, " -verbose or -debug Emit debug output\n");
195 fprintf(stderr, "Switches for wizards:\n");
196 fprintf(stderr, " -baseline Force baseline quantization tables\n");
197 fprintf(stderr, " -qtables file Use quantization tables given in file\n");
198 fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
199 fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n");
200#ifdef C_MULTISCAN_FILES_SUPPORTED
201 fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
202#endif
203 exit(EXIT_FAILURE);
204}
205
206
207LOCAL(int)
208parse_switches (j_compress_ptr cinfo, int argc, char **argv,
209 int last_file_arg_seen, boolean for_real)
210/* Parse optional switches.
211 * Returns argv[] index of first file-name argument (== argc if none).
212 * Any file names with indexes <= last_file_arg_seen are ignored;
213 * they have presumably been processed in a previous iteration.
214 * (Pass 0 for last_file_arg_seen on the first or only iteration.)
215 * for_real is FALSE on the first (dummy) pass; we may skip any expensive
216 * processing.
217 */
218{
219 int argn;
220 char * arg;
221 boolean force_baseline;
222 boolean simple_progressive;
223 char * qualityarg = NULL; /* saves -quality parm if any */
224 char * qtablefile = NULL; /* saves -qtables filename if any */
225 char * qslotsarg = NULL; /* saves -qslots parm if any */
226 char * samplearg = NULL; /* saves -sample parm if any */
227 char * scansarg = NULL; /* saves -scans parm if any */
228
229 /* Set up default JPEG parameters. */
230
231 force_baseline = FALSE; /* by default, allow 16-bit quantizers */
232 simple_progressive = FALSE;
233 is_targa = FALSE;
234 outfilename = NULL;
235 cinfo->err->trace_level = 0;
236
237 /* Scan command line options, adjust parameters */
238
239 for (argn = 1; argn < argc; argn++) {
240 arg = argv[argn];
241 if (*arg != '-') {
242 /* Not a switch, must be a file name argument */
243 if (argn <= last_file_arg_seen) {
244 outfilename = NULL; /* -outfile applies to just one input file */
245 continue; /* ignore this name if previously processed */
246 }
247 break; /* else done parsing switches */
248 }
249 arg++; /* advance past switch marker character */
250
251 if (keymatch(arg, "arithmetic", 1)) {
252 /* Use arithmetic coding. */
253#ifdef C_ARITH_CODING_SUPPORTED
254 cinfo->arith_code = TRUE;
255#else
256 fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
257 progname);
258 exit(EXIT_FAILURE);
259#endif
260
261 } else if (keymatch(arg, "baseline", 2)) {
262 /* Force baseline-compatible output (8-bit quantizer values). */
263 force_baseline = TRUE;
264
265 } else if (keymatch(arg, "block", 2)) {
266 /* Set DCT block size. */
267#if defined DCT_SCALING_SUPPORTED && JPEG_LIB_VERSION_MAJOR >= 8 && \
268 (JPEG_LIB_VERSION_MAJOR > 8 || JPEG_LIB_VERSION_MINOR >= 3)
269 int val;
270
271 if (++argn >= argc) /* advance to next argument */
272 usage();
273 if (sscanf(argv[argn], "%d", &val) != 1)
274 usage();
275 if (val < 1 || val > 16)
276 usage();
277 cinfo->block_size = val;
278#else
279 fprintf(stderr, "%s: sorry, block size setting not supported\n",
280 progname);
281 exit(EXIT_FAILURE);
282#endif
283
284 } else if (keymatch(arg, "dct", 2)) {
285 /* Select DCT algorithm. */
286 if (++argn >= argc) /* advance to next argument */
287 usage();
288 if (keymatch(argv[argn], "int", 1)) {
289 cinfo->dct_method = JDCT_ISLOW;
290 } else if (keymatch(argv[argn], "fast", 2)) {
291 cinfo->dct_method = JDCT_IFAST;
292 } else if (keymatch(argv[argn], "float", 2)) {
293 cinfo->dct_method = JDCT_FLOAT;
294 } else
295 usage();
296
297 } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
298 /* Enable debug printouts. */
299 /* On first -d, print version identification */
300 static boolean printed_version = FALSE;
301
302 if (! printed_version) {
303 fprintf(stderr, "Independent JPEG Group's CJPEG, version %s\n%s\n",
304 JVERSION, JCOPYRIGHT);
305 printed_version = TRUE;
306 }
307 cinfo->err->trace_level++;
308
309 } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
310 /* Force a monochrome JPEG file to be generated. */
311 jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
312
313 } else if (keymatch(arg, "rgb", 3)) {
314 /* Force an RGB JPEG file to be generated. */
315 jpeg_set_colorspace(cinfo, JCS_RGB);
316
317 } else if (keymatch(arg, "maxmemory", 3)) {
318 /* Maximum memory in Kb (or Mb with 'm'). */
319 long lval;
320 char ch = 'x';
321
322 if (++argn >= argc) /* advance to next argument */
323 usage();
324 if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
325 usage();
326 if (ch == 'm' || ch == 'M')
327 lval *= 1000L;
328 cinfo->mem->max_memory_to_use = lval * 1000L;
329
330 } else if (keymatch(arg, "nosmooth", 3)) {
331 /* Suppress fancy downsampling */
332 cinfo->do_fancy_downsampling = FALSE;
333
334 } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
335 /* Enable entropy parm optimization. */
336#ifdef ENTROPY_OPT_SUPPORTED
337 cinfo->optimize_coding = TRUE;
338#else
339 fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n",
340 progname);
341 exit(EXIT_FAILURE);
342#endif
343
344 } else if (keymatch(arg, "outfile", 4)) {
345 /* Set output file name. */
346 if (++argn >= argc) /* advance to next argument */
347 usage();
348 outfilename = argv[argn]; /* save it away for later use */
349
350 } else if (keymatch(arg, "progressive", 1)) {
351 /* Select simple progressive mode. */
352#ifdef C_PROGRESSIVE_SUPPORTED
353 simple_progressive = TRUE;
354 /* We must postpone execution until num_components is known. */
355#else
356 fprintf(stderr, "%s: sorry, progressive output was not compiled\n",
357 progname);
358 exit(EXIT_FAILURE);
359#endif
360
361 } else if (keymatch(arg, "quality", 1)) {
362 /* Quality ratings (quantization table scaling factors). */
363 if (++argn >= argc) /* advance to next argument */
364 usage();
365 qualityarg = argv[argn];
366
367 } else if (keymatch(arg, "qslots", 2)) {
368 /* Quantization table slot numbers. */
369 if (++argn >= argc) /* advance to next argument */
370 usage();
371 qslotsarg = argv[argn];
372 /* Must delay setting qslots until after we have processed any
373 * colorspace-determining switches, since jpeg_set_colorspace sets
374 * default quant table numbers.
375 */
376
377 } else if (keymatch(arg, "qtables", 2)) {
378 /* Quantization tables fetched from file. */
379 if (++argn >= argc) /* advance to next argument */
380 usage();
381 qtablefile = argv[argn];
382 /* We postpone actually reading the file in case -quality comes later. */
383
384 } else if (keymatch(arg, "restart", 1)) {
385 /* Restart interval in MCU rows (or in MCUs with 'b'). */
386 long lval;
387 char ch = 'x';
388
389 if (++argn >= argc) /* advance to next argument */
390 usage();
391 if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
392 usage();
393 if (lval < 0 || lval > 65535L)
394 usage();
395 if (ch == 'b' || ch == 'B') {
396 cinfo->restart_interval = (unsigned int) lval;
397 cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
398 } else {
399 cinfo->restart_in_rows = (int) lval;
400 /* restart_interval will be computed during startup */
401 }
402
403 } else if (keymatch(arg, "sample", 2)) {
404 /* Set sampling factors. */
405 if (++argn >= argc) /* advance to next argument */
406 usage();
407 samplearg = argv[argn];
408 /* Must delay setting sample factors until after we have processed any
409 * colorspace-determining switches, since jpeg_set_colorspace sets
410 * default sampling factors.
411 */
412
413 } else if (keymatch(arg, "scale", 4)) {
414 /* Scale the image by a fraction M/N. */
415 if (++argn >= argc) /* advance to next argument */
416 usage();
417 if (sscanf(argv[argn], "%d/%d",
418 &cinfo->scale_num, &cinfo->scale_denom) != 2)
419 usage();
420
421 } else if (keymatch(arg, "scans", 4)) {
422 /* Set scan script. */
423#ifdef C_MULTISCAN_FILES_SUPPORTED
424 if (++argn >= argc) /* advance to next argument */
425 usage();
426 scansarg = argv[argn];
427 /* We must postpone reading the file in case -progressive appears. */
428#else
429 fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n",
430 progname);
431 exit(EXIT_FAILURE);
432#endif
433
434 } else if (keymatch(arg, "smooth", 2)) {
435 /* Set input smoothing factor. */
436 int val;
437
438 if (++argn >= argc) /* advance to next argument */
439 usage();
440 if (sscanf(argv[argn], "%d", &val) != 1)
441 usage();
442 if (val < 0 || val > 100)
443 usage();
444 cinfo->smoothing_factor = val;
445
446 } else if (keymatch(arg, "targa", 1)) {
447 /* Input file is Targa format. */
448 is_targa = TRUE;
449
450 } else {
451 usage(); /* bogus switch */
452 }
453 }
454
455 /* Post-switch-scanning cleanup */
456
457 if (for_real) {
458
459 /* Set quantization tables for selected quality. */
460 /* Some or all may be overridden if -qtables is present. */
461 if (qualityarg != NULL) /* process -quality if it was present */
462 if (! set_quality_ratings(cinfo, qualityarg, force_baseline))
463 usage();
464
465 if (qtablefile != NULL) /* process -qtables if it was present */
466 if (! read_quant_tables(cinfo, qtablefile, force_baseline))
467 usage();
468
469 if (qslotsarg != NULL) /* process -qslots if it was present */
470 if (! set_quant_slots(cinfo, qslotsarg))
471 usage();
472
473 if (samplearg != NULL) /* process -sample if it was present */
474 if (! set_sample_factors(cinfo, samplearg))
475 usage();
476
477#ifdef C_PROGRESSIVE_SUPPORTED
478 if (simple_progressive) /* process -progressive; -scans can override */
479 jpeg_simple_progression(cinfo);
480#endif
481
482#ifdef C_MULTISCAN_FILES_SUPPORTED
483 if (scansarg != NULL) /* process -scans if it was present */
484 if (! read_scan_script(cinfo, scansarg))
485 usage();
486#endif
487 }
488
489 return argn; /* return index of next arg (file name) */
490}
491
492
493/*
494 * The main program.
495 */
496
497int
498main (int argc, char **argv)
499{
500 struct jpeg_compress_struct cinfo;
501 struct jpeg_error_mgr jerr;
502#ifdef PROGRESS_REPORT
503 struct cdjpeg_progress_mgr progress;
504#endif
505 int file_index;
506 cjpeg_source_ptr src_mgr;
507 FILE * input_file;
508 FILE * output_file;
509 JDIMENSION num_scanlines;
510
511 /* On Mac, fetch a command line. */
512#ifdef USE_CCOMMAND
513 argc = ccommand(&argv);
514#endif
515
516 progname = argv[0];
517 if (progname == NULL || progname[0] == 0)
518 progname = "cjpeg"; /* in case C library doesn't provide it */
519
520 /* Initialize the JPEG compression object with default error handling. */
521 cinfo.err = jpeg_std_error(&jerr);
522 jpeg_create_compress(&cinfo);
523 /* Add some application-specific error messages (from cderror.h) */
524 jerr.addon_message_table = cdjpeg_message_table;
525 jerr.first_addon_message = JMSG_FIRSTADDONCODE;
526 jerr.last_addon_message = JMSG_LASTADDONCODE;
527
528 /* Now safe to enable signal catcher. */
529#ifdef NEED_SIGNAL_CATCHER
530 enable_signal_catcher((j_common_ptr) &cinfo);
531#endif
532
533 /* Initialize JPEG parameters.
534 * Much of this may be overridden later.
535 * In particular, we don't yet know the input file's color space,
536 * but we need to provide some value for jpeg_set_defaults() to work.
537 */
538
539 cinfo.in_color_space = JCS_RGB; /* arbitrary guess */
540 jpeg_set_defaults(&cinfo);
541
542 /* Scan command line to find file names.
543 * It is convenient to use just one switch-parsing routine, but the switch
544 * values read here are ignored; we will rescan the switches after opening
545 * the input file.
546 */
547
548 file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);
549
550#ifdef TWO_FILE_COMMANDLINE
551 /* Must have either -outfile switch or explicit output file name */
552 if (outfilename == NULL) {
553 if (file_index != argc-2) {
554 fprintf(stderr, "%s: must name one input and one output file\n",
555 progname);
556 usage();
557 }
558 outfilename = argv[file_index+1];
559 } else {
560 if (file_index != argc-1) {
561 fprintf(stderr, "%s: must name one input and one output file\n",
562 progname);
563 usage();
564 }
565 }
566#else
567 /* Unix style: expect zero or one file name */
568 if (file_index < argc-1) {
569 fprintf(stderr, "%s: only one input file\n", progname);
570 usage();
571 }
572#endif /* TWO_FILE_COMMANDLINE */
573
574 /* Open the input file. */
575 if (file_index < argc) {
576 if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
577 fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
578 exit(EXIT_FAILURE);
579 }
580 } else {
581 /* default input file is stdin */
582 input_file = read_stdin();
583 }
584
585 /* Open the output file. */
586 if (outfilename != NULL) {
587 if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
588 fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
589 exit(EXIT_FAILURE);
590 }
591 } else {
592 /* default output file is stdout */
593 output_file = write_stdout();
594 }
595
596#ifdef PROGRESS_REPORT
597 start_progress_monitor((j_common_ptr) &cinfo, &progress);
598#endif
599
600 /* Figure out the input file format, and set up to read it. */
601 src_mgr = select_file_type(&cinfo, input_file);
602 src_mgr->input_file = input_file;
603
604 /* Read the input file header to obtain file size & colorspace. */
605 (*src_mgr->start_input) (&cinfo, src_mgr);
606
607 /* Now that we know input colorspace, fix colorspace-dependent defaults */
608 jpeg_default_colorspace(&cinfo);
609
610 /* Adjust default compression parameters by re-parsing the options */
611 file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
612
613 /* Specify data destination for compression */
614 jpeg_stdio_dest(&cinfo, output_file);
615
616 /* Start compressor */
617 jpeg_start_compress(&cinfo, TRUE);
618
619 /* Process data */
620 while (cinfo.next_scanline < cinfo.image_height) {
621 num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr);
622 (void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);
623 }
624
625 /* Finish compression and release memory */
626 (*src_mgr->finish_input) (&cinfo, src_mgr);
627 jpeg_finish_compress(&cinfo);
628 jpeg_destroy_compress(&cinfo);
629
630 /* Close files, if we opened them */
631 if (input_file != stdin)
632 fclose(input_file);
633 if (output_file != stdout)
634 fclose(output_file);
635
636#ifdef PROGRESS_REPORT
637 end_progress_monitor((j_common_ptr) &cinfo);
638#endif
639
640 /* All done. */
641 exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
642 return 0; /* suppress no-return-value warnings */
643}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ckconfig.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ckconfig.c
new file mode 100644
index 0000000..fb9429a
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ckconfig.c
@@ -0,0 +1,402 @@
1/*
2 * ckconfig.c
3 *
4 * Copyright (C) 1991-1994, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 */
8
9/*
10 * This program is intended to help you determine how to configure the JPEG
11 * software for installation on a particular system. The idea is to try to
12 * compile and execute this program. If your compiler fails to compile the
13 * program, make changes as indicated in the comments below. Once you can
14 * compile the program, run it, and it will produce a "jconfig.h" file for
15 * your system.
16 *
17 * As a general rule, each time you try to compile this program,
18 * pay attention only to the *first* error message you get from the compiler.
19 * Many C compilers will issue lots of spurious error messages once they
20 * have gotten confused. Go to the line indicated in the first error message,
21 * and read the comments preceding that line to see what to change.
22 *
23 * Almost all of the edits you may need to make to this program consist of
24 * changing a line that reads "#define SOME_SYMBOL" to "#undef SOME_SYMBOL",
25 * or vice versa. This is called defining or undefining that symbol.
26 */
27
28
29/* First we must see if your system has the include files we need.
30 * We start out with the assumption that your system has all the ANSI-standard
31 * include files. If you get any error trying to include one of these files,
32 * undefine the corresponding HAVE_xxx symbol.
33 */
34
35#define HAVE_STDDEF_H /* replace 'define' by 'undef' if error here */
36#ifdef HAVE_STDDEF_H /* next line will be skipped if you undef... */
37#include <stddef.h>
38#endif
39
40#define HAVE_STDLIB_H /* same thing for stdlib.h */
41#ifdef HAVE_STDLIB_H
42#include <stdlib.h>
43#endif
44
45#include <stdio.h> /* If you ain't got this, you ain't got C. */
46
47/* We have to see if your string functions are defined by
48 * strings.h (old BSD convention) or string.h (everybody else).
49 * We try the non-BSD convention first; define NEED_BSD_STRINGS
50 * if the compiler says it can't find string.h.
51 */
52
53#undef NEED_BSD_STRINGS
54
55#ifdef NEED_BSD_STRINGS
56#include <strings.h>
57#else
58#include <string.h>
59#endif
60
61/* On some systems (especially older Unix machines), type size_t is
62 * defined only in the include file <sys/types.h>. If you get a failure
63 * on the size_t test below, try defining NEED_SYS_TYPES_H.
64 */
65
66#undef NEED_SYS_TYPES_H /* start by assuming we don't need it */
67#ifdef NEED_SYS_TYPES_H
68#include <sys/types.h>
69#endif
70
71
72/* Usually type size_t is defined in one of the include files we've included
73 * above. If not, you'll get an error on the "typedef size_t my_size_t;" line.
74 * In that case, first try defining NEED_SYS_TYPES_H just above.
75 * If that doesn't work, you'll have to search through your system library
76 * to figure out which include file defines "size_t". Look for a line that
77 * says "typedef something-or-other size_t;". Then, change the line below
78 * that says "#include <someincludefile.h>" to instead include the file
79 * you found size_t in, and define NEED_SPECIAL_INCLUDE. If you can't find
80 * type size_t anywhere, try replacing "#include <someincludefile.h>" with
81 * "typedef unsigned int size_t;".
82 */
83
84#undef NEED_SPECIAL_INCLUDE /* assume we DON'T need it, for starters */
85
86#ifdef NEED_SPECIAL_INCLUDE
87#include <someincludefile.h>
88#endif
89
90typedef size_t my_size_t; /* The payoff: do we have size_t now? */
91
92
93/* The next question is whether your compiler supports ANSI-style function
94 * prototypes. You need to know this in order to choose between using
95 * makefile.ansi and using makefile.unix.
96 * The #define line below is set to assume you have ANSI function prototypes.
97 * If you get an error in this group of lines, undefine HAVE_PROTOTYPES.
98 */
99
100#define HAVE_PROTOTYPES
101
102#ifdef HAVE_PROTOTYPES
103int testfunction (int arg1, int * arg2); /* check prototypes */
104
105struct methods_struct { /* check method-pointer declarations */
106 int (*error_exit) (char *msgtext);
107 int (*trace_message) (char *msgtext);
108 int (*another_method) (void);
109};
110
111int testfunction (int arg1, int * arg2) /* check definitions */
112{
113 return arg2[arg1];
114}
115
116int test2function (void) /* check void arg list */
117{
118 return 0;
119}
120#endif
121
122
123/* Now we want to find out if your compiler knows what "unsigned char" means.
124 * If you get an error on the "unsigned char un_char;" line,
125 * then undefine HAVE_UNSIGNED_CHAR.
126 */
127
128#define HAVE_UNSIGNED_CHAR
129
130#ifdef HAVE_UNSIGNED_CHAR
131unsigned char un_char;
132#endif
133
134
135/* Now we want to find out if your compiler knows what "unsigned short" means.
136 * If you get an error on the "unsigned short un_short;" line,
137 * then undefine HAVE_UNSIGNED_SHORT.
138 */
139
140#define HAVE_UNSIGNED_SHORT
141
142#ifdef HAVE_UNSIGNED_SHORT
143unsigned short un_short;
144#endif
145
146
147/* Now we want to find out if your compiler understands type "void".
148 * If you get an error anywhere in here, undefine HAVE_VOID.
149 */
150
151#define HAVE_VOID
152
153#ifdef HAVE_VOID
154/* Caution: a C++ compiler will insist on complete prototypes */
155typedef void * void_ptr; /* check void * */
156#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */
157typedef void (*void_func) (int a, int b);
158#else
159typedef void (*void_func) ();
160#endif
161
162#ifdef HAVE_PROTOTYPES /* check void function result */
163void test3function (void_ptr arg1, void_func arg2)
164#else
165void test3function (arg1, arg2)
166 void_ptr arg1;
167 void_func arg2;
168#endif
169{
170 char * locptr = (char *) arg1; /* check casting to and from void * */
171 arg1 = (void *) locptr;
172 (*arg2) (1, 2); /* check call of fcn returning void */
173}
174#endif
175
176
177/* Now we want to find out if your compiler knows what "const" means.
178 * If you get an error here, undefine HAVE_CONST.
179 */
180
181#define HAVE_CONST
182
183#ifdef HAVE_CONST
184static const int carray[3] = {1, 2, 3};
185
186#ifdef HAVE_PROTOTYPES
187int test4function (const int arg1)
188#else
189int test4function (arg1)
190 const int arg1;
191#endif
192{
193 return carray[arg1];
194}
195#endif
196
197
198/* If you get an error or warning about this structure definition,
199 * define INCOMPLETE_TYPES_BROKEN.
200 */
201
202#undef INCOMPLETE_TYPES_BROKEN
203
204#ifndef INCOMPLETE_TYPES_BROKEN
205typedef struct undefined_structure * undef_struct_ptr;
206#endif
207
208
209/* If you get an error about duplicate names,
210 * define NEED_SHORT_EXTERNAL_NAMES.
211 */
212
213#undef NEED_SHORT_EXTERNAL_NAMES
214
215#ifndef NEED_SHORT_EXTERNAL_NAMES
216
217int possibly_duplicate_function ()
218{
219 return 0;
220}
221
222int possibly_dupli_function ()
223{
224 return 1;
225}
226
227#endif
228
229
230
231/************************************************************************
232 * OK, that's it. You should not have to change anything beyond this
233 * point in order to compile and execute this program. (You might get
234 * some warnings, but you can ignore them.)
235 * When you run the program, it will make a couple more tests that it
236 * can do automatically, and then it will create jconfig.h and print out
237 * any additional suggestions it has.
238 ************************************************************************
239 */
240
241
242#ifdef HAVE_PROTOTYPES
243int is_char_signed (int arg)
244#else
245int is_char_signed (arg)
246 int arg;
247#endif
248{
249 if (arg == 189) { /* expected result for unsigned char */
250 return 0; /* type char is unsigned */
251 }
252 else if (arg != -67) { /* expected result for signed char */
253 printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
254 printf("I fear the JPEG software will not work at all.\n\n");
255 }
256 return 1; /* assume char is signed otherwise */
257}
258
259
260#ifdef HAVE_PROTOTYPES
261int is_shifting_signed (long arg)
262#else
263int is_shifting_signed (arg)
264 long arg;
265#endif
266/* See whether right-shift on a long is signed or not. */
267{
268 long res = arg >> 4;
269
270 if (res == -0x7F7E80CL) { /* expected result for signed shift */
271 return 1; /* right shift is signed */
272 }
273 /* see if unsigned-shift hack will fix it. */
274 /* we can't just test exact value since it depends on width of long... */
275 res |= (~0L) << (32-4);
276 if (res == -0x7F7E80CL) { /* expected result now? */
277 return 0; /* right shift is unsigned */
278 }
279 printf("Right shift isn't acting as I expect it to.\n");
280 printf("I fear the JPEG software will not work at all.\n\n");
281 return 0; /* try it with unsigned anyway */
282}
283
284
285#ifdef HAVE_PROTOTYPES
286int main (int argc, char ** argv)
287#else
288int main (argc, argv)
289 int argc;
290 char ** argv;
291#endif
292{
293 char signed_char_check = (char) (-67);
294 FILE *outfile;
295
296 /* Attempt to write jconfig.h */
297 if ((outfile = fopen("jconfig.h", "w")) == NULL) {
298 printf("Failed to write jconfig.h\n");
299 return 1;
300 }
301
302 /* Write out all the info */
303 fprintf(outfile, "/* jconfig.h --- generated by ckconfig.c */\n");
304 fprintf(outfile, "/* see jconfig.txt for explanations */\n\n");
305#ifdef HAVE_PROTOTYPES
306 fprintf(outfile, "#define HAVE_PROTOTYPES\n");
307#else
308 fprintf(outfile, "#undef HAVE_PROTOTYPES\n");
309#endif
310#ifdef HAVE_UNSIGNED_CHAR
311 fprintf(outfile, "#define HAVE_UNSIGNED_CHAR\n");
312#else
313 fprintf(outfile, "#undef HAVE_UNSIGNED_CHAR\n");
314#endif
315#ifdef HAVE_UNSIGNED_SHORT
316 fprintf(outfile, "#define HAVE_UNSIGNED_SHORT\n");
317#else
318 fprintf(outfile, "#undef HAVE_UNSIGNED_SHORT\n");
319#endif
320#ifdef HAVE_VOID
321 fprintf(outfile, "/* #define void char */\n");
322#else
323 fprintf(outfile, "#define void char\n");
324#endif
325#ifdef HAVE_CONST
326 fprintf(outfile, "/* #define const */\n");
327#else
328 fprintf(outfile, "#define const\n");
329#endif
330 if (is_char_signed((int) signed_char_check))
331 fprintf(outfile, "#undef CHAR_IS_UNSIGNED\n");
332 else
333 fprintf(outfile, "#define CHAR_IS_UNSIGNED\n");
334#ifdef HAVE_STDDEF_H
335 fprintf(outfile, "#define HAVE_STDDEF_H\n");
336#else
337 fprintf(outfile, "#undef HAVE_STDDEF_H\n");
338#endif
339#ifdef HAVE_STDLIB_H
340 fprintf(outfile, "#define HAVE_STDLIB_H\n");
341#else
342 fprintf(outfile, "#undef HAVE_STDLIB_H\n");
343#endif
344#ifdef NEED_BSD_STRINGS
345 fprintf(outfile, "#define NEED_BSD_STRINGS\n");
346#else
347 fprintf(outfile, "#undef NEED_BSD_STRINGS\n");
348#endif
349#ifdef NEED_SYS_TYPES_H
350 fprintf(outfile, "#define NEED_SYS_TYPES_H\n");
351#else
352 fprintf(outfile, "#undef NEED_SYS_TYPES_H\n");
353#endif
354 fprintf(outfile, "#undef NEED_FAR_POINTERS\n");
355#ifdef NEED_SHORT_EXTERNAL_NAMES
356 fprintf(outfile, "#define NEED_SHORT_EXTERNAL_NAMES\n");
357#else
358 fprintf(outfile, "#undef NEED_SHORT_EXTERNAL_NAMES\n");
359#endif
360#ifdef INCOMPLETE_TYPES_BROKEN
361 fprintf(outfile, "#define INCOMPLETE_TYPES_BROKEN\n");
362#else
363 fprintf(outfile, "#undef INCOMPLETE_TYPES_BROKEN\n");
364#endif
365 fprintf(outfile, "\n#ifdef JPEG_INTERNALS\n\n");
366 if (is_shifting_signed(-0x7F7E80B1L))
367 fprintf(outfile, "#undef RIGHT_SHIFT_IS_UNSIGNED\n");
368 else
369 fprintf(outfile, "#define RIGHT_SHIFT_IS_UNSIGNED\n");
370 fprintf(outfile, "\n#endif /* JPEG_INTERNALS */\n");
371 fprintf(outfile, "\n#ifdef JPEG_CJPEG_DJPEG\n\n");
372 fprintf(outfile, "#define BMP_SUPPORTED /* BMP image file format */\n");
373 fprintf(outfile, "#define GIF_SUPPORTED /* GIF image file format */\n");
374 fprintf(outfile, "#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */\n");
375 fprintf(outfile, "#undef RLE_SUPPORTED /* Utah RLE image file format */\n");
376 fprintf(outfile, "#define TARGA_SUPPORTED /* Targa image file format */\n\n");
377 fprintf(outfile, "#undef TWO_FILE_COMMANDLINE /* You may need this on non-Unix systems */\n");
378 fprintf(outfile, "#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */\n");
379 fprintf(outfile, "#undef DONT_USE_B_MODE\n");
380 fprintf(outfile, "/* #define PROGRESS_REPORT */ /* optional */\n");
381 fprintf(outfile, "\n#endif /* JPEG_CJPEG_DJPEG */\n");
382
383 /* Close the jconfig.h file */
384 fclose(outfile);
385
386 /* User report */
387 printf("Configuration check for Independent JPEG Group's software done.\n");
388 printf("\nI have written the jconfig.h file for you.\n\n");
389#ifdef HAVE_PROTOTYPES
390 printf("You should use makefile.ansi as the starting point for your Makefile.\n");
391#else
392 printf("You should use makefile.unix as the starting point for your Makefile.\n");
393#endif
394
395#ifdef NEED_SPECIAL_INCLUDE
396 printf("\nYou'll need to change jconfig.h to include the system include file\n");
397 printf("that you found type size_t in, or add a direct definition of type\n");
398 printf("size_t if that's what you used. Just add it to the end.\n");
399#endif
400
401 return 0;
402}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/coderules.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/coderules.txt
new file mode 100644
index 0000000..382efad
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/coderules.txt
@@ -0,0 +1,118 @@
1IJG JPEG LIBRARY: CODING RULES
2
3Copyright (C) 1991-1996, Thomas G. Lane.
4This file is part of the Independent JPEG Group's software.
5For conditions of distribution and use, see the accompanying README file.
6
7
8Since numerous people will be contributing code and bug fixes, it's important
9to establish a common coding style. The goal of using similar coding styles
10is much more important than the details of just what that style is.
11
12In general we follow the recommendations of "Recommended C Style and Coding
13Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and
14Brader). This document is available in the IJG FTP archive (see
15jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).
16
17Block comments should be laid out thusly:
18
19/*
20 * Block comments in this style.
21 */
22
23We indent statements in K&R style, e.g.,
24 if (test) {
25 then-part;
26 } else {
27 else-part;
28 }
29with two spaces per indentation level. (This indentation convention is
30handled automatically by GNU Emacs and many other text editors.)
31
32Multi-word names should be written in lower case with underscores, e.g.,
33multi_word_name (not multiWordName). Preprocessor symbols and enum constants
34are similar but upper case (MULTI_WORD_NAME). Names should be unique within
35the first fifteen characters. (On some older systems, global names must be
36unique within six characters. We accommodate this without cluttering the
37source code by using macros to substitute shorter names.)
38
39We use function prototypes everywhere; we rely on automatic source code
40transformation to feed prototype-less C compilers. Transformation is done
41by the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript).
42ansi2knr is not very bright, so it imposes a format requirement on function
43declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions
44should be written in the following style:
45
46LOCAL(int *)
47function_name (int a, char *b)
48{
49 code...
50}
51
52Note that each function definition must begin with GLOBAL(type), LOCAL(type),
53or METHODDEF(type). These macros expand to "static type" or just "type" as
54appropriate. They provide a readable indication of the routine's usage and
55can readily be changed for special needs. (For instance, special linkage
56keywords can be inserted for use in Windows DLLs.)
57
58ansi2knr does not transform method declarations (function pointers in
59structs). We handle these with a macro JMETHOD, defined as
60 #ifdef HAVE_PROTOTYPES
61 #define JMETHOD(type,methodname,arglist) type (*methodname) arglist
62 #else
63 #define JMETHOD(type,methodname,arglist) type (*methodname) ()
64 #endif
65which is used like this:
66 struct function_pointers {
67 JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp));
68 JMETHOD(void, term_entropy_encoder, (void));
69 };
70Note the set of parentheses surrounding the parameter list.
71
72A similar solution is used for forward and external function declarations
73(see the EXTERN and JPP macros).
74
75If the code is to work on non-ANSI compilers, we cannot rely on a prototype
76declaration to coerce actual parameters into the right types. Therefore, use
77explicit casts on actual parameters whenever the actual parameter type is not
78identical to the formal parameter. Beware of implicit conversions to "int".
79
80It seems there are some non-ANSI compilers in which the sizeof() operator
81is defined to return int, yet size_t is defined as long. Needless to say,
82this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(),
83so that the result is guaranteed to be of type size_t.
84
85
86The JPEG library is intended to be used within larger programs. Furthermore,
87we want it to be reentrant so that it can be used by applications that process
88multiple images concurrently. The following rules support these requirements:
89
901. Avoid direct use of file I/O, "malloc", error report printouts, etc;
91pass these through the common routines provided.
92
932. Minimize global namespace pollution. Functions should be declared static
94wherever possible. (Note that our method-based calling conventions help this
95a lot: in many modules only the initialization function will ever need to be
96called directly, so only that function need be externally visible.) All
97global function names should begin with "jpeg_", and should have an
98abbreviated name (unique in the first six characters) substituted by macro
99when NEED_SHORT_EXTERNAL_NAMES is set.
100
1013. Don't use global variables; anything that must be used in another module
102should be in the common data structures.
103
1044. Don't use static variables except for read-only constant tables. Variables
105that should be private to a module can be placed into private structures (see
106the system architecture document, structure.txt).
107
1085. Source file names should begin with "j" for files that are part of the
109library proper; source files that are not part of the library, such as cjpeg.c
110and djpeg.c, do not begin with "j". Keep source file names to eight
111characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers. Keep
112compression and decompression code in separate source files --- some
113applications may want only one half of the library.
114
115Note: these rules (particularly #4) are not followed religiously in the
116modules that are used in cjpeg/djpeg but are not part of the JPEG library
117proper. Those modules are not really intended to be used in other
118applications.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.guess b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.guess
new file mode 100644
index 0000000..4308b20
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.guess
@@ -0,0 +1,1522 @@
1#! /bin/sh
2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5# 2011 Free Software Foundation, Inc.
6
7timestamp='2011-11-11'
8
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22# 02110-1301, USA.
23#
24# As a special exception to the GNU General Public License, if you
25# distribute this file as part of a program that contains a
26# configuration script generated by Autoconf, you may include it under
27# the same distribution terms that you use for the rest of that program.
28
29
30# Originally written by Per Bothner. Please send patches (context
31# diff format) to <config-patches@gnu.org> and include a ChangeLog
32# entry.
33#
34# This script attempts to guess a canonical system name similar to
35# config.sub. If it succeeds, it prints the system name on stdout, and
36# exits with 0. Otherwise, it exits with 1.
37#
38# You can get the latest version of this script from:
39# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40
41me=`echo "$0" | sed -e 's,.*/,,'`
42
43usage="\
44Usage: $0 [OPTION]
45
46Output the configuration name of the system \`$me' is run on.
47
48Operation modes:
49 -h, --help print this help, then exit
50 -t, --time-stamp print date of last modification, then exit
51 -v, --version print version number, then exit
52
53Report bugs and patches to <config-patches@gnu.org>."
54
55version="\
56GNU config.guess ($timestamp)
57
58Originally written by Per Bothner.
59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
602001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
61Software Foundation, Inc.
62
63This is free software; see the source for copying conditions. There is NO
64warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
65
66help="
67Try \`$me --help' for more information."
68
69# Parse command line
70while test $# -gt 0 ; do
71 case $1 in
72 --time-stamp | --time* | -t )
73 echo "$timestamp" ; exit ;;
74 --version | -v )
75 echo "$version" ; exit ;;
76 --help | --h* | -h )
77 echo "$usage"; exit ;;
78 -- ) # Stop option processing
79 shift; break ;;
80 - ) # Use stdin as input.
81 break ;;
82 -* )
83 echo "$me: invalid option $1$help" >&2
84 exit 1 ;;
85 * )
86 break ;;
87 esac
88done
89
90if test $# != 0; then
91 echo "$me: too many arguments$help" >&2
92 exit 1
93fi
94
95trap 'exit 1' 1 2 15
96
97# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
98# compiler to aid in system detection is discouraged as it requires
99# temporary files to be created and, as you can see below, it is a
100# headache to deal with in a portable fashion.
101
102# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
103# use `HOST_CC' if defined, but it is deprecated.
104
105# Portable tmp directory creation inspired by the Autoconf team.
106
107set_cc_for_build='
108trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110: ${TMPDIR=/tmp} ;
111 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
115dummy=$tmp/dummy ;
116tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
117case $CC_FOR_BUILD,$HOST_CC,$CC in
118 ,,) echo "int x;" > $dummy.c ;
119 for c in cc gcc c89 c99 ; do
120 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
121 CC_FOR_BUILD="$c"; break ;
122 fi ;
123 done ;
124 if test x"$CC_FOR_BUILD" = x ; then
125 CC_FOR_BUILD=no_compiler_found ;
126 fi
127 ;;
128 ,,*) CC_FOR_BUILD=$CC ;;
129 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
130esac ; set_cc_for_build= ;'
131
132# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
133# (ghazi@noc.rutgers.edu 1994-08-24)
134if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
135 PATH=$PATH:/.attbin ; export PATH
136fi
137
138UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
139UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
141UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142
143# Note: order is significant - the case branches are not exclusive.
144
145case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146 *:NetBSD:*:*)
147 # NetBSD (nbsd) targets should (where applicable) match one or
148 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
149 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
150 # switched to ELF, *-*-netbsd* would select the old
151 # object file format. This provides both forward
152 # compatibility and a consistent mechanism for selecting the
153 # object file format.
154 #
155 # Note: NetBSD doesn't particularly care about the vendor
156 # portion of the name. We always set it to "unknown".
157 sysctl="sysctl -n hw.machine_arch"
158 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
159 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
160 case "${UNAME_MACHINE_ARCH}" in
161 armeb) machine=armeb-unknown ;;
162 arm*) machine=arm-unknown ;;
163 sh3el) machine=shl-unknown ;;
164 sh3eb) machine=sh-unknown ;;
165 sh5el) machine=sh5le-unknown ;;
166 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167 esac
168 # The Operating System including object format, if it has switched
169 # to ELF recently, or will in the future.
170 case "${UNAME_MACHINE_ARCH}" in
171 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172 eval $set_cc_for_build
173 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174 | grep -q __ELF__
175 then
176 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177 # Return netbsd for either. FIX?
178 os=netbsd
179 else
180 os=netbsdelf
181 fi
182 ;;
183 *)
184 os=netbsd
185 ;;
186 esac
187 # The OS release
188 # Debian GNU/NetBSD machines have a different userland, and
189 # thus, need a distinct triplet. However, they do not need
190 # kernel version information, so it can be replaced with a
191 # suitable tag, in the style of linux-gnu.
192 case "${UNAME_VERSION}" in
193 Debian*)
194 release='-gnu'
195 ;;
196 *)
197 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
198 ;;
199 esac
200 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201 # contains redundant information, the shorter form:
202 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203 echo "${machine}-${os}${release}"
204 exit ;;
205 *:OpenBSD:*:*)
206 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208 exit ;;
209 *:ekkoBSD:*:*)
210 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
211 exit ;;
212 *:SolidBSD:*:*)
213 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214 exit ;;
215 macppc:MirBSD:*:*)
216 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
217 exit ;;
218 *:MirBSD:*:*)
219 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
220 exit ;;
221 alpha:OSF1:*:*)
222 case $UNAME_RELEASE in
223 *4.0)
224 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225 ;;
226 *5.*)
227 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228 ;;
229 esac
230 # According to Compaq, /usr/sbin/psrinfo has been available on
231 # OSF/1 and Tru64 systems produced since 1995. I hope that
232 # covers most systems running today. This code pipes the CPU
233 # types through head -n 1, so we only detect the type of CPU 0.
234 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
235 case "$ALPHA_CPU_TYPE" in
236 "EV4 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "EV4.5 (21064)")
239 UNAME_MACHINE="alpha" ;;
240 "LCA4 (21066/21068)")
241 UNAME_MACHINE="alpha" ;;
242 "EV5 (21164)")
243 UNAME_MACHINE="alphaev5" ;;
244 "EV5.6 (21164A)")
245 UNAME_MACHINE="alphaev56" ;;
246 "EV5.6 (21164PC)")
247 UNAME_MACHINE="alphapca56" ;;
248 "EV5.7 (21164PC)")
249 UNAME_MACHINE="alphapca57" ;;
250 "EV6 (21264)")
251 UNAME_MACHINE="alphaev6" ;;
252 "EV6.7 (21264A)")
253 UNAME_MACHINE="alphaev67" ;;
254 "EV6.8CB (21264C)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8AL (21264B)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.8CX (21264D)")
259 UNAME_MACHINE="alphaev68" ;;
260 "EV6.9A (21264/EV69A)")
261 UNAME_MACHINE="alphaev69" ;;
262 "EV7 (21364)")
263 UNAME_MACHINE="alphaev7" ;;
264 "EV7.9 (21364A)")
265 UNAME_MACHINE="alphaev79" ;;
266 esac
267 # A Pn.n version is a patched version.
268 # A Vn.n version is a released version.
269 # A Tn.n version is a released field test version.
270 # A Xn.n version is an unreleased experimental baselevel.
271 # 1.2 uses "1.2" for uname -r.
272 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
274 exitcode=$?
275 trap '' 0
276 exit $exitcode ;;
277 Alpha\ *:Windows_NT*:*)
278 # How do we know it's Interix rather than the generic POSIX subsystem?
279 # Should we change UNAME_MACHINE based on the output of uname instead
280 # of the specific Alpha model?
281 echo alpha-pc-interix
282 exit ;;
283 21064:Windows_NT:50:3)
284 echo alpha-dec-winnt3.5
285 exit ;;
286 Amiga*:UNIX_System_V:4.0:*)
287 echo m68k-unknown-sysv4
288 exit ;;
289 *:[Aa]miga[Oo][Ss]:*:*)
290 echo ${UNAME_MACHINE}-unknown-amigaos
291 exit ;;
292 *:[Mm]orph[Oo][Ss]:*:*)
293 echo ${UNAME_MACHINE}-unknown-morphos
294 exit ;;
295 *:OS/390:*:*)
296 echo i370-ibm-openedition
297 exit ;;
298 *:z/VM:*:*)
299 echo s390-ibm-zvmoe
300 exit ;;
301 *:OS400:*:*)
302 echo powerpc-ibm-os400
303 exit ;;
304 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
305 echo arm-acorn-riscix${UNAME_RELEASE}
306 exit ;;
307 arm:riscos:*:*|arm:RISCOS:*:*)
308 echo arm-unknown-riscos
309 exit ;;
310 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
311 echo hppa1.1-hitachi-hiuxmpp
312 exit ;;
313 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
314 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
315 if test "`(/bin/universe) 2>/dev/null`" = att ; then
316 echo pyramid-pyramid-sysv3
317 else
318 echo pyramid-pyramid-bsd
319 fi
320 exit ;;
321 NILE*:*:*:dcosx)
322 echo pyramid-pyramid-svr4
323 exit ;;
324 DRS?6000:unix:4.0:6*)
325 echo sparc-icl-nx6
326 exit ;;
327 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
328 case `/usr/bin/uname -p` in
329 sparc) echo sparc-icl-nx7; exit ;;
330 esac ;;
331 s390x:SunOS:*:*)
332 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333 exit ;;
334 sun4H:SunOS:5.*:*)
335 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336 exit ;;
337 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
338 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
339 exit ;;
340 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
341 echo i386-pc-auroraux${UNAME_RELEASE}
342 exit ;;
343 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
344 eval $set_cc_for_build
345 SUN_ARCH="i386"
346 # If there is a compiler, see if it is configured for 64-bit objects.
347 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
348 # This test works for both compilers.
349 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
350 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
351 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
352 grep IS_64BIT_ARCH >/dev/null
353 then
354 SUN_ARCH="x86_64"
355 fi
356 fi
357 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
358 exit ;;
359 sun4*:SunOS:6*:*)
360 # According to config.sub, this is the proper way to canonicalize
361 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
362 # it's likely to be more like Solaris than SunOS4.
363 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
364 exit ;;
365 sun4*:SunOS:*:*)
366 case "`/usr/bin/arch -k`" in
367 Series*|S4*)
368 UNAME_RELEASE=`uname -v`
369 ;;
370 esac
371 # Japanese Language versions have a version number like `4.1.3-JL'.
372 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
373 exit ;;
374 sun3*:SunOS:*:*)
375 echo m68k-sun-sunos${UNAME_RELEASE}
376 exit ;;
377 sun*:*:4.2BSD:*)
378 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
379 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
380 case "`/bin/arch`" in
381 sun3)
382 echo m68k-sun-sunos${UNAME_RELEASE}
383 ;;
384 sun4)
385 echo sparc-sun-sunos${UNAME_RELEASE}
386 ;;
387 esac
388 exit ;;
389 aushp:SunOS:*:*)
390 echo sparc-auspex-sunos${UNAME_RELEASE}
391 exit ;;
392 # The situation for MiNT is a little confusing. The machine name
393 # can be virtually everything (everything which is not
394 # "atarist" or "atariste" at least should have a processor
395 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
396 # to the lowercase version "mint" (or "freemint"). Finally
397 # the system name "TOS" denotes a system which is actually not
398 # MiNT. But MiNT is downward compatible to TOS, so this should
399 # be no problem.
400 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
401 echo m68k-atari-mint${UNAME_RELEASE}
402 exit ;;
403 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
404 echo m68k-atari-mint${UNAME_RELEASE}
405 exit ;;
406 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
407 echo m68k-atari-mint${UNAME_RELEASE}
408 exit ;;
409 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
410 echo m68k-milan-mint${UNAME_RELEASE}
411 exit ;;
412 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
413 echo m68k-hades-mint${UNAME_RELEASE}
414 exit ;;
415 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
416 echo m68k-unknown-mint${UNAME_RELEASE}
417 exit ;;
418 m68k:machten:*:*)
419 echo m68k-apple-machten${UNAME_RELEASE}
420 exit ;;
421 powerpc:machten:*:*)
422 echo powerpc-apple-machten${UNAME_RELEASE}
423 exit ;;
424 RISC*:Mach:*:*)
425 echo mips-dec-mach_bsd4.3
426 exit ;;
427 RISC*:ULTRIX:*:*)
428 echo mips-dec-ultrix${UNAME_RELEASE}
429 exit ;;
430 VAX*:ULTRIX*:*:*)
431 echo vax-dec-ultrix${UNAME_RELEASE}
432 exit ;;
433 2020:CLIX:*:* | 2430:CLIX:*:*)
434 echo clipper-intergraph-clix${UNAME_RELEASE}
435 exit ;;
436 mips:*:*:UMIPS | mips:*:*:RISCos)
437 eval $set_cc_for_build
438 sed 's/^ //' << EOF >$dummy.c
439#ifdef __cplusplus
440#include <stdio.h> /* for printf() prototype */
441 int main (int argc, char *argv[]) {
442#else
443 int main (argc, argv) int argc; char *argv[]; {
444#endif
445 #if defined (host_mips) && defined (MIPSEB)
446 #if defined (SYSTYPE_SYSV)
447 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
448 #endif
449 #if defined (SYSTYPE_SVR4)
450 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
451 #endif
452 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
453 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
454 #endif
455 #endif
456 exit (-1);
457 }
458EOF
459 $CC_FOR_BUILD -o $dummy $dummy.c &&
460 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
461 SYSTEM_NAME=`$dummy $dummyarg` &&
462 { echo "$SYSTEM_NAME"; exit; }
463 echo mips-mips-riscos${UNAME_RELEASE}
464 exit ;;
465 Motorola:PowerMAX_OS:*:*)
466 echo powerpc-motorola-powermax
467 exit ;;
468 Motorola:*:4.3:PL8-*)
469 echo powerpc-harris-powermax
470 exit ;;
471 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
472 echo powerpc-harris-powermax
473 exit ;;
474 Night_Hawk:Power_UNIX:*:*)
475 echo powerpc-harris-powerunix
476 exit ;;
477 m88k:CX/UX:7*:*)
478 echo m88k-harris-cxux7
479 exit ;;
480 m88k:*:4*:R4*)
481 echo m88k-motorola-sysv4
482 exit ;;
483 m88k:*:3*:R3*)
484 echo m88k-motorola-sysv3
485 exit ;;
486 AViiON:dgux:*:*)
487 # DG/UX returns AViiON for all architectures
488 UNAME_PROCESSOR=`/usr/bin/uname -p`
489 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
490 then
491 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
492 [ ${TARGET_BINARY_INTERFACE}x = x ]
493 then
494 echo m88k-dg-dgux${UNAME_RELEASE}
495 else
496 echo m88k-dg-dguxbcs${UNAME_RELEASE}
497 fi
498 else
499 echo i586-dg-dgux${UNAME_RELEASE}
500 fi
501 exit ;;
502 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
503 echo m88k-dolphin-sysv3
504 exit ;;
505 M88*:*:R3*:*)
506 # Delta 88k system running SVR3
507 echo m88k-motorola-sysv3
508 exit ;;
509 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
510 echo m88k-tektronix-sysv3
511 exit ;;
512 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
513 echo m68k-tektronix-bsd
514 exit ;;
515 *:IRIX*:*:*)
516 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
517 exit ;;
518 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
519 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
520 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
521 i*86:AIX:*:*)
522 echo i386-ibm-aix
523 exit ;;
524 ia64:AIX:*:*)
525 if [ -x /usr/bin/oslevel ] ; then
526 IBM_REV=`/usr/bin/oslevel`
527 else
528 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
529 fi
530 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
531 exit ;;
532 *:AIX:2:3)
533 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
534 eval $set_cc_for_build
535 sed 's/^ //' << EOF >$dummy.c
536 #include <sys/systemcfg.h>
537
538 main()
539 {
540 if (!__power_pc())
541 exit(1);
542 puts("powerpc-ibm-aix3.2.5");
543 exit(0);
544 }
545EOF
546 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
547 then
548 echo "$SYSTEM_NAME"
549 else
550 echo rs6000-ibm-aix3.2.5
551 fi
552 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
553 echo rs6000-ibm-aix3.2.4
554 else
555 echo rs6000-ibm-aix3.2
556 fi
557 exit ;;
558 *:AIX:*:[4567])
559 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
560 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
561 IBM_ARCH=rs6000
562 else
563 IBM_ARCH=powerpc
564 fi
565 if [ -x /usr/bin/oslevel ] ; then
566 IBM_REV=`/usr/bin/oslevel`
567 else
568 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
569 fi
570 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
571 exit ;;
572 *:AIX:*:*)
573 echo rs6000-ibm-aix
574 exit ;;
575 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
576 echo romp-ibm-bsd4.4
577 exit ;;
578 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
579 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
580 exit ;; # report: romp-ibm BSD 4.3
581 *:BOSX:*:*)
582 echo rs6000-bull-bosx
583 exit ;;
584 DPX/2?00:B.O.S.:*:*)
585 echo m68k-bull-sysv3
586 exit ;;
587 9000/[34]??:4.3bsd:1.*:*)
588 echo m68k-hp-bsd
589 exit ;;
590 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
591 echo m68k-hp-bsd4.4
592 exit ;;
593 9000/[34678]??:HP-UX:*:*)
594 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
595 case "${UNAME_MACHINE}" in
596 9000/31? ) HP_ARCH=m68000 ;;
597 9000/[34]?? ) HP_ARCH=m68k ;;
598 9000/[678][0-9][0-9])
599 if [ -x /usr/bin/getconf ]; then
600 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
601 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
602 case "${sc_cpu_version}" in
603 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
604 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
605 532) # CPU_PA_RISC2_0
606 case "${sc_kernel_bits}" in
607 32) HP_ARCH="hppa2.0n" ;;
608 64) HP_ARCH="hppa2.0w" ;;
609 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
610 esac ;;
611 esac
612 fi
613 if [ "${HP_ARCH}" = "" ]; then
614 eval $set_cc_for_build
615 sed 's/^ //' << EOF >$dummy.c
616
617 #define _HPUX_SOURCE
618 #include <stdlib.h>
619 #include <unistd.h>
620
621 int main ()
622 {
623 #if defined(_SC_KERNEL_BITS)
624 long bits = sysconf(_SC_KERNEL_BITS);
625 #endif
626 long cpu = sysconf (_SC_CPU_VERSION);
627
628 switch (cpu)
629 {
630 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
631 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
632 case CPU_PA_RISC2_0:
633 #if defined(_SC_KERNEL_BITS)
634 switch (bits)
635 {
636 case 64: puts ("hppa2.0w"); break;
637 case 32: puts ("hppa2.0n"); break;
638 default: puts ("hppa2.0"); break;
639 } break;
640 #else /* !defined(_SC_KERNEL_BITS) */
641 puts ("hppa2.0"); break;
642 #endif
643 default: puts ("hppa1.0"); break;
644 }
645 exit (0);
646 }
647EOF
648 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
649 test -z "$HP_ARCH" && HP_ARCH=hppa
650 fi ;;
651 esac
652 if [ ${HP_ARCH} = "hppa2.0w" ]
653 then
654 eval $set_cc_for_build
655
656 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
657 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
658 # generating 64-bit code. GNU and HP use different nomenclature:
659 #
660 # $ CC_FOR_BUILD=cc ./config.guess
661 # => hppa2.0w-hp-hpux11.23
662 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
663 # => hppa64-hp-hpux11.23
664
665 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
666 grep -q __LP64__
667 then
668 HP_ARCH="hppa2.0w"
669 else
670 HP_ARCH="hppa64"
671 fi
672 fi
673 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
674 exit ;;
675 ia64:HP-UX:*:*)
676 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
677 echo ia64-hp-hpux${HPUX_REV}
678 exit ;;
679 3050*:HI-UX:*:*)
680 eval $set_cc_for_build
681 sed 's/^ //' << EOF >$dummy.c
682 #include <unistd.h>
683 int
684 main ()
685 {
686 long cpu = sysconf (_SC_CPU_VERSION);
687 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
688 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
689 results, however. */
690 if (CPU_IS_PA_RISC (cpu))
691 {
692 switch (cpu)
693 {
694 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
695 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
696 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
697 default: puts ("hppa-hitachi-hiuxwe2"); break;
698 }
699 }
700 else if (CPU_IS_HP_MC68K (cpu))
701 puts ("m68k-hitachi-hiuxwe2");
702 else puts ("unknown-hitachi-hiuxwe2");
703 exit (0);
704 }
705EOF
706 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
707 { echo "$SYSTEM_NAME"; exit; }
708 echo unknown-hitachi-hiuxwe2
709 exit ;;
710 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
711 echo hppa1.1-hp-bsd
712 exit ;;
713 9000/8??:4.3bsd:*:*)
714 echo hppa1.0-hp-bsd
715 exit ;;
716 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
717 echo hppa1.0-hp-mpeix
718 exit ;;
719 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
720 echo hppa1.1-hp-osf
721 exit ;;
722 hp8??:OSF1:*:*)
723 echo hppa1.0-hp-osf
724 exit ;;
725 i*86:OSF1:*:*)
726 if [ -x /usr/sbin/sysversion ] ; then
727 echo ${UNAME_MACHINE}-unknown-osf1mk
728 else
729 echo ${UNAME_MACHINE}-unknown-osf1
730 fi
731 exit ;;
732 parisc*:Lites*:*:*)
733 echo hppa1.1-hp-lites
734 exit ;;
735 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
736 echo c1-convex-bsd
737 exit ;;
738 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
739 if getsysinfo -f scalar_acc
740 then echo c32-convex-bsd
741 else echo c2-convex-bsd
742 fi
743 exit ;;
744 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
745 echo c34-convex-bsd
746 exit ;;
747 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
748 echo c38-convex-bsd
749 exit ;;
750 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
751 echo c4-convex-bsd
752 exit ;;
753 CRAY*Y-MP:*:*:*)
754 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
755 exit ;;
756 CRAY*[A-Z]90:*:*:*)
757 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
758 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
759 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
760 -e 's/\.[^.]*$/.X/'
761 exit ;;
762 CRAY*TS:*:*:*)
763 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
764 exit ;;
765 CRAY*T3E:*:*:*)
766 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
767 exit ;;
768 CRAY*SV1:*:*:*)
769 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770 exit ;;
771 *:UNICOS/mp:*:*)
772 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
773 exit ;;
774 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
775 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
776 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
777 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
778 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
779 exit ;;
780 5000:UNIX_System_V:4.*:*)
781 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
782 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
783 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
784 exit ;;
785 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
786 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
787 exit ;;
788 sparc*:BSD/OS:*:*)
789 echo sparc-unknown-bsdi${UNAME_RELEASE}
790 exit ;;
791 *:BSD/OS:*:*)
792 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
793 exit ;;
794 *:FreeBSD:*:*)
795 UNAME_PROCESSOR=`/usr/bin/uname -p`
796 case ${UNAME_PROCESSOR} in
797 amd64)
798 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799 *)
800 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
801 esac
802 exit ;;
803 i*:CYGWIN*:*)
804 echo ${UNAME_MACHINE}-pc-cygwin
805 exit ;;
806 *:MINGW*:*)
807 echo ${UNAME_MACHINE}-pc-mingw32
808 exit ;;
809 i*:MSYS*:*)
810 echo ${UNAME_MACHINE}-pc-msys
811 exit ;;
812 i*:windows32*:*)
813 # uname -m includes "-pc" on this system.
814 echo ${UNAME_MACHINE}-mingw32
815 exit ;;
816 i*:PW*:*)
817 echo ${UNAME_MACHINE}-pc-pw32
818 exit ;;
819 *:Interix*:*)
820 case ${UNAME_MACHINE} in
821 x86)
822 echo i586-pc-interix${UNAME_RELEASE}
823 exit ;;
824 authenticamd | genuineintel | EM64T)
825 echo x86_64-unknown-interix${UNAME_RELEASE}
826 exit ;;
827 IA64)
828 echo ia64-unknown-interix${UNAME_RELEASE}
829 exit ;;
830 esac ;;
831 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
832 echo i${UNAME_MACHINE}-pc-mks
833 exit ;;
834 8664:Windows_NT:*)
835 echo x86_64-pc-mks
836 exit ;;
837 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
838 # How do we know it's Interix rather than the generic POSIX subsystem?
839 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
840 # UNAME_MACHINE based on the output of uname instead of i386?
841 echo i586-pc-interix
842 exit ;;
843 i*:UWIN*:*)
844 echo ${UNAME_MACHINE}-pc-uwin
845 exit ;;
846 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
847 echo x86_64-unknown-cygwin
848 exit ;;
849 p*:CYGWIN*:*)
850 echo powerpcle-unknown-cygwin
851 exit ;;
852 prep*:SunOS:5.*:*)
853 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
854 exit ;;
855 *:GNU:*:*)
856 # the GNU system
857 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
858 exit ;;
859 *:GNU/*:*:*)
860 # other systems with GNU libc and userland
861 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
862 exit ;;
863 i*86:Minix:*:*)
864 echo ${UNAME_MACHINE}-pc-minix
865 exit ;;
866 alpha:Linux:*:*)
867 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
868 EV5) UNAME_MACHINE=alphaev5 ;;
869 EV56) UNAME_MACHINE=alphaev56 ;;
870 PCA56) UNAME_MACHINE=alphapca56 ;;
871 PCA57) UNAME_MACHINE=alphapca56 ;;
872 EV6) UNAME_MACHINE=alphaev6 ;;
873 EV67) UNAME_MACHINE=alphaev67 ;;
874 EV68*) UNAME_MACHINE=alphaev68 ;;
875 esac
876 objdump --private-headers /bin/sh | grep -q ld.so.1
877 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
878 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
879 exit ;;
880 arm*:Linux:*:*)
881 eval $set_cc_for_build
882 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
883 | grep -q __ARM_EABI__
884 then
885 echo ${UNAME_MACHINE}-unknown-linux-gnu
886 else
887 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
888 | grep -q __ARM_PCS_VFP
889 then
890 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
891 else
892 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
893 fi
894 fi
895 exit ;;
896 avr32*:Linux:*:*)
897 echo ${UNAME_MACHINE}-unknown-linux-gnu
898 exit ;;
899 cris:Linux:*:*)
900 echo cris-axis-linux-gnu
901 exit ;;
902 crisv32:Linux:*:*)
903 echo crisv32-axis-linux-gnu
904 exit ;;
905 frv:Linux:*:*)
906 echo frv-unknown-linux-gnu
907 exit ;;
908 hexagon:Linux:*:*)
909 echo hexagon-unknown-linux-gnu
910 exit ;;
911 i*86:Linux:*:*)
912 LIBC=gnu
913 eval $set_cc_for_build
914 sed 's/^ //' << EOF >$dummy.c
915 #ifdef __dietlibc__
916 LIBC=dietlibc
917 #endif
918EOF
919 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
920 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
921 exit ;;
922 ia64:Linux:*:*)
923 echo ${UNAME_MACHINE}-unknown-linux-gnu
924 exit ;;
925 m32r*:Linux:*:*)
926 echo ${UNAME_MACHINE}-unknown-linux-gnu
927 exit ;;
928 m68*:Linux:*:*)
929 echo ${UNAME_MACHINE}-unknown-linux-gnu
930 exit ;;
931 mips:Linux:*:* | mips64:Linux:*:*)
932 eval $set_cc_for_build
933 sed 's/^ //' << EOF >$dummy.c
934 #undef CPU
935 #undef ${UNAME_MACHINE}
936 #undef ${UNAME_MACHINE}el
937 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
938 CPU=${UNAME_MACHINE}el
939 #else
940 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
941 CPU=${UNAME_MACHINE}
942 #else
943 CPU=
944 #endif
945 #endif
946EOF
947 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
948 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
949 ;;
950 or32:Linux:*:*)
951 echo or32-unknown-linux-gnu
952 exit ;;
953 padre:Linux:*:*)
954 echo sparc-unknown-linux-gnu
955 exit ;;
956 parisc64:Linux:*:* | hppa64:Linux:*:*)
957 echo hppa64-unknown-linux-gnu
958 exit ;;
959 parisc:Linux:*:* | hppa:Linux:*:*)
960 # Look for CPU level
961 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
962 PA7*) echo hppa1.1-unknown-linux-gnu ;;
963 PA8*) echo hppa2.0-unknown-linux-gnu ;;
964 *) echo hppa-unknown-linux-gnu ;;
965 esac
966 exit ;;
967 ppc64:Linux:*:*)
968 echo powerpc64-unknown-linux-gnu
969 exit ;;
970 ppc:Linux:*:*)
971 echo powerpc-unknown-linux-gnu
972 exit ;;
973 s390:Linux:*:* | s390x:Linux:*:*)
974 echo ${UNAME_MACHINE}-ibm-linux
975 exit ;;
976 sh64*:Linux:*:*)
977 echo ${UNAME_MACHINE}-unknown-linux-gnu
978 exit ;;
979 sh*:Linux:*:*)
980 echo ${UNAME_MACHINE}-unknown-linux-gnu
981 exit ;;
982 sparc:Linux:*:* | sparc64:Linux:*:*)
983 echo ${UNAME_MACHINE}-unknown-linux-gnu
984 exit ;;
985 tile*:Linux:*:*)
986 echo ${UNAME_MACHINE}-unknown-linux-gnu
987 exit ;;
988 vax:Linux:*:*)
989 echo ${UNAME_MACHINE}-dec-linux-gnu
990 exit ;;
991 x86_64:Linux:*:*)
992 echo x86_64-unknown-linux-gnu
993 exit ;;
994 xtensa*:Linux:*:*)
995 echo ${UNAME_MACHINE}-unknown-linux-gnu
996 exit ;;
997 i*86:DYNIX/ptx:4*:*)
998 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
999 # earlier versions are messed up and put the nodename in both
1000 # sysname and nodename.
1001 echo i386-sequent-sysv4
1002 exit ;;
1003 i*86:UNIX_SV:4.2MP:2.*)
1004 # Unixware is an offshoot of SVR4, but it has its own version
1005 # number series starting with 2...
1006 # I am not positive that other SVR4 systems won't match this,
1007 # I just have to hope. -- rms.
1008 # Use sysv4.2uw... so that sysv4* matches it.
1009 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1010 exit ;;
1011 i*86:OS/2:*:*)
1012 # If we were able to find `uname', then EMX Unix compatibility
1013 # is probably installed.
1014 echo ${UNAME_MACHINE}-pc-os2-emx
1015 exit ;;
1016 i*86:XTS-300:*:STOP)
1017 echo ${UNAME_MACHINE}-unknown-stop
1018 exit ;;
1019 i*86:atheos:*:*)
1020 echo ${UNAME_MACHINE}-unknown-atheos
1021 exit ;;
1022 i*86:syllable:*:*)
1023 echo ${UNAME_MACHINE}-pc-syllable
1024 exit ;;
1025 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1026 echo i386-unknown-lynxos${UNAME_RELEASE}
1027 exit ;;
1028 i*86:*DOS:*:*)
1029 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1030 exit ;;
1031 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1032 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1033 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1034 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1035 else
1036 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1037 fi
1038 exit ;;
1039 i*86:*:5:[678]*)
1040 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1041 case `/bin/uname -X | grep "^Machine"` in
1042 *486*) UNAME_MACHINE=i486 ;;
1043 *Pentium) UNAME_MACHINE=i586 ;;
1044 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1045 esac
1046 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1047 exit ;;
1048 i*86:*:3.2:*)
1049 if test -f /usr/options/cb.name; then
1050 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1051 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1052 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1053 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1054 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1055 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1056 && UNAME_MACHINE=i586
1057 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1058 && UNAME_MACHINE=i686
1059 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1060 && UNAME_MACHINE=i686
1061 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1062 else
1063 echo ${UNAME_MACHINE}-pc-sysv32
1064 fi
1065 exit ;;
1066 pc:*:*:*)
1067 # Left here for compatibility:
1068 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1069 # the processor, so we play safe by assuming i586.
1070 # Note: whatever this is, it MUST be the same as what config.sub
1071 # prints for the "djgpp" host, or else GDB configury will decide that
1072 # this is a cross-build.
1073 echo i586-pc-msdosdjgpp
1074 exit ;;
1075 Intel:Mach:3*:*)
1076 echo i386-pc-mach3
1077 exit ;;
1078 paragon:*:*:*)
1079 echo i860-intel-osf1
1080 exit ;;
1081 i860:*:4.*:*) # i860-SVR4
1082 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1083 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1084 else # Add other i860-SVR4 vendors below as they are discovered.
1085 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1086 fi
1087 exit ;;
1088 mini*:CTIX:SYS*5:*)
1089 # "miniframe"
1090 echo m68010-convergent-sysv
1091 exit ;;
1092 mc68k:UNIX:SYSTEM5:3.51m)
1093 echo m68k-convergent-sysv
1094 exit ;;
1095 M680?0:D-NIX:5.3:*)
1096 echo m68k-diab-dnix
1097 exit ;;
1098 M68*:*:R3V[5678]*:*)
1099 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1100 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1101 OS_REL=''
1102 test -r /etc/.relid \
1103 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1104 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1105 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1106 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1107 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1108 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1109 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1110 && { echo i486-ncr-sysv4; exit; } ;;
1111 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1112 OS_REL='.3'
1113 test -r /etc/.relid \
1114 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1115 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1116 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1117 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1118 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1119 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1120 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1121 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1122 echo m68k-unknown-lynxos${UNAME_RELEASE}
1123 exit ;;
1124 mc68030:UNIX_System_V:4.*:*)
1125 echo m68k-atari-sysv4
1126 exit ;;
1127 TSUNAMI:LynxOS:2.*:*)
1128 echo sparc-unknown-lynxos${UNAME_RELEASE}
1129 exit ;;
1130 rs6000:LynxOS:2.*:*)
1131 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1132 exit ;;
1133 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1134 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1135 exit ;;
1136 SM[BE]S:UNIX_SV:*:*)
1137 echo mips-dde-sysv${UNAME_RELEASE}
1138 exit ;;
1139 RM*:ReliantUNIX-*:*:*)
1140 echo mips-sni-sysv4
1141 exit ;;
1142 RM*:SINIX-*:*:*)
1143 echo mips-sni-sysv4
1144 exit ;;
1145 *:SINIX-*:*:*)
1146 if uname -p 2>/dev/null >/dev/null ; then
1147 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1148 echo ${UNAME_MACHINE}-sni-sysv4
1149 else
1150 echo ns32k-sni-sysv
1151 fi
1152 exit ;;
1153 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1154 # says <Richard.M.Bartel@ccMail.Census.GOV>
1155 echo i586-unisys-sysv4
1156 exit ;;
1157 *:UNIX_System_V:4*:FTX*)
1158 # From Gerald Hewes <hewes@openmarket.com>.
1159 # How about differentiating between stratus architectures? -djm
1160 echo hppa1.1-stratus-sysv4
1161 exit ;;
1162 *:*:*:FTX*)
1163 # From seanf@swdc.stratus.com.
1164 echo i860-stratus-sysv4
1165 exit ;;
1166 i*86:VOS:*:*)
1167 # From Paul.Green@stratus.com.
1168 echo ${UNAME_MACHINE}-stratus-vos
1169 exit ;;
1170 *:VOS:*:*)
1171 # From Paul.Green@stratus.com.
1172 echo hppa1.1-stratus-vos
1173 exit ;;
1174 mc68*:A/UX:*:*)
1175 echo m68k-apple-aux${UNAME_RELEASE}
1176 exit ;;
1177 news*:NEWS-OS:6*:*)
1178 echo mips-sony-newsos6
1179 exit ;;
1180 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1181 if [ -d /usr/nec ]; then
1182 echo mips-nec-sysv${UNAME_RELEASE}
1183 else
1184 echo mips-unknown-sysv${UNAME_RELEASE}
1185 fi
1186 exit ;;
1187 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1188 echo powerpc-be-beos
1189 exit ;;
1190 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1191 echo powerpc-apple-beos
1192 exit ;;
1193 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1194 echo i586-pc-beos
1195 exit ;;
1196 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1197 echo i586-pc-haiku
1198 exit ;;
1199 SX-4:SUPER-UX:*:*)
1200 echo sx4-nec-superux${UNAME_RELEASE}
1201 exit ;;
1202 SX-5:SUPER-UX:*:*)
1203 echo sx5-nec-superux${UNAME_RELEASE}
1204 exit ;;
1205 SX-6:SUPER-UX:*:*)
1206 echo sx6-nec-superux${UNAME_RELEASE}
1207 exit ;;
1208 SX-7:SUPER-UX:*:*)
1209 echo sx7-nec-superux${UNAME_RELEASE}
1210 exit ;;
1211 SX-8:SUPER-UX:*:*)
1212 echo sx8-nec-superux${UNAME_RELEASE}
1213 exit ;;
1214 SX-8R:SUPER-UX:*:*)
1215 echo sx8r-nec-superux${UNAME_RELEASE}
1216 exit ;;
1217 Power*:Rhapsody:*:*)
1218 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1219 exit ;;
1220 *:Rhapsody:*:*)
1221 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1222 exit ;;
1223 *:Darwin:*:*)
1224 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1225 case $UNAME_PROCESSOR in
1226 i386)
1227 eval $set_cc_for_build
1228 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1229 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1230 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1231 grep IS_64BIT_ARCH >/dev/null
1232 then
1233 UNAME_PROCESSOR="x86_64"
1234 fi
1235 fi ;;
1236 unknown) UNAME_PROCESSOR=powerpc ;;
1237 esac
1238 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1239 exit ;;
1240 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1241 UNAME_PROCESSOR=`uname -p`
1242 if test "$UNAME_PROCESSOR" = "x86"; then
1243 UNAME_PROCESSOR=i386
1244 UNAME_MACHINE=pc
1245 fi
1246 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1247 exit ;;
1248 *:QNX:*:4*)
1249 echo i386-pc-qnx
1250 exit ;;
1251 NEO-?:NONSTOP_KERNEL:*:*)
1252 echo neo-tandem-nsk${UNAME_RELEASE}
1253 exit ;;
1254 NSE-?:NONSTOP_KERNEL:*:*)
1255 echo nse-tandem-nsk${UNAME_RELEASE}
1256 exit ;;
1257 NSR-?:NONSTOP_KERNEL:*:*)
1258 echo nsr-tandem-nsk${UNAME_RELEASE}
1259 exit ;;
1260 *:NonStop-UX:*:*)
1261 echo mips-compaq-nonstopux
1262 exit ;;
1263 BS2000:POSIX*:*:*)
1264 echo bs2000-siemens-sysv
1265 exit ;;
1266 DS/*:UNIX_System_V:*:*)
1267 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1268 exit ;;
1269 *:Plan9:*:*)
1270 # "uname -m" is not consistent, so use $cputype instead. 386
1271 # is converted to i386 for consistency with other x86
1272 # operating systems.
1273 if test "$cputype" = "386"; then
1274 UNAME_MACHINE=i386
1275 else
1276 UNAME_MACHINE="$cputype"
1277 fi
1278 echo ${UNAME_MACHINE}-unknown-plan9
1279 exit ;;
1280 *:TOPS-10:*:*)
1281 echo pdp10-unknown-tops10
1282 exit ;;
1283 *:TENEX:*:*)
1284 echo pdp10-unknown-tenex
1285 exit ;;
1286 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1287 echo pdp10-dec-tops20
1288 exit ;;
1289 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1290 echo pdp10-xkl-tops20
1291 exit ;;
1292 *:TOPS-20:*:*)
1293 echo pdp10-unknown-tops20
1294 exit ;;
1295 *:ITS:*:*)
1296 echo pdp10-unknown-its
1297 exit ;;
1298 SEI:*:*:SEIUX)
1299 echo mips-sei-seiux${UNAME_RELEASE}
1300 exit ;;
1301 *:DragonFly:*:*)
1302 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1303 exit ;;
1304 *:*VMS:*:*)
1305 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1306 case "${UNAME_MACHINE}" in
1307 A*) echo alpha-dec-vms ; exit ;;
1308 I*) echo ia64-dec-vms ; exit ;;
1309 V*) echo vax-dec-vms ; exit ;;
1310 esac ;;
1311 *:XENIX:*:SysV)
1312 echo i386-pc-xenix
1313 exit ;;
1314 i*86:skyos:*:*)
1315 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1316 exit ;;
1317 i*86:rdos:*:*)
1318 echo ${UNAME_MACHINE}-pc-rdos
1319 exit ;;
1320 i*86:AROS:*:*)
1321 echo ${UNAME_MACHINE}-pc-aros
1322 exit ;;
1323esac
1324
1325#echo '(No uname command or uname output not recognized.)' 1>&2
1326#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1327
1328eval $set_cc_for_build
1329cat >$dummy.c <<EOF
1330#ifdef _SEQUENT_
1331# include <sys/types.h>
1332# include <sys/utsname.h>
1333#endif
1334main ()
1335{
1336#if defined (sony)
1337#if defined (MIPSEB)
1338 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1339 I don't know.... */
1340 printf ("mips-sony-bsd\n"); exit (0);
1341#else
1342#include <sys/param.h>
1343 printf ("m68k-sony-newsos%s\n",
1344#ifdef NEWSOS4
1345 "4"
1346#else
1347 ""
1348#endif
1349 ); exit (0);
1350#endif
1351#endif
1352
1353#if defined (__arm) && defined (__acorn) && defined (__unix)
1354 printf ("arm-acorn-riscix\n"); exit (0);
1355#endif
1356
1357#if defined (hp300) && !defined (hpux)
1358 printf ("m68k-hp-bsd\n"); exit (0);
1359#endif
1360
1361#if defined (NeXT)
1362#if !defined (__ARCHITECTURE__)
1363#define __ARCHITECTURE__ "m68k"
1364#endif
1365 int version;
1366 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1367 if (version < 4)
1368 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1369 else
1370 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1371 exit (0);
1372#endif
1373
1374#if defined (MULTIMAX) || defined (n16)
1375#if defined (UMAXV)
1376 printf ("ns32k-encore-sysv\n"); exit (0);
1377#else
1378#if defined (CMU)
1379 printf ("ns32k-encore-mach\n"); exit (0);
1380#else
1381 printf ("ns32k-encore-bsd\n"); exit (0);
1382#endif
1383#endif
1384#endif
1385
1386#if defined (__386BSD__)
1387 printf ("i386-pc-bsd\n"); exit (0);
1388#endif
1389
1390#if defined (sequent)
1391#if defined (i386)
1392 printf ("i386-sequent-dynix\n"); exit (0);
1393#endif
1394#if defined (ns32000)
1395 printf ("ns32k-sequent-dynix\n"); exit (0);
1396#endif
1397#endif
1398
1399#if defined (_SEQUENT_)
1400 struct utsname un;
1401
1402 uname(&un);
1403
1404 if (strncmp(un.version, "V2", 2) == 0) {
1405 printf ("i386-sequent-ptx2\n"); exit (0);
1406 }
1407 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1408 printf ("i386-sequent-ptx1\n"); exit (0);
1409 }
1410 printf ("i386-sequent-ptx\n"); exit (0);
1411
1412#endif
1413
1414#if defined (vax)
1415# if !defined (ultrix)
1416# include <sys/param.h>
1417# if defined (BSD)
1418# if BSD == 43
1419 printf ("vax-dec-bsd4.3\n"); exit (0);
1420# else
1421# if BSD == 199006
1422 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1423# else
1424 printf ("vax-dec-bsd\n"); exit (0);
1425# endif
1426# endif
1427# else
1428 printf ("vax-dec-bsd\n"); exit (0);
1429# endif
1430# else
1431 printf ("vax-dec-ultrix\n"); exit (0);
1432# endif
1433#endif
1434
1435#if defined (alliant) && defined (i860)
1436 printf ("i860-alliant-bsd\n"); exit (0);
1437#endif
1438
1439 exit (1);
1440}
1441EOF
1442
1443$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1444 { echo "$SYSTEM_NAME"; exit; }
1445
1446# Apollos put the system type in the environment.
1447
1448test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1449
1450# Convex versions that predate uname can use getsysinfo(1)
1451
1452if [ -x /usr/convex/getsysinfo ]
1453then
1454 case `getsysinfo -f cpu_type` in
1455 c1*)
1456 echo c1-convex-bsd
1457 exit ;;
1458 c2*)
1459 if getsysinfo -f scalar_acc
1460 then echo c32-convex-bsd
1461 else echo c2-convex-bsd
1462 fi
1463 exit ;;
1464 c34*)
1465 echo c34-convex-bsd
1466 exit ;;
1467 c38*)
1468 echo c38-convex-bsd
1469 exit ;;
1470 c4*)
1471 echo c4-convex-bsd
1472 exit ;;
1473 esac
1474fi
1475
1476cat >&2 <<EOF
1477$0: unable to guess system type
1478
1479This script, last modified $timestamp, has failed to recognize
1480the operating system you are using. It is advised that you
1481download the most up to date version of the config scripts from
1482
1483 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1484and
1485 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1486
1487If the version you run ($0) is already up to date, please
1488send the following data and any information you think might be
1489pertinent to <config-patches@gnu.org> in order to provide the needed
1490information to handle your system.
1491
1492config.guess timestamp = $timestamp
1493
1494uname -m = `(uname -m) 2>/dev/null || echo unknown`
1495uname -r = `(uname -r) 2>/dev/null || echo unknown`
1496uname -s = `(uname -s) 2>/dev/null || echo unknown`
1497uname -v = `(uname -v) 2>/dev/null || echo unknown`
1498
1499/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1500/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1501
1502hostinfo = `(hostinfo) 2>/dev/null`
1503/bin/universe = `(/bin/universe) 2>/dev/null`
1504/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1505/bin/arch = `(/bin/arch) 2>/dev/null`
1506/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1507/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1508
1509UNAME_MACHINE = ${UNAME_MACHINE}
1510UNAME_RELEASE = ${UNAME_RELEASE}
1511UNAME_SYSTEM = ${UNAME_SYSTEM}
1512UNAME_VERSION = ${UNAME_VERSION}
1513EOF
1514
1515exit 1
1516
1517# Local variables:
1518# eval: (add-hook 'write-file-hooks 'time-stamp)
1519# time-stamp-start: "timestamp='"
1520# time-stamp-format: "%:y-%02m-%02d"
1521# time-stamp-end: "'"
1522# End:
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.sub b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.sub
new file mode 100644
index 0000000..d43adf9
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/config.sub
@@ -0,0 +1,1771 @@
1#! /bin/sh
2# Configuration validation subroutine script.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5# 2011 Free Software Foundation, Inc.
6
7timestamp='2011-11-11'
8
9# This file is (in principle) common to ALL GNU software.
10# The presence of a machine in this file suggests that SOME GNU software
11# can handle that machine. It does not imply ALL GNU software can.
12#
13# This file is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26# 02110-1301, USA.
27#
28# As a special exception to the GNU General Public License, if you
29# distribute this file as part of a program that contains a
30# configuration script generated by Autoconf, you may include it under
31# the same distribution terms that you use for the rest of that program.
32
33
34# Please send patches to <config-patches@gnu.org>. Submit a context
35# diff and a properly formatted GNU ChangeLog entry.
36#
37# Configuration subroutine to validate and canonicalize a configuration type.
38# Supply the specified configuration type as an argument.
39# If it is invalid, we print an error message on stderr and exit with code 1.
40# Otherwise, we print the canonical config type on stdout and succeed.
41
42# You can get the latest version of this script from:
43# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44
45# This file is supposed to be the same for all GNU packages
46# and recognize all the CPU types, system types and aliases
47# that are meaningful with *any* GNU software.
48# Each package is responsible for reporting which valid configurations
49# it does not support. The user should be able to distinguish
50# a failure to support a valid configuration from a meaningless
51# configuration.
52
53# The goal of this file is to map all the various variations of a given
54# machine specification into a single specification in the form:
55# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
56# or in some cases, the newer four-part form:
57# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
58# It is wrong to echo any other type of specification.
59
60me=`echo "$0" | sed -e 's,.*/,,'`
61
62usage="\
63Usage: $0 [OPTION] CPU-MFR-OPSYS
64 $0 [OPTION] ALIAS
65
66Canonicalize a configuration name.
67
68Operation modes:
69 -h, --help print this help, then exit
70 -t, --time-stamp print date of last modification, then exit
71 -v, --version print version number, then exit
72
73Report bugs and patches to <config-patches@gnu.org>."
74
75version="\
76GNU config.sub ($timestamp)
77
78Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
792001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
80Software Foundation, Inc.
81
82This is free software; see the source for copying conditions. There is NO
83warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84
85help="
86Try \`$me --help' for more information."
87
88# Parse command line
89while test $# -gt 0 ; do
90 case $1 in
91 --time-stamp | --time* | -t )
92 echo "$timestamp" ; exit ;;
93 --version | -v )
94 echo "$version" ; exit ;;
95 --help | --h* | -h )
96 echo "$usage"; exit ;;
97 -- ) # Stop option processing
98 shift; break ;;
99 - ) # Use stdin as input.
100 break ;;
101 -* )
102 echo "$me: invalid option $1$help"
103 exit 1 ;;
104
105 *local*)
106 # First pass through any local machine types.
107 echo $1
108 exit ;;
109
110 * )
111 break ;;
112 esac
113done
114
115case $# in
116 0) echo "$me: missing argument$help" >&2
117 exit 1;;
118 1) ;;
119 *) echo "$me: too many arguments$help" >&2
120 exit 1;;
121esac
122
123# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124# Here we must recognize all the valid KERNEL-OS combinations.
125maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126case $maybe_os in
127 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128 linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129 knetbsd*-gnu* | netbsd*-gnu* | \
130 kopensolaris*-gnu* | \
131 storm-chaos* | os2-emx* | rtmk-nova*)
132 os=-$maybe_os
133 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
134 ;;
135 *)
136 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
137 if [ $basic_machine != $1 ]
138 then os=`echo $1 | sed 's/.*-/-/'`
139 else os=; fi
140 ;;
141esac
142
143### Let's recognize common machines as not being operating systems so
144### that things like config.sub decstation-3100 work. We also
145### recognize some manufacturers as not being operating systems, so we
146### can provide default operating systems below.
147case $os in
148 -sun*os*)
149 # Prevent following clause from handling this invalid input.
150 ;;
151 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
152 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
153 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
154 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
155 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
156 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157 -apple | -axis | -knuth | -cray | -microblaze)
158 os=
159 basic_machine=$1
160 ;;
161 -bluegene*)
162 os=-cnk
163 ;;
164 -sim | -cisco | -oki | -wec | -winbond)
165 os=
166 basic_machine=$1
167 ;;
168 -scout)
169 ;;
170 -wrs)
171 os=-vxworks
172 basic_machine=$1
173 ;;
174 -chorusos*)
175 os=-chorusos
176 basic_machine=$1
177 ;;
178 -chorusrdb)
179 os=-chorusrdb
180 basic_machine=$1
181 ;;
182 -hiux*)
183 os=-hiuxwe2
184 ;;
185 -sco6)
186 os=-sco5v6
187 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188 ;;
189 -sco5)
190 os=-sco3.2v5
191 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192 ;;
193 -sco4)
194 os=-sco3.2v4
195 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196 ;;
197 -sco3.2.[4-9]*)
198 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
199 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200 ;;
201 -sco3.2v[4-9]*)
202 # Don't forget version if it is 3.2v4 or newer.
203 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204 ;;
205 -sco5v6*)
206 # Don't forget version if it is 3.2v4 or newer.
207 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
208 ;;
209 -sco*)
210 os=-sco3.2v2
211 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
212 ;;
213 -udk*)
214 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215 ;;
216 -isc)
217 os=-isc2.2
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219 ;;
220 -clix*)
221 basic_machine=clipper-intergraph
222 ;;
223 -isc*)
224 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
225 ;;
226 -lynx*)
227 os=-lynxos
228 ;;
229 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231 ;;
232 -windowsnt*)
233 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234 ;;
235 -psos*)
236 os=-psos
237 ;;
238 -mint | -mint[0-9]*)
239 basic_machine=m68k-atari
240 os=-mint
241 ;;
242esac
243
244# Decode aliases for certain CPU-COMPANY combinations.
245case $basic_machine in
246 # Recognize the basic CPU types without company name.
247 # Some are omitted here because they have special meanings below.
248 1750a | 580 \
249 | a29k \
250 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
251 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252 | am33_2.0 \
253 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
254 | be32 | be64 \
255 | bfin \
256 | c4x | clipper \
257 | d10v | d30v | dlx | dsp16xx \
258 | epiphany \
259 | fido | fr30 | frv \
260 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
261 | hexagon \
262 | i370 | i860 | i960 | ia64 \
263 | ip2k | iq2000 \
264 | le32 | le64 \
265 | lm32 \
266 | m32c | m32r | m32rle | m68000 | m68k | m88k \
267 | maxq | mb | microblaze | mcore | mep | metag \
268 | mips | mipsbe | mipseb | mipsel | mipsle \
269 | mips16 \
270 | mips64 | mips64el \
271 | mips64octeon | mips64octeonel \
272 | mips64orion | mips64orionel \
273 | mips64r5900 | mips64r5900el \
274 | mips64vr | mips64vrel \
275 | mips64vr4100 | mips64vr4100el \
276 | mips64vr4300 | mips64vr4300el \
277 | mips64vr5000 | mips64vr5000el \
278 | mips64vr5900 | mips64vr5900el \
279 | mipsisa32 | mipsisa32el \
280 | mipsisa32r2 | mipsisa32r2el \
281 | mipsisa64 | mipsisa64el \
282 | mipsisa64r2 | mipsisa64r2el \
283 | mipsisa64sb1 | mipsisa64sb1el \
284 | mipsisa64sr71k | mipsisa64sr71kel \
285 | mipstx39 | mipstx39el \
286 | mn10200 | mn10300 \
287 | moxie \
288 | mt \
289 | msp430 \
290 | nds32 | nds32le | nds32be \
291 | nios | nios2 \
292 | ns16k | ns32k \
293 | open8 \
294 | or32 \
295 | pdp10 | pdp11 | pj | pjl \
296 | powerpc | powerpc64 | powerpc64le | powerpcle \
297 | pyramid \
298 | rl78 | rx \
299 | score \
300 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
301 | sh64 | sh64le \
302 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
303 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
304 | spu \
305 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
306 | ubicom32 \
307 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
308 | we32k \
309 | x86 | xc16x | xstormy16 | xtensa \
310 | z8k | z80)
311 basic_machine=$basic_machine-unknown
312 ;;
313 c54x)
314 basic_machine=tic54x-unknown
315 ;;
316 c55x)
317 basic_machine=tic55x-unknown
318 ;;
319 c6x)
320 basic_machine=tic6x-unknown
321 ;;
322 m6811 | m68hc11 | m6812 | m68hc12 | picochip)
323 # Motorola 68HC11/12.
324 basic_machine=$basic_machine-unknown
325 os=-none
326 ;;
327 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
328 ;;
329 ms1)
330 basic_machine=mt-unknown
331 ;;
332
333 strongarm | thumb | xscale)
334 basic_machine=arm-unknown
335 ;;
336
337 xscaleeb)
338 basic_machine=armeb-unknown
339 ;;
340
341 xscaleel)
342 basic_machine=armel-unknown
343 ;;
344
345 # We use `pc' rather than `unknown'
346 # because (1) that's what they normally are, and
347 # (2) the word "unknown" tends to confuse beginning users.
348 i*86 | x86_64)
349 basic_machine=$basic_machine-pc
350 ;;
351 # Object if more than one company name word.
352 *-*-*)
353 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
354 exit 1
355 ;;
356 # Recognize the basic CPU types with company name.
357 580-* \
358 | a29k-* \
359 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
360 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
361 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
362 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
363 | avr-* | avr32-* \
364 | be32-* | be64-* \
365 | bfin-* | bs2000-* \
366 | c[123]* | c30-* | [cjt]90-* | c4x-* \
367 | clipper-* | craynv-* | cydra-* \
368 | d10v-* | d30v-* | dlx-* \
369 | elxsi-* \
370 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
371 | h8300-* | h8500-* \
372 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
373 | hexagon-* \
374 | i*86-* | i860-* | i960-* | ia64-* \
375 | ip2k-* | iq2000-* \
376 | le32-* | le64-* \
377 | lm32-* \
378 | m32c-* | m32r-* | m32rle-* \
379 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
380 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
381 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
382 | mips16-* \
383 | mips64-* | mips64el-* \
384 | mips64octeon-* | mips64octeonel-* \
385 | mips64orion-* | mips64orionel-* \
386 | mips64r5900-* | mips64r5900el-* \
387 | mips64vr-* | mips64vrel-* \
388 | mips64vr4100-* | mips64vr4100el-* \
389 | mips64vr4300-* | mips64vr4300el-* \
390 | mips64vr5000-* | mips64vr5000el-* \
391 | mips64vr5900-* | mips64vr5900el-* \
392 | mipsisa32-* | mipsisa32el-* \
393 | mipsisa32r2-* | mipsisa32r2el-* \
394 | mipsisa64-* | mipsisa64el-* \
395 | mipsisa64r2-* | mipsisa64r2el-* \
396 | mipsisa64sb1-* | mipsisa64sb1el-* \
397 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
398 | mipstx39-* | mipstx39el-* \
399 | mmix-* \
400 | mt-* \
401 | msp430-* \
402 | nds32-* | nds32le-* | nds32be-* \
403 | nios-* | nios2-* \
404 | none-* | np1-* | ns16k-* | ns32k-* \
405 | open8-* \
406 | orion-* \
407 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
408 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
409 | pyramid-* \
410 | rl78-* | romp-* | rs6000-* | rx-* \
411 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
412 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
413 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
414 | sparclite-* \
415 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
416 | tahoe-* \
417 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
418 | tile*-* \
419 | tron-* \
420 | ubicom32-* \
421 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
422 | vax-* \
423 | we32k-* \
424 | x86-* | x86_64-* | xc16x-* | xps100-* \
425 | xstormy16-* | xtensa*-* \
426 | ymp-* \
427 | z8k-* | z80-*)
428 ;;
429 # Recognize the basic CPU types without company name, with glob match.
430 xtensa*)
431 basic_machine=$basic_machine-unknown
432 ;;
433 # Recognize the various machine names and aliases which stand
434 # for a CPU type and a company and sometimes even an OS.
435 386bsd)
436 basic_machine=i386-unknown
437 os=-bsd
438 ;;
439 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
440 basic_machine=m68000-att
441 ;;
442 3b*)
443 basic_machine=we32k-att
444 ;;
445 a29khif)
446 basic_machine=a29k-amd
447 os=-udi
448 ;;
449 abacus)
450 basic_machine=abacus-unknown
451 ;;
452 adobe68k)
453 basic_machine=m68010-adobe
454 os=-scout
455 ;;
456 alliant | fx80)
457 basic_machine=fx80-alliant
458 ;;
459 altos | altos3068)
460 basic_machine=m68k-altos
461 ;;
462 am29k)
463 basic_machine=a29k-none
464 os=-bsd
465 ;;
466 amd64)
467 basic_machine=x86_64-pc
468 ;;
469 amd64-*)
470 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
471 ;;
472 amdahl)
473 basic_machine=580-amdahl
474 os=-sysv
475 ;;
476 amiga | amiga-*)
477 basic_machine=m68k-unknown
478 ;;
479 amigaos | amigados)
480 basic_machine=m68k-unknown
481 os=-amigaos
482 ;;
483 amigaunix | amix)
484 basic_machine=m68k-unknown
485 os=-sysv4
486 ;;
487 apollo68)
488 basic_machine=m68k-apollo
489 os=-sysv
490 ;;
491 apollo68bsd)
492 basic_machine=m68k-apollo
493 os=-bsd
494 ;;
495 aros)
496 basic_machine=i386-pc
497 os=-aros
498 ;;
499 aux)
500 basic_machine=m68k-apple
501 os=-aux
502 ;;
503 balance)
504 basic_machine=ns32k-sequent
505 os=-dynix
506 ;;
507 blackfin)
508 basic_machine=bfin-unknown
509 os=-linux
510 ;;
511 blackfin-*)
512 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
513 os=-linux
514 ;;
515 bluegene*)
516 basic_machine=powerpc-ibm
517 os=-cnk
518 ;;
519 c54x-*)
520 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
521 ;;
522 c55x-*)
523 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
524 ;;
525 c6x-*)
526 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
527 ;;
528 c90)
529 basic_machine=c90-cray
530 os=-unicos
531 ;;
532 cegcc)
533 basic_machine=arm-unknown
534 os=-cegcc
535 ;;
536 convex-c1)
537 basic_machine=c1-convex
538 os=-bsd
539 ;;
540 convex-c2)
541 basic_machine=c2-convex
542 os=-bsd
543 ;;
544 convex-c32)
545 basic_machine=c32-convex
546 os=-bsd
547 ;;
548 convex-c34)
549 basic_machine=c34-convex
550 os=-bsd
551 ;;
552 convex-c38)
553 basic_machine=c38-convex
554 os=-bsd
555 ;;
556 cray | j90)
557 basic_machine=j90-cray
558 os=-unicos
559 ;;
560 craynv)
561 basic_machine=craynv-cray
562 os=-unicosmp
563 ;;
564 cr16 | cr16-*)
565 basic_machine=cr16-unknown
566 os=-elf
567 ;;
568 crds | unos)
569 basic_machine=m68k-crds
570 ;;
571 crisv32 | crisv32-* | etraxfs*)
572 basic_machine=crisv32-axis
573 ;;
574 cris | cris-* | etrax*)
575 basic_machine=cris-axis
576 ;;
577 crx)
578 basic_machine=crx-unknown
579 os=-elf
580 ;;
581 da30 | da30-*)
582 basic_machine=m68k-da30
583 ;;
584 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
585 basic_machine=mips-dec
586 ;;
587 decsystem10* | dec10*)
588 basic_machine=pdp10-dec
589 os=-tops10
590 ;;
591 decsystem20* | dec20*)
592 basic_machine=pdp10-dec
593 os=-tops20
594 ;;
595 delta | 3300 | motorola-3300 | motorola-delta \
596 | 3300-motorola | delta-motorola)
597 basic_machine=m68k-motorola
598 ;;
599 delta88)
600 basic_machine=m88k-motorola
601 os=-sysv3
602 ;;
603 dicos)
604 basic_machine=i686-pc
605 os=-dicos
606 ;;
607 djgpp)
608 basic_machine=i586-pc
609 os=-msdosdjgpp
610 ;;
611 dpx20 | dpx20-*)
612 basic_machine=rs6000-bull
613 os=-bosx
614 ;;
615 dpx2* | dpx2*-bull)
616 basic_machine=m68k-bull
617 os=-sysv3
618 ;;
619 ebmon29k)
620 basic_machine=a29k-amd
621 os=-ebmon
622 ;;
623 elxsi)
624 basic_machine=elxsi-elxsi
625 os=-bsd
626 ;;
627 encore | umax | mmax)
628 basic_machine=ns32k-encore
629 ;;
630 es1800 | OSE68k | ose68k | ose | OSE)
631 basic_machine=m68k-ericsson
632 os=-ose
633 ;;
634 fx2800)
635 basic_machine=i860-alliant
636 ;;
637 genix)
638 basic_machine=ns32k-ns
639 ;;
640 gmicro)
641 basic_machine=tron-gmicro
642 os=-sysv
643 ;;
644 go32)
645 basic_machine=i386-pc
646 os=-go32
647 ;;
648 h3050r* | hiux*)
649 basic_machine=hppa1.1-hitachi
650 os=-hiuxwe2
651 ;;
652 h8300hms)
653 basic_machine=h8300-hitachi
654 os=-hms
655 ;;
656 h8300xray)
657 basic_machine=h8300-hitachi
658 os=-xray
659 ;;
660 h8500hms)
661 basic_machine=h8500-hitachi
662 os=-hms
663 ;;
664 harris)
665 basic_machine=m88k-harris
666 os=-sysv3
667 ;;
668 hp300-*)
669 basic_machine=m68k-hp
670 ;;
671 hp300bsd)
672 basic_machine=m68k-hp
673 os=-bsd
674 ;;
675 hp300hpux)
676 basic_machine=m68k-hp
677 os=-hpux
678 ;;
679 hp3k9[0-9][0-9] | hp9[0-9][0-9])
680 basic_machine=hppa1.0-hp
681 ;;
682 hp9k2[0-9][0-9] | hp9k31[0-9])
683 basic_machine=m68000-hp
684 ;;
685 hp9k3[2-9][0-9])
686 basic_machine=m68k-hp
687 ;;
688 hp9k6[0-9][0-9] | hp6[0-9][0-9])
689 basic_machine=hppa1.0-hp
690 ;;
691 hp9k7[0-79][0-9] | hp7[0-79][0-9])
692 basic_machine=hppa1.1-hp
693 ;;
694 hp9k78[0-9] | hp78[0-9])
695 # FIXME: really hppa2.0-hp
696 basic_machine=hppa1.1-hp
697 ;;
698 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
699 # FIXME: really hppa2.0-hp
700 basic_machine=hppa1.1-hp
701 ;;
702 hp9k8[0-9][13679] | hp8[0-9][13679])
703 basic_machine=hppa1.1-hp
704 ;;
705 hp9k8[0-9][0-9] | hp8[0-9][0-9])
706 basic_machine=hppa1.0-hp
707 ;;
708 hppa-next)
709 os=-nextstep3
710 ;;
711 hppaosf)
712 basic_machine=hppa1.1-hp
713 os=-osf
714 ;;
715 hppro)
716 basic_machine=hppa1.1-hp
717 os=-proelf
718 ;;
719 i370-ibm* | ibm*)
720 basic_machine=i370-ibm
721 ;;
722# I'm not sure what "Sysv32" means. Should this be sysv3.2?
723 i*86v32)
724 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
725 os=-sysv32
726 ;;
727 i*86v4*)
728 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
729 os=-sysv4
730 ;;
731 i*86v)
732 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
733 os=-sysv
734 ;;
735 i*86sol2)
736 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
737 os=-solaris2
738 ;;
739 i386mach)
740 basic_machine=i386-mach
741 os=-mach
742 ;;
743 i386-vsta | vsta)
744 basic_machine=i386-unknown
745 os=-vsta
746 ;;
747 iris | iris4d)
748 basic_machine=mips-sgi
749 case $os in
750 -irix*)
751 ;;
752 *)
753 os=-irix4
754 ;;
755 esac
756 ;;
757 isi68 | isi)
758 basic_machine=m68k-isi
759 os=-sysv
760 ;;
761 m68knommu)
762 basic_machine=m68k-unknown
763 os=-linux
764 ;;
765 m68knommu-*)
766 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
767 os=-linux
768 ;;
769 m88k-omron*)
770 basic_machine=m88k-omron
771 ;;
772 magnum | m3230)
773 basic_machine=mips-mips
774 os=-sysv
775 ;;
776 merlin)
777 basic_machine=ns32k-utek
778 os=-sysv
779 ;;
780 microblaze)
781 basic_machine=microblaze-xilinx
782 ;;
783 mingw32)
784 basic_machine=i386-pc
785 os=-mingw32
786 ;;
787 mingw32ce)
788 basic_machine=arm-unknown
789 os=-mingw32ce
790 ;;
791 miniframe)
792 basic_machine=m68000-convergent
793 ;;
794 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
795 basic_machine=m68k-atari
796 os=-mint
797 ;;
798 mips3*-*)
799 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
800 ;;
801 mips3*)
802 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
803 ;;
804 monitor)
805 basic_machine=m68k-rom68k
806 os=-coff
807 ;;
808 morphos)
809 basic_machine=powerpc-unknown
810 os=-morphos
811 ;;
812 msdos)
813 basic_machine=i386-pc
814 os=-msdos
815 ;;
816 ms1-*)
817 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
818 ;;
819 msys)
820 basic_machine=i386-pc
821 os=-msys
822 ;;
823 mvs)
824 basic_machine=i370-ibm
825 os=-mvs
826 ;;
827 nacl)
828 basic_machine=le32-unknown
829 os=-nacl
830 ;;
831 ncr3000)
832 basic_machine=i486-ncr
833 os=-sysv4
834 ;;
835 netbsd386)
836 basic_machine=i386-unknown
837 os=-netbsd
838 ;;
839 netwinder)
840 basic_machine=armv4l-rebel
841 os=-linux
842 ;;
843 news | news700 | news800 | news900)
844 basic_machine=m68k-sony
845 os=-newsos
846 ;;
847 news1000)
848 basic_machine=m68030-sony
849 os=-newsos
850 ;;
851 news-3600 | risc-news)
852 basic_machine=mips-sony
853 os=-newsos
854 ;;
855 necv70)
856 basic_machine=v70-nec
857 os=-sysv
858 ;;
859 next | m*-next )
860 basic_machine=m68k-next
861 case $os in
862 -nextstep* )
863 ;;
864 -ns2*)
865 os=-nextstep2
866 ;;
867 *)
868 os=-nextstep3
869 ;;
870 esac
871 ;;
872 nh3000)
873 basic_machine=m68k-harris
874 os=-cxux
875 ;;
876 nh[45]000)
877 basic_machine=m88k-harris
878 os=-cxux
879 ;;
880 nindy960)
881 basic_machine=i960-intel
882 os=-nindy
883 ;;
884 mon960)
885 basic_machine=i960-intel
886 os=-mon960
887 ;;
888 nonstopux)
889 basic_machine=mips-compaq
890 os=-nonstopux
891 ;;
892 np1)
893 basic_machine=np1-gould
894 ;;
895 neo-tandem)
896 basic_machine=neo-tandem
897 ;;
898 nse-tandem)
899 basic_machine=nse-tandem
900 ;;
901 nsr-tandem)
902 basic_machine=nsr-tandem
903 ;;
904 op50n-* | op60c-*)
905 basic_machine=hppa1.1-oki
906 os=-proelf
907 ;;
908 openrisc | openrisc-*)
909 basic_machine=or32-unknown
910 ;;
911 os400)
912 basic_machine=powerpc-ibm
913 os=-os400
914 ;;
915 OSE68000 | ose68000)
916 basic_machine=m68000-ericsson
917 os=-ose
918 ;;
919 os68k)
920 basic_machine=m68k-none
921 os=-os68k
922 ;;
923 pa-hitachi)
924 basic_machine=hppa1.1-hitachi
925 os=-hiuxwe2
926 ;;
927 paragon)
928 basic_machine=i860-intel
929 os=-osf
930 ;;
931 parisc)
932 basic_machine=hppa-unknown
933 os=-linux
934 ;;
935 parisc-*)
936 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
937 os=-linux
938 ;;
939 pbd)
940 basic_machine=sparc-tti
941 ;;
942 pbb)
943 basic_machine=m68k-tti
944 ;;
945 pc532 | pc532-*)
946 basic_machine=ns32k-pc532
947 ;;
948 pc98)
949 basic_machine=i386-pc
950 ;;
951 pc98-*)
952 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
953 ;;
954 pentium | p5 | k5 | k6 | nexgen | viac3)
955 basic_machine=i586-pc
956 ;;
957 pentiumpro | p6 | 6x86 | athlon | athlon_*)
958 basic_machine=i686-pc
959 ;;
960 pentiumii | pentium2 | pentiumiii | pentium3)
961 basic_machine=i686-pc
962 ;;
963 pentium4)
964 basic_machine=i786-pc
965 ;;
966 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
967 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
968 ;;
969 pentiumpro-* | p6-* | 6x86-* | athlon-*)
970 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
971 ;;
972 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
973 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
974 ;;
975 pentium4-*)
976 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
977 ;;
978 pn)
979 basic_machine=pn-gould
980 ;;
981 power) basic_machine=power-ibm
982 ;;
983 ppc | ppcbe) basic_machine=powerpc-unknown
984 ;;
985 ppc-* | ppcbe-*)
986 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
987 ;;
988 ppcle | powerpclittle | ppc-le | powerpc-little)
989 basic_machine=powerpcle-unknown
990 ;;
991 ppcle-* | powerpclittle-*)
992 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
993 ;;
994 ppc64) basic_machine=powerpc64-unknown
995 ;;
996 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
997 ;;
998 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
999 basic_machine=powerpc64le-unknown
1000 ;;
1001 ppc64le-* | powerpc64little-*)
1002 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1003 ;;
1004 ps2)
1005 basic_machine=i386-ibm
1006 ;;
1007 pw32)
1008 basic_machine=i586-unknown
1009 os=-pw32
1010 ;;
1011 rdos)
1012 basic_machine=i386-pc
1013 os=-rdos
1014 ;;
1015 rom68k)
1016 basic_machine=m68k-rom68k
1017 os=-coff
1018 ;;
1019 rm[46]00)
1020 basic_machine=mips-siemens
1021 ;;
1022 rtpc | rtpc-*)
1023 basic_machine=romp-ibm
1024 ;;
1025 s390 | s390-*)
1026 basic_machine=s390-ibm
1027 ;;
1028 s390x | s390x-*)
1029 basic_machine=s390x-ibm
1030 ;;
1031 sa29200)
1032 basic_machine=a29k-amd
1033 os=-udi
1034 ;;
1035 sb1)
1036 basic_machine=mipsisa64sb1-unknown
1037 ;;
1038 sb1el)
1039 basic_machine=mipsisa64sb1el-unknown
1040 ;;
1041 sde)
1042 basic_machine=mipsisa32-sde
1043 os=-elf
1044 ;;
1045 sei)
1046 basic_machine=mips-sei
1047 os=-seiux
1048 ;;
1049 sequent)
1050 basic_machine=i386-sequent
1051 ;;
1052 sh)
1053 basic_machine=sh-hitachi
1054 os=-hms
1055 ;;
1056 sh5el)
1057 basic_machine=sh5le-unknown
1058 ;;
1059 sh64)
1060 basic_machine=sh64-unknown
1061 ;;
1062 sparclite-wrs | simso-wrs)
1063 basic_machine=sparclite-wrs
1064 os=-vxworks
1065 ;;
1066 sps7)
1067 basic_machine=m68k-bull
1068 os=-sysv2
1069 ;;
1070 spur)
1071 basic_machine=spur-unknown
1072 ;;
1073 st2000)
1074 basic_machine=m68k-tandem
1075 ;;
1076 stratus)
1077 basic_machine=i860-stratus
1078 os=-sysv4
1079 ;;
1080 strongarm-* | thumb-*)
1081 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1082 ;;
1083 sun2)
1084 basic_machine=m68000-sun
1085 ;;
1086 sun2os3)
1087 basic_machine=m68000-sun
1088 os=-sunos3
1089 ;;
1090 sun2os4)
1091 basic_machine=m68000-sun
1092 os=-sunos4
1093 ;;
1094 sun3os3)
1095 basic_machine=m68k-sun
1096 os=-sunos3
1097 ;;
1098 sun3os4)
1099 basic_machine=m68k-sun
1100 os=-sunos4
1101 ;;
1102 sun4os3)
1103 basic_machine=sparc-sun
1104 os=-sunos3
1105 ;;
1106 sun4os4)
1107 basic_machine=sparc-sun
1108 os=-sunos4
1109 ;;
1110 sun4sol2)
1111 basic_machine=sparc-sun
1112 os=-solaris2
1113 ;;
1114 sun3 | sun3-*)
1115 basic_machine=m68k-sun
1116 ;;
1117 sun4)
1118 basic_machine=sparc-sun
1119 ;;
1120 sun386 | sun386i | roadrunner)
1121 basic_machine=i386-sun
1122 ;;
1123 sv1)
1124 basic_machine=sv1-cray
1125 os=-unicos
1126 ;;
1127 symmetry)
1128 basic_machine=i386-sequent
1129 os=-dynix
1130 ;;
1131 t3e)
1132 basic_machine=alphaev5-cray
1133 os=-unicos
1134 ;;
1135 t90)
1136 basic_machine=t90-cray
1137 os=-unicos
1138 ;;
1139 tile*)
1140 basic_machine=$basic_machine-unknown
1141 os=-linux-gnu
1142 ;;
1143 tx39)
1144 basic_machine=mipstx39-unknown
1145 ;;
1146 tx39el)
1147 basic_machine=mipstx39el-unknown
1148 ;;
1149 toad1)
1150 basic_machine=pdp10-xkl
1151 os=-tops20
1152 ;;
1153 tower | tower-32)
1154 basic_machine=m68k-ncr
1155 ;;
1156 tpf)
1157 basic_machine=s390x-ibm
1158 os=-tpf
1159 ;;
1160 udi29k)
1161 basic_machine=a29k-amd
1162 os=-udi
1163 ;;
1164 ultra3)
1165 basic_machine=a29k-nyu
1166 os=-sym1
1167 ;;
1168 v810 | necv810)
1169 basic_machine=v810-nec
1170 os=-none
1171 ;;
1172 vaxv)
1173 basic_machine=vax-dec
1174 os=-sysv
1175 ;;
1176 vms)
1177 basic_machine=vax-dec
1178 os=-vms
1179 ;;
1180 vpp*|vx|vx-*)
1181 basic_machine=f301-fujitsu
1182 ;;
1183 vxworks960)
1184 basic_machine=i960-wrs
1185 os=-vxworks
1186 ;;
1187 vxworks68)
1188 basic_machine=m68k-wrs
1189 os=-vxworks
1190 ;;
1191 vxworks29k)
1192 basic_machine=a29k-wrs
1193 os=-vxworks
1194 ;;
1195 w65*)
1196 basic_machine=w65-wdc
1197 os=-none
1198 ;;
1199 w89k-*)
1200 basic_machine=hppa1.1-winbond
1201 os=-proelf
1202 ;;
1203 xbox)
1204 basic_machine=i686-pc
1205 os=-mingw32
1206 ;;
1207 xps | xps100)
1208 basic_machine=xps100-honeywell
1209 ;;
1210 xscale-* | xscalee[bl]-*)
1211 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1212 ;;
1213 ymp)
1214 basic_machine=ymp-cray
1215 os=-unicos
1216 ;;
1217 z8k-*-coff)
1218 basic_machine=z8k-unknown
1219 os=-sim
1220 ;;
1221 z80-*-coff)
1222 basic_machine=z80-unknown
1223 os=-sim
1224 ;;
1225 none)
1226 basic_machine=none-none
1227 os=-none
1228 ;;
1229
1230# Here we handle the default manufacturer of certain CPU types. It is in
1231# some cases the only manufacturer, in others, it is the most popular.
1232 w89k)
1233 basic_machine=hppa1.1-winbond
1234 ;;
1235 op50n)
1236 basic_machine=hppa1.1-oki
1237 ;;
1238 op60c)
1239 basic_machine=hppa1.1-oki
1240 ;;
1241 romp)
1242 basic_machine=romp-ibm
1243 ;;
1244 mmix)
1245 basic_machine=mmix-knuth
1246 ;;
1247 rs6000)
1248 basic_machine=rs6000-ibm
1249 ;;
1250 vax)
1251 basic_machine=vax-dec
1252 ;;
1253 pdp10)
1254 # there are many clones, so DEC is not a safe bet
1255 basic_machine=pdp10-unknown
1256 ;;
1257 pdp11)
1258 basic_machine=pdp11-dec
1259 ;;
1260 we32k)
1261 basic_machine=we32k-att
1262 ;;
1263 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1264 basic_machine=sh-unknown
1265 ;;
1266 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1267 basic_machine=sparc-sun
1268 ;;
1269 cydra)
1270 basic_machine=cydra-cydrome
1271 ;;
1272 orion)
1273 basic_machine=orion-highlevel
1274 ;;
1275 orion105)
1276 basic_machine=clipper-highlevel
1277 ;;
1278 mac | mpw | mac-mpw)
1279 basic_machine=m68k-apple
1280 ;;
1281 pmac | pmac-mpw)
1282 basic_machine=powerpc-apple
1283 ;;
1284 *-unknown)
1285 # Make sure to match an already-canonicalized machine name.
1286 ;;
1287 *)
1288 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1289 exit 1
1290 ;;
1291esac
1292
1293# Here we canonicalize certain aliases for manufacturers.
1294case $basic_machine in
1295 *-digital*)
1296 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1297 ;;
1298 *-commodore*)
1299 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1300 ;;
1301 *)
1302 ;;
1303esac
1304
1305# Decode manufacturer-specific aliases for certain operating systems.
1306
1307if [ x"$os" != x"" ]
1308then
1309case $os in
1310 # First match some system type aliases
1311 # that might get confused with valid system types.
1312 # -solaris* is a basic system type, with this one exception.
1313 -auroraux)
1314 os=-auroraux
1315 ;;
1316 -solaris1 | -solaris1.*)
1317 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1318 ;;
1319 -solaris)
1320 os=-solaris2
1321 ;;
1322 -svr4*)
1323 os=-sysv4
1324 ;;
1325 -unixware*)
1326 os=-sysv4.2uw
1327 ;;
1328 -gnu/linux*)
1329 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1330 ;;
1331 # First accept the basic system types.
1332 # The portable systems comes first.
1333 # Each alternative MUST END IN A *, to match a version number.
1334 # -sysv* is not here because it comes later, after sysvr4.
1335 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1336 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1337 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1338 | -sym* | -kopensolaris* \
1339 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1340 | -aos* | -aros* \
1341 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1342 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1343 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1344 | -openbsd* | -solidbsd* \
1345 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1346 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1347 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1348 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1349 | -chorusos* | -chorusrdb* | -cegcc* \
1350 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1351 | -mingw32* | -linux-gnu* | -linux-android* \
1352 | -linux-newlib* | -linux-uclibc* \
1353 | -uxpv* | -beos* | -mpeix* | -udk* \
1354 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1355 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1356 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1357 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1358 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1359 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1360 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1361 # Remember, each alternative MUST END IN *, to match a version number.
1362 ;;
1363 -qnx*)
1364 case $basic_machine in
1365 x86-* | i*86-*)
1366 ;;
1367 *)
1368 os=-nto$os
1369 ;;
1370 esac
1371 ;;
1372 -nto-qnx*)
1373 ;;
1374 -nto*)
1375 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1376 ;;
1377 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1378 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1379 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1380 ;;
1381 -mac*)
1382 os=`echo $os | sed -e 's|mac|macos|'`
1383 ;;
1384 -linux-dietlibc)
1385 os=-linux-dietlibc
1386 ;;
1387 -linux*)
1388 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1389 ;;
1390 -sunos5*)
1391 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1392 ;;
1393 -sunos6*)
1394 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1395 ;;
1396 -opened*)
1397 os=-openedition
1398 ;;
1399 -os400*)
1400 os=-os400
1401 ;;
1402 -wince*)
1403 os=-wince
1404 ;;
1405 -osfrose*)
1406 os=-osfrose
1407 ;;
1408 -osf*)
1409 os=-osf
1410 ;;
1411 -utek*)
1412 os=-bsd
1413 ;;
1414 -dynix*)
1415 os=-bsd
1416 ;;
1417 -acis*)
1418 os=-aos
1419 ;;
1420 -atheos*)
1421 os=-atheos
1422 ;;
1423 -syllable*)
1424 os=-syllable
1425 ;;
1426 -386bsd)
1427 os=-bsd
1428 ;;
1429 -ctix* | -uts*)
1430 os=-sysv
1431 ;;
1432 -nova*)
1433 os=-rtmk-nova
1434 ;;
1435 -ns2 )
1436 os=-nextstep2
1437 ;;
1438 -nsk*)
1439 os=-nsk
1440 ;;
1441 # Preserve the version number of sinix5.
1442 -sinix5.*)
1443 os=`echo $os | sed -e 's|sinix|sysv|'`
1444 ;;
1445 -sinix*)
1446 os=-sysv4
1447 ;;
1448 -tpf*)
1449 os=-tpf
1450 ;;
1451 -triton*)
1452 os=-sysv3
1453 ;;
1454 -oss*)
1455 os=-sysv3
1456 ;;
1457 -svr4)
1458 os=-sysv4
1459 ;;
1460 -svr3)
1461 os=-sysv3
1462 ;;
1463 -sysvr4)
1464 os=-sysv4
1465 ;;
1466 # This must come after -sysvr4.
1467 -sysv*)
1468 ;;
1469 -ose*)
1470 os=-ose
1471 ;;
1472 -es1800*)
1473 os=-ose
1474 ;;
1475 -xenix)
1476 os=-xenix
1477 ;;
1478 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1479 os=-mint
1480 ;;
1481 -aros*)
1482 os=-aros
1483 ;;
1484 -kaos*)
1485 os=-kaos
1486 ;;
1487 -zvmoe)
1488 os=-zvmoe
1489 ;;
1490 -dicos*)
1491 os=-dicos
1492 ;;
1493 -nacl*)
1494 ;;
1495 -none)
1496 ;;
1497 *)
1498 # Get rid of the `-' at the beginning of $os.
1499 os=`echo $os | sed 's/[^-]*-//'`
1500 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1501 exit 1
1502 ;;
1503esac
1504else
1505
1506# Here we handle the default operating systems that come with various machines.
1507# The value should be what the vendor currently ships out the door with their
1508# machine or put another way, the most popular os provided with the machine.
1509
1510# Note that if you're going to try to match "-MANUFACTURER" here (say,
1511# "-sun"), then you have to tell the case statement up towards the top
1512# that MANUFACTURER isn't an operating system. Otherwise, code above
1513# will signal an error saying that MANUFACTURER isn't an operating
1514# system, and we'll never get to this point.
1515
1516case $basic_machine in
1517 score-*)
1518 os=-elf
1519 ;;
1520 spu-*)
1521 os=-elf
1522 ;;
1523 *-acorn)
1524 os=-riscix1.2
1525 ;;
1526 arm*-rebel)
1527 os=-linux
1528 ;;
1529 arm*-semi)
1530 os=-aout
1531 ;;
1532 c4x-* | tic4x-*)
1533 os=-coff
1534 ;;
1535 tic54x-*)
1536 os=-coff
1537 ;;
1538 tic55x-*)
1539 os=-coff
1540 ;;
1541 tic6x-*)
1542 os=-coff
1543 ;;
1544 # This must come before the *-dec entry.
1545 pdp10-*)
1546 os=-tops20
1547 ;;
1548 pdp11-*)
1549 os=-none
1550 ;;
1551 *-dec | vax-*)
1552 os=-ultrix4.2
1553 ;;
1554 m68*-apollo)
1555 os=-domain
1556 ;;
1557 i386-sun)
1558 os=-sunos4.0.2
1559 ;;
1560 m68000-sun)
1561 os=-sunos3
1562 # This also exists in the configure program, but was not the
1563 # default.
1564 # os=-sunos4
1565 ;;
1566 m68*-cisco)
1567 os=-aout
1568 ;;
1569 mep-*)
1570 os=-elf
1571 ;;
1572 mips*-cisco)
1573 os=-elf
1574 ;;
1575 mips*-*)
1576 os=-elf
1577 ;;
1578 or32-*)
1579 os=-coff
1580 ;;
1581 *-tti) # must be before sparc entry or we get the wrong os.
1582 os=-sysv3
1583 ;;
1584 sparc-* | *-sun)
1585 os=-sunos4.1.1
1586 ;;
1587 *-be)
1588 os=-beos
1589 ;;
1590 *-haiku)
1591 os=-haiku
1592 ;;
1593 *-ibm)
1594 os=-aix
1595 ;;
1596 *-knuth)
1597 os=-mmixware
1598 ;;
1599 *-wec)
1600 os=-proelf
1601 ;;
1602 *-winbond)
1603 os=-proelf
1604 ;;
1605 *-oki)
1606 os=-proelf
1607 ;;
1608 *-hp)
1609 os=-hpux
1610 ;;
1611 *-hitachi)
1612 os=-hiux
1613 ;;
1614 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1615 os=-sysv
1616 ;;
1617 *-cbm)
1618 os=-amigaos
1619 ;;
1620 *-dg)
1621 os=-dgux
1622 ;;
1623 *-dolphin)
1624 os=-sysv3
1625 ;;
1626 m68k-ccur)
1627 os=-rtu
1628 ;;
1629 m88k-omron*)
1630 os=-luna
1631 ;;
1632 *-next )
1633 os=-nextstep
1634 ;;
1635 *-sequent)
1636 os=-ptx
1637 ;;
1638 *-crds)
1639 os=-unos
1640 ;;
1641 *-ns)
1642 os=-genix
1643 ;;
1644 i370-*)
1645 os=-mvs
1646 ;;
1647 *-next)
1648 os=-nextstep3
1649 ;;
1650 *-gould)
1651 os=-sysv
1652 ;;
1653 *-highlevel)
1654 os=-bsd
1655 ;;
1656 *-encore)
1657 os=-bsd
1658 ;;
1659 *-sgi)
1660 os=-irix
1661 ;;
1662 *-siemens)
1663 os=-sysv4
1664 ;;
1665 *-masscomp)
1666 os=-rtu
1667 ;;
1668 f30[01]-fujitsu | f700-fujitsu)
1669 os=-uxpv
1670 ;;
1671 *-rom68k)
1672 os=-coff
1673 ;;
1674 *-*bug)
1675 os=-coff
1676 ;;
1677 *-apple)
1678 os=-macos
1679 ;;
1680 *-atari*)
1681 os=-mint
1682 ;;
1683 *)
1684 os=-none
1685 ;;
1686esac
1687fi
1688
1689# Here we handle the case where we know the os, and the CPU type, but not the
1690# manufacturer. We pick the logical manufacturer.
1691vendor=unknown
1692case $basic_machine in
1693 *-unknown)
1694 case $os in
1695 -riscix*)
1696 vendor=acorn
1697 ;;
1698 -sunos*)
1699 vendor=sun
1700 ;;
1701 -cnk*|-aix*)
1702 vendor=ibm
1703 ;;
1704 -beos*)
1705 vendor=be
1706 ;;
1707 -hpux*)
1708 vendor=hp
1709 ;;
1710 -mpeix*)
1711 vendor=hp
1712 ;;
1713 -hiux*)
1714 vendor=hitachi
1715 ;;
1716 -unos*)
1717 vendor=crds
1718 ;;
1719 -dgux*)
1720 vendor=dg
1721 ;;
1722 -luna*)
1723 vendor=omron
1724 ;;
1725 -genix*)
1726 vendor=ns
1727 ;;
1728 -mvs* | -opened*)
1729 vendor=ibm
1730 ;;
1731 -os400*)
1732 vendor=ibm
1733 ;;
1734 -ptx*)
1735 vendor=sequent
1736 ;;
1737 -tpf*)
1738 vendor=ibm
1739 ;;
1740 -vxsim* | -vxworks* | -windiss*)
1741 vendor=wrs
1742 ;;
1743 -aux*)
1744 vendor=apple
1745 ;;
1746 -hms*)
1747 vendor=hitachi
1748 ;;
1749 -mpw* | -macos*)
1750 vendor=apple
1751 ;;
1752 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1753 vendor=atari
1754 ;;
1755 -vos*)
1756 vendor=stratus
1757 ;;
1758 esac
1759 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1760 ;;
1761esac
1762
1763echo $basic_machine$os
1764exit
1765
1766# Local variables:
1767# eval: (add-hook 'write-file-hooks 'time-stamp)
1768# time-stamp-start: "timestamp='"
1769# time-stamp-format: "%:y-%02m-%02d"
1770# time-stamp-end: "'"
1771# End:
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure
new file mode 100644
index 0000000..bb5f694
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure
@@ -0,0 +1,15928 @@
1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.68 for libjpeg 8.4.0.
4#
5#
6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
8# Foundation, Inc.
9#
10#
11# This configure script is free software; the Free Software Foundation
12# gives unlimited permission to copy, distribute and modify it.
13## -------------------- ##
14## M4sh Initialization. ##
15## -------------------- ##
16
17# Be more Bourne compatible
18DUALCASE=1; export DUALCASE # for MKS sh
19if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
20 emulate sh
21 NULLCMD=:
22 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
23 # is contrary to our usage. Disable this feature.
24 alias -g '${1+"$@"}'='"$@"'
25 setopt NO_GLOB_SUBST
26else
27 case `(set -o) 2>/dev/null` in #(
28 *posix*) :
29 set -o posix ;; #(
30 *) :
31 ;;
32esac
33fi
34
35
36as_nl='
37'
38export as_nl
39# Printing a long string crashes Solaris 7 /usr/bin/printf.
40as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
41as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
42as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
43# Prefer a ksh shell builtin over an external printf program on Solaris,
44# but without wasting forks for bash or zsh.
45if test -z "$BASH_VERSION$ZSH_VERSION" \
46 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
47 as_echo='print -r --'
48 as_echo_n='print -rn --'
49elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
50 as_echo='printf %s\n'
51 as_echo_n='printf %s'
52else
53 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
54 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
55 as_echo_n='/usr/ucb/echo -n'
56 else
57 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
58 as_echo_n_body='eval
59 arg=$1;
60 case $arg in #(
61 *"$as_nl"*)
62 expr "X$arg" : "X\\(.*\\)$as_nl";
63 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
64 esac;
65 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
66 '
67 export as_echo_n_body
68 as_echo_n='sh -c $as_echo_n_body as_echo'
69 fi
70 export as_echo_body
71 as_echo='sh -c $as_echo_body as_echo'
72fi
73
74# The user is always right.
75if test "${PATH_SEPARATOR+set}" != set; then
76 PATH_SEPARATOR=:
77 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
78 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
79 PATH_SEPARATOR=';'
80 }
81fi
82
83
84# IFS
85# We need space, tab and new line, in precisely that order. Quoting is
86# there to prevent editors from complaining about space-tab.
87# (If _AS_PATH_WALK were called with IFS unset, it would disable word
88# splitting by setting IFS to empty value.)
89IFS=" "" $as_nl"
90
91# Find who we are. Look in the path if we contain no directory separator.
92as_myself=
93case $0 in #((
94 *[\\/]* ) as_myself=$0 ;;
95 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
96for as_dir in $PATH
97do
98 IFS=$as_save_IFS
99 test -z "$as_dir" && as_dir=.
100 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
101 done
102IFS=$as_save_IFS
103
104 ;;
105esac
106# We did not find ourselves, most probably we were run as `sh COMMAND'
107# in which case we are not to be found in the path.
108if test "x$as_myself" = x; then
109 as_myself=$0
110fi
111if test ! -f "$as_myself"; then
112 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
113 exit 1
114fi
115
116# Unset variables that we do not need and which cause bugs (e.g. in
117# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
118# suppresses any "Segmentation fault" message there. '((' could
119# trigger a bug in pdksh 5.2.14.
120for as_var in BASH_ENV ENV MAIL MAILPATH
121do eval test x\${$as_var+set} = xset \
122 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
123done
124PS1='$ '
125PS2='> '
126PS4='+ '
127
128# NLS nuisances.
129LC_ALL=C
130export LC_ALL
131LANGUAGE=C
132export LANGUAGE
133
134# CDPATH.
135(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
136
137if test "x$CONFIG_SHELL" = x; then
138 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
139 emulate sh
140 NULLCMD=:
141 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
142 # is contrary to our usage. Disable this feature.
143 alias -g '\${1+\"\$@\"}'='\"\$@\"'
144 setopt NO_GLOB_SUBST
145else
146 case \`(set -o) 2>/dev/null\` in #(
147 *posix*) :
148 set -o posix ;; #(
149 *) :
150 ;;
151esac
152fi
153"
154 as_required="as_fn_return () { (exit \$1); }
155as_fn_success () { as_fn_return 0; }
156as_fn_failure () { as_fn_return 1; }
157as_fn_ret_success () { return 0; }
158as_fn_ret_failure () { return 1; }
159
160exitcode=0
161as_fn_success || { exitcode=1; echo as_fn_success failed.; }
162as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
163as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
164as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
165if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
166
167else
168 exitcode=1; echo positional parameters were not saved.
169fi
170test x\$exitcode = x0 || exit 1"
171 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
172 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
173 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
174 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
175test \$(( 1 + 1 )) = 2 || exit 1
176
177 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
178 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
179 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
180 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
181 PATH=/empty FPATH=/empty; export PATH FPATH
182 test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
183 || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
184 if (eval "$as_required") 2>/dev/null; then :
185 as_have_required=yes
186else
187 as_have_required=no
188fi
189 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
190
191else
192 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
193as_found=false
194for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
195do
196 IFS=$as_save_IFS
197 test -z "$as_dir" && as_dir=.
198 as_found=:
199 case $as_dir in #(
200 /*)
201 for as_base in sh bash ksh sh5; do
202 # Try only shells that exist, to save several forks.
203 as_shell=$as_dir/$as_base
204 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
205 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
206 CONFIG_SHELL=$as_shell as_have_required=yes
207 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
208 break 2
209fi
210fi
211 done;;
212 esac
213 as_found=false
214done
215$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
216 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
217 CONFIG_SHELL=$SHELL as_have_required=yes
218fi; }
219IFS=$as_save_IFS
220
221
222 if test "x$CONFIG_SHELL" != x; then :
223 # We cannot yet assume a decent shell, so we have to provide a
224 # neutralization value for shells without unset; and this also
225 # works around shells that cannot unset nonexistent variables.
226 # Preserve -v and -x to the replacement shell.
227 BASH_ENV=/dev/null
228 ENV=/dev/null
229 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
230 export CONFIG_SHELL
231 case $- in # ((((
232 *v*x* | *x*v* ) as_opts=-vx ;;
233 *v* ) as_opts=-v ;;
234 *x* ) as_opts=-x ;;
235 * ) as_opts= ;;
236 esac
237 exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
238fi
239
240 if test x$as_have_required = xno; then :
241 $as_echo "$0: This script requires a shell more modern than all"
242 $as_echo "$0: the shells that I found on your system."
243 if test x${ZSH_VERSION+set} = xset ; then
244 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
245 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
246 else
247 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
248$0: including any error possibly output before this
249$0: message. Then install a modern shell, or manually run
250$0: the script under such a shell if you do have one."
251 fi
252 exit 1
253fi
254fi
255fi
256SHELL=${CONFIG_SHELL-/bin/sh}
257export SHELL
258# Unset more variables known to interfere with behavior of common tools.
259CLICOLOR_FORCE= GREP_OPTIONS=
260unset CLICOLOR_FORCE GREP_OPTIONS
261
262## --------------------- ##
263## M4sh Shell Functions. ##
264## --------------------- ##
265# as_fn_unset VAR
266# ---------------
267# Portably unset VAR.
268as_fn_unset ()
269{
270 { eval $1=; unset $1;}
271}
272as_unset=as_fn_unset
273
274# as_fn_set_status STATUS
275# -----------------------
276# Set $? to STATUS, without forking.
277as_fn_set_status ()
278{
279 return $1
280} # as_fn_set_status
281
282# as_fn_exit STATUS
283# -----------------
284# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
285as_fn_exit ()
286{
287 set +e
288 as_fn_set_status $1
289 exit $1
290} # as_fn_exit
291
292# as_fn_mkdir_p
293# -------------
294# Create "$as_dir" as a directory, including parents if necessary.
295as_fn_mkdir_p ()
296{
297
298 case $as_dir in #(
299 -*) as_dir=./$as_dir;;
300 esac
301 test -d "$as_dir" || eval $as_mkdir_p || {
302 as_dirs=
303 while :; do
304 case $as_dir in #(
305 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
306 *) as_qdir=$as_dir;;
307 esac
308 as_dirs="'$as_qdir' $as_dirs"
309 as_dir=`$as_dirname -- "$as_dir" ||
310$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
311 X"$as_dir" : 'X\(//\)[^/]' \| \
312 X"$as_dir" : 'X\(//\)$' \| \
313 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
314$as_echo X"$as_dir" |
315 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
316 s//\1/
317 q
318 }
319 /^X\(\/\/\)[^/].*/{
320 s//\1/
321 q
322 }
323 /^X\(\/\/\)$/{
324 s//\1/
325 q
326 }
327 /^X\(\/\).*/{
328 s//\1/
329 q
330 }
331 s/.*/./; q'`
332 test -d "$as_dir" && break
333 done
334 test -z "$as_dirs" || eval "mkdir $as_dirs"
335 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
336
337
338} # as_fn_mkdir_p
339# as_fn_append VAR VALUE
340# ----------------------
341# Append the text in VALUE to the end of the definition contained in VAR. Take
342# advantage of any shell optimizations that allow amortized linear growth over
343# repeated appends, instead of the typical quadratic growth present in naive
344# implementations.
345if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
346 eval 'as_fn_append ()
347 {
348 eval $1+=\$2
349 }'
350else
351 as_fn_append ()
352 {
353 eval $1=\$$1\$2
354 }
355fi # as_fn_append
356
357# as_fn_arith ARG...
358# ------------------
359# Perform arithmetic evaluation on the ARGs, and store the result in the
360# global $as_val. Take advantage of shells that can avoid forks. The arguments
361# must be portable across $(()) and expr.
362if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
363 eval 'as_fn_arith ()
364 {
365 as_val=$(( $* ))
366 }'
367else
368 as_fn_arith ()
369 {
370 as_val=`expr "$@" || test $? -eq 1`
371 }
372fi # as_fn_arith
373
374
375# as_fn_error STATUS ERROR [LINENO LOG_FD]
376# ----------------------------------------
377# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
378# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
379# script with STATUS, using 1 if that was 0.
380as_fn_error ()
381{
382 as_status=$1; test $as_status -eq 0 && as_status=1
383 if test "$4"; then
384 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
385 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
386 fi
387 $as_echo "$as_me: error: $2" >&2
388 as_fn_exit $as_status
389} # as_fn_error
390
391if expr a : '\(a\)' >/dev/null 2>&1 &&
392 test "X`expr 00001 : '.*\(...\)'`" = X001; then
393 as_expr=expr
394else
395 as_expr=false
396fi
397
398if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
399 as_basename=basename
400else
401 as_basename=false
402fi
403
404if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
405 as_dirname=dirname
406else
407 as_dirname=false
408fi
409
410as_me=`$as_basename -- "$0" ||
411$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
412 X"$0" : 'X\(//\)$' \| \
413 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
414$as_echo X/"$0" |
415 sed '/^.*\/\([^/][^/]*\)\/*$/{
416 s//\1/
417 q
418 }
419 /^X\/\(\/\/\)$/{
420 s//\1/
421 q
422 }
423 /^X\/\(\/\).*/{
424 s//\1/
425 q
426 }
427 s/.*/./; q'`
428
429# Avoid depending upon Character Ranges.
430as_cr_letters='abcdefghijklmnopqrstuvwxyz'
431as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
432as_cr_Letters=$as_cr_letters$as_cr_LETTERS
433as_cr_digits='0123456789'
434as_cr_alnum=$as_cr_Letters$as_cr_digits
435
436
437 as_lineno_1=$LINENO as_lineno_1a=$LINENO
438 as_lineno_2=$LINENO as_lineno_2a=$LINENO
439 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
440 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
441 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
442 sed -n '
443 p
444 /[$]LINENO/=
445 ' <$as_myself |
446 sed '
447 s/[$]LINENO.*/&-/
448 t lineno
449 b
450 :lineno
451 N
452 :loop
453 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
454 t loop
455 s/-\n.*//
456 ' >$as_me.lineno &&
457 chmod +x "$as_me.lineno" ||
458 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
459
460 # Don't try to exec as it changes $[0], causing all sort of problems
461 # (the dirname of $[0] is not the place where we might find the
462 # original and so on. Autoconf is especially sensitive to this).
463 . "./$as_me.lineno"
464 # Exit status is that of the last command.
465 exit
466}
467
468ECHO_C= ECHO_N= ECHO_T=
469case `echo -n x` in #(((((
470-n*)
471 case `echo 'xy\c'` in
472 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
473 xy) ECHO_C='\c';;
474 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
475 ECHO_T=' ';;
476 esac;;
477*)
478 ECHO_N='-n';;
479esac
480
481rm -f conf$$ conf$$.exe conf$$.file
482if test -d conf$$.dir; then
483 rm -f conf$$.dir/conf$$.file
484else
485 rm -f conf$$.dir
486 mkdir conf$$.dir 2>/dev/null
487fi
488if (echo >conf$$.file) 2>/dev/null; then
489 if ln -s conf$$.file conf$$ 2>/dev/null; then
490 as_ln_s='ln -s'
491 # ... but there are two gotchas:
492 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
493 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
494 # In both cases, we have to default to `cp -p'.
495 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
496 as_ln_s='cp -p'
497 elif ln conf$$.file conf$$ 2>/dev/null; then
498 as_ln_s=ln
499 else
500 as_ln_s='cp -p'
501 fi
502else
503 as_ln_s='cp -p'
504fi
505rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
506rmdir conf$$.dir 2>/dev/null
507
508if mkdir -p . 2>/dev/null; then
509 as_mkdir_p='mkdir -p "$as_dir"'
510else
511 test -d ./-p && rmdir ./-p
512 as_mkdir_p=false
513fi
514
515if test -x / >/dev/null 2>&1; then
516 as_test_x='test -x'
517else
518 if ls -dL / >/dev/null 2>&1; then
519 as_ls_L_option=L
520 else
521 as_ls_L_option=
522 fi
523 as_test_x='
524 eval sh -c '\''
525 if test -d "$1"; then
526 test -d "$1/.";
527 else
528 case $1 in #(
529 -*)set "./$1";;
530 esac;
531 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
532 ???[sx]*):;;*)false;;esac;fi
533 '\'' sh
534 '
535fi
536as_executable_p=$as_test_x
537
538# Sed expression to map a string onto a valid CPP name.
539as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
540
541# Sed expression to map a string onto a valid variable name.
542as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
543
544SHELL=${CONFIG_SHELL-/bin/sh}
545
546
547test -n "$DJDIR" || exec 7<&0 </dev/null
548exec 6>&1
549
550# Name of the host.
551# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
552# so uname gets run too.
553ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
554
555#
556# Initializations.
557#
558ac_default_prefix=/usr/local
559ac_clean_files=
560ac_config_libobj_dir=.
561LIBOBJS=
562cross_compiling=no
563subdirs=
564MFLAGS=
565MAKEFLAGS=
566
567# Identity of this package.
568PACKAGE_NAME='libjpeg'
569PACKAGE_TARNAME='libjpeg'
570PACKAGE_VERSION='8.4.0'
571PACKAGE_STRING='libjpeg 8.4.0'
572PACKAGE_BUGREPORT=''
573PACKAGE_URL=''
574
575# Factoring default headers for most tests.
576ac_includes_default="\
577#include <stdio.h>
578#ifdef HAVE_SYS_TYPES_H
579# include <sys/types.h>
580#endif
581#ifdef HAVE_SYS_STAT_H
582# include <sys/stat.h>
583#endif
584#ifdef STDC_HEADERS
585# include <stdlib.h>
586# include <stddef.h>
587#else
588# ifdef HAVE_STDLIB_H
589# include <stdlib.h>
590# endif
591#endif
592#ifdef HAVE_STRING_H
593# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
594# include <memory.h>
595# endif
596# include <string.h>
597#endif
598#ifdef HAVE_STRINGS_H
599# include <strings.h>
600#endif
601#ifdef HAVE_INTTYPES_H
602# include <inttypes.h>
603#endif
604#ifdef HAVE_STDINT_H
605# include <stdint.h>
606#endif
607#ifdef HAVE_UNISTD_H
608# include <unistd.h>
609#endif"
610
611ac_subst_vars='am__EXEEXT_FALSE
612am__EXEEXT_TRUE
613LTLIBOBJS
614LIBOBJS
615JPEG_LIB_VERSION
616MEMORYMGR
617OTOOL64
618OTOOL
619LIPO
620NMEDIT
621DSYMUTIL
622MANIFEST_TOOL
623RANLIB
624ac_ct_AR
625AR
626NM
627ac_ct_DUMPBIN
628DUMPBIN
629LD
630FGREP
631SED
632LIBTOOL
633OBJDUMP
634DLLTOOL
635AS
636HAVE_LD_VERSION_SCRIPT_FALSE
637HAVE_LD_VERSION_SCRIPT_TRUE
638LN_S
639MAINT
640MAINTAINER_MODE_FALSE
641MAINTAINER_MODE_TRUE
642ANSI2KNR
643U
644EGREP
645GREP
646CPP
647am__fastdepCC_FALSE
648am__fastdepCC_TRUE
649CCDEPMODE
650am__nodep
651AMDEPBACKSLASH
652AMDEP_FALSE
653AMDEP_TRUE
654am__quote
655am__include
656DEPDIR
657OBJEXT
658EXEEXT
659ac_ct_CC
660CPPFLAGS
661LDFLAGS
662CFLAGS
663CC
664AM_BACKSLASH
665AM_DEFAULT_VERBOSITY
666am__untar
667am__tar
668AMTAR
669am__leading_dot
670SET_MAKE
671AWK
672mkdir_p
673MKDIR_P
674INSTALL_STRIP_PROGRAM
675STRIP
676install_sh
677MAKEINFO
678AUTOHEADER
679AUTOMAKE
680AUTOCONF
681ACLOCAL
682VERSION
683PACKAGE
684CYGPATH_W
685am__isrc
686INSTALL_DATA
687INSTALL_SCRIPT
688INSTALL_PROGRAM
689target_os
690target_vendor
691target_cpu
692target
693host_os
694host_vendor
695host_cpu
696host
697build_os
698build_vendor
699build_cpu
700build
701target_alias
702host_alias
703build_alias
704LIBS
705ECHO_T
706ECHO_N
707ECHO_C
708DEFS
709mandir
710localedir
711libdir
712psdir
713pdfdir
714dvidir
715htmldir
716infodir
717docdir
718oldincludedir
719includedir
720localstatedir
721sharedstatedir
722sysconfdir
723datadir
724datarootdir
725libexecdir
726sbindir
727bindir
728program_transform_name
729prefix
730exec_prefix
731PACKAGE_URL
732PACKAGE_BUGREPORT
733PACKAGE_STRING
734PACKAGE_VERSION
735PACKAGE_TARNAME
736PACKAGE_NAME
737PATH_SEPARATOR
738SHELL'
739ac_subst_files=''
740ac_user_opts='
741enable_option_checking
742enable_silent_rules
743enable_dependency_tracking
744enable_maintainer_mode
745enable_ld_version_script
746enable_shared
747enable_static
748with_pic
749enable_fast_install
750with_gnu_ld
751with_sysroot
752enable_libtool_lock
753enable_maxmem
754'
755 ac_precious_vars='build_alias
756host_alias
757target_alias
758CC
759CFLAGS
760LDFLAGS
761LIBS
762CPPFLAGS
763CPP'
764
765
766# Initialize some variables set by options.
767ac_init_help=
768ac_init_version=false
769ac_unrecognized_opts=
770ac_unrecognized_sep=
771# The variables have the same names as the options, with
772# dashes changed to underlines.
773cache_file=/dev/null
774exec_prefix=NONE
775no_create=
776no_recursion=
777prefix=NONE
778program_prefix=NONE
779program_suffix=NONE
780program_transform_name=s,x,x,
781silent=
782site=
783srcdir=
784verbose=
785x_includes=NONE
786x_libraries=NONE
787
788# Installation directory options.
789# These are left unexpanded so users can "make install exec_prefix=/foo"
790# and all the variables that are supposed to be based on exec_prefix
791# by default will actually change.
792# Use braces instead of parens because sh, perl, etc. also accept them.
793# (The list follows the same order as the GNU Coding Standards.)
794bindir='${exec_prefix}/bin'
795sbindir='${exec_prefix}/sbin'
796libexecdir='${exec_prefix}/libexec'
797datarootdir='${prefix}/share'
798datadir='${datarootdir}'
799sysconfdir='${prefix}/etc'
800sharedstatedir='${prefix}/com'
801localstatedir='${prefix}/var'
802includedir='${prefix}/include'
803oldincludedir='/usr/include'
804docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
805infodir='${datarootdir}/info'
806htmldir='${docdir}'
807dvidir='${docdir}'
808pdfdir='${docdir}'
809psdir='${docdir}'
810libdir='${exec_prefix}/lib'
811localedir='${datarootdir}/locale'
812mandir='${datarootdir}/man'
813
814ac_prev=
815ac_dashdash=
816for ac_option
817do
818 # If the previous option needs an argument, assign it.
819 if test -n "$ac_prev"; then
820 eval $ac_prev=\$ac_option
821 ac_prev=
822 continue
823 fi
824
825 case $ac_option in
826 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
827 *=) ac_optarg= ;;
828 *) ac_optarg=yes ;;
829 esac
830
831 # Accept the important Cygnus configure options, so we can diagnose typos.
832
833 case $ac_dashdash$ac_option in
834 --)
835 ac_dashdash=yes ;;
836
837 -bindir | --bindir | --bindi | --bind | --bin | --bi)
838 ac_prev=bindir ;;
839 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
840 bindir=$ac_optarg ;;
841
842 -build | --build | --buil | --bui | --bu)
843 ac_prev=build_alias ;;
844 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
845 build_alias=$ac_optarg ;;
846
847 -cache-file | --cache-file | --cache-fil | --cache-fi \
848 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
849 ac_prev=cache_file ;;
850 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
851 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
852 cache_file=$ac_optarg ;;
853
854 --config-cache | -C)
855 cache_file=config.cache ;;
856
857 -datadir | --datadir | --datadi | --datad)
858 ac_prev=datadir ;;
859 -datadir=* | --datadir=* | --datadi=* | --datad=*)
860 datadir=$ac_optarg ;;
861
862 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
863 | --dataroo | --dataro | --datar)
864 ac_prev=datarootdir ;;
865 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
866 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
867 datarootdir=$ac_optarg ;;
868
869 -disable-* | --disable-*)
870 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
871 # Reject names that are not valid shell variable names.
872 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
873 as_fn_error $? "invalid feature name: $ac_useropt"
874 ac_useropt_orig=$ac_useropt
875 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
876 case $ac_user_opts in
877 *"
878"enable_$ac_useropt"
879"*) ;;
880 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
881 ac_unrecognized_sep=', ';;
882 esac
883 eval enable_$ac_useropt=no ;;
884
885 -docdir | --docdir | --docdi | --doc | --do)
886 ac_prev=docdir ;;
887 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
888 docdir=$ac_optarg ;;
889
890 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
891 ac_prev=dvidir ;;
892 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
893 dvidir=$ac_optarg ;;
894
895 -enable-* | --enable-*)
896 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
897 # Reject names that are not valid shell variable names.
898 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
899 as_fn_error $? "invalid feature name: $ac_useropt"
900 ac_useropt_orig=$ac_useropt
901 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
902 case $ac_user_opts in
903 *"
904"enable_$ac_useropt"
905"*) ;;
906 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
907 ac_unrecognized_sep=', ';;
908 esac
909 eval enable_$ac_useropt=\$ac_optarg ;;
910
911 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
912 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
913 | --exec | --exe | --ex)
914 ac_prev=exec_prefix ;;
915 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
916 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
917 | --exec=* | --exe=* | --ex=*)
918 exec_prefix=$ac_optarg ;;
919
920 -gas | --gas | --ga | --g)
921 # Obsolete; use --with-gas.
922 with_gas=yes ;;
923
924 -help | --help | --hel | --he | -h)
925 ac_init_help=long ;;
926 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
927 ac_init_help=recursive ;;
928 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
929 ac_init_help=short ;;
930
931 -host | --host | --hos | --ho)
932 ac_prev=host_alias ;;
933 -host=* | --host=* | --hos=* | --ho=*)
934 host_alias=$ac_optarg ;;
935
936 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
937 ac_prev=htmldir ;;
938 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
939 | --ht=*)
940 htmldir=$ac_optarg ;;
941
942 -includedir | --includedir | --includedi | --included | --include \
943 | --includ | --inclu | --incl | --inc)
944 ac_prev=includedir ;;
945 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
946 | --includ=* | --inclu=* | --incl=* | --inc=*)
947 includedir=$ac_optarg ;;
948
949 -infodir | --infodir | --infodi | --infod | --info | --inf)
950 ac_prev=infodir ;;
951 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
952 infodir=$ac_optarg ;;
953
954 -libdir | --libdir | --libdi | --libd)
955 ac_prev=libdir ;;
956 -libdir=* | --libdir=* | --libdi=* | --libd=*)
957 libdir=$ac_optarg ;;
958
959 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
960 | --libexe | --libex | --libe)
961 ac_prev=libexecdir ;;
962 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
963 | --libexe=* | --libex=* | --libe=*)
964 libexecdir=$ac_optarg ;;
965
966 -localedir | --localedir | --localedi | --localed | --locale)
967 ac_prev=localedir ;;
968 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
969 localedir=$ac_optarg ;;
970
971 -localstatedir | --localstatedir | --localstatedi | --localstated \
972 | --localstate | --localstat | --localsta | --localst | --locals)
973 ac_prev=localstatedir ;;
974 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
975 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
976 localstatedir=$ac_optarg ;;
977
978 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
979 ac_prev=mandir ;;
980 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
981 mandir=$ac_optarg ;;
982
983 -nfp | --nfp | --nf)
984 # Obsolete; use --without-fp.
985 with_fp=no ;;
986
987 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
988 | --no-cr | --no-c | -n)
989 no_create=yes ;;
990
991 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
992 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
993 no_recursion=yes ;;
994
995 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
996 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
997 | --oldin | --oldi | --old | --ol | --o)
998 ac_prev=oldincludedir ;;
999 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1000 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1001 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1002 oldincludedir=$ac_optarg ;;
1003
1004 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1005 ac_prev=prefix ;;
1006 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1007 prefix=$ac_optarg ;;
1008
1009 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1010 | --program-pre | --program-pr | --program-p)
1011 ac_prev=program_prefix ;;
1012 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1013 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1014 program_prefix=$ac_optarg ;;
1015
1016 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1017 | --program-suf | --program-su | --program-s)
1018 ac_prev=program_suffix ;;
1019 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1020 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1021 program_suffix=$ac_optarg ;;
1022
1023 -program-transform-name | --program-transform-name \
1024 | --program-transform-nam | --program-transform-na \
1025 | --program-transform-n | --program-transform- \
1026 | --program-transform | --program-transfor \
1027 | --program-transfo | --program-transf \
1028 | --program-trans | --program-tran \
1029 | --progr-tra | --program-tr | --program-t)
1030 ac_prev=program_transform_name ;;
1031 -program-transform-name=* | --program-transform-name=* \
1032 | --program-transform-nam=* | --program-transform-na=* \
1033 | --program-transform-n=* | --program-transform-=* \
1034 | --program-transform=* | --program-transfor=* \
1035 | --program-transfo=* | --program-transf=* \
1036 | --program-trans=* | --program-tran=* \
1037 | --progr-tra=* | --program-tr=* | --program-t=*)
1038 program_transform_name=$ac_optarg ;;
1039
1040 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1041 ac_prev=pdfdir ;;
1042 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1043 pdfdir=$ac_optarg ;;
1044
1045 -psdir | --psdir | --psdi | --psd | --ps)
1046 ac_prev=psdir ;;
1047 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1048 psdir=$ac_optarg ;;
1049
1050 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1051 | -silent | --silent | --silen | --sile | --sil)
1052 silent=yes ;;
1053
1054 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1055 ac_prev=sbindir ;;
1056 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1057 | --sbi=* | --sb=*)
1058 sbindir=$ac_optarg ;;
1059
1060 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1061 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1062 | --sharedst | --shareds | --shared | --share | --shar \
1063 | --sha | --sh)
1064 ac_prev=sharedstatedir ;;
1065 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1066 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1067 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1068 | --sha=* | --sh=*)
1069 sharedstatedir=$ac_optarg ;;
1070
1071 -site | --site | --sit)
1072 ac_prev=site ;;
1073 -site=* | --site=* | --sit=*)
1074 site=$ac_optarg ;;
1075
1076 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1077 ac_prev=srcdir ;;
1078 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1079 srcdir=$ac_optarg ;;
1080
1081 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1082 | --syscon | --sysco | --sysc | --sys | --sy)
1083 ac_prev=sysconfdir ;;
1084 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1085 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1086 sysconfdir=$ac_optarg ;;
1087
1088 -target | --target | --targe | --targ | --tar | --ta | --t)
1089 ac_prev=target_alias ;;
1090 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1091 target_alias=$ac_optarg ;;
1092
1093 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1094 verbose=yes ;;
1095
1096 -version | --version | --versio | --versi | --vers | -V)
1097 ac_init_version=: ;;
1098
1099 -with-* | --with-*)
1100 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1101 # Reject names that are not valid shell variable names.
1102 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1103 as_fn_error $? "invalid package name: $ac_useropt"
1104 ac_useropt_orig=$ac_useropt
1105 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1106 case $ac_user_opts in
1107 *"
1108"with_$ac_useropt"
1109"*) ;;
1110 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1111 ac_unrecognized_sep=', ';;
1112 esac
1113 eval with_$ac_useropt=\$ac_optarg ;;
1114
1115 -without-* | --without-*)
1116 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1117 # Reject names that are not valid shell variable names.
1118 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1119 as_fn_error $? "invalid package name: $ac_useropt"
1120 ac_useropt_orig=$ac_useropt
1121 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1122 case $ac_user_opts in
1123 *"
1124"with_$ac_useropt"
1125"*) ;;
1126 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1127 ac_unrecognized_sep=', ';;
1128 esac
1129 eval with_$ac_useropt=no ;;
1130
1131 --x)
1132 # Obsolete; use --with-x.
1133 with_x=yes ;;
1134
1135 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1136 | --x-incl | --x-inc | --x-in | --x-i)
1137 ac_prev=x_includes ;;
1138 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1139 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1140 x_includes=$ac_optarg ;;
1141
1142 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1143 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1144 ac_prev=x_libraries ;;
1145 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1146 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1147 x_libraries=$ac_optarg ;;
1148
1149 -*) as_fn_error $? "unrecognized option: \`$ac_option'
1150Try \`$0 --help' for more information"
1151 ;;
1152
1153 *=*)
1154 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1155 # Reject names that are not valid shell variable names.
1156 case $ac_envvar in #(
1157 '' | [0-9]* | *[!_$as_cr_alnum]* )
1158 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1159 esac
1160 eval $ac_envvar=\$ac_optarg
1161 export $ac_envvar ;;
1162
1163 *)
1164 # FIXME: should be removed in autoconf 3.0.
1165 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1166 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1167 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1168 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1169 ;;
1170
1171 esac
1172done
1173
1174if test -n "$ac_prev"; then
1175 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1176 as_fn_error $? "missing argument to $ac_option"
1177fi
1178
1179if test -n "$ac_unrecognized_opts"; then
1180 case $enable_option_checking in
1181 no) ;;
1182 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1183 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1184 esac
1185fi
1186
1187# Check all directory arguments for consistency.
1188for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1189 datadir sysconfdir sharedstatedir localstatedir includedir \
1190 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1191 libdir localedir mandir
1192do
1193 eval ac_val=\$$ac_var
1194 # Remove trailing slashes.
1195 case $ac_val in
1196 */ )
1197 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1198 eval $ac_var=\$ac_val;;
1199 esac
1200 # Be sure to have absolute directory names.
1201 case $ac_val in
1202 [\\/$]* | ?:[\\/]* ) continue;;
1203 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1204 esac
1205 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1206done
1207
1208# There might be people who depend on the old broken behavior: `$host'
1209# used to hold the argument of --host etc.
1210# FIXME: To remove some day.
1211build=$build_alias
1212host=$host_alias
1213target=$target_alias
1214
1215# FIXME: To remove some day.
1216if test "x$host_alias" != x; then
1217 if test "x$build_alias" = x; then
1218 cross_compiling=maybe
1219 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
1220 If a cross compiler is detected then cross compile mode will be used" >&2
1221 elif test "x$build_alias" != "x$host_alias"; then
1222 cross_compiling=yes
1223 fi
1224fi
1225
1226ac_tool_prefix=
1227test -n "$host_alias" && ac_tool_prefix=$host_alias-
1228
1229test "$silent" = yes && exec 6>/dev/null
1230
1231
1232ac_pwd=`pwd` && test -n "$ac_pwd" &&
1233ac_ls_di=`ls -di .` &&
1234ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1235 as_fn_error $? "working directory cannot be determined"
1236test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1237 as_fn_error $? "pwd does not report name of working directory"
1238
1239
1240# Find the source files, if location was not specified.
1241if test -z "$srcdir"; then
1242 ac_srcdir_defaulted=yes
1243 # Try the directory containing this script, then the parent directory.
1244 ac_confdir=`$as_dirname -- "$as_myself" ||
1245$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1246 X"$as_myself" : 'X\(//\)[^/]' \| \
1247 X"$as_myself" : 'X\(//\)$' \| \
1248 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1249$as_echo X"$as_myself" |
1250 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1251 s//\1/
1252 q
1253 }
1254 /^X\(\/\/\)[^/].*/{
1255 s//\1/
1256 q
1257 }
1258 /^X\(\/\/\)$/{
1259 s//\1/
1260 q
1261 }
1262 /^X\(\/\).*/{
1263 s//\1/
1264 q
1265 }
1266 s/.*/./; q'`
1267 srcdir=$ac_confdir
1268 if test ! -r "$srcdir/$ac_unique_file"; then
1269 srcdir=..
1270 fi
1271else
1272 ac_srcdir_defaulted=no
1273fi
1274if test ! -r "$srcdir/$ac_unique_file"; then
1275 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1276 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1277fi
1278ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1279ac_abs_confdir=`(
1280 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1281 pwd)`
1282# When building in place, set srcdir=.
1283if test "$ac_abs_confdir" = "$ac_pwd"; then
1284 srcdir=.
1285fi
1286# Remove unnecessary trailing slashes from srcdir.
1287# Double slashes in file names in object file debugging info
1288# mess up M-x gdb in Emacs.
1289case $srcdir in
1290*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1291esac
1292for ac_var in $ac_precious_vars; do
1293 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1294 eval ac_env_${ac_var}_value=\$${ac_var}
1295 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1296 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1297done
1298
1299#
1300# Report the --help message.
1301#
1302if test "$ac_init_help" = "long"; then
1303 # Omit some internal or obsolete options to make the list less imposing.
1304 # This message is too long to be a string in the A/UX 3.1 sh.
1305 cat <<_ACEOF
1306\`configure' configures libjpeg 8.4.0 to adapt to many kinds of systems.
1307
1308Usage: $0 [OPTION]... [VAR=VALUE]...
1309
1310To assign environment variables (e.g., CC, CFLAGS...), specify them as
1311VAR=VALUE. See below for descriptions of some of the useful variables.
1312
1313Defaults for the options are specified in brackets.
1314
1315Configuration:
1316 -h, --help display this help and exit
1317 --help=short display options specific to this package
1318 --help=recursive display the short help of all the included packages
1319 -V, --version display version information and exit
1320 -q, --quiet, --silent do not print \`checking ...' messages
1321 --cache-file=FILE cache test results in FILE [disabled]
1322 -C, --config-cache alias for \`--cache-file=config.cache'
1323 -n, --no-create do not create output files
1324 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1325
1326Installation directories:
1327 --prefix=PREFIX install architecture-independent files in PREFIX
1328 [$ac_default_prefix]
1329 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1330 [PREFIX]
1331
1332By default, \`make install' will install all the files in
1333\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1334an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1335for instance \`--prefix=\$HOME'.
1336
1337For better control, use the options below.
1338
1339Fine tuning of the installation directories:
1340 --bindir=DIR user executables [EPREFIX/bin]
1341 --sbindir=DIR system admin executables [EPREFIX/sbin]
1342 --libexecdir=DIR program executables [EPREFIX/libexec]
1343 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1344 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1345 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1346 --libdir=DIR object code libraries [EPREFIX/lib]
1347 --includedir=DIR C header files [PREFIX/include]
1348 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1349 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1350 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1351 --infodir=DIR info documentation [DATAROOTDIR/info]
1352 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1353 --mandir=DIR man documentation [DATAROOTDIR/man]
1354 --docdir=DIR documentation root [DATAROOTDIR/doc/libjpeg]
1355 --htmldir=DIR html documentation [DOCDIR]
1356 --dvidir=DIR dvi documentation [DOCDIR]
1357 --pdfdir=DIR pdf documentation [DOCDIR]
1358 --psdir=DIR ps documentation [DOCDIR]
1359_ACEOF
1360
1361 cat <<\_ACEOF
1362
1363Program names:
1364 --program-prefix=PREFIX prepend PREFIX to installed program names
1365 --program-suffix=SUFFIX append SUFFIX to installed program names
1366 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1367
1368System types:
1369 --build=BUILD configure for building on BUILD [guessed]
1370 --host=HOST cross-compile to build programs to run on HOST [BUILD]
1371 --target=TARGET configure for building compilers for TARGET [HOST]
1372_ACEOF
1373fi
1374
1375if test -n "$ac_init_help"; then
1376 case $ac_init_help in
1377 short | recursive ) echo "Configuration of libjpeg 8.4.0:";;
1378 esac
1379 cat <<\_ACEOF
1380
1381Optional Features:
1382 --disable-option-checking ignore unrecognized --enable/--with options
1383 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1384 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1385 --enable-silent-rules less verbose build output (undo: `make V=1')
1386 --disable-silent-rules verbose build output (undo: `make V=0')
1387 --disable-dependency-tracking speeds up one-time build
1388 --enable-dependency-tracking do not reject slow dependency extractors
1389 --enable-maintainer-mode enable make rules and dependencies not useful
1390 (and sometimes confusing) to the casual installer
1391 --enable-ld-version-script
1392 enable linker version script (default is enabled
1393 when possible)
1394 --enable-shared[=PKGS] build shared libraries [default=yes]
1395 --enable-static[=PKGS] build static libraries [default=yes]
1396 --enable-fast-install[=PKGS]
1397 optimize for fast installation [default=yes]
1398 --disable-libtool-lock avoid locking (might break parallel builds)
1399 --enable-maxmem=N enable use of temp files, set max mem usage to N MB
1400
1401Optional Packages:
1402 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1403 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1404 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
1405 both]
1406 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1407 --with-sysroot=DIR Search for dependent libraries within DIR
1408 (or the compiler's sysroot if not specified).
1409
1410Some influential environment variables:
1411 CC C compiler command
1412 CFLAGS C compiler flags
1413 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
1414 nonstandard directory <lib dir>
1415 LIBS libraries to pass to the linker, e.g. -l<library>
1416 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1417 you have headers in a nonstandard directory <include dir>
1418 CPP C preprocessor
1419
1420Use these variables to override the choices made by `configure' or to help
1421it to find libraries and programs with nonstandard names/locations.
1422
1423Report bugs to the package provider.
1424_ACEOF
1425ac_status=$?
1426fi
1427
1428if test "$ac_init_help" = "recursive"; then
1429 # If there are subdirs, report their specific --help.
1430 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1431 test -d "$ac_dir" ||
1432 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1433 continue
1434 ac_builddir=.
1435
1436case "$ac_dir" in
1437.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1438*)
1439 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1440 # A ".." for each directory in $ac_dir_suffix.
1441 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1442 case $ac_top_builddir_sub in
1443 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1444 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1445 esac ;;
1446esac
1447ac_abs_top_builddir=$ac_pwd
1448ac_abs_builddir=$ac_pwd$ac_dir_suffix
1449# for backward compatibility:
1450ac_top_builddir=$ac_top_build_prefix
1451
1452case $srcdir in
1453 .) # We are building in place.
1454 ac_srcdir=.
1455 ac_top_srcdir=$ac_top_builddir_sub
1456 ac_abs_top_srcdir=$ac_pwd ;;
1457 [\\/]* | ?:[\\/]* ) # Absolute name.
1458 ac_srcdir=$srcdir$ac_dir_suffix;
1459 ac_top_srcdir=$srcdir
1460 ac_abs_top_srcdir=$srcdir ;;
1461 *) # Relative name.
1462 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1463 ac_top_srcdir=$ac_top_build_prefix$srcdir
1464 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1465esac
1466ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1467
1468 cd "$ac_dir" || { ac_status=$?; continue; }
1469 # Check for guested configure.
1470 if test -f "$ac_srcdir/configure.gnu"; then
1471 echo &&
1472 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1473 elif test -f "$ac_srcdir/configure"; then
1474 echo &&
1475 $SHELL "$ac_srcdir/configure" --help=recursive
1476 else
1477 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1478 fi || ac_status=$?
1479 cd "$ac_pwd" || { ac_status=$?; break; }
1480 done
1481fi
1482
1483test -n "$ac_init_help" && exit $ac_status
1484if $ac_init_version; then
1485 cat <<\_ACEOF
1486libjpeg configure 8.4.0
1487generated by GNU Autoconf 2.68
1488
1489Copyright (C) 2010 Free Software Foundation, Inc.
1490This configure script is free software; the Free Software Foundation
1491gives unlimited permission to copy, distribute and modify it.
1492_ACEOF
1493 exit
1494fi
1495
1496## ------------------------ ##
1497## Autoconf initialization. ##
1498## ------------------------ ##
1499
1500# ac_fn_c_try_compile LINENO
1501# --------------------------
1502# Try to compile conftest.$ac_ext, and return whether this succeeded.
1503ac_fn_c_try_compile ()
1504{
1505 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1506 rm -f conftest.$ac_objext
1507 if { { ac_try="$ac_compile"
1508case "(($ac_try" in
1509 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1510 *) ac_try_echo=$ac_try;;
1511esac
1512eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1513$as_echo "$ac_try_echo"; } >&5
1514 (eval "$ac_compile") 2>conftest.err
1515 ac_status=$?
1516 if test -s conftest.err; then
1517 grep -v '^ *+' conftest.err >conftest.er1
1518 cat conftest.er1 >&5
1519 mv -f conftest.er1 conftest.err
1520 fi
1521 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1522 test $ac_status = 0; } && {
1523 test -z "$ac_c_werror_flag" ||
1524 test ! -s conftest.err
1525 } && test -s conftest.$ac_objext; then :
1526 ac_retval=0
1527else
1528 $as_echo "$as_me: failed program was:" >&5
1529sed 's/^/| /' conftest.$ac_ext >&5
1530
1531 ac_retval=1
1532fi
1533 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1534 as_fn_set_status $ac_retval
1535
1536} # ac_fn_c_try_compile
1537
1538# ac_fn_c_try_cpp LINENO
1539# ----------------------
1540# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1541ac_fn_c_try_cpp ()
1542{
1543 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1544 if { { ac_try="$ac_cpp conftest.$ac_ext"
1545case "(($ac_try" in
1546 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1547 *) ac_try_echo=$ac_try;;
1548esac
1549eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1550$as_echo "$ac_try_echo"; } >&5
1551 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1552 ac_status=$?
1553 if test -s conftest.err; then
1554 grep -v '^ *+' conftest.err >conftest.er1
1555 cat conftest.er1 >&5
1556 mv -f conftest.er1 conftest.err
1557 fi
1558 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1559 test $ac_status = 0; } > conftest.i && {
1560 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1561 test ! -s conftest.err
1562 }; then :
1563 ac_retval=0
1564else
1565 $as_echo "$as_me: failed program was:" >&5
1566sed 's/^/| /' conftest.$ac_ext >&5
1567
1568 ac_retval=1
1569fi
1570 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1571 as_fn_set_status $ac_retval
1572
1573} # ac_fn_c_try_cpp
1574
1575# ac_fn_c_try_run LINENO
1576# ----------------------
1577# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1578# that executables *can* be run.
1579ac_fn_c_try_run ()
1580{
1581 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1582 if { { ac_try="$ac_link"
1583case "(($ac_try" in
1584 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1585 *) ac_try_echo=$ac_try;;
1586esac
1587eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1588$as_echo "$ac_try_echo"; } >&5
1589 (eval "$ac_link") 2>&5
1590 ac_status=$?
1591 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1592 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1593 { { case "(($ac_try" in
1594 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1595 *) ac_try_echo=$ac_try;;
1596esac
1597eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1598$as_echo "$ac_try_echo"; } >&5
1599 (eval "$ac_try") 2>&5
1600 ac_status=$?
1601 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1602 test $ac_status = 0; }; }; then :
1603 ac_retval=0
1604else
1605 $as_echo "$as_me: program exited with status $ac_status" >&5
1606 $as_echo "$as_me: failed program was:" >&5
1607sed 's/^/| /' conftest.$ac_ext >&5
1608
1609 ac_retval=$ac_status
1610fi
1611 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1612 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1613 as_fn_set_status $ac_retval
1614
1615} # ac_fn_c_try_run
1616
1617# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1618# -------------------------------------------------------
1619# Tests whether HEADER exists, giving a warning if it cannot be compiled using
1620# the include files in INCLUDES and setting the cache variable VAR
1621# accordingly.
1622ac_fn_c_check_header_mongrel ()
1623{
1624 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1625 if eval \${$3+:} false; then :
1626 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1627$as_echo_n "checking for $2... " >&6; }
1628if eval \${$3+:} false; then :
1629 $as_echo_n "(cached) " >&6
1630fi
1631eval ac_res=\$$3
1632 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1633$as_echo "$ac_res" >&6; }
1634else
1635 # Is the header compilable?
1636{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1637$as_echo_n "checking $2 usability... " >&6; }
1638cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1639/* end confdefs.h. */
1640$4
1641#include <$2>
1642_ACEOF
1643if ac_fn_c_try_compile "$LINENO"; then :
1644 ac_header_compiler=yes
1645else
1646 ac_header_compiler=no
1647fi
1648rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1649{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1650$as_echo "$ac_header_compiler" >&6; }
1651
1652# Is the header present?
1653{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1654$as_echo_n "checking $2 presence... " >&6; }
1655cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1656/* end confdefs.h. */
1657#include <$2>
1658_ACEOF
1659if ac_fn_c_try_cpp "$LINENO"; then :
1660 ac_header_preproc=yes
1661else
1662 ac_header_preproc=no
1663fi
1664rm -f conftest.err conftest.i conftest.$ac_ext
1665{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1666$as_echo "$ac_header_preproc" >&6; }
1667
1668# So? What about this header?
1669case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1670 yes:no: )
1671 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1672$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1673 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1674$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1675 ;;
1676 no:yes:* )
1677 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1678$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1679 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
1680$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
1681 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1682$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1683 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
1684$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
1685 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1686$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1687 ;;
1688esac
1689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1690$as_echo_n "checking for $2... " >&6; }
1691if eval \${$3+:} false; then :
1692 $as_echo_n "(cached) " >&6
1693else
1694 eval "$3=\$ac_header_compiler"
1695fi
1696eval ac_res=\$$3
1697 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1698$as_echo "$ac_res" >&6; }
1699fi
1700 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1701
1702} # ac_fn_c_check_header_mongrel
1703
1704# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1705# -------------------------------------------------------
1706# Tests whether HEADER exists and can be compiled using the include files in
1707# INCLUDES, setting the cache variable VAR accordingly.
1708ac_fn_c_check_header_compile ()
1709{
1710 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1712$as_echo_n "checking for $2... " >&6; }
1713if eval \${$3+:} false; then :
1714 $as_echo_n "(cached) " >&6
1715else
1716 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1717/* end confdefs.h. */
1718$4
1719#include <$2>
1720_ACEOF
1721if ac_fn_c_try_compile "$LINENO"; then :
1722 eval "$3=yes"
1723else
1724 eval "$3=no"
1725fi
1726rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1727fi
1728eval ac_res=\$$3
1729 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1730$as_echo "$ac_res" >&6; }
1731 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1732
1733} # ac_fn_c_check_header_compile
1734
1735# ac_fn_c_try_link LINENO
1736# -----------------------
1737# Try to link conftest.$ac_ext, and return whether this succeeded.
1738ac_fn_c_try_link ()
1739{
1740 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1741 rm -f conftest.$ac_objext conftest$ac_exeext
1742 if { { ac_try="$ac_link"
1743case "(($ac_try" in
1744 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1745 *) ac_try_echo=$ac_try;;
1746esac
1747eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1748$as_echo "$ac_try_echo"; } >&5
1749 (eval "$ac_link") 2>conftest.err
1750 ac_status=$?
1751 if test -s conftest.err; then
1752 grep -v '^ *+' conftest.err >conftest.er1
1753 cat conftest.er1 >&5
1754 mv -f conftest.er1 conftest.err
1755 fi
1756 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1757 test $ac_status = 0; } && {
1758 test -z "$ac_c_werror_flag" ||
1759 test ! -s conftest.err
1760 } && test -s conftest$ac_exeext && {
1761 test "$cross_compiling" = yes ||
1762 $as_test_x conftest$ac_exeext
1763 }; then :
1764 ac_retval=0
1765else
1766 $as_echo "$as_me: failed program was:" >&5
1767sed 's/^/| /' conftest.$ac_ext >&5
1768
1769 ac_retval=1
1770fi
1771 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1772 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1773 # interfere with the next link command; also delete a directory that is
1774 # left behind by Apple's compiler. We do this before executing the actions.
1775 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1776 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1777 as_fn_set_status $ac_retval
1778
1779} # ac_fn_c_try_link
1780
1781# ac_fn_c_check_func LINENO FUNC VAR
1782# ----------------------------------
1783# Tests whether FUNC exists, setting the cache variable VAR accordingly
1784ac_fn_c_check_func ()
1785{
1786 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1787 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1788$as_echo_n "checking for $2... " >&6; }
1789if eval \${$3+:} false; then :
1790 $as_echo_n "(cached) " >&6
1791else
1792 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1793/* end confdefs.h. */
1794/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1795 For example, HP-UX 11i <limits.h> declares gettimeofday. */
1796#define $2 innocuous_$2
1797
1798/* System header to define __stub macros and hopefully few prototypes,
1799 which can conflict with char $2 (); below.
1800 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1801 <limits.h> exists even on freestanding compilers. */
1802
1803#ifdef __STDC__
1804# include <limits.h>
1805#else
1806# include <assert.h>
1807#endif
1808
1809#undef $2
1810
1811/* Override any GCC internal prototype to avoid an error.
1812 Use char because int might match the return type of a GCC
1813 builtin and then its argument prototype would still apply. */
1814#ifdef __cplusplus
1815extern "C"
1816#endif
1817char $2 ();
1818/* The GNU C library defines this for functions which it implements
1819 to always fail with ENOSYS. Some functions are actually named
1820 something starting with __ and the normal name is an alias. */
1821#if defined __stub_$2 || defined __stub___$2
1822choke me
1823#endif
1824
1825int
1826main ()
1827{
1828return $2 ();
1829 ;
1830 return 0;
1831}
1832_ACEOF
1833if ac_fn_c_try_link "$LINENO"; then :
1834 eval "$3=yes"
1835else
1836 eval "$3=no"
1837fi
1838rm -f core conftest.err conftest.$ac_objext \
1839 conftest$ac_exeext conftest.$ac_ext
1840fi
1841eval ac_res=\$$3
1842 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1843$as_echo "$ac_res" >&6; }
1844 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1845
1846} # ac_fn_c_check_func
1847cat >config.log <<_ACEOF
1848This file contains any messages produced by compilers while
1849running configure, to aid debugging if configure makes a mistake.
1850
1851It was created by libjpeg $as_me 8.4.0, which was
1852generated by GNU Autoconf 2.68. Invocation command line was
1853
1854 $ $0 $@
1855
1856_ACEOF
1857exec 5>>config.log
1858{
1859cat <<_ASUNAME
1860## --------- ##
1861## Platform. ##
1862## --------- ##
1863
1864hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1865uname -m = `(uname -m) 2>/dev/null || echo unknown`
1866uname -r = `(uname -r) 2>/dev/null || echo unknown`
1867uname -s = `(uname -s) 2>/dev/null || echo unknown`
1868uname -v = `(uname -v) 2>/dev/null || echo unknown`
1869
1870/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1871/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1872
1873/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1874/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1875/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1876/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1877/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1878/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1879/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1880
1881_ASUNAME
1882
1883as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1884for as_dir in $PATH
1885do
1886 IFS=$as_save_IFS
1887 test -z "$as_dir" && as_dir=.
1888 $as_echo "PATH: $as_dir"
1889 done
1890IFS=$as_save_IFS
1891
1892} >&5
1893
1894cat >&5 <<_ACEOF
1895
1896
1897## ----------- ##
1898## Core tests. ##
1899## ----------- ##
1900
1901_ACEOF
1902
1903
1904# Keep a trace of the command line.
1905# Strip out --no-create and --no-recursion so they do not pile up.
1906# Strip out --silent because we don't want to record it for future runs.
1907# Also quote any args containing shell meta-characters.
1908# Make two passes to allow for proper duplicate-argument suppression.
1909ac_configure_args=
1910ac_configure_args0=
1911ac_configure_args1=
1912ac_must_keep_next=false
1913for ac_pass in 1 2
1914do
1915 for ac_arg
1916 do
1917 case $ac_arg in
1918 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1919 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1920 | -silent | --silent | --silen | --sile | --sil)
1921 continue ;;
1922 *\'*)
1923 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1924 esac
1925 case $ac_pass in
1926 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
1927 2)
1928 as_fn_append ac_configure_args1 " '$ac_arg'"
1929 if test $ac_must_keep_next = true; then
1930 ac_must_keep_next=false # Got value, back to normal.
1931 else
1932 case $ac_arg in
1933 *=* | --config-cache | -C | -disable-* | --disable-* \
1934 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1935 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1936 | -with-* | --with-* | -without-* | --without-* | --x)
1937 case "$ac_configure_args0 " in
1938 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1939 esac
1940 ;;
1941 -* ) ac_must_keep_next=true ;;
1942 esac
1943 fi
1944 as_fn_append ac_configure_args " '$ac_arg'"
1945 ;;
1946 esac
1947 done
1948done
1949{ ac_configure_args0=; unset ac_configure_args0;}
1950{ ac_configure_args1=; unset ac_configure_args1;}
1951
1952# When interrupted or exit'd, cleanup temporary files, and complete
1953# config.log. We remove comments because anyway the quotes in there
1954# would cause problems or look ugly.
1955# WARNING: Use '\'' to represent an apostrophe within the trap.
1956# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1957trap 'exit_status=$?
1958 # Save into config.log some information that might help in debugging.
1959 {
1960 echo
1961
1962 $as_echo "## ---------------- ##
1963## Cache variables. ##
1964## ---------------- ##"
1965 echo
1966 # The following way of writing the cache mishandles newlines in values,
1967(
1968 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1969 eval ac_val=\$$ac_var
1970 case $ac_val in #(
1971 *${as_nl}*)
1972 case $ac_var in #(
1973 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
1974$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
1975 esac
1976 case $ac_var in #(
1977 _ | IFS | as_nl) ;; #(
1978 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1979 *) { eval $ac_var=; unset $ac_var;} ;;
1980 esac ;;
1981 esac
1982 done
1983 (set) 2>&1 |
1984 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1985 *${as_nl}ac_space=\ *)
1986 sed -n \
1987 "s/'\''/'\''\\\\'\'''\''/g;
1988 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1989 ;; #(
1990 *)
1991 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1992 ;;
1993 esac |
1994 sort
1995)
1996 echo
1997
1998 $as_echo "## ----------------- ##
1999## Output variables. ##
2000## ----------------- ##"
2001 echo
2002 for ac_var in $ac_subst_vars
2003 do
2004 eval ac_val=\$$ac_var
2005 case $ac_val in
2006 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2007 esac
2008 $as_echo "$ac_var='\''$ac_val'\''"
2009 done | sort
2010 echo
2011
2012 if test -n "$ac_subst_files"; then
2013 $as_echo "## ------------------- ##
2014## File substitutions. ##
2015## ------------------- ##"
2016 echo
2017 for ac_var in $ac_subst_files
2018 do
2019 eval ac_val=\$$ac_var
2020 case $ac_val in
2021 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2022 esac
2023 $as_echo "$ac_var='\''$ac_val'\''"
2024 done | sort
2025 echo
2026 fi
2027
2028 if test -s confdefs.h; then
2029 $as_echo "## ----------- ##
2030## confdefs.h. ##
2031## ----------- ##"
2032 echo
2033 cat confdefs.h
2034 echo
2035 fi
2036 test "$ac_signal" != 0 &&
2037 $as_echo "$as_me: caught signal $ac_signal"
2038 $as_echo "$as_me: exit $exit_status"
2039 } >&5
2040 rm -f core *.core core.conftest.* &&
2041 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2042 exit $exit_status
2043' 0
2044for ac_signal in 1 2 13 15; do
2045 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2046done
2047ac_signal=0
2048
2049# confdefs.h avoids OS command line length limits that DEFS can exceed.
2050rm -f -r conftest* confdefs.h
2051
2052$as_echo "/* confdefs.h */" > confdefs.h
2053
2054# Predefined preprocessor variables.
2055
2056cat >>confdefs.h <<_ACEOF
2057#define PACKAGE_NAME "$PACKAGE_NAME"
2058_ACEOF
2059
2060cat >>confdefs.h <<_ACEOF
2061#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2062_ACEOF
2063
2064cat >>confdefs.h <<_ACEOF
2065#define PACKAGE_VERSION "$PACKAGE_VERSION"
2066_ACEOF
2067
2068cat >>confdefs.h <<_ACEOF
2069#define PACKAGE_STRING "$PACKAGE_STRING"
2070_ACEOF
2071
2072cat >>confdefs.h <<_ACEOF
2073#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2074_ACEOF
2075
2076cat >>confdefs.h <<_ACEOF
2077#define PACKAGE_URL "$PACKAGE_URL"
2078_ACEOF
2079
2080
2081# Let the site file select an alternate cache file if it wants to.
2082# Prefer an explicitly selected file to automatically selected ones.
2083ac_site_file1=NONE
2084ac_site_file2=NONE
2085if test -n "$CONFIG_SITE"; then
2086 # We do not want a PATH search for config.site.
2087 case $CONFIG_SITE in #((
2088 -*) ac_site_file1=./$CONFIG_SITE;;
2089 */*) ac_site_file1=$CONFIG_SITE;;
2090 *) ac_site_file1=./$CONFIG_SITE;;
2091 esac
2092elif test "x$prefix" != xNONE; then
2093 ac_site_file1=$prefix/share/config.site
2094 ac_site_file2=$prefix/etc/config.site
2095else
2096 ac_site_file1=$ac_default_prefix/share/config.site
2097 ac_site_file2=$ac_default_prefix/etc/config.site
2098fi
2099for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2100do
2101 test "x$ac_site_file" = xNONE && continue
2102 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2103 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2104$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2105 sed 's/^/| /' "$ac_site_file" >&5
2106 . "$ac_site_file" \
2107 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2108$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2109as_fn_error $? "failed to load site script $ac_site_file
2110See \`config.log' for more details" "$LINENO" 5; }
2111 fi
2112done
2113
2114if test -r "$cache_file"; then
2115 # Some versions of bash will fail to source /dev/null (special files
2116 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
2117 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2118 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2119$as_echo "$as_me: loading cache $cache_file" >&6;}
2120 case $cache_file in
2121 [\\/]* | ?:[\\/]* ) . "$cache_file";;
2122 *) . "./$cache_file";;
2123 esac
2124 fi
2125else
2126 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2127$as_echo "$as_me: creating cache $cache_file" >&6;}
2128 >$cache_file
2129fi
2130
2131# Check that the precious variables saved in the cache have kept the same
2132# value.
2133ac_cache_corrupted=false
2134for ac_var in $ac_precious_vars; do
2135 eval ac_old_set=\$ac_cv_env_${ac_var}_set
2136 eval ac_new_set=\$ac_env_${ac_var}_set
2137 eval ac_old_val=\$ac_cv_env_${ac_var}_value
2138 eval ac_new_val=\$ac_env_${ac_var}_value
2139 case $ac_old_set,$ac_new_set in
2140 set,)
2141 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2142$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2143 ac_cache_corrupted=: ;;
2144 ,set)
2145 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2146$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2147 ac_cache_corrupted=: ;;
2148 ,);;
2149 *)
2150 if test "x$ac_old_val" != "x$ac_new_val"; then
2151 # differences in whitespace do not lead to failure.
2152 ac_old_val_w=`echo x $ac_old_val`
2153 ac_new_val_w=`echo x $ac_new_val`
2154 if test "$ac_old_val_w" != "$ac_new_val_w"; then
2155 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2156$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2157 ac_cache_corrupted=:
2158 else
2159 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2160$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2161 eval $ac_var=\$ac_old_val
2162 fi
2163 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
2164$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
2165 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
2166$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
2167 fi;;
2168 esac
2169 # Pass precious variables to config.status.
2170 if test "$ac_new_set" = set; then
2171 case $ac_new_val in
2172 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2173 *) ac_arg=$ac_var=$ac_new_val ;;
2174 esac
2175 case " $ac_configure_args " in
2176 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
2177 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2178 esac
2179 fi
2180done
2181if $ac_cache_corrupted; then
2182 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2183$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2184 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2185$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2186 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2187fi
2188## -------------------- ##
2189## Main body of script. ##
2190## -------------------- ##
2191
2192ac_ext=c
2193ac_cpp='$CPP $CPPFLAGS'
2194ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2195ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2196ac_compiler_gnu=$ac_cv_c_compiler_gnu
2197
2198
2199
2200# Directory where autotools helper scripts lives.
2201ac_aux_dir=
2202for ac_dir in . "$srcdir"/.; do
2203 if test -f "$ac_dir/install-sh"; then
2204 ac_aux_dir=$ac_dir
2205 ac_install_sh="$ac_aux_dir/install-sh -c"
2206 break
2207 elif test -f "$ac_dir/install.sh"; then
2208 ac_aux_dir=$ac_dir
2209 ac_install_sh="$ac_aux_dir/install.sh -c"
2210 break
2211 elif test -f "$ac_dir/shtool"; then
2212 ac_aux_dir=$ac_dir
2213 ac_install_sh="$ac_aux_dir/shtool install -c"
2214 break
2215 fi
2216done
2217if test -z "$ac_aux_dir"; then
2218 as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5
2219fi
2220
2221# These three variables are undocumented and unsupported,
2222# and are intended to be withdrawn in a future Autoconf release.
2223# They can cause serious problems if a builder's source tree is in a directory
2224# whose full name contains unusual characters.
2225ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
2226ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
2227ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
2228
2229
2230
2231# Generate configuration headers.
2232ac_config_headers="$ac_config_headers jconfig.h:jconfig.cfg"
2233
2234
2235# Hack: disable autoheader so that it doesn't overwrite our cfg template.
2236AUTOHEADER="echo autoheader ignored"
2237
2238# Check system type
2239# Make sure we can run config.sub.
2240$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2241 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2242
2243{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2244$as_echo_n "checking build system type... " >&6; }
2245if ${ac_cv_build+:} false; then :
2246 $as_echo_n "(cached) " >&6
2247else
2248 ac_build_alias=$build_alias
2249test "x$ac_build_alias" = x &&
2250 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2251test "x$ac_build_alias" = x &&
2252 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2253ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2254 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2255
2256fi
2257{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2258$as_echo "$ac_cv_build" >&6; }
2259case $ac_cv_build in
2260*-*-*) ;;
2261*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
2262esac
2263build=$ac_cv_build
2264ac_save_IFS=$IFS; IFS='-'
2265set x $ac_cv_build
2266shift
2267build_cpu=$1
2268build_vendor=$2
2269shift; shift
2270# Remember, the first character of IFS is used to create $*,
2271# except with old shells:
2272build_os=$*
2273IFS=$ac_save_IFS
2274case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2275
2276
2277{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2278$as_echo_n "checking host system type... " >&6; }
2279if ${ac_cv_host+:} false; then :
2280 $as_echo_n "(cached) " >&6
2281else
2282 if test "x$host_alias" = x; then
2283 ac_cv_host=$ac_cv_build
2284else
2285 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2286 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2287fi
2288
2289fi
2290{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2291$as_echo "$ac_cv_host" >&6; }
2292case $ac_cv_host in
2293*-*-*) ;;
2294*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
2295esac
2296host=$ac_cv_host
2297ac_save_IFS=$IFS; IFS='-'
2298set x $ac_cv_host
2299shift
2300host_cpu=$1
2301host_vendor=$2
2302shift; shift
2303# Remember, the first character of IFS is used to create $*,
2304# except with old shells:
2305host_os=$*
2306IFS=$ac_save_IFS
2307case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2308
2309
2310{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
2311$as_echo_n "checking target system type... " >&6; }
2312if ${ac_cv_target+:} false; then :
2313 $as_echo_n "(cached) " >&6
2314else
2315 if test "x$target_alias" = x; then
2316 ac_cv_target=$ac_cv_host
2317else
2318 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
2319 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
2320fi
2321
2322fi
2323{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
2324$as_echo "$ac_cv_target" >&6; }
2325case $ac_cv_target in
2326*-*-*) ;;
2327*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
2328esac
2329target=$ac_cv_target
2330ac_save_IFS=$IFS; IFS='-'
2331set x $ac_cv_target
2332shift
2333target_cpu=$1
2334target_vendor=$2
2335shift; shift
2336# Remember, the first character of IFS is used to create $*,
2337# except with old shells:
2338target_os=$*
2339IFS=$ac_save_IFS
2340case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
2341
2342
2343# The aliases save the names the user supplied, while $host etc.
2344# will get canonicalized.
2345test -n "$target_alias" &&
2346 test "$program_prefix$program_suffix$program_transform_name" = \
2347 NONENONEs,x,x, &&
2348 program_prefix=${target_alias}-
2349
2350# Initialize Automake
2351# Don't require all the GNU mandated files
2352am__api_version='1.11'
2353
2354# Find a good install program. We prefer a C program (faster),
2355# so one script is as good as another. But avoid the broken or
2356# incompatible versions:
2357# SysV /etc/install, /usr/sbin/install
2358# SunOS /usr/etc/install
2359# IRIX /sbin/install
2360# AIX /bin/install
2361# AmigaOS /C/install, which installs bootblocks on floppy discs
2362# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2363# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2364# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2365# OS/2's system install, which has a completely different semantic
2366# ./install, which can be erroneously created by make from ./install.sh.
2367# Reject install programs that cannot install multiple files.
2368{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
2369$as_echo_n "checking for a BSD-compatible install... " >&6; }
2370if test -z "$INSTALL"; then
2371if ${ac_cv_path_install+:} false; then :
2372 $as_echo_n "(cached) " >&6
2373else
2374 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2375for as_dir in $PATH
2376do
2377 IFS=$as_save_IFS
2378 test -z "$as_dir" && as_dir=.
2379 # Account for people who put trailing slashes in PATH elements.
2380case $as_dir/ in #((
2381 ./ | .// | /[cC]/* | \
2382 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
2383 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
2384 /usr/ucb/* ) ;;
2385 *)
2386 # OSF1 and SCO ODT 3.0 have their own names for install.
2387 # Don't use installbsd from OSF since it installs stuff as root
2388 # by default.
2389 for ac_prog in ginstall scoinst install; do
2390 for ac_exec_ext in '' $ac_executable_extensions; do
2391 if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
2392 if test $ac_prog = install &&
2393 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2394 # AIX install. It has an incompatible calling convention.
2395 :
2396 elif test $ac_prog = install &&
2397 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2398 # program-specific install script used by HP pwplus--don't use.
2399 :
2400 else
2401 rm -rf conftest.one conftest.two conftest.dir
2402 echo one > conftest.one
2403 echo two > conftest.two
2404 mkdir conftest.dir
2405 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
2406 test -s conftest.one && test -s conftest.two &&
2407 test -s conftest.dir/conftest.one &&
2408 test -s conftest.dir/conftest.two
2409 then
2410 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
2411 break 3
2412 fi
2413 fi
2414 fi
2415 done
2416 done
2417 ;;
2418esac
2419
2420 done
2421IFS=$as_save_IFS
2422
2423rm -rf conftest.one conftest.two conftest.dir
2424
2425fi
2426 if test "${ac_cv_path_install+set}" = set; then
2427 INSTALL=$ac_cv_path_install
2428 else
2429 # As a last resort, use the slow shell script. Don't cache a
2430 # value for INSTALL within a source directory, because that will
2431 # break other packages using the cache if that directory is
2432 # removed, or if the value is a relative name.
2433 INSTALL=$ac_install_sh
2434 fi
2435fi
2436{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
2437$as_echo "$INSTALL" >&6; }
2438
2439# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2440# It thinks the first close brace ends the variable substitution.
2441test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2442
2443test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2444
2445test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2446
2447{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2448$as_echo_n "checking whether build environment is sane... " >&6; }
2449# Just in case
2450sleep 1
2451echo timestamp > conftest.file
2452# Reject unsafe characters in $srcdir or the absolute working directory
2453# name. Accept space and tab only in the latter.
2454am_lf='
2455'
2456case `pwd` in
2457 *[\\\"\#\$\&\'\`$am_lf]*)
2458 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
2459esac
2460case $srcdir in
2461 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
2462 as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
2463esac
2464
2465# Do `set' in a subshell so we don't clobber the current shell's
2466# arguments. Must try -L first in case configure is actually a
2467# symlink; some systems play weird games with the mod time of symlinks
2468# (eg FreeBSD returns the mod time of the symlink's containing
2469# directory).
2470if (
2471 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2472 if test "$*" = "X"; then
2473 # -L didn't work.
2474 set X `ls -t "$srcdir/configure" conftest.file`
2475 fi
2476 rm -f conftest.file
2477 if test "$*" != "X $srcdir/configure conftest.file" \
2478 && test "$*" != "X conftest.file $srcdir/configure"; then
2479
2480 # If neither matched, then we have a broken ls. This can happen
2481 # if, for instance, CONFIG_SHELL is bash and it inherits a
2482 # broken ls alias from the environment. This has actually
2483 # happened. Such a system could not be considered "sane".
2484 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
2485alias in your environment" "$LINENO" 5
2486 fi
2487
2488 test "$2" = conftest.file
2489 )
2490then
2491 # Ok.
2492 :
2493else
2494 as_fn_error $? "newly created file is older than distributed files!
2495Check your system clock" "$LINENO" 5
2496fi
2497{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2498$as_echo "yes" >&6; }
2499test "$program_prefix" != NONE &&
2500 program_transform_name="s&^&$program_prefix&;$program_transform_name"
2501# Use a double $ so make ignores it.
2502test "$program_suffix" != NONE &&
2503 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
2504# Double any \ or $.
2505# By default was `s,x,x', remove it if useless.
2506ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2507program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2508
2509# expand $ac_aux_dir to an absolute path
2510am_aux_dir=`cd $ac_aux_dir && pwd`
2511
2512if test x"${MISSING+set}" != xset; then
2513 case $am_aux_dir in
2514 *\ * | *\ *)
2515 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2516 *)
2517 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2518 esac
2519fi
2520# Use eval to expand $SHELL
2521if eval "$MISSING --run true"; then
2522 am_missing_run="$MISSING --run "
2523else
2524 am_missing_run=
2525 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
2526$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
2527fi
2528
2529if test x"${install_sh}" != xset; then
2530 case $am_aux_dir in
2531 *\ * | *\ *)
2532 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2533 *)
2534 install_sh="\${SHELL} $am_aux_dir/install-sh"
2535 esac
2536fi
2537
2538# Installed binaries are usually stripped using `strip' when the user
2539# run `make install-strip'. However `strip' might not be the right
2540# tool to use in cross-compilation environments, therefore Automake
2541# will honor the `STRIP' environment variable to overrule this program.
2542if test "$cross_compiling" != no; then
2543 if test -n "$ac_tool_prefix"; then
2544 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
2545set dummy ${ac_tool_prefix}strip; ac_word=$2
2546{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2547$as_echo_n "checking for $ac_word... " >&6; }
2548if ${ac_cv_prog_STRIP+:} false; then :
2549 $as_echo_n "(cached) " >&6
2550else
2551 if test -n "$STRIP"; then
2552 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
2553else
2554as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2555for as_dir in $PATH
2556do
2557 IFS=$as_save_IFS
2558 test -z "$as_dir" && as_dir=.
2559 for ac_exec_ext in '' $ac_executable_extensions; do
2560 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2561 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2562 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2563 break 2
2564 fi
2565done
2566 done
2567IFS=$as_save_IFS
2568
2569fi
2570fi
2571STRIP=$ac_cv_prog_STRIP
2572if test -n "$STRIP"; then
2573 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
2574$as_echo "$STRIP" >&6; }
2575else
2576 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2577$as_echo "no" >&6; }
2578fi
2579
2580
2581fi
2582if test -z "$ac_cv_prog_STRIP"; then
2583 ac_ct_STRIP=$STRIP
2584 # Extract the first word of "strip", so it can be a program name with args.
2585set dummy strip; ac_word=$2
2586{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2587$as_echo_n "checking for $ac_word... " >&6; }
2588if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
2589 $as_echo_n "(cached) " >&6
2590else
2591 if test -n "$ac_ct_STRIP"; then
2592 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
2593else
2594as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2595for as_dir in $PATH
2596do
2597 IFS=$as_save_IFS
2598 test -z "$as_dir" && as_dir=.
2599 for ac_exec_ext in '' $ac_executable_extensions; do
2600 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2601 ac_cv_prog_ac_ct_STRIP="strip"
2602 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2603 break 2
2604 fi
2605done
2606 done
2607IFS=$as_save_IFS
2608
2609fi
2610fi
2611ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
2612if test -n "$ac_ct_STRIP"; then
2613 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
2614$as_echo "$ac_ct_STRIP" >&6; }
2615else
2616 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2617$as_echo "no" >&6; }
2618fi
2619
2620 if test "x$ac_ct_STRIP" = x; then
2621 STRIP=":"
2622 else
2623 case $cross_compiling:$ac_tool_warned in
2624yes:)
2625{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2626$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2627ac_tool_warned=yes ;;
2628esac
2629 STRIP=$ac_ct_STRIP
2630 fi
2631else
2632 STRIP="$ac_cv_prog_STRIP"
2633fi
2634
2635fi
2636INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2637
2638{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
2639$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
2640if test -z "$MKDIR_P"; then
2641 if ${ac_cv_path_mkdir+:} false; then :
2642 $as_echo_n "(cached) " >&6
2643else
2644 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2645for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
2646do
2647 IFS=$as_save_IFS
2648 test -z "$as_dir" && as_dir=.
2649 for ac_prog in mkdir gmkdir; do
2650 for ac_exec_ext in '' $ac_executable_extensions; do
2651 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
2652 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
2653 'mkdir (GNU coreutils) '* | \
2654 'mkdir (coreutils) '* | \
2655 'mkdir (fileutils) '4.1*)
2656 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
2657 break 3;;
2658 esac
2659 done
2660 done
2661 done
2662IFS=$as_save_IFS
2663
2664fi
2665
2666 test -d ./--version && rmdir ./--version
2667 if test "${ac_cv_path_mkdir+set}" = set; then
2668 MKDIR_P="$ac_cv_path_mkdir -p"
2669 else
2670 # As a last resort, use the slow shell script. Don't cache a
2671 # value for MKDIR_P within a source directory, because that will
2672 # break other packages using the cache if that directory is
2673 # removed, or if the value is a relative name.
2674 MKDIR_P="$ac_install_sh -d"
2675 fi
2676fi
2677{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
2678$as_echo "$MKDIR_P" >&6; }
2679
2680mkdir_p="$MKDIR_P"
2681case $mkdir_p in
2682 [\\/$]* | ?:[\\/]*) ;;
2683 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2684esac
2685
2686for ac_prog in gawk mawk nawk awk
2687do
2688 # Extract the first word of "$ac_prog", so it can be a program name with args.
2689set dummy $ac_prog; ac_word=$2
2690{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2691$as_echo_n "checking for $ac_word... " >&6; }
2692if ${ac_cv_prog_AWK+:} false; then :
2693 $as_echo_n "(cached) " >&6
2694else
2695 if test -n "$AWK"; then
2696 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2697else
2698as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2699for as_dir in $PATH
2700do
2701 IFS=$as_save_IFS
2702 test -z "$as_dir" && as_dir=.
2703 for ac_exec_ext in '' $ac_executable_extensions; do
2704 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2705 ac_cv_prog_AWK="$ac_prog"
2706 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2707 break 2
2708 fi
2709done
2710 done
2711IFS=$as_save_IFS
2712
2713fi
2714fi
2715AWK=$ac_cv_prog_AWK
2716if test -n "$AWK"; then
2717 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
2718$as_echo "$AWK" >&6; }
2719else
2720 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2721$as_echo "no" >&6; }
2722fi
2723
2724
2725 test -n "$AWK" && break
2726done
2727
2728{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2729$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
2730set x ${MAKE-make}
2731ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2732if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
2733 $as_echo_n "(cached) " >&6
2734else
2735 cat >conftest.make <<\_ACEOF
2736SHELL = /bin/sh
2737all:
2738 @echo '@@@%%%=$(MAKE)=@@@%%%'
2739_ACEOF
2740# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
2741case `${MAKE-make} -f conftest.make 2>/dev/null` in
2742 *@@@%%%=?*=@@@%%%*)
2743 eval ac_cv_prog_make_${ac_make}_set=yes;;
2744 *)
2745 eval ac_cv_prog_make_${ac_make}_set=no;;
2746esac
2747rm -f conftest.make
2748fi
2749if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
2750 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2751$as_echo "yes" >&6; }
2752 SET_MAKE=
2753else
2754 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2755$as_echo "no" >&6; }
2756 SET_MAKE="MAKE=${MAKE-make}"
2757fi
2758
2759rm -rf .tst 2>/dev/null
2760mkdir .tst 2>/dev/null
2761if test -d .tst; then
2762 am__leading_dot=.
2763else
2764 am__leading_dot=_
2765fi
2766rmdir .tst 2>/dev/null
2767
2768if test "`cd $srcdir && pwd`" != "`pwd`"; then
2769 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2770 # is not polluted with repeated "-I."
2771 am__isrc=' -I$(srcdir)'
2772 # test to see if srcdir already configured
2773 if test -f $srcdir/config.status; then
2774 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
2775 fi
2776fi
2777
2778# test whether we have cygpath
2779if test -z "$CYGPATH_W"; then
2780 if (cygpath --version) >/dev/null 2>/dev/null; then
2781 CYGPATH_W='cygpath -w'
2782 else
2783 CYGPATH_W=echo
2784 fi
2785fi
2786
2787
2788# Define the identity of the package.
2789 PACKAGE='libjpeg'
2790 VERSION='8.4.0'
2791
2792
2793cat >>confdefs.h <<_ACEOF
2794#define PACKAGE "$PACKAGE"
2795_ACEOF
2796
2797
2798cat >>confdefs.h <<_ACEOF
2799#define VERSION "$VERSION"
2800_ACEOF
2801
2802# Some tools Automake needs.
2803
2804ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
2805
2806
2807AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
2808
2809
2810AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
2811
2812
2813AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
2814
2815
2816MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2817
2818# We need awk for the "check" target. The system "awk" is bad on
2819# some platforms.
2820# Always define AMTAR for backward compatibility.
2821
2822AMTAR=${AMTAR-"${am_missing_run}tar"}
2823
2824am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
2825
2826
2827
2828
2829
2830
2831# Make --enable-silent-rules the default.
2832# To get verbose build output you may configure
2833# with --disable-silent-rules or use "make V=1".
2834# Check whether --enable-silent-rules was given.
2835if test "${enable_silent_rules+set}" = set; then :
2836 enableval=$enable_silent_rules;
2837fi
2838
2839case $enable_silent_rules in
2840yes) AM_DEFAULT_VERBOSITY=0;;
2841no) AM_DEFAULT_VERBOSITY=1;;
2842*) AM_DEFAULT_VERBOSITY=0;;
2843esac
2844AM_BACKSLASH='\'
2845
2846
2847# This is required when using the de-ANSI-fication feature.
2848DEPDIR="${am__leading_dot}deps"
2849
2850ac_config_commands="$ac_config_commands depfiles"
2851
2852
2853am_make=${MAKE-make}
2854cat > confinc << 'END'
2855am__doit:
2856 @echo this is the am__doit target
2857.PHONY: am__doit
2858END
2859# If we don't find an include directive, just comment out the code.
2860{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
2861$as_echo_n "checking for style of include used by $am_make... " >&6; }
2862am__include="#"
2863am__quote=
2864_am_result=none
2865# First try GNU make style include.
2866echo "include confinc" > confmf
2867# Ignore all kinds of additional output from `make'.
2868case `$am_make -s -f confmf 2> /dev/null` in #(
2869*the\ am__doit\ target*)
2870 am__include=include
2871 am__quote=
2872 _am_result=GNU
2873 ;;
2874esac
2875# Now try BSD make style include.
2876if test "$am__include" = "#"; then
2877 echo '.include "confinc"' > confmf
2878 case `$am_make -s -f confmf 2> /dev/null` in #(
2879 *the\ am__doit\ target*)
2880 am__include=.include
2881 am__quote="\""
2882 _am_result=BSD
2883 ;;
2884 esac
2885fi
2886
2887
2888{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
2889$as_echo "$_am_result" >&6; }
2890rm -f confinc confmf
2891
2892# Check whether --enable-dependency-tracking was given.
2893if test "${enable_dependency_tracking+set}" = set; then :
2894 enableval=$enable_dependency_tracking;
2895fi
2896
2897if test "x$enable_dependency_tracking" != xno; then
2898 am_depcomp="$ac_aux_dir/depcomp"
2899 AMDEPBACKSLASH='\'
2900 am__nodep='_no'
2901fi
2902 if test "x$enable_dependency_tracking" != xno; then
2903 AMDEP_TRUE=
2904 AMDEP_FALSE='#'
2905else
2906 AMDEP_TRUE='#'
2907 AMDEP_FALSE=
2908fi
2909
2910
2911ac_ext=c
2912ac_cpp='$CPP $CPPFLAGS'
2913ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2914ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2915ac_compiler_gnu=$ac_cv_c_compiler_gnu
2916if test -n "$ac_tool_prefix"; then
2917 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2918set dummy ${ac_tool_prefix}gcc; ac_word=$2
2919{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2920$as_echo_n "checking for $ac_word... " >&6; }
2921if ${ac_cv_prog_CC+:} false; then :
2922 $as_echo_n "(cached) " >&6
2923else
2924 if test -n "$CC"; then
2925 ac_cv_prog_CC="$CC" # Let the user override the test.
2926else
2927as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2928for as_dir in $PATH
2929do
2930 IFS=$as_save_IFS
2931 test -z "$as_dir" && as_dir=.
2932 for ac_exec_ext in '' $ac_executable_extensions; do
2933 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2934 ac_cv_prog_CC="${ac_tool_prefix}gcc"
2935 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2936 break 2
2937 fi
2938done
2939 done
2940IFS=$as_save_IFS
2941
2942fi
2943fi
2944CC=$ac_cv_prog_CC
2945if test -n "$CC"; then
2946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2947$as_echo "$CC" >&6; }
2948else
2949 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2950$as_echo "no" >&6; }
2951fi
2952
2953
2954fi
2955if test -z "$ac_cv_prog_CC"; then
2956 ac_ct_CC=$CC
2957 # Extract the first word of "gcc", so it can be a program name with args.
2958set dummy gcc; ac_word=$2
2959{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2960$as_echo_n "checking for $ac_word... " >&6; }
2961if ${ac_cv_prog_ac_ct_CC+:} false; then :
2962 $as_echo_n "(cached) " >&6
2963else
2964 if test -n "$ac_ct_CC"; then
2965 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2966else
2967as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2968for as_dir in $PATH
2969do
2970 IFS=$as_save_IFS
2971 test -z "$as_dir" && as_dir=.
2972 for ac_exec_ext in '' $ac_executable_extensions; do
2973 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2974 ac_cv_prog_ac_ct_CC="gcc"
2975 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2976 break 2
2977 fi
2978done
2979 done
2980IFS=$as_save_IFS
2981
2982fi
2983fi
2984ac_ct_CC=$ac_cv_prog_ac_ct_CC
2985if test -n "$ac_ct_CC"; then
2986 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2987$as_echo "$ac_ct_CC" >&6; }
2988else
2989 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2990$as_echo "no" >&6; }
2991fi
2992
2993 if test "x$ac_ct_CC" = x; then
2994 CC=""
2995 else
2996 case $cross_compiling:$ac_tool_warned in
2997yes:)
2998{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2999$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3000ac_tool_warned=yes ;;
3001esac
3002 CC=$ac_ct_CC
3003 fi
3004else
3005 CC="$ac_cv_prog_CC"
3006fi
3007
3008if test -z "$CC"; then
3009 if test -n "$ac_tool_prefix"; then
3010 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3011set dummy ${ac_tool_prefix}cc; ac_word=$2
3012{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3013$as_echo_n "checking for $ac_word... " >&6; }
3014if ${ac_cv_prog_CC+:} false; then :
3015 $as_echo_n "(cached) " >&6
3016else
3017 if test -n "$CC"; then
3018 ac_cv_prog_CC="$CC" # Let the user override the test.
3019else
3020as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3021for as_dir in $PATH
3022do
3023 IFS=$as_save_IFS
3024 test -z "$as_dir" && as_dir=.
3025 for ac_exec_ext in '' $ac_executable_extensions; do
3026 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3027 ac_cv_prog_CC="${ac_tool_prefix}cc"
3028 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3029 break 2
3030 fi
3031done
3032 done
3033IFS=$as_save_IFS
3034
3035fi
3036fi
3037CC=$ac_cv_prog_CC
3038if test -n "$CC"; then
3039 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3040$as_echo "$CC" >&6; }
3041else
3042 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3043$as_echo "no" >&6; }
3044fi
3045
3046
3047 fi
3048fi
3049if test -z "$CC"; then
3050 # Extract the first word of "cc", so it can be a program name with args.
3051set dummy cc; ac_word=$2
3052{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3053$as_echo_n "checking for $ac_word... " >&6; }
3054if ${ac_cv_prog_CC+:} false; then :
3055 $as_echo_n "(cached) " >&6
3056else
3057 if test -n "$CC"; then
3058 ac_cv_prog_CC="$CC" # Let the user override the test.
3059else
3060 ac_prog_rejected=no
3061as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3062for as_dir in $PATH
3063do
3064 IFS=$as_save_IFS
3065 test -z "$as_dir" && as_dir=.
3066 for ac_exec_ext in '' $ac_executable_extensions; do
3067 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3068 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3069 ac_prog_rejected=yes
3070 continue
3071 fi
3072 ac_cv_prog_CC="cc"
3073 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3074 break 2
3075 fi
3076done
3077 done
3078IFS=$as_save_IFS
3079
3080if test $ac_prog_rejected = yes; then
3081 # We found a bogon in the path, so make sure we never use it.
3082 set dummy $ac_cv_prog_CC
3083 shift
3084 if test $# != 0; then
3085 # We chose a different compiler from the bogus one.
3086 # However, it has the same basename, so the bogon will be chosen
3087 # first if we set CC to just the basename; use the full file name.
3088 shift
3089 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3090 fi
3091fi
3092fi
3093fi
3094CC=$ac_cv_prog_CC
3095if test -n "$CC"; then
3096 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3097$as_echo "$CC" >&6; }
3098else
3099 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3100$as_echo "no" >&6; }
3101fi
3102
3103
3104fi
3105if test -z "$CC"; then
3106 if test -n "$ac_tool_prefix"; then
3107 for ac_prog in cl.exe
3108 do
3109 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3110set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3111{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3112$as_echo_n "checking for $ac_word... " >&6; }
3113if ${ac_cv_prog_CC+:} false; then :
3114 $as_echo_n "(cached) " >&6
3115else
3116 if test -n "$CC"; then
3117 ac_cv_prog_CC="$CC" # Let the user override the test.
3118else
3119as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3120for as_dir in $PATH
3121do
3122 IFS=$as_save_IFS
3123 test -z "$as_dir" && as_dir=.
3124 for ac_exec_ext in '' $ac_executable_extensions; do
3125 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3126 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3127 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3128 break 2
3129 fi
3130done
3131 done
3132IFS=$as_save_IFS
3133
3134fi
3135fi
3136CC=$ac_cv_prog_CC
3137if test -n "$CC"; then
3138 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3139$as_echo "$CC" >&6; }
3140else
3141 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3142$as_echo "no" >&6; }
3143fi
3144
3145
3146 test -n "$CC" && break
3147 done
3148fi
3149if test -z "$CC"; then
3150 ac_ct_CC=$CC
3151 for ac_prog in cl.exe
3152do
3153 # Extract the first word of "$ac_prog", so it can be a program name with args.
3154set dummy $ac_prog; ac_word=$2
3155{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3156$as_echo_n "checking for $ac_word... " >&6; }
3157if ${ac_cv_prog_ac_ct_CC+:} false; then :
3158 $as_echo_n "(cached) " >&6
3159else
3160 if test -n "$ac_ct_CC"; then
3161 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3162else
3163as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3164for as_dir in $PATH
3165do
3166 IFS=$as_save_IFS
3167 test -z "$as_dir" && as_dir=.
3168 for ac_exec_ext in '' $ac_executable_extensions; do
3169 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3170 ac_cv_prog_ac_ct_CC="$ac_prog"
3171 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3172 break 2
3173 fi
3174done
3175 done
3176IFS=$as_save_IFS
3177
3178fi
3179fi
3180ac_ct_CC=$ac_cv_prog_ac_ct_CC
3181if test -n "$ac_ct_CC"; then
3182 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3183$as_echo "$ac_ct_CC" >&6; }
3184else
3185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3186$as_echo "no" >&6; }
3187fi
3188
3189
3190 test -n "$ac_ct_CC" && break
3191done
3192
3193 if test "x$ac_ct_CC" = x; then
3194 CC=""
3195 else
3196 case $cross_compiling:$ac_tool_warned in
3197yes:)
3198{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3199$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3200ac_tool_warned=yes ;;
3201esac
3202 CC=$ac_ct_CC
3203 fi
3204fi
3205
3206fi
3207
3208
3209test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3210$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3211as_fn_error $? "no acceptable C compiler found in \$PATH
3212See \`config.log' for more details" "$LINENO" 5; }
3213
3214# Provide some information about the compiler.
3215$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3216set X $ac_compile
3217ac_compiler=$2
3218for ac_option in --version -v -V -qversion; do
3219 { { ac_try="$ac_compiler $ac_option >&5"
3220case "(($ac_try" in
3221 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3222 *) ac_try_echo=$ac_try;;
3223esac
3224eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3225$as_echo "$ac_try_echo"; } >&5
3226 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3227 ac_status=$?
3228 if test -s conftest.err; then
3229 sed '10a\
3230... rest of stderr output deleted ...
3231 10q' conftest.err >conftest.er1
3232 cat conftest.er1 >&5
3233 fi
3234 rm -f conftest.er1 conftest.err
3235 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3236 test $ac_status = 0; }
3237done
3238
3239cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3240/* end confdefs.h. */
3241
3242int
3243main ()
3244{
3245
3246 ;
3247 return 0;
3248}
3249_ACEOF
3250ac_clean_files_save=$ac_clean_files
3251ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3252# Try to create an executable without -o first, disregard a.out.
3253# It will help us diagnose broken compilers, and finding out an intuition
3254# of exeext.
3255{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3256$as_echo_n "checking whether the C compiler works... " >&6; }
3257ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3258
3259# The possible output files:
3260ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3261
3262ac_rmfiles=
3263for ac_file in $ac_files
3264do
3265 case $ac_file in
3266 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3267 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3268 esac
3269done
3270rm -f $ac_rmfiles
3271
3272if { { ac_try="$ac_link_default"
3273case "(($ac_try" in
3274 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3275 *) ac_try_echo=$ac_try;;
3276esac
3277eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3278$as_echo "$ac_try_echo"; } >&5
3279 (eval "$ac_link_default") 2>&5
3280 ac_status=$?
3281 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3282 test $ac_status = 0; }; then :
3283 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3284# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3285# in a Makefile. We should not override ac_cv_exeext if it was cached,
3286# so that the user can short-circuit this test for compilers unknown to
3287# Autoconf.
3288for ac_file in $ac_files ''
3289do
3290 test -f "$ac_file" || continue
3291 case $ac_file in
3292 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3293 ;;
3294 [ab].out )
3295 # We found the default executable, but exeext='' is most
3296 # certainly right.
3297 break;;
3298 *.* )
3299 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3300 then :; else
3301 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3302 fi
3303 # We set ac_cv_exeext here because the later test for it is not
3304 # safe: cross compilers may not add the suffix if given an `-o'
3305 # argument, so we may need to know it at that point already.
3306 # Even if this section looks crufty: it has the advantage of
3307 # actually working.
3308 break;;
3309 * )
3310 break;;
3311 esac
3312done
3313test "$ac_cv_exeext" = no && ac_cv_exeext=
3314
3315else
3316 ac_file=''
3317fi
3318if test -z "$ac_file"; then :
3319 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3320$as_echo "no" >&6; }
3321$as_echo "$as_me: failed program was:" >&5
3322sed 's/^/| /' conftest.$ac_ext >&5
3323
3324{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3325$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3326as_fn_error 77 "C compiler cannot create executables
3327See \`config.log' for more details" "$LINENO" 5; }
3328else
3329 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3330$as_echo "yes" >&6; }
3331fi
3332{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3333$as_echo_n "checking for C compiler default output file name... " >&6; }
3334{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3335$as_echo "$ac_file" >&6; }
3336ac_exeext=$ac_cv_exeext
3337
3338rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3339ac_clean_files=$ac_clean_files_save
3340{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3341$as_echo_n "checking for suffix of executables... " >&6; }
3342if { { ac_try="$ac_link"
3343case "(($ac_try" in
3344 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3345 *) ac_try_echo=$ac_try;;
3346esac
3347eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3348$as_echo "$ac_try_echo"; } >&5
3349 (eval "$ac_link") 2>&5
3350 ac_status=$?
3351 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3352 test $ac_status = 0; }; then :
3353 # If both `conftest.exe' and `conftest' are `present' (well, observable)
3354# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
3355# work properly (i.e., refer to `conftest.exe'), while it won't with
3356# `rm'.
3357for ac_file in conftest.exe conftest conftest.*; do
3358 test -f "$ac_file" || continue
3359 case $ac_file in
3360 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3361 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3362 break;;
3363 * ) break;;
3364 esac
3365done
3366else
3367 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3368$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3369as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3370See \`config.log' for more details" "$LINENO" 5; }
3371fi
3372rm -f conftest conftest$ac_cv_exeext
3373{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3374$as_echo "$ac_cv_exeext" >&6; }
3375
3376rm -f conftest.$ac_ext
3377EXEEXT=$ac_cv_exeext
3378ac_exeext=$EXEEXT
3379cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3380/* end confdefs.h. */
3381#include <stdio.h>
3382int
3383main ()
3384{
3385FILE *f = fopen ("conftest.out", "w");
3386 return ferror (f) || fclose (f) != 0;
3387
3388 ;
3389 return 0;
3390}
3391_ACEOF
3392ac_clean_files="$ac_clean_files conftest.out"
3393# Check that the compiler produces executables we can run. If not, either
3394# the compiler is broken, or we cross compile.
3395{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
3396$as_echo_n "checking whether we are cross compiling... " >&6; }
3397if test "$cross_compiling" != yes; then
3398 { { ac_try="$ac_link"
3399case "(($ac_try" in
3400 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3401 *) ac_try_echo=$ac_try;;
3402esac
3403eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3404$as_echo "$ac_try_echo"; } >&5
3405 (eval "$ac_link") 2>&5
3406 ac_status=$?
3407 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3408 test $ac_status = 0; }
3409 if { ac_try='./conftest$ac_cv_exeext'
3410 { { case "(($ac_try" in
3411 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3412 *) ac_try_echo=$ac_try;;
3413esac
3414eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3415$as_echo "$ac_try_echo"; } >&5
3416 (eval "$ac_try") 2>&5
3417 ac_status=$?
3418 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3419 test $ac_status = 0; }; }; then
3420 cross_compiling=no
3421 else
3422 if test "$cross_compiling" = maybe; then
3423 cross_compiling=yes
3424 else
3425 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3426$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3427as_fn_error $? "cannot run C compiled programs.
3428If you meant to cross compile, use \`--host'.
3429See \`config.log' for more details" "$LINENO" 5; }
3430 fi
3431 fi
3432fi
3433{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
3434$as_echo "$cross_compiling" >&6; }
3435
3436rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
3437ac_clean_files=$ac_clean_files_save
3438{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
3439$as_echo_n "checking for suffix of object files... " >&6; }
3440if ${ac_cv_objext+:} false; then :
3441 $as_echo_n "(cached) " >&6
3442else
3443 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3444/* end confdefs.h. */
3445
3446int
3447main ()
3448{
3449
3450 ;
3451 return 0;
3452}
3453_ACEOF
3454rm -f conftest.o conftest.obj
3455if { { ac_try="$ac_compile"
3456case "(($ac_try" in
3457 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3458 *) ac_try_echo=$ac_try;;
3459esac
3460eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3461$as_echo "$ac_try_echo"; } >&5
3462 (eval "$ac_compile") 2>&5
3463 ac_status=$?
3464 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3465 test $ac_status = 0; }; then :
3466 for ac_file in conftest.o conftest.obj conftest.*; do
3467 test -f "$ac_file" || continue;
3468 case $ac_file in
3469 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3470 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3471 break;;
3472 esac
3473done
3474else
3475 $as_echo "$as_me: failed program was:" >&5
3476sed 's/^/| /' conftest.$ac_ext >&5
3477
3478{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3479$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3480as_fn_error $? "cannot compute suffix of object files: cannot compile
3481See \`config.log' for more details" "$LINENO" 5; }
3482fi
3483rm -f conftest.$ac_cv_objext conftest.$ac_ext
3484fi
3485{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
3486$as_echo "$ac_cv_objext" >&6; }
3487OBJEXT=$ac_cv_objext
3488ac_objext=$OBJEXT
3489{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
3490$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3491if ${ac_cv_c_compiler_gnu+:} false; then :
3492 $as_echo_n "(cached) " >&6
3493else
3494 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3495/* end confdefs.h. */
3496
3497int
3498main ()
3499{
3500#ifndef __GNUC__
3501 choke me
3502#endif
3503
3504 ;
3505 return 0;
3506}
3507_ACEOF
3508if ac_fn_c_try_compile "$LINENO"; then :
3509 ac_compiler_gnu=yes
3510else
3511 ac_compiler_gnu=no
3512fi
3513rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3514ac_cv_c_compiler_gnu=$ac_compiler_gnu
3515
3516fi
3517{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
3518$as_echo "$ac_cv_c_compiler_gnu" >&6; }
3519if test $ac_compiler_gnu = yes; then
3520 GCC=yes
3521else
3522 GCC=
3523fi
3524ac_test_CFLAGS=${CFLAGS+set}
3525ac_save_CFLAGS=$CFLAGS
3526{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
3527$as_echo_n "checking whether $CC accepts -g... " >&6; }
3528if ${ac_cv_prog_cc_g+:} false; then :
3529 $as_echo_n "(cached) " >&6
3530else
3531 ac_save_c_werror_flag=$ac_c_werror_flag
3532 ac_c_werror_flag=yes
3533 ac_cv_prog_cc_g=no
3534 CFLAGS="-g"
3535 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3536/* end confdefs.h. */
3537
3538int
3539main ()
3540{
3541
3542 ;
3543 return 0;
3544}
3545_ACEOF
3546if ac_fn_c_try_compile "$LINENO"; then :
3547 ac_cv_prog_cc_g=yes
3548else
3549 CFLAGS=""
3550 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3551/* end confdefs.h. */
3552
3553int
3554main ()
3555{
3556
3557 ;
3558 return 0;
3559}
3560_ACEOF
3561if ac_fn_c_try_compile "$LINENO"; then :
3562
3563else
3564 ac_c_werror_flag=$ac_save_c_werror_flag
3565 CFLAGS="-g"
3566 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3567/* end confdefs.h. */
3568
3569int
3570main ()
3571{
3572
3573 ;
3574 return 0;
3575}
3576_ACEOF
3577if ac_fn_c_try_compile "$LINENO"; then :
3578 ac_cv_prog_cc_g=yes
3579fi
3580rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3581fi
3582rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3583fi
3584rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3585 ac_c_werror_flag=$ac_save_c_werror_flag
3586fi
3587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
3588$as_echo "$ac_cv_prog_cc_g" >&6; }
3589if test "$ac_test_CFLAGS" = set; then
3590 CFLAGS=$ac_save_CFLAGS
3591elif test $ac_cv_prog_cc_g = yes; then
3592 if test "$GCC" = yes; then
3593 CFLAGS="-g -O2"
3594 else
3595 CFLAGS="-g"
3596 fi
3597else
3598 if test "$GCC" = yes; then
3599 CFLAGS="-O2"
3600 else
3601 CFLAGS=
3602 fi
3603fi
3604{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
3605$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3606if ${ac_cv_prog_cc_c89+:} false; then :
3607 $as_echo_n "(cached) " >&6
3608else
3609 ac_cv_prog_cc_c89=no
3610ac_save_CC=$CC
3611cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3612/* end confdefs.h. */
3613#include <stdarg.h>
3614#include <stdio.h>
3615#include <sys/types.h>
3616#include <sys/stat.h>
3617/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3618struct buf { int x; };
3619FILE * (*rcsopen) (struct buf *, struct stat *, int);
3620static char *e (p, i)
3621 char **p;
3622 int i;
3623{
3624 return p[i];
3625}
3626static char *f (char * (*g) (char **, int), char **p, ...)
3627{
3628 char *s;
3629 va_list v;
3630 va_start (v,p);
3631 s = g (p, va_arg (v,int));
3632 va_end (v);
3633 return s;
3634}
3635
3636/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
3637 function prototypes and stuff, but not '\xHH' hex character constants.
3638 These don't provoke an error unfortunately, instead are silently treated
3639 as 'x'. The following induces an error, until -std is added to get
3640 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
3641 array size at least. It's necessary to write '\x00'==0 to get something
3642 that's true only with -std. */
3643int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3644
3645/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3646 inside strings and character constants. */
3647#define FOO(x) 'x'
3648int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3649
3650int test (int i, double x);
3651struct s1 {int (*f) (int a);};
3652struct s2 {int (*f) (double a);};
3653int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3654int argc;
3655char **argv;
3656int
3657main ()
3658{
3659return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3660 ;
3661 return 0;
3662}
3663_ACEOF
3664for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3665 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3666do
3667 CC="$ac_save_CC $ac_arg"
3668 if ac_fn_c_try_compile "$LINENO"; then :
3669 ac_cv_prog_cc_c89=$ac_arg
3670fi
3671rm -f core conftest.err conftest.$ac_objext
3672 test "x$ac_cv_prog_cc_c89" != "xno" && break
3673done
3674rm -f conftest.$ac_ext
3675CC=$ac_save_CC
3676
3677fi
3678# AC_CACHE_VAL
3679case "x$ac_cv_prog_cc_c89" in
3680 x)
3681 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
3682$as_echo "none needed" >&6; } ;;
3683 xno)
3684 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3685$as_echo "unsupported" >&6; } ;;
3686 *)
3687 CC="$CC $ac_cv_prog_cc_c89"
3688 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
3689$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
3690esac
3691if test "x$ac_cv_prog_cc_c89" != xno; then :
3692
3693fi
3694
3695ac_ext=c
3696ac_cpp='$CPP $CPPFLAGS'
3697ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3698ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3699ac_compiler_gnu=$ac_cv_c_compiler_gnu
3700
3701depcc="$CC" am_compiler_list=
3702
3703{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
3704$as_echo_n "checking dependency style of $depcc... " >&6; }
3705if ${am_cv_CC_dependencies_compiler_type+:} false; then :
3706 $as_echo_n "(cached) " >&6
3707else
3708 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3709 # We make a subdir and do the tests there. Otherwise we can end up
3710 # making bogus files that we don't know about and never remove. For
3711 # instance it was reported that on HP-UX the gcc test will end up
3712 # making a dummy file named `D' -- because `-MD' means `put the output
3713 # in D'.
3714 rm -rf conftest.dir
3715 mkdir conftest.dir
3716 # Copy depcomp to subdir because otherwise we won't find it if we're
3717 # using a relative directory.
3718 cp "$am_depcomp" conftest.dir
3719 cd conftest.dir
3720 # We will build objects and dependencies in a subdirectory because
3721 # it helps to detect inapplicable dependency modes. For instance
3722 # both Tru64's cc and ICC support -MD to output dependencies as a
3723 # side effect of compilation, but ICC will put the dependencies in
3724 # the current directory while Tru64 will put them in the object
3725 # directory.
3726 mkdir sub
3727
3728 am_cv_CC_dependencies_compiler_type=none
3729 if test "$am_compiler_list" = ""; then
3730 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
3731 fi
3732 am__universal=false
3733 case " $depcc " in #(
3734 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3735 esac
3736
3737 for depmode in $am_compiler_list; do
3738 # Setup a source with many dependencies, because some compilers
3739 # like to wrap large dependency lists on column 80 (with \), and
3740 # we should not choose a depcomp mode which is confused by this.
3741 #
3742 # We need to recreate these files for each test, as the compiler may
3743 # overwrite some of them when testing with obscure command lines.
3744 # This happens at least with the AIX C compiler.
3745 : > sub/conftest.c
3746 for i in 1 2 3 4 5 6; do
3747 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3748 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3749 # Solaris 8's {/usr,}/bin/sh.
3750 touch sub/conftst$i.h
3751 done
3752 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3753
3754 # We check with `-c' and `-o' for the sake of the "dashmstdout"
3755 # mode. It turns out that the SunPro C++ compiler does not properly
3756 # handle `-M -o', and we need to detect this. Also, some Intel
3757 # versions had trouble with output in subdirs
3758 am__obj=sub/conftest.${OBJEXT-o}
3759 am__minus_obj="-o $am__obj"
3760 case $depmode in
3761 gcc)
3762 # This depmode causes a compiler race in universal mode.
3763 test "$am__universal" = false || continue
3764 ;;
3765 nosideeffect)
3766 # after this tag, mechanisms are not by side-effect, so they'll
3767 # only be used when explicitly requested
3768 if test "x$enable_dependency_tracking" = xyes; then
3769 continue
3770 else
3771 break
3772 fi
3773 ;;
3774 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3775 # This compiler won't grok `-c -o', but also, the minuso test has
3776 # not run yet. These depmodes are late enough in the game, and
3777 # so weak that their functioning should not be impacted.
3778 am__obj=conftest.${OBJEXT-o}
3779 am__minus_obj=
3780 ;;
3781 none) break ;;
3782 esac
3783 if depmode=$depmode \
3784 source=sub/conftest.c object=$am__obj \
3785 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3786 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3787 >/dev/null 2>conftest.err &&
3788 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3789 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3790 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3791 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3792 # icc doesn't choke on unknown options, it will just issue warnings
3793 # or remarks (even with -Werror). So we grep stderr for any message
3794 # that says an option was ignored or not supported.
3795 # When given -MP, icc 7.0 and 7.1 complain thusly:
3796 # icc: Command line warning: ignoring option '-M'; no argument required
3797 # The diagnosis changed in icc 8.0:
3798 # icc: Command line remark: option '-MP' not supported
3799 if (grep 'ignoring option' conftest.err ||
3800 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3801 am_cv_CC_dependencies_compiler_type=$depmode
3802 break
3803 fi
3804 fi
3805 done
3806
3807 cd ..
3808 rm -rf conftest.dir
3809else
3810 am_cv_CC_dependencies_compiler_type=none
3811fi
3812
3813fi
3814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
3815$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
3816CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
3817
3818 if
3819 test "x$enable_dependency_tracking" != xno \
3820 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
3821 am__fastdepCC_TRUE=
3822 am__fastdepCC_FALSE='#'
3823else
3824 am__fastdepCC_TRUE='#'
3825 am__fastdepCC_FALSE=
3826fi
3827
3828
3829{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5
3830$as_echo_n "checking for function prototypes... " >&6; }
3831if test "$ac_cv_prog_cc_c89" != no; then
3832 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3833$as_echo "yes" >&6; }
3834
3835$as_echo "#define PROTOTYPES 1" >>confdefs.h
3836
3837
3838$as_echo "#define __PROTOTYPES 1" >>confdefs.h
3839
3840else
3841 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3842$as_echo "no" >&6; }
3843fi
3844
3845
3846ac_ext=c
3847ac_cpp='$CPP $CPPFLAGS'
3848ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3849ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3850ac_compiler_gnu=$ac_cv_c_compiler_gnu
3851{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3852$as_echo_n "checking how to run the C preprocessor... " >&6; }
3853# On Suns, sometimes $CPP names a directory.
3854if test -n "$CPP" && test -d "$CPP"; then
3855 CPP=
3856fi
3857if test -z "$CPP"; then
3858 if ${ac_cv_prog_CPP+:} false; then :
3859 $as_echo_n "(cached) " >&6
3860else
3861 # Double quotes because CPP needs to be expanded
3862 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3863 do
3864 ac_preproc_ok=false
3865for ac_c_preproc_warn_flag in '' yes
3866do
3867 # Use a header file that comes with gcc, so configuring glibc
3868 # with a fresh cross-compiler works.
3869 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3870 # <limits.h> exists even on freestanding compilers.
3871 # On the NeXT, cc -E runs the code through the compiler's parser,
3872 # not just through cpp. "Syntax error" is here to catch this case.
3873 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3874/* end confdefs.h. */
3875#ifdef __STDC__
3876# include <limits.h>
3877#else
3878# include <assert.h>
3879#endif
3880 Syntax error
3881_ACEOF
3882if ac_fn_c_try_cpp "$LINENO"; then :
3883
3884else
3885 # Broken: fails on valid input.
3886continue
3887fi
3888rm -f conftest.err conftest.i conftest.$ac_ext
3889
3890 # OK, works on sane cases. Now check whether nonexistent headers
3891 # can be detected and how.
3892 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3893/* end confdefs.h. */
3894#include <ac_nonexistent.h>
3895_ACEOF
3896if ac_fn_c_try_cpp "$LINENO"; then :
3897 # Broken: success on invalid input.
3898continue
3899else
3900 # Passes both tests.
3901ac_preproc_ok=:
3902break
3903fi
3904rm -f conftest.err conftest.i conftest.$ac_ext
3905
3906done
3907# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3908rm -f conftest.i conftest.err conftest.$ac_ext
3909if $ac_preproc_ok; then :
3910 break
3911fi
3912
3913 done
3914 ac_cv_prog_CPP=$CPP
3915
3916fi
3917 CPP=$ac_cv_prog_CPP
3918else
3919 ac_cv_prog_CPP=$CPP
3920fi
3921{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3922$as_echo "$CPP" >&6; }
3923ac_preproc_ok=false
3924for ac_c_preproc_warn_flag in '' yes
3925do
3926 # Use a header file that comes with gcc, so configuring glibc
3927 # with a fresh cross-compiler works.
3928 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3929 # <limits.h> exists even on freestanding compilers.
3930 # On the NeXT, cc -E runs the code through the compiler's parser,
3931 # not just through cpp. "Syntax error" is here to catch this case.
3932 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3933/* end confdefs.h. */
3934#ifdef __STDC__
3935# include <limits.h>
3936#else
3937# include <assert.h>
3938#endif
3939 Syntax error
3940_ACEOF
3941if ac_fn_c_try_cpp "$LINENO"; then :
3942
3943else
3944 # Broken: fails on valid input.
3945continue
3946fi
3947rm -f conftest.err conftest.i conftest.$ac_ext
3948
3949 # OK, works on sane cases. Now check whether nonexistent headers
3950 # can be detected and how.
3951 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3952/* end confdefs.h. */
3953#include <ac_nonexistent.h>
3954_ACEOF
3955if ac_fn_c_try_cpp "$LINENO"; then :
3956 # Broken: success on invalid input.
3957continue
3958else
3959 # Passes both tests.
3960ac_preproc_ok=:
3961break
3962fi
3963rm -f conftest.err conftest.i conftest.$ac_ext
3964
3965done
3966# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3967rm -f conftest.i conftest.err conftest.$ac_ext
3968if $ac_preproc_ok; then :
3969
3970else
3971 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3972$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3973as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
3974See \`config.log' for more details" "$LINENO" 5; }
3975fi
3976
3977ac_ext=c
3978ac_cpp='$CPP $CPPFLAGS'
3979ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3980ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3981ac_compiler_gnu=$ac_cv_c_compiler_gnu
3982
3983
3984{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
3985$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
3986if ${ac_cv_path_GREP+:} false; then :
3987 $as_echo_n "(cached) " >&6
3988else
3989 if test -z "$GREP"; then
3990 ac_path_GREP_found=false
3991 # Loop through the user's path and test for each of PROGNAME-LIST
3992 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3993for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3994do
3995 IFS=$as_save_IFS
3996 test -z "$as_dir" && as_dir=.
3997 for ac_prog in grep ggrep; do
3998 for ac_exec_ext in '' $ac_executable_extensions; do
3999 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4000 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4001# Check for GNU ac_path_GREP and select it if it is found.
4002 # Check for GNU $ac_path_GREP
4003case `"$ac_path_GREP" --version 2>&1` in
4004*GNU*)
4005 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4006*)
4007 ac_count=0
4008 $as_echo_n 0123456789 >"conftest.in"
4009 while :
4010 do
4011 cat "conftest.in" "conftest.in" >"conftest.tmp"
4012 mv "conftest.tmp" "conftest.in"
4013 cp "conftest.in" "conftest.nl"
4014 $as_echo 'GREP' >> "conftest.nl"
4015 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4016 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4017 as_fn_arith $ac_count + 1 && ac_count=$as_val
4018 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4019 # Best one so far, save it but keep looking for a better one
4020 ac_cv_path_GREP="$ac_path_GREP"
4021 ac_path_GREP_max=$ac_count
4022 fi
4023 # 10*(2^10) chars as input seems more than enough
4024 test $ac_count -gt 10 && break
4025 done
4026 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4027esac
4028
4029 $ac_path_GREP_found && break 3
4030 done
4031 done
4032 done
4033IFS=$as_save_IFS
4034 if test -z "$ac_cv_path_GREP"; then
4035 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4036 fi
4037else
4038 ac_cv_path_GREP=$GREP
4039fi
4040
4041fi
4042{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4043$as_echo "$ac_cv_path_GREP" >&6; }
4044 GREP="$ac_cv_path_GREP"
4045
4046
4047{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4048$as_echo_n "checking for egrep... " >&6; }
4049if ${ac_cv_path_EGREP+:} false; then :
4050 $as_echo_n "(cached) " >&6
4051else
4052 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4053 then ac_cv_path_EGREP="$GREP -E"
4054 else
4055 if test -z "$EGREP"; then
4056 ac_path_EGREP_found=false
4057 # Loop through the user's path and test for each of PROGNAME-LIST
4058 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4059for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4060do
4061 IFS=$as_save_IFS
4062 test -z "$as_dir" && as_dir=.
4063 for ac_prog in egrep; do
4064 for ac_exec_ext in '' $ac_executable_extensions; do
4065 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4066 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4067# Check for GNU ac_path_EGREP and select it if it is found.
4068 # Check for GNU $ac_path_EGREP
4069case `"$ac_path_EGREP" --version 2>&1` in
4070*GNU*)
4071 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4072*)
4073 ac_count=0
4074 $as_echo_n 0123456789 >"conftest.in"
4075 while :
4076 do
4077 cat "conftest.in" "conftest.in" >"conftest.tmp"
4078 mv "conftest.tmp" "conftest.in"
4079 cp "conftest.in" "conftest.nl"
4080 $as_echo 'EGREP' >> "conftest.nl"
4081 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4082 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4083 as_fn_arith $ac_count + 1 && ac_count=$as_val
4084 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4085 # Best one so far, save it but keep looking for a better one
4086 ac_cv_path_EGREP="$ac_path_EGREP"
4087 ac_path_EGREP_max=$ac_count
4088 fi
4089 # 10*(2^10) chars as input seems more than enough
4090 test $ac_count -gt 10 && break
4091 done
4092 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4093esac
4094
4095 $ac_path_EGREP_found && break 3
4096 done
4097 done
4098 done
4099IFS=$as_save_IFS
4100 if test -z "$ac_cv_path_EGREP"; then
4101 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4102 fi
4103else
4104 ac_cv_path_EGREP=$EGREP
4105fi
4106
4107 fi
4108fi
4109{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4110$as_echo "$ac_cv_path_EGREP" >&6; }
4111 EGREP="$ac_cv_path_EGREP"
4112
4113
4114{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
4115$as_echo_n "checking for ANSI C header files... " >&6; }
4116if ${ac_cv_header_stdc+:} false; then :
4117 $as_echo_n "(cached) " >&6
4118else
4119 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4120/* end confdefs.h. */
4121#include <stdlib.h>
4122#include <stdarg.h>
4123#include <string.h>
4124#include <float.h>
4125
4126int
4127main ()
4128{
4129
4130 ;
4131 return 0;
4132}
4133_ACEOF
4134if ac_fn_c_try_compile "$LINENO"; then :
4135 ac_cv_header_stdc=yes
4136else
4137 ac_cv_header_stdc=no
4138fi
4139rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4140
4141if test $ac_cv_header_stdc = yes; then
4142 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4143 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4144/* end confdefs.h. */
4145#include <string.h>
4146
4147_ACEOF
4148if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4149 $EGREP "memchr" >/dev/null 2>&1; then :
4150
4151else
4152 ac_cv_header_stdc=no
4153fi
4154rm -f conftest*
4155
4156fi
4157
4158if test $ac_cv_header_stdc = yes; then
4159 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4161/* end confdefs.h. */
4162#include <stdlib.h>
4163
4164_ACEOF
4165if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4166 $EGREP "free" >/dev/null 2>&1; then :
4167
4168else
4169 ac_cv_header_stdc=no
4170fi
4171rm -f conftest*
4172
4173fi
4174
4175if test $ac_cv_header_stdc = yes; then
4176 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4177 if test "$cross_compiling" = yes; then :
4178 :
4179else
4180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4181/* end confdefs.h. */
4182#include <ctype.h>
4183#include <stdlib.h>
4184#if ((' ' & 0x0FF) == 0x020)
4185# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4186# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4187#else
4188# define ISLOWER(c) \
4189 (('a' <= (c) && (c) <= 'i') \
4190 || ('j' <= (c) && (c) <= 'r') \
4191 || ('s' <= (c) && (c) <= 'z'))
4192# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
4193#endif
4194
4195#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4196int
4197main ()
4198{
4199 int i;
4200 for (i = 0; i < 256; i++)
4201 if (XOR (islower (i), ISLOWER (i))
4202 || toupper (i) != TOUPPER (i))
4203 return 2;
4204 return 0;
4205}
4206_ACEOF
4207if ac_fn_c_try_run "$LINENO"; then :
4208
4209else
4210 ac_cv_header_stdc=no
4211fi
4212rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
4213 conftest.$ac_objext conftest.beam conftest.$ac_ext
4214fi
4215
4216fi
4217fi
4218{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
4219$as_echo "$ac_cv_header_stdc" >&6; }
4220if test $ac_cv_header_stdc = yes; then
4221
4222$as_echo "#define STDC_HEADERS 1" >>confdefs.h
4223
4224fi
4225
4226# On IRIX 5.3, sys/types and inttypes.h are conflicting.
4227for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
4228 inttypes.h stdint.h unistd.h
4229do :
4230 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
4231ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
4232"
4233if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
4234 cat >>confdefs.h <<_ACEOF
4235#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
4236_ACEOF
4237
4238fi
4239
4240done
4241
4242
4243
4244
4245if test "$ac_cv_prog_cc_stdc" != no; then
4246 U= ANSI2KNR=
4247else
4248 U=_ ANSI2KNR=./ansi2knr
4249fi
4250# Ensure some checks needed by ansi2knr itself.
4251
4252for ac_header in string.h
4253do :
4254 ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
4255if test "x$ac_cv_header_string_h" = xyes; then :
4256 cat >>confdefs.h <<_ACEOF
4257#define HAVE_STRING_H 1
4258_ACEOF
4259
4260fi
4261
4262done
4263
4264
4265
4266# Add configure option --enable-maintainer-mode which enables
4267# dependency checking and generation useful to package maintainers.
4268# This is made an option to avoid confusing end users.
4269
4270{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
4271$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
4272 # Check whether --enable-maintainer-mode was given.
4273if test "${enable_maintainer_mode+set}" = set; then :
4274 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
4275else
4276 USE_MAINTAINER_MODE=no
4277fi
4278
4279 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
4280$as_echo "$USE_MAINTAINER_MODE" >&6; }
4281 if test $USE_MAINTAINER_MODE = yes; then
4282 MAINTAINER_MODE_TRUE=
4283 MAINTAINER_MODE_FALSE='#'
4284else
4285 MAINTAINER_MODE_TRUE='#'
4286 MAINTAINER_MODE_FALSE=
4287fi
4288
4289 MAINT=$MAINTAINER_MODE_TRUE
4290
4291
4292
4293# Check for programs
4294ac_ext=c
4295ac_cpp='$CPP $CPPFLAGS'
4296ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4297ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4298ac_compiler_gnu=$ac_cv_c_compiler_gnu
4299if test -n "$ac_tool_prefix"; then
4300 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
4301set dummy ${ac_tool_prefix}gcc; ac_word=$2
4302{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4303$as_echo_n "checking for $ac_word... " >&6; }
4304if ${ac_cv_prog_CC+:} false; then :
4305 $as_echo_n "(cached) " >&6
4306else
4307 if test -n "$CC"; then
4308 ac_cv_prog_CC="$CC" # Let the user override the test.
4309else
4310as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4311for as_dir in $PATH
4312do
4313 IFS=$as_save_IFS
4314 test -z "$as_dir" && as_dir=.
4315 for ac_exec_ext in '' $ac_executable_extensions; do
4316 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4317 ac_cv_prog_CC="${ac_tool_prefix}gcc"
4318 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4319 break 2
4320 fi
4321done
4322 done
4323IFS=$as_save_IFS
4324
4325fi
4326fi
4327CC=$ac_cv_prog_CC
4328if test -n "$CC"; then
4329 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4330$as_echo "$CC" >&6; }
4331else
4332 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4333$as_echo "no" >&6; }
4334fi
4335
4336
4337fi
4338if test -z "$ac_cv_prog_CC"; then
4339 ac_ct_CC=$CC
4340 # Extract the first word of "gcc", so it can be a program name with args.
4341set dummy gcc; ac_word=$2
4342{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4343$as_echo_n "checking for $ac_word... " >&6; }
4344if ${ac_cv_prog_ac_ct_CC+:} false; then :
4345 $as_echo_n "(cached) " >&6
4346else
4347 if test -n "$ac_ct_CC"; then
4348 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4349else
4350as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4351for as_dir in $PATH
4352do
4353 IFS=$as_save_IFS
4354 test -z "$as_dir" && as_dir=.
4355 for ac_exec_ext in '' $ac_executable_extensions; do
4356 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4357 ac_cv_prog_ac_ct_CC="gcc"
4358 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4359 break 2
4360 fi
4361done
4362 done
4363IFS=$as_save_IFS
4364
4365fi
4366fi
4367ac_ct_CC=$ac_cv_prog_ac_ct_CC
4368if test -n "$ac_ct_CC"; then
4369 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4370$as_echo "$ac_ct_CC" >&6; }
4371else
4372 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4373$as_echo "no" >&6; }
4374fi
4375
4376 if test "x$ac_ct_CC" = x; then
4377 CC=""
4378 else
4379 case $cross_compiling:$ac_tool_warned in
4380yes:)
4381{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4382$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4383ac_tool_warned=yes ;;
4384esac
4385 CC=$ac_ct_CC
4386 fi
4387else
4388 CC="$ac_cv_prog_CC"
4389fi
4390
4391if test -z "$CC"; then
4392 if test -n "$ac_tool_prefix"; then
4393 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
4394set dummy ${ac_tool_prefix}cc; ac_word=$2
4395{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4396$as_echo_n "checking for $ac_word... " >&6; }
4397if ${ac_cv_prog_CC+:} false; then :
4398 $as_echo_n "(cached) " >&6
4399else
4400 if test -n "$CC"; then
4401 ac_cv_prog_CC="$CC" # Let the user override the test.
4402else
4403as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4404for as_dir in $PATH
4405do
4406 IFS=$as_save_IFS
4407 test -z "$as_dir" && as_dir=.
4408 for ac_exec_ext in '' $ac_executable_extensions; do
4409 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4410 ac_cv_prog_CC="${ac_tool_prefix}cc"
4411 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4412 break 2
4413 fi
4414done
4415 done
4416IFS=$as_save_IFS
4417
4418fi
4419fi
4420CC=$ac_cv_prog_CC
4421if test -n "$CC"; then
4422 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4423$as_echo "$CC" >&6; }
4424else
4425 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4426$as_echo "no" >&6; }
4427fi
4428
4429
4430 fi
4431fi
4432if test -z "$CC"; then
4433 # Extract the first word of "cc", so it can be a program name with args.
4434set dummy cc; ac_word=$2
4435{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4436$as_echo_n "checking for $ac_word... " >&6; }
4437if ${ac_cv_prog_CC+:} false; then :
4438 $as_echo_n "(cached) " >&6
4439else
4440 if test -n "$CC"; then
4441 ac_cv_prog_CC="$CC" # Let the user override the test.
4442else
4443 ac_prog_rejected=no
4444as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4445for as_dir in $PATH
4446do
4447 IFS=$as_save_IFS
4448 test -z "$as_dir" && as_dir=.
4449 for ac_exec_ext in '' $ac_executable_extensions; do
4450 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4451 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4452 ac_prog_rejected=yes
4453 continue
4454 fi
4455 ac_cv_prog_CC="cc"
4456 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4457 break 2
4458 fi
4459done
4460 done
4461IFS=$as_save_IFS
4462
4463if test $ac_prog_rejected = yes; then
4464 # We found a bogon in the path, so make sure we never use it.
4465 set dummy $ac_cv_prog_CC
4466 shift
4467 if test $# != 0; then
4468 # We chose a different compiler from the bogus one.
4469 # However, it has the same basename, so the bogon will be chosen
4470 # first if we set CC to just the basename; use the full file name.
4471 shift
4472 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
4473 fi
4474fi
4475fi
4476fi
4477CC=$ac_cv_prog_CC
4478if test -n "$CC"; then
4479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4480$as_echo "$CC" >&6; }
4481else
4482 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4483$as_echo "no" >&6; }
4484fi
4485
4486
4487fi
4488if test -z "$CC"; then
4489 if test -n "$ac_tool_prefix"; then
4490 for ac_prog in cl.exe
4491 do
4492 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4493set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4494{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4495$as_echo_n "checking for $ac_word... " >&6; }
4496if ${ac_cv_prog_CC+:} false; then :
4497 $as_echo_n "(cached) " >&6
4498else
4499 if test -n "$CC"; then
4500 ac_cv_prog_CC="$CC" # Let the user override the test.
4501else
4502as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4503for as_dir in $PATH
4504do
4505 IFS=$as_save_IFS
4506 test -z "$as_dir" && as_dir=.
4507 for ac_exec_ext in '' $ac_executable_extensions; do
4508 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4509 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4510 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4511 break 2
4512 fi
4513done
4514 done
4515IFS=$as_save_IFS
4516
4517fi
4518fi
4519CC=$ac_cv_prog_CC
4520if test -n "$CC"; then
4521 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4522$as_echo "$CC" >&6; }
4523else
4524 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4525$as_echo "no" >&6; }
4526fi
4527
4528
4529 test -n "$CC" && break
4530 done
4531fi
4532if test -z "$CC"; then
4533 ac_ct_CC=$CC
4534 for ac_prog in cl.exe
4535do
4536 # Extract the first word of "$ac_prog", so it can be a program name with args.
4537set dummy $ac_prog; ac_word=$2
4538{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4539$as_echo_n "checking for $ac_word... " >&6; }
4540if ${ac_cv_prog_ac_ct_CC+:} false; then :
4541 $as_echo_n "(cached) " >&6
4542else
4543 if test -n "$ac_ct_CC"; then
4544 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4545else
4546as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4547for as_dir in $PATH
4548do
4549 IFS=$as_save_IFS
4550 test -z "$as_dir" && as_dir=.
4551 for ac_exec_ext in '' $ac_executable_extensions; do
4552 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4553 ac_cv_prog_ac_ct_CC="$ac_prog"
4554 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4555 break 2
4556 fi
4557done
4558 done
4559IFS=$as_save_IFS
4560
4561fi
4562fi
4563ac_ct_CC=$ac_cv_prog_ac_ct_CC
4564if test -n "$ac_ct_CC"; then
4565 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4566$as_echo "$ac_ct_CC" >&6; }
4567else
4568 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4569$as_echo "no" >&6; }
4570fi
4571
4572
4573 test -n "$ac_ct_CC" && break
4574done
4575
4576 if test "x$ac_ct_CC" = x; then
4577 CC=""
4578 else
4579 case $cross_compiling:$ac_tool_warned in
4580yes:)
4581{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4582$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4583ac_tool_warned=yes ;;
4584esac
4585 CC=$ac_ct_CC
4586 fi
4587fi
4588
4589fi
4590
4591
4592test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4593$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4594as_fn_error $? "no acceptable C compiler found in \$PATH
4595See \`config.log' for more details" "$LINENO" 5; }
4596
4597# Provide some information about the compiler.
4598$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4599set X $ac_compile
4600ac_compiler=$2
4601for ac_option in --version -v -V -qversion; do
4602 { { ac_try="$ac_compiler $ac_option >&5"
4603case "(($ac_try" in
4604 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4605 *) ac_try_echo=$ac_try;;
4606esac
4607eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4608$as_echo "$ac_try_echo"; } >&5
4609 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4610 ac_status=$?
4611 if test -s conftest.err; then
4612 sed '10a\
4613... rest of stderr output deleted ...
4614 10q' conftest.err >conftest.er1
4615 cat conftest.er1 >&5
4616 fi
4617 rm -f conftest.er1 conftest.err
4618 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4619 test $ac_status = 0; }
4620done
4621
4622{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4623$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4624if ${ac_cv_c_compiler_gnu+:} false; then :
4625 $as_echo_n "(cached) " >&6
4626else
4627 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4628/* end confdefs.h. */
4629
4630int
4631main ()
4632{
4633#ifndef __GNUC__
4634 choke me
4635#endif
4636
4637 ;
4638 return 0;
4639}
4640_ACEOF
4641if ac_fn_c_try_compile "$LINENO"; then :
4642 ac_compiler_gnu=yes
4643else
4644 ac_compiler_gnu=no
4645fi
4646rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4647ac_cv_c_compiler_gnu=$ac_compiler_gnu
4648
4649fi
4650{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4651$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4652if test $ac_compiler_gnu = yes; then
4653 GCC=yes
4654else
4655 GCC=
4656fi
4657ac_test_CFLAGS=${CFLAGS+set}
4658ac_save_CFLAGS=$CFLAGS
4659{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4660$as_echo_n "checking whether $CC accepts -g... " >&6; }
4661if ${ac_cv_prog_cc_g+:} false; then :
4662 $as_echo_n "(cached) " >&6
4663else
4664 ac_save_c_werror_flag=$ac_c_werror_flag
4665 ac_c_werror_flag=yes
4666 ac_cv_prog_cc_g=no
4667 CFLAGS="-g"
4668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4669/* end confdefs.h. */
4670
4671int
4672main ()
4673{
4674
4675 ;
4676 return 0;
4677}
4678_ACEOF
4679if ac_fn_c_try_compile "$LINENO"; then :
4680 ac_cv_prog_cc_g=yes
4681else
4682 CFLAGS=""
4683 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4684/* end confdefs.h. */
4685
4686int
4687main ()
4688{
4689
4690 ;
4691 return 0;
4692}
4693_ACEOF
4694if ac_fn_c_try_compile "$LINENO"; then :
4695
4696else
4697 ac_c_werror_flag=$ac_save_c_werror_flag
4698 CFLAGS="-g"
4699 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4700/* end confdefs.h. */
4701
4702int
4703main ()
4704{
4705
4706 ;
4707 return 0;
4708}
4709_ACEOF
4710if ac_fn_c_try_compile "$LINENO"; then :
4711 ac_cv_prog_cc_g=yes
4712fi
4713rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4714fi
4715rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4716fi
4717rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4718 ac_c_werror_flag=$ac_save_c_werror_flag
4719fi
4720{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4721$as_echo "$ac_cv_prog_cc_g" >&6; }
4722if test "$ac_test_CFLAGS" = set; then
4723 CFLAGS=$ac_save_CFLAGS
4724elif test $ac_cv_prog_cc_g = yes; then
4725 if test "$GCC" = yes; then
4726 CFLAGS="-g -O2"
4727 else
4728 CFLAGS="-g"
4729 fi
4730else
4731 if test "$GCC" = yes; then
4732 CFLAGS="-O2"
4733 else
4734 CFLAGS=
4735 fi
4736fi
4737{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4738$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4739if ${ac_cv_prog_cc_c89+:} false; then :
4740 $as_echo_n "(cached) " >&6
4741else
4742 ac_cv_prog_cc_c89=no
4743ac_save_CC=$CC
4744cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4745/* end confdefs.h. */
4746#include <stdarg.h>
4747#include <stdio.h>
4748#include <sys/types.h>
4749#include <sys/stat.h>
4750/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
4751struct buf { int x; };
4752FILE * (*rcsopen) (struct buf *, struct stat *, int);
4753static char *e (p, i)
4754 char **p;
4755 int i;
4756{
4757 return p[i];
4758}
4759static char *f (char * (*g) (char **, int), char **p, ...)
4760{
4761 char *s;
4762 va_list v;
4763 va_start (v,p);
4764 s = g (p, va_arg (v,int));
4765 va_end (v);
4766 return s;
4767}
4768
4769/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
4770 function prototypes and stuff, but not '\xHH' hex character constants.
4771 These don't provoke an error unfortunately, instead are silently treated
4772 as 'x'. The following induces an error, until -std is added to get
4773 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
4774 array size at least. It's necessary to write '\x00'==0 to get something
4775 that's true only with -std. */
4776int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4777
4778/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4779 inside strings and character constants. */
4780#define FOO(x) 'x'
4781int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4782
4783int test (int i, double x);
4784struct s1 {int (*f) (int a);};
4785struct s2 {int (*f) (double a);};
4786int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4787int argc;
4788char **argv;
4789int
4790main ()
4791{
4792return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
4793 ;
4794 return 0;
4795}
4796_ACEOF
4797for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4798 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4799do
4800 CC="$ac_save_CC $ac_arg"
4801 if ac_fn_c_try_compile "$LINENO"; then :
4802 ac_cv_prog_cc_c89=$ac_arg
4803fi
4804rm -f core conftest.err conftest.$ac_objext
4805 test "x$ac_cv_prog_cc_c89" != "xno" && break
4806done
4807rm -f conftest.$ac_ext
4808CC=$ac_save_CC
4809
4810fi
4811# AC_CACHE_VAL
4812case "x$ac_cv_prog_cc_c89" in
4813 x)
4814 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4815$as_echo "none needed" >&6; } ;;
4816 xno)
4817 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4818$as_echo "unsupported" >&6; } ;;
4819 *)
4820 CC="$CC $ac_cv_prog_cc_c89"
4821 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4822$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4823esac
4824if test "x$ac_cv_prog_cc_c89" != xno; then :
4825
4826fi
4827
4828ac_ext=c
4829ac_cpp='$CPP $CPPFLAGS'
4830ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4831ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4832ac_compiler_gnu=$ac_cv_c_compiler_gnu
4833
4834depcc="$CC" am_compiler_list=
4835
4836{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
4837$as_echo_n "checking dependency style of $depcc... " >&6; }
4838if ${am_cv_CC_dependencies_compiler_type+:} false; then :
4839 $as_echo_n "(cached) " >&6
4840else
4841 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
4842 # We make a subdir and do the tests there. Otherwise we can end up
4843 # making bogus files that we don't know about and never remove. For
4844 # instance it was reported that on HP-UX the gcc test will end up
4845 # making a dummy file named `D' -- because `-MD' means `put the output
4846 # in D'.
4847 rm -rf conftest.dir
4848 mkdir conftest.dir
4849 # Copy depcomp to subdir because otherwise we won't find it if we're
4850 # using a relative directory.
4851 cp "$am_depcomp" conftest.dir
4852 cd conftest.dir
4853 # We will build objects and dependencies in a subdirectory because
4854 # it helps to detect inapplicable dependency modes. For instance
4855 # both Tru64's cc and ICC support -MD to output dependencies as a
4856 # side effect of compilation, but ICC will put the dependencies in
4857 # the current directory while Tru64 will put them in the object
4858 # directory.
4859 mkdir sub
4860
4861 am_cv_CC_dependencies_compiler_type=none
4862 if test "$am_compiler_list" = ""; then
4863 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
4864 fi
4865 am__universal=false
4866 case " $depcc " in #(
4867 *\ -arch\ *\ -arch\ *) am__universal=true ;;
4868 esac
4869
4870 for depmode in $am_compiler_list; do
4871 # Setup a source with many dependencies, because some compilers
4872 # like to wrap large dependency lists on column 80 (with \), and
4873 # we should not choose a depcomp mode which is confused by this.
4874 #
4875 # We need to recreate these files for each test, as the compiler may
4876 # overwrite some of them when testing with obscure command lines.
4877 # This happens at least with the AIX C compiler.
4878 : > sub/conftest.c
4879 for i in 1 2 3 4 5 6; do
4880 echo '#include "conftst'$i'.h"' >> sub/conftest.c
4881 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
4882 # Solaris 8's {/usr,}/bin/sh.
4883 touch sub/conftst$i.h
4884 done
4885 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4886
4887 # We check with `-c' and `-o' for the sake of the "dashmstdout"
4888 # mode. It turns out that the SunPro C++ compiler does not properly
4889 # handle `-M -o', and we need to detect this. Also, some Intel
4890 # versions had trouble with output in subdirs
4891 am__obj=sub/conftest.${OBJEXT-o}
4892 am__minus_obj="-o $am__obj"
4893 case $depmode in
4894 gcc)
4895 # This depmode causes a compiler race in universal mode.
4896 test "$am__universal" = false || continue
4897 ;;
4898 nosideeffect)
4899 # after this tag, mechanisms are not by side-effect, so they'll
4900 # only be used when explicitly requested
4901 if test "x$enable_dependency_tracking" = xyes; then
4902 continue
4903 else
4904 break
4905 fi
4906 ;;
4907 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
4908 # This compiler won't grok `-c -o', but also, the minuso test has
4909 # not run yet. These depmodes are late enough in the game, and
4910 # so weak that their functioning should not be impacted.
4911 am__obj=conftest.${OBJEXT-o}
4912 am__minus_obj=
4913 ;;
4914 none) break ;;
4915 esac
4916 if depmode=$depmode \
4917 source=sub/conftest.c object=$am__obj \
4918 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4919 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
4920 >/dev/null 2>conftest.err &&
4921 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4922 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4923 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
4924 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4925 # icc doesn't choke on unknown options, it will just issue warnings
4926 # or remarks (even with -Werror). So we grep stderr for any message
4927 # that says an option was ignored or not supported.
4928 # When given -MP, icc 7.0 and 7.1 complain thusly:
4929 # icc: Command line warning: ignoring option '-M'; no argument required
4930 # The diagnosis changed in icc 8.0:
4931 # icc: Command line remark: option '-MP' not supported
4932 if (grep 'ignoring option' conftest.err ||
4933 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4934 am_cv_CC_dependencies_compiler_type=$depmode
4935 break
4936 fi
4937 fi
4938 done
4939
4940 cd ..
4941 rm -rf conftest.dir
4942else
4943 am_cv_CC_dependencies_compiler_type=none
4944fi
4945
4946fi
4947{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
4948$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
4949CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
4950
4951 if
4952 test "x$enable_dependency_tracking" != xno \
4953 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
4954 am__fastdepCC_TRUE=
4955 am__fastdepCC_FALSE='#'
4956else
4957 am__fastdepCC_TRUE='#'
4958 am__fastdepCC_FALSE=
4959fi
4960
4961
4962 case $ac_cv_prog_cc_stdc in #(
4963 no) :
4964 ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
4965 *) :
4966 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
4967$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
4968if ${ac_cv_prog_cc_c99+:} false; then :
4969 $as_echo_n "(cached) " >&6
4970else
4971 ac_cv_prog_cc_c99=no
4972ac_save_CC=$CC
4973cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4974/* end confdefs.h. */
4975#include <stdarg.h>
4976#include <stdbool.h>
4977#include <stdlib.h>
4978#include <wchar.h>
4979#include <stdio.h>
4980
4981// Check varargs macros. These examples are taken from C99 6.10.3.5.
4982#define debug(...) fprintf (stderr, __VA_ARGS__)
4983#define showlist(...) puts (#__VA_ARGS__)
4984#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4985static void
4986test_varargs_macros (void)
4987{
4988 int x = 1234;
4989 int y = 5678;
4990 debug ("Flag");
4991 debug ("X = %d\n", x);
4992 showlist (The first, second, and third items.);
4993 report (x>y, "x is %d but y is %d", x, y);
4994}
4995
4996// Check long long types.
4997#define BIG64 18446744073709551615ull
4998#define BIG32 4294967295ul
4999#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
5000#if !BIG_OK
5001 your preprocessor is broken;
5002#endif
5003#if BIG_OK
5004#else
5005 your preprocessor is broken;
5006#endif
5007static long long int bignum = -9223372036854775807LL;
5008static unsigned long long int ubignum = BIG64;
5009
5010struct incomplete_array
5011{
5012 int datasize;
5013 double data[];
5014};
5015
5016struct named_init {
5017 int number;
5018 const wchar_t *name;
5019 double average;
5020};
5021
5022typedef const char *ccp;
5023
5024static inline int
5025test_restrict (ccp restrict text)
5026{
5027 // See if C++-style comments work.
5028 // Iterate through items via the restricted pointer.
5029 // Also check for declarations in for loops.
5030 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
5031 continue;
5032 return 0;
5033}
5034
5035// Check varargs and va_copy.
5036static void
5037test_varargs (const char *format, ...)
5038{
5039 va_list args;
5040 va_start (args, format);
5041 va_list args_copy;
5042 va_copy (args_copy, args);
5043
5044 const char *str;
5045 int number;
5046 float fnumber;
5047
5048 while (*format)
5049 {
5050 switch (*format++)
5051 {
5052 case 's': // string
5053 str = va_arg (args_copy, const char *);
5054 break;
5055 case 'd': // int
5056 number = va_arg (args_copy, int);
5057 break;
5058 case 'f': // float
5059 fnumber = va_arg (args_copy, double);
5060 break;
5061 default:
5062 break;
5063 }
5064 }
5065 va_end (args_copy);
5066 va_end (args);
5067}
5068
5069int
5070main ()
5071{
5072
5073 // Check bool.
5074 _Bool success = false;
5075
5076 // Check restrict.
5077 if (test_restrict ("String literal") == 0)
5078 success = true;
5079 char *restrict newvar = "Another string";
5080
5081 // Check varargs.
5082 test_varargs ("s, d' f .", "string", 65, 34.234);
5083 test_varargs_macros ();
5084
5085 // Check flexible array members.
5086 struct incomplete_array *ia =
5087 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
5088 ia->datasize = 10;
5089 for (int i = 0; i < ia->datasize; ++i)
5090 ia->data[i] = i * 1.234;
5091
5092 // Check named initializers.
5093 struct named_init ni = {
5094 .number = 34,
5095 .name = L"Test wide string",
5096 .average = 543.34343,
5097 };
5098
5099 ni.number = 58;
5100
5101 int dynamic_array[ni.number];
5102 dynamic_array[ni.number - 1] = 543;
5103
5104 // work around unused variable warnings
5105 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
5106 || dynamic_array[ni.number - 1] != 543);
5107
5108 ;
5109 return 0;
5110}
5111_ACEOF
5112for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
5113do
5114 CC="$ac_save_CC $ac_arg"
5115 if ac_fn_c_try_compile "$LINENO"; then :
5116 ac_cv_prog_cc_c99=$ac_arg
5117fi
5118rm -f core conftest.err conftest.$ac_objext
5119 test "x$ac_cv_prog_cc_c99" != "xno" && break
5120done
5121rm -f conftest.$ac_ext
5122CC=$ac_save_CC
5123
5124fi
5125# AC_CACHE_VAL
5126case "x$ac_cv_prog_cc_c99" in
5127 x)
5128 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5129$as_echo "none needed" >&6; } ;;
5130 xno)
5131 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5132$as_echo "unsupported" >&6; } ;;
5133 *)
5134 CC="$CC $ac_cv_prog_cc_c99"
5135 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
5136$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
5137esac
5138if test "x$ac_cv_prog_cc_c99" != xno; then :
5139 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
5140else
5141 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
5142$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
5143if ${ac_cv_prog_cc_c89+:} false; then :
5144 $as_echo_n "(cached) " >&6
5145else
5146 ac_cv_prog_cc_c89=no
5147ac_save_CC=$CC
5148cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5149/* end confdefs.h. */
5150#include <stdarg.h>
5151#include <stdio.h>
5152#include <sys/types.h>
5153#include <sys/stat.h>
5154/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
5155struct buf { int x; };
5156FILE * (*rcsopen) (struct buf *, struct stat *, int);
5157static char *e (p, i)
5158 char **p;
5159 int i;
5160{
5161 return p[i];
5162}
5163static char *f (char * (*g) (char **, int), char **p, ...)
5164{
5165 char *s;
5166 va_list v;
5167 va_start (v,p);
5168 s = g (p, va_arg (v,int));
5169 va_end (v);
5170 return s;
5171}
5172
5173/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
5174 function prototypes and stuff, but not '\xHH' hex character constants.
5175 These don't provoke an error unfortunately, instead are silently treated
5176 as 'x'. The following induces an error, until -std is added to get
5177 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
5178 array size at least. It's necessary to write '\x00'==0 to get something
5179 that's true only with -std. */
5180int osf4_cc_array ['\x00' == 0 ? 1 : -1];
5181
5182/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
5183 inside strings and character constants. */
5184#define FOO(x) 'x'
5185int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
5186
5187int test (int i, double x);
5188struct s1 {int (*f) (int a);};
5189struct s2 {int (*f) (double a);};
5190int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
5191int argc;
5192char **argv;
5193int
5194main ()
5195{
5196return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
5197 ;
5198 return 0;
5199}
5200_ACEOF
5201for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
5202 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
5203do
5204 CC="$ac_save_CC $ac_arg"
5205 if ac_fn_c_try_compile "$LINENO"; then :
5206 ac_cv_prog_cc_c89=$ac_arg
5207fi
5208rm -f core conftest.err conftest.$ac_objext
5209 test "x$ac_cv_prog_cc_c89" != "xno" && break
5210done
5211rm -f conftest.$ac_ext
5212CC=$ac_save_CC
5213
5214fi
5215# AC_CACHE_VAL
5216case "x$ac_cv_prog_cc_c89" in
5217 x)
5218 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5219$as_echo "none needed" >&6; } ;;
5220 xno)
5221 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5222$as_echo "unsupported" >&6; } ;;
5223 *)
5224 CC="$CC $ac_cv_prog_cc_c89"
5225 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5226$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5227esac
5228if test "x$ac_cv_prog_cc_c89" != xno; then :
5229 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5230else
5231 ac_cv_prog_cc_stdc=no
5232fi
5233
5234fi
5235 ;;
5236esac
5237 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
5238$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
5239 if ${ac_cv_prog_cc_stdc+:} false; then :
5240 $as_echo_n "(cached) " >&6
5241fi
5242
5243 case $ac_cv_prog_cc_stdc in #(
5244 no) :
5245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5246$as_echo "unsupported" >&6; } ;; #(
5247 '') :
5248 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5249$as_echo "none needed" >&6; } ;; #(
5250 *) :
5251 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
5252$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
5253esac
5254
5255ac_ext=c
5256ac_cpp='$CPP $CPPFLAGS'
5257ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5258ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5259ac_compiler_gnu=$ac_cv_c_compiler_gnu
5260{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5261$as_echo_n "checking how to run the C preprocessor... " >&6; }
5262# On Suns, sometimes $CPP names a directory.
5263if test -n "$CPP" && test -d "$CPP"; then
5264 CPP=
5265fi
5266if test -z "$CPP"; then
5267 if ${ac_cv_prog_CPP+:} false; then :
5268 $as_echo_n "(cached) " >&6
5269else
5270 # Double quotes because CPP needs to be expanded
5271 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5272 do
5273 ac_preproc_ok=false
5274for ac_c_preproc_warn_flag in '' yes
5275do
5276 # Use a header file that comes with gcc, so configuring glibc
5277 # with a fresh cross-compiler works.
5278 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5279 # <limits.h> exists even on freestanding compilers.
5280 # On the NeXT, cc -E runs the code through the compiler's parser,
5281 # not just through cpp. "Syntax error" is here to catch this case.
5282 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5283/* end confdefs.h. */
5284#ifdef __STDC__
5285# include <limits.h>
5286#else
5287# include <assert.h>
5288#endif
5289 Syntax error
5290_ACEOF
5291if ac_fn_c_try_cpp "$LINENO"; then :
5292
5293else
5294 # Broken: fails on valid input.
5295continue
5296fi
5297rm -f conftest.err conftest.i conftest.$ac_ext
5298
5299 # OK, works on sane cases. Now check whether nonexistent headers
5300 # can be detected and how.
5301 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5302/* end confdefs.h. */
5303#include <ac_nonexistent.h>
5304_ACEOF
5305if ac_fn_c_try_cpp "$LINENO"; then :
5306 # Broken: success on invalid input.
5307continue
5308else
5309 # Passes both tests.
5310ac_preproc_ok=:
5311break
5312fi
5313rm -f conftest.err conftest.i conftest.$ac_ext
5314
5315done
5316# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5317rm -f conftest.i conftest.err conftest.$ac_ext
5318if $ac_preproc_ok; then :
5319 break
5320fi
5321
5322 done
5323 ac_cv_prog_CPP=$CPP
5324
5325fi
5326 CPP=$ac_cv_prog_CPP
5327else
5328 ac_cv_prog_CPP=$CPP
5329fi
5330{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5331$as_echo "$CPP" >&6; }
5332ac_preproc_ok=false
5333for ac_c_preproc_warn_flag in '' yes
5334do
5335 # Use a header file that comes with gcc, so configuring glibc
5336 # with a fresh cross-compiler works.
5337 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5338 # <limits.h> exists even on freestanding compilers.
5339 # On the NeXT, cc -E runs the code through the compiler's parser,
5340 # not just through cpp. "Syntax error" is here to catch this case.
5341 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5342/* end confdefs.h. */
5343#ifdef __STDC__
5344# include <limits.h>
5345#else
5346# include <assert.h>
5347#endif
5348 Syntax error
5349_ACEOF
5350if ac_fn_c_try_cpp "$LINENO"; then :
5351
5352else
5353 # Broken: fails on valid input.
5354continue
5355fi
5356rm -f conftest.err conftest.i conftest.$ac_ext
5357
5358 # OK, works on sane cases. Now check whether nonexistent headers
5359 # can be detected and how.
5360 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5361/* end confdefs.h. */
5362#include <ac_nonexistent.h>
5363_ACEOF
5364if ac_fn_c_try_cpp "$LINENO"; then :
5365 # Broken: success on invalid input.
5366continue
5367else
5368 # Passes both tests.
5369ac_preproc_ok=:
5370break
5371fi
5372rm -f conftest.err conftest.i conftest.$ac_ext
5373
5374done
5375# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5376rm -f conftest.i conftest.err conftest.$ac_ext
5377if $ac_preproc_ok; then :
5378
5379else
5380 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5381$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5382as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5383See \`config.log' for more details" "$LINENO" 5; }
5384fi
5385
5386ac_ext=c
5387ac_cpp='$CPP $CPPFLAGS'
5388ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5389ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5390ac_compiler_gnu=$ac_cv_c_compiler_gnu
5391
5392
5393{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
5394$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
5395set x ${MAKE-make}
5396ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
5397if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
5398 $as_echo_n "(cached) " >&6
5399else
5400 cat >conftest.make <<\_ACEOF
5401SHELL = /bin/sh
5402all:
5403 @echo '@@@%%%=$(MAKE)=@@@%%%'
5404_ACEOF
5405# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
5406case `${MAKE-make} -f conftest.make 2>/dev/null` in
5407 *@@@%%%=?*=@@@%%%*)
5408 eval ac_cv_prog_make_${ac_make}_set=yes;;
5409 *)
5410 eval ac_cv_prog_make_${ac_make}_set=no;;
5411esac
5412rm -f conftest.make
5413fi
5414if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
5415 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5416$as_echo "yes" >&6; }
5417 SET_MAKE=
5418else
5419 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5420$as_echo "no" >&6; }
5421 SET_MAKE="MAKE=${MAKE-make}"
5422fi
5423
5424{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
5425$as_echo_n "checking whether ln -s works... " >&6; }
5426LN_S=$as_ln_s
5427if test "$LN_S" = "ln -s"; then
5428 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5429$as_echo "yes" >&6; }
5430else
5431 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
5432$as_echo "no, using $LN_S" >&6; }
5433fi
5434
5435
5436# Check if LD supports linker scripts,
5437# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.
5438# Check whether --enable-ld-version-script was given.
5439if test "${enable_ld_version_script+set}" = set; then :
5440 enableval=$enable_ld_version_script; have_ld_version_script=$enableval
5441fi
5442
5443if test -z "$have_ld_version_script"; then
5444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5
5445$as_echo_n "checking if LD -Wl,--version-script works... " >&6; }
5446 save_LDFLAGS="$LDFLAGS"
5447 LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5448 cat > conftest.map <<EOF
5449VERS_1 {
5450 global: sym;
5451};
5452
5453VERS_2 {
5454 global: sym;
5455} VERS_1;
5456EOF
5457 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5458/* end confdefs.h. */
5459
5460int
5461main ()
5462{
5463
5464 ;
5465 return 0;
5466}
5467_ACEOF
5468if ac_fn_c_try_link "$LINENO"; then :
5469 have_ld_version_script=yes
5470else
5471 have_ld_version_script=no
5472fi
5473rm -f core conftest.err conftest.$ac_objext \
5474 conftest$ac_exeext conftest.$ac_ext
5475 rm -f conftest.map
5476 LDFLAGS="$save_LDFLAGS"
5477 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5
5478$as_echo "$have_ld_version_script" >&6; }
5479fi
5480 if test "$have_ld_version_script" = "yes"; then
5481 HAVE_LD_VERSION_SCRIPT_TRUE=
5482 HAVE_LD_VERSION_SCRIPT_FALSE='#'
5483else
5484 HAVE_LD_VERSION_SCRIPT_TRUE='#'
5485 HAVE_LD_VERSION_SCRIPT_FALSE=
5486fi
5487
5488
5489# See if compiler supports prototypes.
5490{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5
5491$as_echo_n "checking for function prototypes... " >&6; }
5492if ${ijg_cv_have_prototypes+:} false; then :
5493 $as_echo_n "(cached) " >&6
5494else
5495 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5496/* end confdefs.h. */
5497
5498int testfunction (int arg1, int * arg2); /* check prototypes */
5499struct methods_struct { /* check method-pointer declarations */
5500 int (*error_exit) (char *msgtext);
5501 int (*trace_message) (char *msgtext);
5502 int (*another_method) (void);
5503};
5504int testfunction (int arg1, int * arg2) /* check definitions */
5505{ return arg2[arg1]; }
5506int test2function (void) /* check void arg list */
5507{ return 0; }
5508
5509_ACEOF
5510if ac_fn_c_try_compile "$LINENO"; then :
5511 ijg_cv_have_prototypes=yes
5512else
5513 ijg_cv_have_prototypes=no
5514fi
5515rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5516fi
5517
5518{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_cv_have_prototypes" >&5
5519$as_echo "$ijg_cv_have_prototypes" >&6; }
5520if test $ijg_cv_have_prototypes = yes; then
5521
5522$as_echo "#define HAVE_PROTOTYPES 1" >>confdefs.h
5523
5524else
5525 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your compiler does not seem to know about function prototypes.
5526 Perhaps it needs a special switch to enable ANSI C mode.
5527 If so, we recommend running configure like this:
5528 ./configure CC='cc -switch'
5529 where -switch is the proper switch." >&5
5530$as_echo "$as_me: WARNING: Your compiler does not seem to know about function prototypes.
5531 Perhaps it needs a special switch to enable ANSI C mode.
5532 If so, we recommend running configure like this:
5533 ./configure CC='cc -switch'
5534 where -switch is the proper switch." >&2;}
5535fi
5536
5537# Check header files
5538for ac_header in stddef.h stdlib.h locale.h
5539do :
5540 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5541ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
5542if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5543 cat >>confdefs.h <<_ACEOF
5544#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5545_ACEOF
5546
5547fi
5548
5549done
5550
5551ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
5552if test "x$ac_cv_header_string_h" = xyes; then :
5553
5554else
5555
5556$as_echo "#define NEED_BSD_STRINGS 1" >>confdefs.h
5557
5558fi
5559
5560
5561
5562# See whether type size_t is defined in any ANSI-standard places;
5563# if not, perhaps it is defined in <sys/types.h>.
5564{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5
5565$as_echo_n "checking for size_t... " >&6; }
5566cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5567/* end confdefs.h. */
5568
5569#ifdef HAVE_STDDEF_H
5570#include <stddef.h>
5571#endif
5572#ifdef HAVE_STDLIB_H
5573#include <stdlib.h>
5574#endif
5575#include <stdio.h>
5576#ifdef NEED_BSD_STRINGS
5577#include <strings.h>
5578#else
5579#include <string.h>
5580#endif
5581typedef size_t my_size_t;
5582
5583int
5584main ()
5585{
5586 my_size_t foovar;
5587 ;
5588 return 0;
5589}
5590_ACEOF
5591if ac_fn_c_try_compile "$LINENO"; then :
5592 ijg_size_t_ok=yes
5593else
5594 ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"
5595fi
5596rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5597{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok" >&5
5598$as_echo "$ijg_size_t_ok" >&6; }
5599if test "$ijg_size_t_ok" != yes; then
5600 ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
5601if test "x$ac_cv_header_sys_types_h" = xyes; then :
5602
5603$as_echo "#define NEED_SYS_TYPES_H 1" >>confdefs.h
5604
5605 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5606/* end confdefs.h. */
5607#include <sys/types.h>
5608_ACEOF
5609if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5610 $EGREP "size_t" >/dev/null 2>&1; then :
5611 ijg_size_t_ok="size_t is in sys/types.h"
5612else
5613 ijg_size_t_ok=no
5614fi
5615rm -f conftest*
5616
5617else
5618 ijg_size_t_ok=no
5619fi
5620
5621
5622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok" >&5
5623$as_echo "$ijg_size_t_ok" >&6; }
5624 if test "$ijg_size_t_ok" = no; then
5625 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Type size_t is not defined in any of the usual places.
5626 Try putting '\"typedef unsigned int size_t;\"' in jconfig.h." >&5
5627$as_echo "$as_me: WARNING: Type size_t is not defined in any of the usual places.
5628 Try putting '\"typedef unsigned int size_t;\"' in jconfig.h." >&2;}
5629 fi
5630fi
5631
5632# Check compiler characteristics
5633{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type unsigned char" >&5
5634$as_echo_n "checking for type unsigned char... " >&6; }
5635cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5636/* end confdefs.h. */
5637
5638int
5639main ()
5640{
5641 unsigned char un_char;
5642 ;
5643 return 0;
5644}
5645_ACEOF
5646if ac_fn_c_try_compile "$LINENO"; then :
5647 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5648$as_echo "yes" >&6; }
5649
5650$as_echo "#define HAVE_UNSIGNED_CHAR 1" >>confdefs.h
5651
5652else
5653 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5654$as_echo "no" >&6; }
5655fi
5656rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5657
5658{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type unsigned short" >&5
5659$as_echo_n "checking for type unsigned short... " >&6; }
5660cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5661/* end confdefs.h. */
5662
5663int
5664main ()
5665{
5666 unsigned short un_short;
5667 ;
5668 return 0;
5669}
5670_ACEOF
5671if ac_fn_c_try_compile "$LINENO"; then :
5672 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5673$as_echo "yes" >&6; }
5674
5675$as_echo "#define HAVE_UNSIGNED_SHORT 1" >>confdefs.h
5676
5677else
5678 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5679$as_echo "no" >&6; }
5680fi
5681rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5682
5683{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type void" >&5
5684$as_echo_n "checking for type void... " >&6; }
5685cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5686/* end confdefs.h. */
5687
5688/* Caution: a C++ compiler will insist on valid prototypes */
5689typedef void * void_ptr; /* check void * */
5690#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */
5691typedef void (*void_func) (int a, int b);
5692#else
5693typedef void (*void_func) ();
5694#endif
5695
5696#ifdef HAVE_PROTOTYPES /* check void function result */
5697void test3function (void_ptr arg1, void_func arg2)
5698#else
5699void test3function (arg1, arg2)
5700 void_ptr arg1;
5701 void_func arg2;
5702#endif
5703{
5704 char * locptr = (char *) arg1; /* check casting to and from void * */
5705 arg1 = (void *) locptr;
5706 (*arg2) (1, 2); /* check call of fcn returning void */
5707}
5708
5709int
5710main ()
5711{
5712
5713 ;
5714 return 0;
5715}
5716_ACEOF
5717if ac_fn_c_try_compile "$LINENO"; then :
5718 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5719$as_echo "yes" >&6; }
5720else
5721 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5722$as_echo "no" >&6; }
5723
5724$as_echo "#define void char" >>confdefs.h
5725
5726fi
5727rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5728{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
5729$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
5730if ${ac_cv_c_const+:} false; then :
5731 $as_echo_n "(cached) " >&6
5732else
5733 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5734/* end confdefs.h. */
5735
5736int
5737main ()
5738{
5739/* FIXME: Include the comments suggested by Paul. */
5740#ifndef __cplusplus
5741 /* Ultrix mips cc rejects this. */
5742 typedef int charset[2];
5743 const charset cs;
5744 /* SunOS 4.1.1 cc rejects this. */
5745 char const *const *pcpcc;
5746 char **ppc;
5747 /* NEC SVR4.0.2 mips cc rejects this. */
5748 struct point {int x, y;};
5749 static struct point const zero = {0,0};
5750 /* AIX XL C 1.02.0.0 rejects this.
5751 It does not let you subtract one const X* pointer from another in
5752 an arm of an if-expression whose if-part is not a constant
5753 expression */
5754 const char *g = "string";
5755 pcpcc = &g + (g ? g-g : 0);
5756 /* HPUX 7.0 cc rejects these. */
5757 ++pcpcc;
5758 ppc = (char**) pcpcc;
5759 pcpcc = (char const *const *) ppc;
5760 { /* SCO 3.2v4 cc rejects this. */
5761 char *t;
5762 char const *s = 0 ? (char *) 0 : (char const *) 0;
5763
5764 *t++ = 0;
5765 if (s) return 0;
5766 }
5767 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
5768 int x[] = {25, 17};
5769 const int *foo = &x[0];
5770 ++foo;
5771 }
5772 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5773 typedef const int *iptr;
5774 iptr p = 0;
5775 ++p;
5776 }
5777 { /* AIX XL C 1.02.0.0 rejects this saying
5778 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5779 struct s { int j; const int *ap[3]; };
5780 struct s *b; b->j = 5;
5781 }
5782 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5783 const int foo = 10;
5784 if (!foo) return 0;
5785 }
5786 return !cs[0] && !zero.x;
5787#endif
5788
5789 ;
5790 return 0;
5791}
5792_ACEOF
5793if ac_fn_c_try_compile "$LINENO"; then :
5794 ac_cv_c_const=yes
5795else
5796 ac_cv_c_const=no
5797fi
5798rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5799fi
5800{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
5801$as_echo "$ac_cv_c_const" >&6; }
5802if test $ac_cv_c_const = no; then
5803
5804$as_echo "#define const /**/" >>confdefs.h
5805
5806fi
5807
5808
5809# Check for non-broken inline under various spellings
5810{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
5811$as_echo_n "checking for inline... " >&6; }
5812ijg_cv_inline=""
5813cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5814/* end confdefs.h. */
5815
5816int
5817main ()
5818{
5819} __inline__ int foo() { return 0; }
5820int bar() { return foo();
5821 ;
5822 return 0;
5823}
5824_ACEOF
5825if ac_fn_c_try_compile "$LINENO"; then :
5826 ijg_cv_inline="__inline__"
5827else
5828 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5829/* end confdefs.h. */
5830
5831int
5832main ()
5833{
5834} __inline int foo() { return 0; }
5835int bar() { return foo();
5836 ;
5837 return 0;
5838}
5839_ACEOF
5840if ac_fn_c_try_compile "$LINENO"; then :
5841 ijg_cv_inline="__inline"
5842else
5843 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5844/* end confdefs.h. */
5845
5846int
5847main ()
5848{
5849} inline int foo() { return 0; }
5850int bar() { return foo();
5851 ;
5852 return 0;
5853}
5854_ACEOF
5855if ac_fn_c_try_compile "$LINENO"; then :
5856 ijg_cv_inline="inline"
5857fi
5858rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5859fi
5860rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5861fi
5862rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5863{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_cv_inline" >&5
5864$as_echo "$ijg_cv_inline" >&6; }
5865
5866cat >>confdefs.h <<_ACEOF
5867#define INLINE $ijg_cv_inline
5868_ACEOF
5869
5870
5871# We cannot check for bogus warnings, but at least we can check for errors
5872{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken incomplete types" >&5
5873$as_echo_n "checking for broken incomplete types... " >&6; }
5874cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5875/* end confdefs.h. */
5876 typedef struct undefined_structure * undef_struct_ptr;
5877int
5878main ()
5879{
5880
5881 ;
5882 return 0;
5883}
5884_ACEOF
5885if ac_fn_c_try_compile "$LINENO"; then :
5886 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
5887$as_echo "ok" >&6; }
5888else
5889 { $as_echo "$as_me:${as_lineno-$LINENO}: result: broken" >&5
5890$as_echo "broken" >&6; }
5891
5892$as_echo "#define INCOMPLETE_TYPES_BROKEN 1" >>confdefs.h
5893
5894fi
5895rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5896
5897# Test whether global names are unique to at least 15 chars
5898{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for short external names" >&5
5899$as_echo_n "checking for short external names... " >&6; }
5900cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5901/* end confdefs.h. */
5902
5903int possibly_duplicate_function () { return 0; }
5904int possibly_dupli_function () { return 1; }
5905
5906int
5907main ()
5908{
5909
5910 ;
5911 return 0;
5912}
5913_ACEOF
5914if ac_fn_c_try_link "$LINENO"; then :
5915 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
5916$as_echo "ok" >&6; }
5917else
5918 { $as_echo "$as_me:${as_lineno-$LINENO}: result: short" >&5
5919$as_echo "short" >&6; }
5920
5921$as_echo "#define NEED_SHORT_EXTERNAL_NAMES 1" >>confdefs.h
5922
5923fi
5924rm -f core conftest.err conftest.$ac_objext \
5925 conftest$ac_exeext conftest.$ac_ext
5926
5927# Run-time checks
5928{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if char is signed" >&5
5929$as_echo_n "checking to see if char is signed... " >&6; }
5930if test "$cross_compiling" = yes; then :
5931 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Assuming that char is signed on target machine.
5932 If it is unsigned, this will be a little bit inefficient." >&5
5933$as_echo "$as_me: WARNING: Assuming that char is signed on target machine.
5934 If it is unsigned, this will be a little bit inefficient." >&2;}
5935
5936else
5937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5938/* end confdefs.h. */
5939
5940#ifdef HAVE_PROTOTYPES
5941int is_char_signed (int arg)
5942#else
5943int is_char_signed (arg)
5944 int arg;
5945#endif
5946{
5947 if (arg == 189) { /* expected result for unsigned char */
5948 return 0; /* type char is unsigned */
5949 }
5950 else if (arg != -67) { /* expected result for signed char */
5951 printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
5952 printf("I fear the JPEG software will not work at all.\n\n");
5953 }
5954 return 1; /* assume char is signed otherwise */
5955}
5956char signed_char_check = (char) (-67);
5957int main() {
5958 exit(is_char_signed((int) signed_char_check));
5959}
5960_ACEOF
5961if ac_fn_c_try_run "$LINENO"; then :
5962 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5963$as_echo "no" >&6; }
5964
5965$as_echo "#define CHAR_IS_UNSIGNED 1" >>confdefs.h
5966
5967else
5968 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5969$as_echo "yes" >&6; }
5970fi
5971rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5972 conftest.$ac_objext conftest.beam conftest.$ac_ext
5973fi
5974
5975
5976{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if right shift is signed" >&5
5977$as_echo_n "checking to see if right shift is signed... " >&6; }
5978if test "$cross_compiling" = yes; then :
5979 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Assuming that right shift is signed on target machine." >&5
5980$as_echo "Assuming that right shift is signed on target machine." >&6; }
5981else
5982 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5983/* end confdefs.h. */
5984
5985#ifdef HAVE_PROTOTYPES
5986int is_shifting_signed (long arg)
5987#else
5988int is_shifting_signed (arg)
5989 long arg;
5990#endif
5991/* See whether right-shift on a long is signed or not. */
5992{
5993 long res = arg >> 4;
5994
5995 if (res == -0x7F7E80CL) { /* expected result for signed shift */
5996 return 1; /* right shift is signed */
5997 }
5998 /* see if unsigned-shift hack will fix it. */
5999 /* we can't just test exact value since it depends on width of long... */
6000 res |= (~0L) << (32-4);
6001 if (res == -0x7F7E80CL) { /* expected result now? */
6002 return 0; /* right shift is unsigned */
6003 }
6004 printf("Right shift isn't acting as I expect it to.\n");
6005 printf("I fear the JPEG software will not work at all.\n\n");
6006 return 0; /* try it with unsigned anyway */
6007}
6008int main() {
6009 exit(is_shifting_signed(-0x7F7E80B1L));
6010}
6011_ACEOF
6012if ac_fn_c_try_run "$LINENO"; then :
6013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6014$as_echo "no" >&6; }
6015
6016$as_echo "#define RIGHT_SHIFT_IS_UNSIGNED 1" >>confdefs.h
6017
6018else
6019 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6020$as_echo "yes" >&6; }
6021fi
6022rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6023 conftest.$ac_objext conftest.beam conftest.$ac_ext
6024fi
6025
6026
6027{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if fopen accepts b spec" >&5
6028$as_echo_n "checking to see if fopen accepts b spec... " >&6; }
6029if test "$cross_compiling" = yes; then :
6030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Assuming that it does." >&5
6031$as_echo "Assuming that it does." >&6; }
6032else
6033 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6034/* end confdefs.h. */
6035
6036#include <stdio.h>
6037int main() {
6038 if (fopen("conftestdata", "wb") != NULL)
6039 exit(0);
6040 exit(1);
6041}
6042_ACEOF
6043if ac_fn_c_try_run "$LINENO"; then :
6044 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6045$as_echo "yes" >&6; }
6046else
6047 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6048$as_echo "no" >&6; }
6049
6050$as_echo "#define DONT_USE_B_MODE 1" >>confdefs.h
6051
6052fi
6053rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6054 conftest.$ac_objext conftest.beam conftest.$ac_ext
6055fi
6056
6057
6058# Configure libtool
6059enable_win32_dll=yes
6060
6061case $host in
6062*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
6063 if test -n "$ac_tool_prefix"; then
6064 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
6065set dummy ${ac_tool_prefix}as; ac_word=$2
6066{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6067$as_echo_n "checking for $ac_word... " >&6; }
6068if ${ac_cv_prog_AS+:} false; then :
6069 $as_echo_n "(cached) " >&6
6070else
6071 if test -n "$AS"; then
6072 ac_cv_prog_AS="$AS" # Let the user override the test.
6073else
6074as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6075for as_dir in $PATH
6076do
6077 IFS=$as_save_IFS
6078 test -z "$as_dir" && as_dir=.
6079 for ac_exec_ext in '' $ac_executable_extensions; do
6080 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6081 ac_cv_prog_AS="${ac_tool_prefix}as"
6082 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6083 break 2
6084 fi
6085done
6086 done
6087IFS=$as_save_IFS
6088
6089fi
6090fi
6091AS=$ac_cv_prog_AS
6092if test -n "$AS"; then
6093 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
6094$as_echo "$AS" >&6; }
6095else
6096 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6097$as_echo "no" >&6; }
6098fi
6099
6100
6101fi
6102if test -z "$ac_cv_prog_AS"; then
6103 ac_ct_AS=$AS
6104 # Extract the first word of "as", so it can be a program name with args.
6105set dummy as; ac_word=$2
6106{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6107$as_echo_n "checking for $ac_word... " >&6; }
6108if ${ac_cv_prog_ac_ct_AS+:} false; then :
6109 $as_echo_n "(cached) " >&6
6110else
6111 if test -n "$ac_ct_AS"; then
6112 ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
6113else
6114as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6115for as_dir in $PATH
6116do
6117 IFS=$as_save_IFS
6118 test -z "$as_dir" && as_dir=.
6119 for ac_exec_ext in '' $ac_executable_extensions; do
6120 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6121 ac_cv_prog_ac_ct_AS="as"
6122 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6123 break 2
6124 fi
6125done
6126 done
6127IFS=$as_save_IFS
6128
6129fi
6130fi
6131ac_ct_AS=$ac_cv_prog_ac_ct_AS
6132if test -n "$ac_ct_AS"; then
6133 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
6134$as_echo "$ac_ct_AS" >&6; }
6135else
6136 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6137$as_echo "no" >&6; }
6138fi
6139
6140 if test "x$ac_ct_AS" = x; then
6141 AS="false"
6142 else
6143 case $cross_compiling:$ac_tool_warned in
6144yes:)
6145{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6146$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6147ac_tool_warned=yes ;;
6148esac
6149 AS=$ac_ct_AS
6150 fi
6151else
6152 AS="$ac_cv_prog_AS"
6153fi
6154
6155 if test -n "$ac_tool_prefix"; then
6156 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
6157set dummy ${ac_tool_prefix}dlltool; ac_word=$2
6158{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6159$as_echo_n "checking for $ac_word... " >&6; }
6160if ${ac_cv_prog_DLLTOOL+:} false; then :
6161 $as_echo_n "(cached) " >&6
6162else
6163 if test -n "$DLLTOOL"; then
6164 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
6165else
6166as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6167for as_dir in $PATH
6168do
6169 IFS=$as_save_IFS
6170 test -z "$as_dir" && as_dir=.
6171 for ac_exec_ext in '' $ac_executable_extensions; do
6172 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6173 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6174 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6175 break 2
6176 fi
6177done
6178 done
6179IFS=$as_save_IFS
6180
6181fi
6182fi
6183DLLTOOL=$ac_cv_prog_DLLTOOL
6184if test -n "$DLLTOOL"; then
6185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
6186$as_echo "$DLLTOOL" >&6; }
6187else
6188 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6189$as_echo "no" >&6; }
6190fi
6191
6192
6193fi
6194if test -z "$ac_cv_prog_DLLTOOL"; then
6195 ac_ct_DLLTOOL=$DLLTOOL
6196 # Extract the first word of "dlltool", so it can be a program name with args.
6197set dummy dlltool; ac_word=$2
6198{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6199$as_echo_n "checking for $ac_word... " >&6; }
6200if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
6201 $as_echo_n "(cached) " >&6
6202else
6203 if test -n "$ac_ct_DLLTOOL"; then
6204 ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
6205else
6206as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6207for as_dir in $PATH
6208do
6209 IFS=$as_save_IFS
6210 test -z "$as_dir" && as_dir=.
6211 for ac_exec_ext in '' $ac_executable_extensions; do
6212 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6213 ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6214 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6215 break 2
6216 fi
6217done
6218 done
6219IFS=$as_save_IFS
6220
6221fi
6222fi
6223ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
6224if test -n "$ac_ct_DLLTOOL"; then
6225 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
6226$as_echo "$ac_ct_DLLTOOL" >&6; }
6227else
6228 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6229$as_echo "no" >&6; }
6230fi
6231
6232 if test "x$ac_ct_DLLTOOL" = x; then
6233 DLLTOOL="false"
6234 else
6235 case $cross_compiling:$ac_tool_warned in
6236yes:)
6237{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6238$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6239ac_tool_warned=yes ;;
6240esac
6241 DLLTOOL=$ac_ct_DLLTOOL
6242 fi
6243else
6244 DLLTOOL="$ac_cv_prog_DLLTOOL"
6245fi
6246
6247 if test -n "$ac_tool_prefix"; then
6248 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
6249set dummy ${ac_tool_prefix}objdump; ac_word=$2
6250{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6251$as_echo_n "checking for $ac_word... " >&6; }
6252if ${ac_cv_prog_OBJDUMP+:} false; then :
6253 $as_echo_n "(cached) " >&6
6254else
6255 if test -n "$OBJDUMP"; then
6256 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
6257else
6258as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6259for as_dir in $PATH
6260do
6261 IFS=$as_save_IFS
6262 test -z "$as_dir" && as_dir=.
6263 for ac_exec_ext in '' $ac_executable_extensions; do
6264 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6265 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
6266 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6267 break 2
6268 fi
6269done
6270 done
6271IFS=$as_save_IFS
6272
6273fi
6274fi
6275OBJDUMP=$ac_cv_prog_OBJDUMP
6276if test -n "$OBJDUMP"; then
6277 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
6278$as_echo "$OBJDUMP" >&6; }
6279else
6280 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6281$as_echo "no" >&6; }
6282fi
6283
6284
6285fi
6286if test -z "$ac_cv_prog_OBJDUMP"; then
6287 ac_ct_OBJDUMP=$OBJDUMP
6288 # Extract the first word of "objdump", so it can be a program name with args.
6289set dummy objdump; ac_word=$2
6290{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6291$as_echo_n "checking for $ac_word... " >&6; }
6292if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
6293 $as_echo_n "(cached) " >&6
6294else
6295 if test -n "$ac_ct_OBJDUMP"; then
6296 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
6297else
6298as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6299for as_dir in $PATH
6300do
6301 IFS=$as_save_IFS
6302 test -z "$as_dir" && as_dir=.
6303 for ac_exec_ext in '' $ac_executable_extensions; do
6304 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6305 ac_cv_prog_ac_ct_OBJDUMP="objdump"
6306 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6307 break 2
6308 fi
6309done
6310 done
6311IFS=$as_save_IFS
6312
6313fi
6314fi
6315ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
6316if test -n "$ac_ct_OBJDUMP"; then
6317 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
6318$as_echo "$ac_ct_OBJDUMP" >&6; }
6319else
6320 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6321$as_echo "no" >&6; }
6322fi
6323
6324 if test "x$ac_ct_OBJDUMP" = x; then
6325 OBJDUMP="false"
6326 else
6327 case $cross_compiling:$ac_tool_warned in
6328yes:)
6329{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6330$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6331ac_tool_warned=yes ;;
6332esac
6333 OBJDUMP=$ac_ct_OBJDUMP
6334 fi
6335else
6336 OBJDUMP="$ac_cv_prog_OBJDUMP"
6337fi
6338
6339 ;;
6340esac
6341
6342test -z "$AS" && AS=as
6343
6344
6345
6346
6347
6348test -z "$DLLTOOL" && DLLTOOL=dlltool
6349
6350
6351
6352
6353
6354test -z "$OBJDUMP" && OBJDUMP=objdump
6355
6356
6357
6358
6359
6360
6361
6362case `pwd` in
6363 *\ * | *\ *)
6364 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
6365$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
6366esac
6367
6368
6369
6370macro_version='2.4.2'
6371macro_revision='1.3337'
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385ltmain="$ac_aux_dir/ltmain.sh"
6386
6387# Backslashify metacharacters that are still active within
6388# double-quoted strings.
6389sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
6390
6391# Same as above, but do not quote variable references.
6392double_quote_subst='s/\(["`\\]\)/\\\1/g'
6393
6394# Sed substitution to delay expansion of an escaped shell variable in a
6395# double_quote_subst'ed string.
6396delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
6397
6398# Sed substitution to delay expansion of an escaped single quote.
6399delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
6400
6401# Sed substitution to avoid accidental globbing in evaled expressions
6402no_glob_subst='s/\*/\\\*/g'
6403
6404ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
6405ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
6406ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
6407
6408{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
6409$as_echo_n "checking how to print strings... " >&6; }
6410# Test print first, because it will be a builtin if present.
6411if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
6412 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
6413 ECHO='print -r --'
6414elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
6415 ECHO='printf %s\n'
6416else
6417 # Use this function as a fallback that always works.
6418 func_fallback_echo ()
6419 {
6420 eval 'cat <<_LTECHO_EOF
6421$1
6422_LTECHO_EOF'
6423 }
6424 ECHO='func_fallback_echo'
6425fi
6426
6427# func_echo_all arg...
6428# Invoke $ECHO with all args, space-separated.
6429func_echo_all ()
6430{
6431 $ECHO ""
6432}
6433
6434case "$ECHO" in
6435 printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
6436$as_echo "printf" >&6; } ;;
6437 print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
6438$as_echo "print -r" >&6; } ;;
6439 *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
6440$as_echo "cat" >&6; } ;;
6441esac
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
6457$as_echo_n "checking for a sed that does not truncate output... " >&6; }
6458if ${ac_cv_path_SED+:} false; then :
6459 $as_echo_n "(cached) " >&6
6460else
6461 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
6462 for ac_i in 1 2 3 4 5 6 7; do
6463 ac_script="$ac_script$as_nl$ac_script"
6464 done
6465 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
6466 { ac_script=; unset ac_script;}
6467 if test -z "$SED"; then
6468 ac_path_SED_found=false
6469 # Loop through the user's path and test for each of PROGNAME-LIST
6470 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6471for as_dir in $PATH
6472do
6473 IFS=$as_save_IFS
6474 test -z "$as_dir" && as_dir=.
6475 for ac_prog in sed gsed; do
6476 for ac_exec_ext in '' $ac_executable_extensions; do
6477 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
6478 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
6479# Check for GNU ac_path_SED and select it if it is found.
6480 # Check for GNU $ac_path_SED
6481case `"$ac_path_SED" --version 2>&1` in
6482*GNU*)
6483 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
6484*)
6485 ac_count=0
6486 $as_echo_n 0123456789 >"conftest.in"
6487 while :
6488 do
6489 cat "conftest.in" "conftest.in" >"conftest.tmp"
6490 mv "conftest.tmp" "conftest.in"
6491 cp "conftest.in" "conftest.nl"
6492 $as_echo '' >> "conftest.nl"
6493 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
6494 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6495 as_fn_arith $ac_count + 1 && ac_count=$as_val
6496 if test $ac_count -gt ${ac_path_SED_max-0}; then
6497 # Best one so far, save it but keep looking for a better one
6498 ac_cv_path_SED="$ac_path_SED"
6499 ac_path_SED_max=$ac_count
6500 fi
6501 # 10*(2^10) chars as input seems more than enough
6502 test $ac_count -gt 10 && break
6503 done
6504 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6505esac
6506
6507 $ac_path_SED_found && break 3
6508 done
6509 done
6510 done
6511IFS=$as_save_IFS
6512 if test -z "$ac_cv_path_SED"; then
6513 as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
6514 fi
6515else
6516 ac_cv_path_SED=$SED
6517fi
6518
6519fi
6520{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
6521$as_echo "$ac_cv_path_SED" >&6; }
6522 SED="$ac_cv_path_SED"
6523 rm -f conftest.sed
6524
6525test -z "$SED" && SED=sed
6526Xsed="$SED -e 1s/^X//"
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
6539$as_echo_n "checking for fgrep... " >&6; }
6540if ${ac_cv_path_FGREP+:} false; then :
6541 $as_echo_n "(cached) " >&6
6542else
6543 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
6544 then ac_cv_path_FGREP="$GREP -F"
6545 else
6546 if test -z "$FGREP"; then
6547 ac_path_FGREP_found=false
6548 # Loop through the user's path and test for each of PROGNAME-LIST
6549 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6550for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6551do
6552 IFS=$as_save_IFS
6553 test -z "$as_dir" && as_dir=.
6554 for ac_prog in fgrep; do
6555 for ac_exec_ext in '' $ac_executable_extensions; do
6556 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
6557 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
6558# Check for GNU ac_path_FGREP and select it if it is found.
6559 # Check for GNU $ac_path_FGREP
6560case `"$ac_path_FGREP" --version 2>&1` in
6561*GNU*)
6562 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
6563*)
6564 ac_count=0
6565 $as_echo_n 0123456789 >"conftest.in"
6566 while :
6567 do
6568 cat "conftest.in" "conftest.in" >"conftest.tmp"
6569 mv "conftest.tmp" "conftest.in"
6570 cp "conftest.in" "conftest.nl"
6571 $as_echo 'FGREP' >> "conftest.nl"
6572 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
6573 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6574 as_fn_arith $ac_count + 1 && ac_count=$as_val
6575 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
6576 # Best one so far, save it but keep looking for a better one
6577 ac_cv_path_FGREP="$ac_path_FGREP"
6578 ac_path_FGREP_max=$ac_count
6579 fi
6580 # 10*(2^10) chars as input seems more than enough
6581 test $ac_count -gt 10 && break
6582 done
6583 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6584esac
6585
6586 $ac_path_FGREP_found && break 3
6587 done
6588 done
6589 done
6590IFS=$as_save_IFS
6591 if test -z "$ac_cv_path_FGREP"; then
6592 as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6593 fi
6594else
6595 ac_cv_path_FGREP=$FGREP
6596fi
6597
6598 fi
6599fi
6600{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
6601$as_echo "$ac_cv_path_FGREP" >&6; }
6602 FGREP="$ac_cv_path_FGREP"
6603
6604
6605test -z "$GREP" && GREP=grep
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625# Check whether --with-gnu-ld was given.
6626if test "${with_gnu_ld+set}" = set; then :
6627 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
6628else
6629 with_gnu_ld=no
6630fi
6631
6632ac_prog=ld
6633if test "$GCC" = yes; then
6634 # Check if gcc -print-prog-name=ld gives a path.
6635 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
6636$as_echo_n "checking for ld used by $CC... " >&6; }
6637 case $host in
6638 *-*-mingw*)
6639 # gcc leaves a trailing carriage return which upsets mingw
6640 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6641 *)
6642 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6643 esac
6644 case $ac_prog in
6645 # Accept absolute paths.
6646 [\\/]* | ?:[\\/]*)
6647 re_direlt='/[^/][^/]*/\.\./'
6648 # Canonicalize the pathname of ld
6649 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
6650 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
6651 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
6652 done
6653 test -z "$LD" && LD="$ac_prog"
6654 ;;
6655 "")
6656 # If it fails, then pretend we aren't using GCC.
6657 ac_prog=ld
6658 ;;
6659 *)
6660 # If it is relative, then search for the first ld in PATH.
6661 with_gnu_ld=unknown
6662 ;;
6663 esac
6664elif test "$with_gnu_ld" = yes; then
6665 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
6666$as_echo_n "checking for GNU ld... " >&6; }
6667else
6668 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
6669$as_echo_n "checking for non-GNU ld... " >&6; }
6670fi
6671if ${lt_cv_path_LD+:} false; then :
6672 $as_echo_n "(cached) " >&6
6673else
6674 if test -z "$LD"; then
6675 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
6676 for ac_dir in $PATH; do
6677 IFS="$lt_save_ifs"
6678 test -z "$ac_dir" && ac_dir=.
6679 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6680 lt_cv_path_LD="$ac_dir/$ac_prog"
6681 # Check to see if the program is GNU ld. I'd rather use --version,
6682 # but apparently some variants of GNU ld only accept -v.
6683 # Break only if it was the GNU/non-GNU ld that we prefer.
6684 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
6685 *GNU* | *'with BFD'*)
6686 test "$with_gnu_ld" != no && break
6687 ;;
6688 *)
6689 test "$with_gnu_ld" != yes && break
6690 ;;
6691 esac
6692 fi
6693 done
6694 IFS="$lt_save_ifs"
6695else
6696 lt_cv_path_LD="$LD" # Let the user override the test with a path.
6697fi
6698fi
6699
6700LD="$lt_cv_path_LD"
6701if test -n "$LD"; then
6702 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
6703$as_echo "$LD" >&6; }
6704else
6705 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6706$as_echo "no" >&6; }
6707fi
6708test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
6709{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
6710$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
6711if ${lt_cv_prog_gnu_ld+:} false; then :
6712 $as_echo_n "(cached) " >&6
6713else
6714 # I'd rather use --version here, but apparently some GNU lds only accept -v.
6715case `$LD -v 2>&1 </dev/null` in
6716*GNU* | *'with BFD'*)
6717 lt_cv_prog_gnu_ld=yes
6718 ;;
6719*)
6720 lt_cv_prog_gnu_ld=no
6721 ;;
6722esac
6723fi
6724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
6725$as_echo "$lt_cv_prog_gnu_ld" >&6; }
6726with_gnu_ld=$lt_cv_prog_gnu_ld
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
6737$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
6738if ${lt_cv_path_NM+:} false; then :
6739 $as_echo_n "(cached) " >&6
6740else
6741 if test -n "$NM"; then
6742 # Let the user override the test.
6743 lt_cv_path_NM="$NM"
6744else
6745 lt_nm_to_check="${ac_tool_prefix}nm"
6746 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
6747 lt_nm_to_check="$lt_nm_to_check nm"
6748 fi
6749 for lt_tmp_nm in $lt_nm_to_check; do
6750 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
6751 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
6752 IFS="$lt_save_ifs"
6753 test -z "$ac_dir" && ac_dir=.
6754 tmp_nm="$ac_dir/$lt_tmp_nm"
6755 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
6756 # Check to see if the nm accepts a BSD-compat flag.
6757 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
6758 # nm: unknown option "B" ignored
6759 # Tru64's nm complains that /dev/null is an invalid object file
6760 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
6761 */dev/null* | *'Invalid file or object type'*)
6762 lt_cv_path_NM="$tmp_nm -B"
6763 break
6764 ;;
6765 *)
6766 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
6767 */dev/null*)
6768 lt_cv_path_NM="$tmp_nm -p"
6769 break
6770 ;;
6771 *)
6772 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
6773 continue # so that we can try to find one that supports BSD flags
6774 ;;
6775 esac
6776 ;;
6777 esac
6778 fi
6779 done
6780 IFS="$lt_save_ifs"
6781 done
6782 : ${lt_cv_path_NM=no}
6783fi
6784fi
6785{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
6786$as_echo "$lt_cv_path_NM" >&6; }
6787if test "$lt_cv_path_NM" != "no"; then
6788 NM="$lt_cv_path_NM"
6789else
6790 # Didn't find any BSD compatible name lister, look for dumpbin.
6791 if test -n "$DUMPBIN"; then :
6792 # Let the user override the test.
6793 else
6794 if test -n "$ac_tool_prefix"; then
6795 for ac_prog in dumpbin "link -dump"
6796 do
6797 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6798set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6799{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6800$as_echo_n "checking for $ac_word... " >&6; }
6801if ${ac_cv_prog_DUMPBIN+:} false; then :
6802 $as_echo_n "(cached) " >&6
6803else
6804 if test -n "$DUMPBIN"; then
6805 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
6806else
6807as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6808for as_dir in $PATH
6809do
6810 IFS=$as_save_IFS
6811 test -z "$as_dir" && as_dir=.
6812 for ac_exec_ext in '' $ac_executable_extensions; do
6813 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6814 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
6815 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6816 break 2
6817 fi
6818done
6819 done
6820IFS=$as_save_IFS
6821
6822fi
6823fi
6824DUMPBIN=$ac_cv_prog_DUMPBIN
6825if test -n "$DUMPBIN"; then
6826 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
6827$as_echo "$DUMPBIN" >&6; }
6828else
6829 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6830$as_echo "no" >&6; }
6831fi
6832
6833
6834 test -n "$DUMPBIN" && break
6835 done
6836fi
6837if test -z "$DUMPBIN"; then
6838 ac_ct_DUMPBIN=$DUMPBIN
6839 for ac_prog in dumpbin "link -dump"
6840do
6841 # Extract the first word of "$ac_prog", so it can be a program name with args.
6842set dummy $ac_prog; ac_word=$2
6843{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6844$as_echo_n "checking for $ac_word... " >&6; }
6845if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
6846 $as_echo_n "(cached) " >&6
6847else
6848 if test -n "$ac_ct_DUMPBIN"; then
6849 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
6850else
6851as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6852for as_dir in $PATH
6853do
6854 IFS=$as_save_IFS
6855 test -z "$as_dir" && as_dir=.
6856 for ac_exec_ext in '' $ac_executable_extensions; do
6857 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6858 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
6859 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6860 break 2
6861 fi
6862done
6863 done
6864IFS=$as_save_IFS
6865
6866fi
6867fi
6868ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
6869if test -n "$ac_ct_DUMPBIN"; then
6870 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
6871$as_echo "$ac_ct_DUMPBIN" >&6; }
6872else
6873 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6874$as_echo "no" >&6; }
6875fi
6876
6877
6878 test -n "$ac_ct_DUMPBIN" && break
6879done
6880
6881 if test "x$ac_ct_DUMPBIN" = x; then
6882 DUMPBIN=":"
6883 else
6884 case $cross_compiling:$ac_tool_warned in
6885yes:)
6886{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6887$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6888ac_tool_warned=yes ;;
6889esac
6890 DUMPBIN=$ac_ct_DUMPBIN
6891 fi
6892fi
6893
6894 case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
6895 *COFF*)
6896 DUMPBIN="$DUMPBIN -symbols"
6897 ;;
6898 *)
6899 DUMPBIN=:
6900 ;;
6901 esac
6902 fi
6903
6904 if test "$DUMPBIN" != ":"; then
6905 NM="$DUMPBIN"
6906 fi
6907fi
6908test -z "$NM" && NM=nm
6909
6910
6911
6912
6913
6914
6915{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
6916$as_echo_n "checking the name lister ($NM) interface... " >&6; }
6917if ${lt_cv_nm_interface+:} false; then :
6918 $as_echo_n "(cached) " >&6
6919else
6920 lt_cv_nm_interface="BSD nm"
6921 echo "int some_variable = 0;" > conftest.$ac_ext
6922 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
6923 (eval "$ac_compile" 2>conftest.err)
6924 cat conftest.err >&5
6925 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
6926 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
6927 cat conftest.err >&5
6928 (eval echo "\"\$as_me:$LINENO: output\"" >&5)
6929 cat conftest.out >&5
6930 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
6931 lt_cv_nm_interface="MS dumpbin"
6932 fi
6933 rm -f conftest*
6934fi
6935{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
6936$as_echo "$lt_cv_nm_interface" >&6; }
6937
6938# find the maximum length of command line arguments
6939{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
6940$as_echo_n "checking the maximum length of command line arguments... " >&6; }
6941if ${lt_cv_sys_max_cmd_len+:} false; then :
6942 $as_echo_n "(cached) " >&6
6943else
6944 i=0
6945 teststring="ABCD"
6946
6947 case $build_os in
6948 msdosdjgpp*)
6949 # On DJGPP, this test can blow up pretty badly due to problems in libc
6950 # (any single argument exceeding 2000 bytes causes a buffer overrun
6951 # during glob expansion). Even if it were fixed, the result of this
6952 # check would be larger than it should be.
6953 lt_cv_sys_max_cmd_len=12288; # 12K is about right
6954 ;;
6955
6956 gnu*)
6957 # Under GNU Hurd, this test is not required because there is
6958 # no limit to the length of command line arguments.
6959 # Libtool will interpret -1 as no limit whatsoever
6960 lt_cv_sys_max_cmd_len=-1;
6961 ;;
6962
6963 cygwin* | mingw* | cegcc*)
6964 # On Win9x/ME, this test blows up -- it succeeds, but takes
6965 # about 5 minutes as the teststring grows exponentially.
6966 # Worse, since 9x/ME are not pre-emptively multitasking,
6967 # you end up with a "frozen" computer, even though with patience
6968 # the test eventually succeeds (with a max line length of 256k).
6969 # Instead, let's just punt: use the minimum linelength reported by
6970 # all of the supported platforms: 8192 (on NT/2K/XP).
6971 lt_cv_sys_max_cmd_len=8192;
6972 ;;
6973
6974 mint*)
6975 # On MiNT this can take a long time and run out of memory.
6976 lt_cv_sys_max_cmd_len=8192;
6977 ;;
6978
6979 amigaos*)
6980 # On AmigaOS with pdksh, this test takes hours, literally.
6981 # So we just punt and use a minimum line length of 8192.
6982 lt_cv_sys_max_cmd_len=8192;
6983 ;;
6984
6985 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
6986 # This has been around since 386BSD, at least. Likely further.
6987 if test -x /sbin/sysctl; then
6988 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
6989 elif test -x /usr/sbin/sysctl; then
6990 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
6991 else
6992 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
6993 fi
6994 # And add a safety zone
6995 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
6996 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
6997 ;;
6998
6999 interix*)
7000 # We know the value 262144 and hardcode it with a safety zone (like BSD)
7001 lt_cv_sys_max_cmd_len=196608
7002 ;;
7003
7004 os2*)
7005 # The test takes a long time on OS/2.
7006 lt_cv_sys_max_cmd_len=8192
7007 ;;
7008
7009 osf*)
7010 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
7011 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
7012 # nice to cause kernel panics so lets avoid the loop below.
7013 # First set a reasonable default.
7014 lt_cv_sys_max_cmd_len=16384
7015 #
7016 if test -x /sbin/sysconfig; then
7017 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
7018 *1*) lt_cv_sys_max_cmd_len=-1 ;;
7019 esac
7020 fi
7021 ;;
7022 sco3.2v5*)
7023 lt_cv_sys_max_cmd_len=102400
7024 ;;
7025 sysv5* | sco5v6* | sysv4.2uw2*)
7026 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
7027 if test -n "$kargmax"; then
7028 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
7029 else
7030 lt_cv_sys_max_cmd_len=32768
7031 fi
7032 ;;
7033 *)
7034 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
7035 if test -n "$lt_cv_sys_max_cmd_len"; then
7036 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
7037 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
7038 else
7039 # Make teststring a little bigger before we do anything with it.
7040 # a 1K string should be a reasonable start.
7041 for i in 1 2 3 4 5 6 7 8 ; do
7042 teststring=$teststring$teststring
7043 done
7044 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
7045 # If test is not a shell built-in, we'll probably end up computing a
7046 # maximum length that is only half of the actual maximum length, but
7047 # we can't tell.
7048 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
7049 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
7050 test $i != 17 # 1/2 MB should be enough
7051 do
7052 i=`expr $i + 1`
7053 teststring=$teststring$teststring
7054 done
7055 # Only check the string length outside the loop.
7056 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
7057 teststring=
7058 # Add a significant safety factor because C++ compilers can tack on
7059 # massive amounts of additional arguments before passing them to the
7060 # linker. It appears as though 1/2 is a usable value.
7061 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
7062 fi
7063 ;;
7064 esac
7065
7066fi
7067
7068if test -n $lt_cv_sys_max_cmd_len ; then
7069 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
7070$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
7071else
7072 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
7073$as_echo "none" >&6; }
7074fi
7075max_cmd_len=$lt_cv_sys_max_cmd_len
7076
7077
7078
7079
7080
7081
7082: ${CP="cp -f"}
7083: ${MV="mv -f"}
7084: ${RM="rm -f"}
7085
7086{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
7087$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
7088# Try some XSI features
7089xsi_shell=no
7090( _lt_dummy="a/b/c"
7091 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7092 = c,a/b,b/c, \
7093 && eval 'test $(( 1 + 1 )) -eq 2 \
7094 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7095 && xsi_shell=yes
7096{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
7097$as_echo "$xsi_shell" >&6; }
7098
7099
7100{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
7101$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
7102lt_shell_append=no
7103( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
7104 >/dev/null 2>&1 \
7105 && lt_shell_append=yes
7106{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
7107$as_echo "$lt_shell_append" >&6; }
7108
7109
7110if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7111 lt_unset=unset
7112else
7113 lt_unset=false
7114fi
7115
7116
7117
7118
7119
7120# test EBCDIC or ASCII
7121case `echo X|tr X '\101'` in
7122 A) # ASCII based system
7123 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7124 lt_SP2NL='tr \040 \012'
7125 lt_NL2SP='tr \015\012 \040\040'
7126 ;;
7127 *) # EBCDIC based system
7128 lt_SP2NL='tr \100 \n'
7129 lt_NL2SP='tr \r\n \100\100'
7130 ;;
7131esac
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
7142$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
7143if ${lt_cv_to_host_file_cmd+:} false; then :
7144 $as_echo_n "(cached) " >&6
7145else
7146 case $host in
7147 *-*-mingw* )
7148 case $build in
7149 *-*-mingw* ) # actually msys
7150 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7151 ;;
7152 *-*-cygwin* )
7153 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7154 ;;
7155 * ) # otherwise, assume *nix
7156 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7157 ;;
7158 esac
7159 ;;
7160 *-*-cygwin* )
7161 case $build in
7162 *-*-mingw* ) # actually msys
7163 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7164 ;;
7165 *-*-cygwin* )
7166 lt_cv_to_host_file_cmd=func_convert_file_noop
7167 ;;
7168 * ) # otherwise, assume *nix
7169 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7170 ;;
7171 esac
7172 ;;
7173 * ) # unhandled hosts (and "normal" native builds)
7174 lt_cv_to_host_file_cmd=func_convert_file_noop
7175 ;;
7176esac
7177
7178fi
7179
7180to_host_file_cmd=$lt_cv_to_host_file_cmd
7181{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
7182$as_echo "$lt_cv_to_host_file_cmd" >&6; }
7183
7184
7185
7186
7187
7188{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
7189$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
7190if ${lt_cv_to_tool_file_cmd+:} false; then :
7191 $as_echo_n "(cached) " >&6
7192else
7193 #assume ordinary cross tools, or native build.
7194lt_cv_to_tool_file_cmd=func_convert_file_noop
7195case $host in
7196 *-*-mingw* )
7197 case $build in
7198 *-*-mingw* ) # actually msys
7199 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7200 ;;
7201 esac
7202 ;;
7203esac
7204
7205fi
7206
7207to_tool_file_cmd=$lt_cv_to_tool_file_cmd
7208{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
7209$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
7210
7211
7212
7213
7214
7215{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
7216$as_echo_n "checking for $LD option to reload object files... " >&6; }
7217if ${lt_cv_ld_reload_flag+:} false; then :
7218 $as_echo_n "(cached) " >&6
7219else
7220 lt_cv_ld_reload_flag='-r'
7221fi
7222{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
7223$as_echo "$lt_cv_ld_reload_flag" >&6; }
7224reload_flag=$lt_cv_ld_reload_flag
7225case $reload_flag in
7226"" | " "*) ;;
7227*) reload_flag=" $reload_flag" ;;
7228esac
7229reload_cmds='$LD$reload_flag -o $output$reload_objs'
7230case $host_os in
7231 cygwin* | mingw* | pw32* | cegcc*)
7232 if test "$GCC" != yes; then
7233 reload_cmds=false
7234 fi
7235 ;;
7236 darwin*)
7237 if test "$GCC" = yes; then
7238 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
7239 else
7240 reload_cmds='$LD$reload_flag -o $output$reload_objs'
7241 fi
7242 ;;
7243esac
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253if test -n "$ac_tool_prefix"; then
7254 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
7255set dummy ${ac_tool_prefix}objdump; ac_word=$2
7256{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7257$as_echo_n "checking for $ac_word... " >&6; }
7258if ${ac_cv_prog_OBJDUMP+:} false; then :
7259 $as_echo_n "(cached) " >&6
7260else
7261 if test -n "$OBJDUMP"; then
7262 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
7263else
7264as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7265for as_dir in $PATH
7266do
7267 IFS=$as_save_IFS
7268 test -z "$as_dir" && as_dir=.
7269 for ac_exec_ext in '' $ac_executable_extensions; do
7270 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7271 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
7272 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7273 break 2
7274 fi
7275done
7276 done
7277IFS=$as_save_IFS
7278
7279fi
7280fi
7281OBJDUMP=$ac_cv_prog_OBJDUMP
7282if test -n "$OBJDUMP"; then
7283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
7284$as_echo "$OBJDUMP" >&6; }
7285else
7286 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7287$as_echo "no" >&6; }
7288fi
7289
7290
7291fi
7292if test -z "$ac_cv_prog_OBJDUMP"; then
7293 ac_ct_OBJDUMP=$OBJDUMP
7294 # Extract the first word of "objdump", so it can be a program name with args.
7295set dummy objdump; ac_word=$2
7296{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7297$as_echo_n "checking for $ac_word... " >&6; }
7298if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
7299 $as_echo_n "(cached) " >&6
7300else
7301 if test -n "$ac_ct_OBJDUMP"; then
7302 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
7303else
7304as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7305for as_dir in $PATH
7306do
7307 IFS=$as_save_IFS
7308 test -z "$as_dir" && as_dir=.
7309 for ac_exec_ext in '' $ac_executable_extensions; do
7310 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7311 ac_cv_prog_ac_ct_OBJDUMP="objdump"
7312 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7313 break 2
7314 fi
7315done
7316 done
7317IFS=$as_save_IFS
7318
7319fi
7320fi
7321ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
7322if test -n "$ac_ct_OBJDUMP"; then
7323 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
7324$as_echo "$ac_ct_OBJDUMP" >&6; }
7325else
7326 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7327$as_echo "no" >&6; }
7328fi
7329
7330 if test "x$ac_ct_OBJDUMP" = x; then
7331 OBJDUMP="false"
7332 else
7333 case $cross_compiling:$ac_tool_warned in
7334yes:)
7335{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7336$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7337ac_tool_warned=yes ;;
7338esac
7339 OBJDUMP=$ac_ct_OBJDUMP
7340 fi
7341else
7342 OBJDUMP="$ac_cv_prog_OBJDUMP"
7343fi
7344
7345test -z "$OBJDUMP" && OBJDUMP=objdump
7346
7347
7348
7349
7350
7351
7352{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
7353$as_echo_n "checking how to recognize dependent libraries... " >&6; }
7354if ${lt_cv_deplibs_check_method+:} false; then :
7355 $as_echo_n "(cached) " >&6
7356else
7357 lt_cv_file_magic_cmd='$MAGIC_CMD'
7358lt_cv_file_magic_test_file=
7359lt_cv_deplibs_check_method='unknown'
7360# Need to set the preceding variable on all platforms that support
7361# interlibrary dependencies.
7362# 'none' -- dependencies not supported.
7363# `unknown' -- same as none, but documents that we really don't know.
7364# 'pass_all' -- all dependencies passed with no checks.
7365# 'test_compile' -- check by making test program.
7366# 'file_magic [[regex]]' -- check by looking for files in library path
7367# which responds to the $file_magic_cmd with a given extended regex.
7368# If you have `file' or equivalent on your system and you're not sure
7369# whether `pass_all' will *always* work, you probably want this one.
7370
7371case $host_os in
7372aix[4-9]*)
7373 lt_cv_deplibs_check_method=pass_all
7374 ;;
7375
7376beos*)
7377 lt_cv_deplibs_check_method=pass_all
7378 ;;
7379
7380bsdi[45]*)
7381 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
7382 lt_cv_file_magic_cmd='/usr/bin/file -L'
7383 lt_cv_file_magic_test_file=/shlib/libc.so
7384 ;;
7385
7386cygwin*)
7387 # func_win32_libid is a shell function defined in ltmain.sh
7388 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
7389 lt_cv_file_magic_cmd='func_win32_libid'
7390 ;;
7391
7392mingw* | pw32*)
7393 # Base MSYS/MinGW do not provide the 'file' command needed by
7394 # func_win32_libid shell function, so use a weaker test based on 'objdump',
7395 # unless we find 'file', for example because we are cross-compiling.
7396 # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
7397 if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
7398 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
7399 lt_cv_file_magic_cmd='func_win32_libid'
7400 else
7401 # Keep this pattern in sync with the one in func_win32_libid.
7402 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
7403 lt_cv_file_magic_cmd='$OBJDUMP -f'
7404 fi
7405 ;;
7406
7407cegcc*)
7408 # use the weaker test based on 'objdump'. See mingw*.
7409 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
7410 lt_cv_file_magic_cmd='$OBJDUMP -f'
7411 ;;
7412
7413darwin* | rhapsody*)
7414 lt_cv_deplibs_check_method=pass_all
7415 ;;
7416
7417freebsd* | dragonfly*)
7418 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
7419 case $host_cpu in
7420 i*86 )
7421 # Not sure whether the presence of OpenBSD here was a mistake.
7422 # Let's accept both of them until this is cleared up.
7423 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
7424 lt_cv_file_magic_cmd=/usr/bin/file
7425 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7426 ;;
7427 esac
7428 else
7429 lt_cv_deplibs_check_method=pass_all
7430 fi
7431 ;;
7432
7433gnu*)
7434 lt_cv_deplibs_check_method=pass_all
7435 ;;
7436
7437haiku*)
7438 lt_cv_deplibs_check_method=pass_all
7439 ;;
7440
7441hpux10.20* | hpux11*)
7442 lt_cv_file_magic_cmd=/usr/bin/file
7443 case $host_cpu in
7444 ia64*)
7445 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
7446 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
7447 ;;
7448 hppa*64*)
7449 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
7450 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
7451 ;;
7452 *)
7453 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
7454 lt_cv_file_magic_test_file=/usr/lib/libc.sl
7455 ;;
7456 esac
7457 ;;
7458
7459interix[3-9]*)
7460 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
7461 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
7462 ;;
7463
7464irix5* | irix6* | nonstopux*)
7465 case $LD in
7466 *-32|*"-32 ") libmagic=32-bit;;
7467 *-n32|*"-n32 ") libmagic=N32;;
7468 *-64|*"-64 ") libmagic=64-bit;;
7469 *) libmagic=never-match;;
7470 esac
7471 lt_cv_deplibs_check_method=pass_all
7472 ;;
7473
7474# This must be glibc/ELF.
7475linux* | k*bsd*-gnu | kopensolaris*-gnu)
7476 lt_cv_deplibs_check_method=pass_all
7477 ;;
7478
7479netbsd*)
7480 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
7481 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
7482 else
7483 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
7484 fi
7485 ;;
7486
7487newos6*)
7488 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
7489 lt_cv_file_magic_cmd=/usr/bin/file
7490 lt_cv_file_magic_test_file=/usr/lib/libnls.so
7491 ;;
7492
7493*nto* | *qnx*)
7494 lt_cv_deplibs_check_method=pass_all
7495 ;;
7496
7497openbsd*)
7498 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7499 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
7500 else
7501 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
7502 fi
7503 ;;
7504
7505osf3* | osf4* | osf5*)
7506 lt_cv_deplibs_check_method=pass_all
7507 ;;
7508
7509rdos*)
7510 lt_cv_deplibs_check_method=pass_all
7511 ;;
7512
7513solaris*)
7514 lt_cv_deplibs_check_method=pass_all
7515 ;;
7516
7517sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7518 lt_cv_deplibs_check_method=pass_all
7519 ;;
7520
7521sysv4 | sysv4.3*)
7522 case $host_vendor in
7523 motorola)
7524 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
7525 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7526 ;;
7527 ncr)
7528 lt_cv_deplibs_check_method=pass_all
7529 ;;
7530 sequent)
7531 lt_cv_file_magic_cmd='/bin/file'
7532 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
7533 ;;
7534 sni)
7535 lt_cv_file_magic_cmd='/bin/file'
7536 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
7537 lt_cv_file_magic_test_file=/lib/libc.so
7538 ;;
7539 siemens)
7540 lt_cv_deplibs_check_method=pass_all
7541 ;;
7542 pc)
7543 lt_cv_deplibs_check_method=pass_all
7544 ;;
7545 esac
7546 ;;
7547
7548tpf*)
7549 lt_cv_deplibs_check_method=pass_all
7550 ;;
7551esac
7552
7553fi
7554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
7555$as_echo "$lt_cv_deplibs_check_method" >&6; }
7556
7557file_magic_glob=
7558want_nocaseglob=no
7559if test "$build" = "$host"; then
7560 case $host_os in
7561 mingw* | pw32*)
7562 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
7563 want_nocaseglob=yes
7564 else
7565 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
7566 fi
7567 ;;
7568 esac
7569fi
7570
7571file_magic_cmd=$lt_cv_file_magic_cmd
7572deplibs_check_method=$lt_cv_deplibs_check_method
7573test -z "$deplibs_check_method" && deplibs_check_method=unknown
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596if test -n "$ac_tool_prefix"; then
7597 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
7598set dummy ${ac_tool_prefix}dlltool; ac_word=$2
7599{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7600$as_echo_n "checking for $ac_word... " >&6; }
7601if ${ac_cv_prog_DLLTOOL+:} false; then :
7602 $as_echo_n "(cached) " >&6
7603else
7604 if test -n "$DLLTOOL"; then
7605 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
7606else
7607as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7608for as_dir in $PATH
7609do
7610 IFS=$as_save_IFS
7611 test -z "$as_dir" && as_dir=.
7612 for ac_exec_ext in '' $ac_executable_extensions; do
7613 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7614 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
7615 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7616 break 2
7617 fi
7618done
7619 done
7620IFS=$as_save_IFS
7621
7622fi
7623fi
7624DLLTOOL=$ac_cv_prog_DLLTOOL
7625if test -n "$DLLTOOL"; then
7626 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
7627$as_echo "$DLLTOOL" >&6; }
7628else
7629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7630$as_echo "no" >&6; }
7631fi
7632
7633
7634fi
7635if test -z "$ac_cv_prog_DLLTOOL"; then
7636 ac_ct_DLLTOOL=$DLLTOOL
7637 # Extract the first word of "dlltool", so it can be a program name with args.
7638set dummy dlltool; ac_word=$2
7639{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7640$as_echo_n "checking for $ac_word... " >&6; }
7641if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
7642 $as_echo_n "(cached) " >&6
7643else
7644 if test -n "$ac_ct_DLLTOOL"; then
7645 ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
7646else
7647as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7648for as_dir in $PATH
7649do
7650 IFS=$as_save_IFS
7651 test -z "$as_dir" && as_dir=.
7652 for ac_exec_ext in '' $ac_executable_extensions; do
7653 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7654 ac_cv_prog_ac_ct_DLLTOOL="dlltool"
7655 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7656 break 2
7657 fi
7658done
7659 done
7660IFS=$as_save_IFS
7661
7662fi
7663fi
7664ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
7665if test -n "$ac_ct_DLLTOOL"; then
7666 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
7667$as_echo "$ac_ct_DLLTOOL" >&6; }
7668else
7669 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7670$as_echo "no" >&6; }
7671fi
7672
7673 if test "x$ac_ct_DLLTOOL" = x; then
7674 DLLTOOL="false"
7675 else
7676 case $cross_compiling:$ac_tool_warned in
7677yes:)
7678{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7679$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7680ac_tool_warned=yes ;;
7681esac
7682 DLLTOOL=$ac_ct_DLLTOOL
7683 fi
7684else
7685 DLLTOOL="$ac_cv_prog_DLLTOOL"
7686fi
7687
7688test -z "$DLLTOOL" && DLLTOOL=dlltool
7689
7690
7691
7692
7693
7694
7695
7696{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
7697$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
7698if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
7699 $as_echo_n "(cached) " >&6
7700else
7701 lt_cv_sharedlib_from_linklib_cmd='unknown'
7702
7703case $host_os in
7704cygwin* | mingw* | pw32* | cegcc*)
7705 # two different shell functions defined in ltmain.sh
7706 # decide which to use based on capabilities of $DLLTOOL
7707 case `$DLLTOOL --help 2>&1` in
7708 *--identify-strict*)
7709 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
7710 ;;
7711 *)
7712 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
7713 ;;
7714 esac
7715 ;;
7716*)
7717 # fallback: assume linklib IS sharedlib
7718 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
7719 ;;
7720esac
7721
7722fi
7723{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
7724$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
7725sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
7726test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
7727
7728
7729
7730
7731
7732
7733
7734if test -n "$ac_tool_prefix"; then
7735 for ac_prog in ar
7736 do
7737 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7738set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7739{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7740$as_echo_n "checking for $ac_word... " >&6; }
7741if ${ac_cv_prog_AR+:} false; then :
7742 $as_echo_n "(cached) " >&6
7743else
7744 if test -n "$AR"; then
7745 ac_cv_prog_AR="$AR" # Let the user override the test.
7746else
7747as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7748for as_dir in $PATH
7749do
7750 IFS=$as_save_IFS
7751 test -z "$as_dir" && as_dir=.
7752 for ac_exec_ext in '' $ac_executable_extensions; do
7753 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7754 ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
7755 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7756 break 2
7757 fi
7758done
7759 done
7760IFS=$as_save_IFS
7761
7762fi
7763fi
7764AR=$ac_cv_prog_AR
7765if test -n "$AR"; then
7766 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
7767$as_echo "$AR" >&6; }
7768else
7769 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7770$as_echo "no" >&6; }
7771fi
7772
7773
7774 test -n "$AR" && break
7775 done
7776fi
7777if test -z "$AR"; then
7778 ac_ct_AR=$AR
7779 for ac_prog in ar
7780do
7781 # Extract the first word of "$ac_prog", so it can be a program name with args.
7782set dummy $ac_prog; ac_word=$2
7783{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7784$as_echo_n "checking for $ac_word... " >&6; }
7785if ${ac_cv_prog_ac_ct_AR+:} false; then :
7786 $as_echo_n "(cached) " >&6
7787else
7788 if test -n "$ac_ct_AR"; then
7789 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
7790else
7791as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7792for as_dir in $PATH
7793do
7794 IFS=$as_save_IFS
7795 test -z "$as_dir" && as_dir=.
7796 for ac_exec_ext in '' $ac_executable_extensions; do
7797 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7798 ac_cv_prog_ac_ct_AR="$ac_prog"
7799 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7800 break 2
7801 fi
7802done
7803 done
7804IFS=$as_save_IFS
7805
7806fi
7807fi
7808ac_ct_AR=$ac_cv_prog_ac_ct_AR
7809if test -n "$ac_ct_AR"; then
7810 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
7811$as_echo "$ac_ct_AR" >&6; }
7812else
7813 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7814$as_echo "no" >&6; }
7815fi
7816
7817
7818 test -n "$ac_ct_AR" && break
7819done
7820
7821 if test "x$ac_ct_AR" = x; then
7822 AR="false"
7823 else
7824 case $cross_compiling:$ac_tool_warned in
7825yes:)
7826{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7827$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7828ac_tool_warned=yes ;;
7829esac
7830 AR=$ac_ct_AR
7831 fi
7832fi
7833
7834: ${AR=ar}
7835: ${AR_FLAGS=cru}
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
7848$as_echo_n "checking for archiver @FILE support... " >&6; }
7849if ${lt_cv_ar_at_file+:} false; then :
7850 $as_echo_n "(cached) " >&6
7851else
7852 lt_cv_ar_at_file=no
7853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7854/* end confdefs.h. */
7855
7856int
7857main ()
7858{
7859
7860 ;
7861 return 0;
7862}
7863_ACEOF
7864if ac_fn_c_try_compile "$LINENO"; then :
7865 echo conftest.$ac_objext > conftest.lst
7866 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
7867 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
7868 (eval $lt_ar_try) 2>&5
7869 ac_status=$?
7870 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7871 test $ac_status = 0; }
7872 if test "$ac_status" -eq 0; then
7873 # Ensure the archiver fails upon bogus file names.
7874 rm -f conftest.$ac_objext libconftest.a
7875 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
7876 (eval $lt_ar_try) 2>&5
7877 ac_status=$?
7878 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7879 test $ac_status = 0; }
7880 if test "$ac_status" -ne 0; then
7881 lt_cv_ar_at_file=@
7882 fi
7883 fi
7884 rm -f conftest.* libconftest.a
7885
7886fi
7887rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7888
7889fi
7890{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
7891$as_echo "$lt_cv_ar_at_file" >&6; }
7892
7893if test "x$lt_cv_ar_at_file" = xno; then
7894 archiver_list_spec=
7895else
7896 archiver_list_spec=$lt_cv_ar_at_file
7897fi
7898
7899
7900
7901
7902
7903
7904
7905if test -n "$ac_tool_prefix"; then
7906 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
7907set dummy ${ac_tool_prefix}strip; ac_word=$2
7908{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7909$as_echo_n "checking for $ac_word... " >&6; }
7910if ${ac_cv_prog_STRIP+:} false; then :
7911 $as_echo_n "(cached) " >&6
7912else
7913 if test -n "$STRIP"; then
7914 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
7915else
7916as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7917for as_dir in $PATH
7918do
7919 IFS=$as_save_IFS
7920 test -z "$as_dir" && as_dir=.
7921 for ac_exec_ext in '' $ac_executable_extensions; do
7922 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7923 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
7924 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7925 break 2
7926 fi
7927done
7928 done
7929IFS=$as_save_IFS
7930
7931fi
7932fi
7933STRIP=$ac_cv_prog_STRIP
7934if test -n "$STRIP"; then
7935 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
7936$as_echo "$STRIP" >&6; }
7937else
7938 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7939$as_echo "no" >&6; }
7940fi
7941
7942
7943fi
7944if test -z "$ac_cv_prog_STRIP"; then
7945 ac_ct_STRIP=$STRIP
7946 # Extract the first word of "strip", so it can be a program name with args.
7947set dummy strip; ac_word=$2
7948{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7949$as_echo_n "checking for $ac_word... " >&6; }
7950if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
7951 $as_echo_n "(cached) " >&6
7952else
7953 if test -n "$ac_ct_STRIP"; then
7954 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
7955else
7956as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7957for as_dir in $PATH
7958do
7959 IFS=$as_save_IFS
7960 test -z "$as_dir" && as_dir=.
7961 for ac_exec_ext in '' $ac_executable_extensions; do
7962 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
7963 ac_cv_prog_ac_ct_STRIP="strip"
7964 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7965 break 2
7966 fi
7967done
7968 done
7969IFS=$as_save_IFS
7970
7971fi
7972fi
7973ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
7974if test -n "$ac_ct_STRIP"; then
7975 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
7976$as_echo "$ac_ct_STRIP" >&6; }
7977else
7978 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7979$as_echo "no" >&6; }
7980fi
7981
7982 if test "x$ac_ct_STRIP" = x; then
7983 STRIP=":"
7984 else
7985 case $cross_compiling:$ac_tool_warned in
7986yes:)
7987{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7988$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7989ac_tool_warned=yes ;;
7990esac
7991 STRIP=$ac_ct_STRIP
7992 fi
7993else
7994 STRIP="$ac_cv_prog_STRIP"
7995fi
7996
7997test -z "$STRIP" && STRIP=:
7998
7999
8000
8001
8002
8003
8004if test -n "$ac_tool_prefix"; then
8005 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
8006set dummy ${ac_tool_prefix}ranlib; ac_word=$2
8007{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8008$as_echo_n "checking for $ac_word... " >&6; }
8009if ${ac_cv_prog_RANLIB+:} false; then :
8010 $as_echo_n "(cached) " >&6
8011else
8012 if test -n "$RANLIB"; then
8013 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
8014else
8015as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8016for as_dir in $PATH
8017do
8018 IFS=$as_save_IFS
8019 test -z "$as_dir" && as_dir=.
8020 for ac_exec_ext in '' $ac_executable_extensions; do
8021 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8022 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
8023 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8024 break 2
8025 fi
8026done
8027 done
8028IFS=$as_save_IFS
8029
8030fi
8031fi
8032RANLIB=$ac_cv_prog_RANLIB
8033if test -n "$RANLIB"; then
8034 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
8035$as_echo "$RANLIB" >&6; }
8036else
8037 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8038$as_echo "no" >&6; }
8039fi
8040
8041
8042fi
8043if test -z "$ac_cv_prog_RANLIB"; then
8044 ac_ct_RANLIB=$RANLIB
8045 # Extract the first word of "ranlib", so it can be a program name with args.
8046set dummy ranlib; ac_word=$2
8047{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8048$as_echo_n "checking for $ac_word... " >&6; }
8049if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
8050 $as_echo_n "(cached) " >&6
8051else
8052 if test -n "$ac_ct_RANLIB"; then
8053 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
8054else
8055as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8056for as_dir in $PATH
8057do
8058 IFS=$as_save_IFS
8059 test -z "$as_dir" && as_dir=.
8060 for ac_exec_ext in '' $ac_executable_extensions; do
8061 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8062 ac_cv_prog_ac_ct_RANLIB="ranlib"
8063 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8064 break 2
8065 fi
8066done
8067 done
8068IFS=$as_save_IFS
8069
8070fi
8071fi
8072ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
8073if test -n "$ac_ct_RANLIB"; then
8074 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
8075$as_echo "$ac_ct_RANLIB" >&6; }
8076else
8077 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8078$as_echo "no" >&6; }
8079fi
8080
8081 if test "x$ac_ct_RANLIB" = x; then
8082 RANLIB=":"
8083 else
8084 case $cross_compiling:$ac_tool_warned in
8085yes:)
8086{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8087$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8088ac_tool_warned=yes ;;
8089esac
8090 RANLIB=$ac_ct_RANLIB
8091 fi
8092else
8093 RANLIB="$ac_cv_prog_RANLIB"
8094fi
8095
8096test -z "$RANLIB" && RANLIB=:
8097
8098
8099
8100
8101
8102
8103# Determine commands to create old-style static archives.
8104old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
8105old_postinstall_cmds='chmod 644 $oldlib'
8106old_postuninstall_cmds=
8107
8108if test -n "$RANLIB"; then
8109 case $host_os in
8110 openbsd*)
8111 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
8112 ;;
8113 *)
8114 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
8115 ;;
8116 esac
8117 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
8118fi
8119
8120case $host_os in
8121 darwin*)
8122 lock_old_archive_extraction=yes ;;
8123 *)
8124 lock_old_archive_extraction=no ;;
8125esac
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165# If no C compiler was specified, use CC.
8166LTCC=${LTCC-"$CC"}
8167
8168# If no C compiler flags were specified, use CFLAGS.
8169LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
8170
8171# Allow CC to be a program name with arguments.
8172compiler=$CC
8173
8174
8175# Check for command to grab the raw symbol name followed by C symbol from nm.
8176{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
8177$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
8178if ${lt_cv_sys_global_symbol_pipe+:} false; then :
8179 $as_echo_n "(cached) " >&6
8180else
8181
8182# These are sane defaults that work on at least a few old systems.
8183# [They come from Ultrix. What could be older than Ultrix?!! ;)]
8184
8185# Character class describing NM global symbol codes.
8186symcode='[BCDEGRST]'
8187
8188# Regexp to match symbols that can be accessed directly from C.
8189sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
8190
8191# Define system-specific variables.
8192case $host_os in
8193aix*)
8194 symcode='[BCDT]'
8195 ;;
8196cygwin* | mingw* | pw32* | cegcc*)
8197 symcode='[ABCDGISTW]'
8198 ;;
8199hpux*)
8200 if test "$host_cpu" = ia64; then
8201 symcode='[ABCDEGRST]'
8202 fi
8203 ;;
8204irix* | nonstopux*)
8205 symcode='[BCDEGRST]'
8206 ;;
8207osf*)
8208 symcode='[BCDEGQRST]'
8209 ;;
8210solaris*)
8211 symcode='[BDRT]'
8212 ;;
8213sco3.2v5*)
8214 symcode='[DT]'
8215 ;;
8216sysv4.2uw2*)
8217 symcode='[DT]'
8218 ;;
8219sysv5* | sco5v6* | unixware* | OpenUNIX*)
8220 symcode='[ABDT]'
8221 ;;
8222sysv4)
8223 symcode='[DFNSTU]'
8224 ;;
8225esac
8226
8227# If we're using GNU nm, then use its standard symbol codes.
8228case `$NM -V 2>&1` in
8229*GNU* | *'with BFD'*)
8230 symcode='[ABCDGIRSTW]' ;;
8231esac
8232
8233# Transform an extracted symbol line into a proper C declaration.
8234# Some systems (esp. on ia64) link data and code symbols differently,
8235# so use this general approach.
8236lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
8237
8238# Transform an extracted symbol line into symbol name and symbol address
8239lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
8240lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
8241
8242# Handle CRLF in mingw tool chain
8243opt_cr=
8244case $build_os in
8245mingw*)
8246 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
8247 ;;
8248esac
8249
8250# Try without a prefix underscore, then with it.
8251for ac_symprfx in "" "_"; do
8252
8253 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
8254 symxfrm="\\1 $ac_symprfx\\2 \\2"
8255
8256 # Write the raw and C identifiers.
8257 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
8258 # Fake it for dumpbin and say T for any non-static function
8259 # and D for any global variable.
8260 # Also find C++ and __fastcall symbols from MSVC++,
8261 # which start with @ or ?.
8262 lt_cv_sys_global_symbol_pipe="$AWK '"\
8263" {last_section=section; section=\$ 3};"\
8264" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
8265" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
8266" \$ 0!~/External *\|/{next};"\
8267" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
8268" {if(hide[section]) next};"\
8269" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
8270" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
8271" s[1]~/^[@?]/{print s[1], s[1]; next};"\
8272" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
8273" ' prfx=^$ac_symprfx"
8274 else
8275 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
8276 fi
8277 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
8278
8279 # Check to see that the pipe works correctly.
8280 pipe_works=no
8281
8282 rm -f conftest*
8283 cat > conftest.$ac_ext <<_LT_EOF
8284#ifdef __cplusplus
8285extern "C" {
8286#endif
8287char nm_test_var;
8288void nm_test_func(void);
8289void nm_test_func(void){}
8290#ifdef __cplusplus
8291}
8292#endif
8293int main(){nm_test_var='a';nm_test_func();return(0);}
8294_LT_EOF
8295
8296 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
8297 (eval $ac_compile) 2>&5
8298 ac_status=$?
8299 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8300 test $ac_status = 0; }; then
8301 # Now try to grab the symbols.
8302 nlist=conftest.nm
8303 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
8304 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
8305 ac_status=$?
8306 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8307 test $ac_status = 0; } && test -s "$nlist"; then
8308 # Try sorting and uniquifying the output.
8309 if sort "$nlist" | uniq > "$nlist"T; then
8310 mv -f "$nlist"T "$nlist"
8311 else
8312 rm -f "$nlist"T
8313 fi
8314
8315 # Make sure that we snagged all the symbols we need.
8316 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
8317 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
8318 cat <<_LT_EOF > conftest.$ac_ext
8319/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
8320#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
8321/* DATA imports from DLLs on WIN32 con't be const, because runtime
8322 relocations are performed -- see ld's documentation on pseudo-relocs. */
8323# define LT_DLSYM_CONST
8324#elif defined(__osf__)
8325/* This system does not cope well with relocations in const data. */
8326# define LT_DLSYM_CONST
8327#else
8328# define LT_DLSYM_CONST const
8329#endif
8330
8331#ifdef __cplusplus
8332extern "C" {
8333#endif
8334
8335_LT_EOF
8336 # Now generate the symbol file.
8337 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
8338
8339 cat <<_LT_EOF >> conftest.$ac_ext
8340
8341/* The mapping between symbol names and symbols. */
8342LT_DLSYM_CONST struct {
8343 const char *name;
8344 void *address;
8345}
8346lt__PROGRAM__LTX_preloaded_symbols[] =
8347{
8348 { "@PROGRAM@", (void *) 0 },
8349_LT_EOF
8350 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
8351 cat <<\_LT_EOF >> conftest.$ac_ext
8352 {0, (void *) 0}
8353};
8354
8355/* This works around a problem in FreeBSD linker */
8356#ifdef FREEBSD_WORKAROUND
8357static const void *lt_preloaded_setup() {
8358 return lt__PROGRAM__LTX_preloaded_symbols;
8359}
8360#endif
8361
8362#ifdef __cplusplus
8363}
8364#endif
8365_LT_EOF
8366 # Now try linking the two files.
8367 mv conftest.$ac_objext conftstm.$ac_objext
8368 lt_globsym_save_LIBS=$LIBS
8369 lt_globsym_save_CFLAGS=$CFLAGS
8370 LIBS="conftstm.$ac_objext"
8371 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
8372 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
8373 (eval $ac_link) 2>&5
8374 ac_status=$?
8375 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8376 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
8377 pipe_works=yes
8378 fi
8379 LIBS=$lt_globsym_save_LIBS
8380 CFLAGS=$lt_globsym_save_CFLAGS
8381 else
8382 echo "cannot find nm_test_func in $nlist" >&5
8383 fi
8384 else
8385 echo "cannot find nm_test_var in $nlist" >&5
8386 fi
8387 else
8388 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
8389 fi
8390 else
8391 echo "$progname: failed program was:" >&5
8392 cat conftest.$ac_ext >&5
8393 fi
8394 rm -rf conftest* conftst*
8395
8396 # Do not use the global_symbol_pipe unless it works.
8397 if test "$pipe_works" = yes; then
8398 break
8399 else
8400 lt_cv_sys_global_symbol_pipe=
8401 fi
8402done
8403
8404fi
8405
8406if test -z "$lt_cv_sys_global_symbol_pipe"; then
8407 lt_cv_sys_global_symbol_to_cdecl=
8408fi
8409if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
8410 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
8411$as_echo "failed" >&6; }
8412else
8413 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
8414$as_echo "ok" >&6; }
8415fi
8416
8417# Response file support.
8418if test "$lt_cv_nm_interface" = "MS dumpbin"; then
8419 nm_file_list_spec='@'
8420elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
8421 nm_file_list_spec='@'
8422fi
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
8451$as_echo_n "checking for sysroot... " >&6; }
8452
8453# Check whether --with-sysroot was given.
8454if test "${with_sysroot+set}" = set; then :
8455 withval=$with_sysroot;
8456else
8457 with_sysroot=no
8458fi
8459
8460
8461lt_sysroot=
8462case ${with_sysroot} in #(
8463 yes)
8464 if test "$GCC" = yes; then
8465 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
8466 fi
8467 ;; #(
8468 /*)
8469 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
8470 ;; #(
8471 no|'')
8472 ;; #(
8473 *)
8474 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
8475$as_echo "${with_sysroot}" >&6; }
8476 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
8477 ;;
8478esac
8479
8480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
8481$as_echo "${lt_sysroot:-no}" >&6; }
8482
8483
8484
8485
8486
8487# Check whether --enable-libtool-lock was given.
8488if test "${enable_libtool_lock+set}" = set; then :
8489 enableval=$enable_libtool_lock;
8490fi
8491
8492test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
8493
8494# Some flags need to be propagated to the compiler or linker for good
8495# libtool support.
8496case $host in
8497ia64-*-hpux*)
8498 # Find out which ABI we are using.
8499 echo 'int i;' > conftest.$ac_ext
8500 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
8501 (eval $ac_compile) 2>&5
8502 ac_status=$?
8503 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8504 test $ac_status = 0; }; then
8505 case `/usr/bin/file conftest.$ac_objext` in
8506 *ELF-32*)
8507 HPUX_IA64_MODE="32"
8508 ;;
8509 *ELF-64*)
8510 HPUX_IA64_MODE="64"
8511 ;;
8512 esac
8513 fi
8514 rm -rf conftest*
8515 ;;
8516*-*-irix6*)
8517 # Find out which ABI we are using.
8518 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
8519 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
8520 (eval $ac_compile) 2>&5
8521 ac_status=$?
8522 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8523 test $ac_status = 0; }; then
8524 if test "$lt_cv_prog_gnu_ld" = yes; then
8525 case `/usr/bin/file conftest.$ac_objext` in
8526 *32-bit*)
8527 LD="${LD-ld} -melf32bsmip"
8528 ;;
8529 *N32*)
8530 LD="${LD-ld} -melf32bmipn32"
8531 ;;
8532 *64-bit*)
8533 LD="${LD-ld} -melf64bmip"
8534 ;;
8535 esac
8536 else
8537 case `/usr/bin/file conftest.$ac_objext` in
8538 *32-bit*)
8539 LD="${LD-ld} -32"
8540 ;;
8541 *N32*)
8542 LD="${LD-ld} -n32"
8543 ;;
8544 *64-bit*)
8545 LD="${LD-ld} -64"
8546 ;;
8547 esac
8548 fi
8549 fi
8550 rm -rf conftest*
8551 ;;
8552
8553x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
8554s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
8555 # Find out which ABI we are using.
8556 echo 'int i;' > conftest.$ac_ext
8557 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
8558 (eval $ac_compile) 2>&5
8559 ac_status=$?
8560 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8561 test $ac_status = 0; }; then
8562 case `/usr/bin/file conftest.o` in
8563 *32-bit*)
8564 case $host in
8565 x86_64-*kfreebsd*-gnu)
8566 LD="${LD-ld} -m elf_i386_fbsd"
8567 ;;
8568 x86_64-*linux*)
8569 LD="${LD-ld} -m elf_i386"
8570 ;;
8571 ppc64-*linux*|powerpc64-*linux*)
8572 LD="${LD-ld} -m elf32ppclinux"
8573 ;;
8574 s390x-*linux*)
8575 LD="${LD-ld} -m elf_s390"
8576 ;;
8577 sparc64-*linux*)
8578 LD="${LD-ld} -m elf32_sparc"
8579 ;;
8580 esac
8581 ;;
8582 *64-bit*)
8583 case $host in
8584 x86_64-*kfreebsd*-gnu)
8585 LD="${LD-ld} -m elf_x86_64_fbsd"
8586 ;;
8587 x86_64-*linux*)
8588 LD="${LD-ld} -m elf_x86_64"
8589 ;;
8590 ppc*-*linux*|powerpc*-*linux*)
8591 LD="${LD-ld} -m elf64ppc"
8592 ;;
8593 s390*-*linux*|s390*-*tpf*)
8594 LD="${LD-ld} -m elf64_s390"
8595 ;;
8596 sparc*-*linux*)
8597 LD="${LD-ld} -m elf64_sparc"
8598 ;;
8599 esac
8600 ;;
8601 esac
8602 fi
8603 rm -rf conftest*
8604 ;;
8605
8606*-*-sco3.2v5*)
8607 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
8608 SAVE_CFLAGS="$CFLAGS"
8609 CFLAGS="$CFLAGS -belf"
8610 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
8611$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
8612if ${lt_cv_cc_needs_belf+:} false; then :
8613 $as_echo_n "(cached) " >&6
8614else
8615 ac_ext=c
8616ac_cpp='$CPP $CPPFLAGS'
8617ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8618ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8619ac_compiler_gnu=$ac_cv_c_compiler_gnu
8620
8621 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8622/* end confdefs.h. */
8623
8624int
8625main ()
8626{
8627
8628 ;
8629 return 0;
8630}
8631_ACEOF
8632if ac_fn_c_try_link "$LINENO"; then :
8633 lt_cv_cc_needs_belf=yes
8634else
8635 lt_cv_cc_needs_belf=no
8636fi
8637rm -f core conftest.err conftest.$ac_objext \
8638 conftest$ac_exeext conftest.$ac_ext
8639 ac_ext=c
8640ac_cpp='$CPP $CPPFLAGS'
8641ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8642ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8643ac_compiler_gnu=$ac_cv_c_compiler_gnu
8644
8645fi
8646{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
8647$as_echo "$lt_cv_cc_needs_belf" >&6; }
8648 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
8649 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
8650 CFLAGS="$SAVE_CFLAGS"
8651 fi
8652 ;;
8653*-*solaris*)
8654 # Find out which ABI we are using.
8655 echo 'int i;' > conftest.$ac_ext
8656 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
8657 (eval $ac_compile) 2>&5
8658 ac_status=$?
8659 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8660 test $ac_status = 0; }; then
8661 case `/usr/bin/file conftest.o` in
8662 *64-bit*)
8663 case $lt_cv_prog_gnu_ld in
8664 yes*)
8665 case $host in
8666 i?86-*-solaris*)
8667 LD="${LD-ld} -m elf_x86_64"
8668 ;;
8669 sparc*-*-solaris*)
8670 LD="${LD-ld} -m elf64_sparc"
8671 ;;
8672 esac
8673 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
8674 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
8675 LD="${LD-ld}_sol2"
8676 fi
8677 ;;
8678 *)
8679 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
8680 LD="${LD-ld} -64"
8681 fi
8682 ;;
8683 esac
8684 ;;
8685 esac
8686 fi
8687 rm -rf conftest*
8688 ;;
8689esac
8690
8691need_locks="$enable_libtool_lock"
8692
8693if test -n "$ac_tool_prefix"; then
8694 # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
8695set dummy ${ac_tool_prefix}mt; ac_word=$2
8696{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8697$as_echo_n "checking for $ac_word... " >&6; }
8698if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
8699 $as_echo_n "(cached) " >&6
8700else
8701 if test -n "$MANIFEST_TOOL"; then
8702 ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
8703else
8704as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8705for as_dir in $PATH
8706do
8707 IFS=$as_save_IFS
8708 test -z "$as_dir" && as_dir=.
8709 for ac_exec_ext in '' $ac_executable_extensions; do
8710 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8711 ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
8712 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8713 break 2
8714 fi
8715done
8716 done
8717IFS=$as_save_IFS
8718
8719fi
8720fi
8721MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
8722if test -n "$MANIFEST_TOOL"; then
8723 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
8724$as_echo "$MANIFEST_TOOL" >&6; }
8725else
8726 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8727$as_echo "no" >&6; }
8728fi
8729
8730
8731fi
8732if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
8733 ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
8734 # Extract the first word of "mt", so it can be a program name with args.
8735set dummy mt; ac_word=$2
8736{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8737$as_echo_n "checking for $ac_word... " >&6; }
8738if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
8739 $as_echo_n "(cached) " >&6
8740else
8741 if test -n "$ac_ct_MANIFEST_TOOL"; then
8742 ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
8743else
8744as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8745for as_dir in $PATH
8746do
8747 IFS=$as_save_IFS
8748 test -z "$as_dir" && as_dir=.
8749 for ac_exec_ext in '' $ac_executable_extensions; do
8750 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8751 ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
8752 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8753 break 2
8754 fi
8755done
8756 done
8757IFS=$as_save_IFS
8758
8759fi
8760fi
8761ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
8762if test -n "$ac_ct_MANIFEST_TOOL"; then
8763 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
8764$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
8765else
8766 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8767$as_echo "no" >&6; }
8768fi
8769
8770 if test "x$ac_ct_MANIFEST_TOOL" = x; then
8771 MANIFEST_TOOL=":"
8772 else
8773 case $cross_compiling:$ac_tool_warned in
8774yes:)
8775{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8776$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8777ac_tool_warned=yes ;;
8778esac
8779 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
8780 fi
8781else
8782 MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
8783fi
8784
8785test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
8786{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
8787$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
8788if ${lt_cv_path_mainfest_tool+:} false; then :
8789 $as_echo_n "(cached) " >&6
8790else
8791 lt_cv_path_mainfest_tool=no
8792 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
8793 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
8794 cat conftest.err >&5
8795 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
8796 lt_cv_path_mainfest_tool=yes
8797 fi
8798 rm -f conftest*
8799fi
8800{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
8801$as_echo "$lt_cv_path_mainfest_tool" >&6; }
8802if test "x$lt_cv_path_mainfest_tool" != xyes; then
8803 MANIFEST_TOOL=:
8804fi
8805
8806
8807
8808
8809
8810
8811 case $host_os in
8812 rhapsody* | darwin*)
8813 if test -n "$ac_tool_prefix"; then
8814 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
8815set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
8816{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8817$as_echo_n "checking for $ac_word... " >&6; }
8818if ${ac_cv_prog_DSYMUTIL+:} false; then :
8819 $as_echo_n "(cached) " >&6
8820else
8821 if test -n "$DSYMUTIL"; then
8822 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
8823else
8824as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8825for as_dir in $PATH
8826do
8827 IFS=$as_save_IFS
8828 test -z "$as_dir" && as_dir=.
8829 for ac_exec_ext in '' $ac_executable_extensions; do
8830 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8831 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
8832 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8833 break 2
8834 fi
8835done
8836 done
8837IFS=$as_save_IFS
8838
8839fi
8840fi
8841DSYMUTIL=$ac_cv_prog_DSYMUTIL
8842if test -n "$DSYMUTIL"; then
8843 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
8844$as_echo "$DSYMUTIL" >&6; }
8845else
8846 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8847$as_echo "no" >&6; }
8848fi
8849
8850
8851fi
8852if test -z "$ac_cv_prog_DSYMUTIL"; then
8853 ac_ct_DSYMUTIL=$DSYMUTIL
8854 # Extract the first word of "dsymutil", so it can be a program name with args.
8855set dummy dsymutil; ac_word=$2
8856{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8857$as_echo_n "checking for $ac_word... " >&6; }
8858if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
8859 $as_echo_n "(cached) " >&6
8860else
8861 if test -n "$ac_ct_DSYMUTIL"; then
8862 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
8863else
8864as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8865for as_dir in $PATH
8866do
8867 IFS=$as_save_IFS
8868 test -z "$as_dir" && as_dir=.
8869 for ac_exec_ext in '' $ac_executable_extensions; do
8870 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8871 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
8872 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8873 break 2
8874 fi
8875done
8876 done
8877IFS=$as_save_IFS
8878
8879fi
8880fi
8881ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
8882if test -n "$ac_ct_DSYMUTIL"; then
8883 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
8884$as_echo "$ac_ct_DSYMUTIL" >&6; }
8885else
8886 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8887$as_echo "no" >&6; }
8888fi
8889
8890 if test "x$ac_ct_DSYMUTIL" = x; then
8891 DSYMUTIL=":"
8892 else
8893 case $cross_compiling:$ac_tool_warned in
8894yes:)
8895{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8896$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8897ac_tool_warned=yes ;;
8898esac
8899 DSYMUTIL=$ac_ct_DSYMUTIL
8900 fi
8901else
8902 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
8903fi
8904
8905 if test -n "$ac_tool_prefix"; then
8906 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
8907set dummy ${ac_tool_prefix}nmedit; ac_word=$2
8908{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8909$as_echo_n "checking for $ac_word... " >&6; }
8910if ${ac_cv_prog_NMEDIT+:} false; then :
8911 $as_echo_n "(cached) " >&6
8912else
8913 if test -n "$NMEDIT"; then
8914 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
8915else
8916as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8917for as_dir in $PATH
8918do
8919 IFS=$as_save_IFS
8920 test -z "$as_dir" && as_dir=.
8921 for ac_exec_ext in '' $ac_executable_extensions; do
8922 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8923 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
8924 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8925 break 2
8926 fi
8927done
8928 done
8929IFS=$as_save_IFS
8930
8931fi
8932fi
8933NMEDIT=$ac_cv_prog_NMEDIT
8934if test -n "$NMEDIT"; then
8935 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
8936$as_echo "$NMEDIT" >&6; }
8937else
8938 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8939$as_echo "no" >&6; }
8940fi
8941
8942
8943fi
8944if test -z "$ac_cv_prog_NMEDIT"; then
8945 ac_ct_NMEDIT=$NMEDIT
8946 # Extract the first word of "nmedit", so it can be a program name with args.
8947set dummy nmedit; ac_word=$2
8948{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8949$as_echo_n "checking for $ac_word... " >&6; }
8950if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
8951 $as_echo_n "(cached) " >&6
8952else
8953 if test -n "$ac_ct_NMEDIT"; then
8954 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
8955else
8956as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8957for as_dir in $PATH
8958do
8959 IFS=$as_save_IFS
8960 test -z "$as_dir" && as_dir=.
8961 for ac_exec_ext in '' $ac_executable_extensions; do
8962 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8963 ac_cv_prog_ac_ct_NMEDIT="nmedit"
8964 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8965 break 2
8966 fi
8967done
8968 done
8969IFS=$as_save_IFS
8970
8971fi
8972fi
8973ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
8974if test -n "$ac_ct_NMEDIT"; then
8975 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
8976$as_echo "$ac_ct_NMEDIT" >&6; }
8977else
8978 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8979$as_echo "no" >&6; }
8980fi
8981
8982 if test "x$ac_ct_NMEDIT" = x; then
8983 NMEDIT=":"
8984 else
8985 case $cross_compiling:$ac_tool_warned in
8986yes:)
8987{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8988$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8989ac_tool_warned=yes ;;
8990esac
8991 NMEDIT=$ac_ct_NMEDIT
8992 fi
8993else
8994 NMEDIT="$ac_cv_prog_NMEDIT"
8995fi
8996
8997 if test -n "$ac_tool_prefix"; then
8998 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
8999set dummy ${ac_tool_prefix}lipo; ac_word=$2
9000{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9001$as_echo_n "checking for $ac_word... " >&6; }
9002if ${ac_cv_prog_LIPO+:} false; then :
9003 $as_echo_n "(cached) " >&6
9004else
9005 if test -n "$LIPO"; then
9006 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
9007else
9008as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9009for as_dir in $PATH
9010do
9011 IFS=$as_save_IFS
9012 test -z "$as_dir" && as_dir=.
9013 for ac_exec_ext in '' $ac_executable_extensions; do
9014 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9015 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
9016 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9017 break 2
9018 fi
9019done
9020 done
9021IFS=$as_save_IFS
9022
9023fi
9024fi
9025LIPO=$ac_cv_prog_LIPO
9026if test -n "$LIPO"; then
9027 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
9028$as_echo "$LIPO" >&6; }
9029else
9030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9031$as_echo "no" >&6; }
9032fi
9033
9034
9035fi
9036if test -z "$ac_cv_prog_LIPO"; then
9037 ac_ct_LIPO=$LIPO
9038 # Extract the first word of "lipo", so it can be a program name with args.
9039set dummy lipo; ac_word=$2
9040{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9041$as_echo_n "checking for $ac_word... " >&6; }
9042if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
9043 $as_echo_n "(cached) " >&6
9044else
9045 if test -n "$ac_ct_LIPO"; then
9046 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
9047else
9048as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9049for as_dir in $PATH
9050do
9051 IFS=$as_save_IFS
9052 test -z "$as_dir" && as_dir=.
9053 for ac_exec_ext in '' $ac_executable_extensions; do
9054 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9055 ac_cv_prog_ac_ct_LIPO="lipo"
9056 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9057 break 2
9058 fi
9059done
9060 done
9061IFS=$as_save_IFS
9062
9063fi
9064fi
9065ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
9066if test -n "$ac_ct_LIPO"; then
9067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
9068$as_echo "$ac_ct_LIPO" >&6; }
9069else
9070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9071$as_echo "no" >&6; }
9072fi
9073
9074 if test "x$ac_ct_LIPO" = x; then
9075 LIPO=":"
9076 else
9077 case $cross_compiling:$ac_tool_warned in
9078yes:)
9079{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9080$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9081ac_tool_warned=yes ;;
9082esac
9083 LIPO=$ac_ct_LIPO
9084 fi
9085else
9086 LIPO="$ac_cv_prog_LIPO"
9087fi
9088
9089 if test -n "$ac_tool_prefix"; then
9090 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
9091set dummy ${ac_tool_prefix}otool; ac_word=$2
9092{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9093$as_echo_n "checking for $ac_word... " >&6; }
9094if ${ac_cv_prog_OTOOL+:} false; then :
9095 $as_echo_n "(cached) " >&6
9096else
9097 if test -n "$OTOOL"; then
9098 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
9099else
9100as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9101for as_dir in $PATH
9102do
9103 IFS=$as_save_IFS
9104 test -z "$as_dir" && as_dir=.
9105 for ac_exec_ext in '' $ac_executable_extensions; do
9106 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9107 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
9108 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9109 break 2
9110 fi
9111done
9112 done
9113IFS=$as_save_IFS
9114
9115fi
9116fi
9117OTOOL=$ac_cv_prog_OTOOL
9118if test -n "$OTOOL"; then
9119 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
9120$as_echo "$OTOOL" >&6; }
9121else
9122 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9123$as_echo "no" >&6; }
9124fi
9125
9126
9127fi
9128if test -z "$ac_cv_prog_OTOOL"; then
9129 ac_ct_OTOOL=$OTOOL
9130 # Extract the first word of "otool", so it can be a program name with args.
9131set dummy otool; ac_word=$2
9132{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9133$as_echo_n "checking for $ac_word... " >&6; }
9134if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
9135 $as_echo_n "(cached) " >&6
9136else
9137 if test -n "$ac_ct_OTOOL"; then
9138 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
9139else
9140as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9141for as_dir in $PATH
9142do
9143 IFS=$as_save_IFS
9144 test -z "$as_dir" && as_dir=.
9145 for ac_exec_ext in '' $ac_executable_extensions; do
9146 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9147 ac_cv_prog_ac_ct_OTOOL="otool"
9148 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9149 break 2
9150 fi
9151done
9152 done
9153IFS=$as_save_IFS
9154
9155fi
9156fi
9157ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
9158if test -n "$ac_ct_OTOOL"; then
9159 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
9160$as_echo "$ac_ct_OTOOL" >&6; }
9161else
9162 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9163$as_echo "no" >&6; }
9164fi
9165
9166 if test "x$ac_ct_OTOOL" = x; then
9167 OTOOL=":"
9168 else
9169 case $cross_compiling:$ac_tool_warned in
9170yes:)
9171{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9172$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9173ac_tool_warned=yes ;;
9174esac
9175 OTOOL=$ac_ct_OTOOL
9176 fi
9177else
9178 OTOOL="$ac_cv_prog_OTOOL"
9179fi
9180
9181 if test -n "$ac_tool_prefix"; then
9182 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
9183set dummy ${ac_tool_prefix}otool64; ac_word=$2
9184{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9185$as_echo_n "checking for $ac_word... " >&6; }
9186if ${ac_cv_prog_OTOOL64+:} false; then :
9187 $as_echo_n "(cached) " >&6
9188else
9189 if test -n "$OTOOL64"; then
9190 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
9191else
9192as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9193for as_dir in $PATH
9194do
9195 IFS=$as_save_IFS
9196 test -z "$as_dir" && as_dir=.
9197 for ac_exec_ext in '' $ac_executable_extensions; do
9198 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9199 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
9200 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9201 break 2
9202 fi
9203done
9204 done
9205IFS=$as_save_IFS
9206
9207fi
9208fi
9209OTOOL64=$ac_cv_prog_OTOOL64
9210if test -n "$OTOOL64"; then
9211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
9212$as_echo "$OTOOL64" >&6; }
9213else
9214 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9215$as_echo "no" >&6; }
9216fi
9217
9218
9219fi
9220if test -z "$ac_cv_prog_OTOOL64"; then
9221 ac_ct_OTOOL64=$OTOOL64
9222 # Extract the first word of "otool64", so it can be a program name with args.
9223set dummy otool64; ac_word=$2
9224{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9225$as_echo_n "checking for $ac_word... " >&6; }
9226if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
9227 $as_echo_n "(cached) " >&6
9228else
9229 if test -n "$ac_ct_OTOOL64"; then
9230 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
9231else
9232as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9233for as_dir in $PATH
9234do
9235 IFS=$as_save_IFS
9236 test -z "$as_dir" && as_dir=.
9237 for ac_exec_ext in '' $ac_executable_extensions; do
9238 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9239 ac_cv_prog_ac_ct_OTOOL64="otool64"
9240 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9241 break 2
9242 fi
9243done
9244 done
9245IFS=$as_save_IFS
9246
9247fi
9248fi
9249ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
9250if test -n "$ac_ct_OTOOL64"; then
9251 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
9252$as_echo "$ac_ct_OTOOL64" >&6; }
9253else
9254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9255$as_echo "no" >&6; }
9256fi
9257
9258 if test "x$ac_ct_OTOOL64" = x; then
9259 OTOOL64=":"
9260 else
9261 case $cross_compiling:$ac_tool_warned in
9262yes:)
9263{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9264$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9265ac_tool_warned=yes ;;
9266esac
9267 OTOOL64=$ac_ct_OTOOL64
9268 fi
9269else
9270 OTOOL64="$ac_cv_prog_OTOOL64"
9271fi
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
9300$as_echo_n "checking for -single_module linker flag... " >&6; }
9301if ${lt_cv_apple_cc_single_mod+:} false; then :
9302 $as_echo_n "(cached) " >&6
9303else
9304 lt_cv_apple_cc_single_mod=no
9305 if test -z "${LT_MULTI_MODULE}"; then
9306 # By default we will add the -single_module flag. You can override
9307 # by either setting the environment variable LT_MULTI_MODULE
9308 # non-empty at configure time, or by adding -multi_module to the
9309 # link flags.
9310 rm -rf libconftest.dylib*
9311 echo "int foo(void){return 1;}" > conftest.c
9312 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9313-dynamiclib -Wl,-single_module conftest.c" >&5
9314 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9315 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
9316 _lt_result=$?
9317 # If there is a non-empty error log, and "single_module"
9318 # appears in it, assume the flag caused a linker warning
9319 if test -s conftest.err && $GREP single_module conftest.err; then
9320 cat conftest.err >&5
9321 # Otherwise, if the output was created with a 0 exit code from
9322 # the compiler, it worked.
9323 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
9324 lt_cv_apple_cc_single_mod=yes
9325 else
9326 cat conftest.err >&5
9327 fi
9328 rm -rf libconftest.dylib*
9329 rm -f conftest.*
9330 fi
9331fi
9332{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
9333$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
9334
9335 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
9336$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
9337if ${lt_cv_ld_exported_symbols_list+:} false; then :
9338 $as_echo_n "(cached) " >&6
9339else
9340 lt_cv_ld_exported_symbols_list=no
9341 save_LDFLAGS=$LDFLAGS
9342 echo "_main" > conftest.sym
9343 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
9344 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9345/* end confdefs.h. */
9346
9347int
9348main ()
9349{
9350
9351 ;
9352 return 0;
9353}
9354_ACEOF
9355if ac_fn_c_try_link "$LINENO"; then :
9356 lt_cv_ld_exported_symbols_list=yes
9357else
9358 lt_cv_ld_exported_symbols_list=no
9359fi
9360rm -f core conftest.err conftest.$ac_objext \
9361 conftest$ac_exeext conftest.$ac_ext
9362 LDFLAGS="$save_LDFLAGS"
9363
9364fi
9365{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
9366$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
9367
9368 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
9369$as_echo_n "checking for -force_load linker flag... " >&6; }
9370if ${lt_cv_ld_force_load+:} false; then :
9371 $as_echo_n "(cached) " >&6
9372else
9373 lt_cv_ld_force_load=no
9374 cat > conftest.c << _LT_EOF
9375int forced_loaded() { return 2;}
9376_LT_EOF
9377 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
9378 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
9379 echo "$AR cru libconftest.a conftest.o" >&5
9380 $AR cru libconftest.a conftest.o 2>&5
9381 echo "$RANLIB libconftest.a" >&5
9382 $RANLIB libconftest.a 2>&5
9383 cat > conftest.c << _LT_EOF
9384int main() { return 0;}
9385_LT_EOF
9386 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
9387 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
9388 _lt_result=$?
9389 if test -s conftest.err && $GREP force_load conftest.err; then
9390 cat conftest.err >&5
9391 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
9392 lt_cv_ld_force_load=yes
9393 else
9394 cat conftest.err >&5
9395 fi
9396 rm -f conftest.err libconftest.a conftest conftest.c
9397 rm -rf conftest.dSYM
9398
9399fi
9400{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
9401$as_echo "$lt_cv_ld_force_load" >&6; }
9402 case $host_os in
9403 rhapsody* | darwin1.[012])
9404 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
9405 darwin1.*)
9406 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
9407 darwin*) # darwin 5.x on
9408 # if running on 10.5 or later, the deployment target defaults
9409 # to the OS version, if on x86, and 10.4, the deployment
9410 # target defaults to 10.4. Don't you love it?
9411 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
9412 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
9413 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9414 10.[012]*)
9415 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
9416 10.*)
9417 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9418 esac
9419 ;;
9420 esac
9421 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
9422 _lt_dar_single_mod='$single_module'
9423 fi
9424 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
9425 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
9426 else
9427 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
9428 fi
9429 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
9430 _lt_dsymutil='~$DSYMUTIL $lib || :'
9431 else
9432 _lt_dsymutil=
9433 fi
9434 ;;
9435 esac
9436
9437for ac_header in dlfcn.h
9438do :
9439 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
9440"
9441if test "x$ac_cv_header_dlfcn_h" = xyes; then :
9442 cat >>confdefs.h <<_ACEOF
9443#define HAVE_DLFCN_H 1
9444_ACEOF
9445
9446fi
9447
9448done
9449
9450
9451
9452
9453
9454# Set options
9455
9456
9457
9458 enable_dlopen=no
9459
9460
9461
9462 # Check whether --enable-shared was given.
9463if test "${enable_shared+set}" = set; then :
9464 enableval=$enable_shared; p=${PACKAGE-default}
9465 case $enableval in
9466 yes) enable_shared=yes ;;
9467 no) enable_shared=no ;;
9468 *)
9469 enable_shared=no
9470 # Look at the argument we got. We use all the common list separators.
9471 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9472 for pkg in $enableval; do
9473 IFS="$lt_save_ifs"
9474 if test "X$pkg" = "X$p"; then
9475 enable_shared=yes
9476 fi
9477 done
9478 IFS="$lt_save_ifs"
9479 ;;
9480 esac
9481else
9482 enable_shared=yes
9483fi
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493 # Check whether --enable-static was given.
9494if test "${enable_static+set}" = set; then :
9495 enableval=$enable_static; p=${PACKAGE-default}
9496 case $enableval in
9497 yes) enable_static=yes ;;
9498 no) enable_static=no ;;
9499 *)
9500 enable_static=no
9501 # Look at the argument we got. We use all the common list separators.
9502 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9503 for pkg in $enableval; do
9504 IFS="$lt_save_ifs"
9505 if test "X$pkg" = "X$p"; then
9506 enable_static=yes
9507 fi
9508 done
9509 IFS="$lt_save_ifs"
9510 ;;
9511 esac
9512else
9513 enable_static=yes
9514fi
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525# Check whether --with-pic was given.
9526if test "${with_pic+set}" = set; then :
9527 withval=$with_pic; lt_p=${PACKAGE-default}
9528 case $withval in
9529 yes|no) pic_mode=$withval ;;
9530 *)
9531 pic_mode=default
9532 # Look at the argument we got. We use all the common list separators.
9533 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9534 for lt_pkg in $withval; do
9535 IFS="$lt_save_ifs"
9536 if test "X$lt_pkg" = "X$lt_p"; then
9537 pic_mode=yes
9538 fi
9539 done
9540 IFS="$lt_save_ifs"
9541 ;;
9542 esac
9543else
9544 pic_mode=default
9545fi
9546
9547
9548test -z "$pic_mode" && pic_mode=default
9549
9550
9551
9552
9553
9554
9555
9556 # Check whether --enable-fast-install was given.
9557if test "${enable_fast_install+set}" = set; then :
9558 enableval=$enable_fast_install; p=${PACKAGE-default}
9559 case $enableval in
9560 yes) enable_fast_install=yes ;;
9561 no) enable_fast_install=no ;;
9562 *)
9563 enable_fast_install=no
9564 # Look at the argument we got. We use all the common list separators.
9565 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9566 for pkg in $enableval; do
9567 IFS="$lt_save_ifs"
9568 if test "X$pkg" = "X$p"; then
9569 enable_fast_install=yes
9570 fi
9571 done
9572 IFS="$lt_save_ifs"
9573 ;;
9574 esac
9575else
9576 enable_fast_install=yes
9577fi
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589# This can be used to rebuild libtool when needed
9590LIBTOOL_DEPS="$ltmain"
9591
9592# Always use our own libtool.
9593LIBTOOL='$(SHELL) $(top_builddir)/libtool'
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624test -z "$LN_S" && LN_S="ln -s"
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639if test -n "${ZSH_VERSION+set}" ; then
9640 setopt NO_GLOB_SUBST
9641fi
9642
9643{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
9644$as_echo_n "checking for objdir... " >&6; }
9645if ${lt_cv_objdir+:} false; then :
9646 $as_echo_n "(cached) " >&6
9647else
9648 rm -f .libs 2>/dev/null
9649mkdir .libs 2>/dev/null
9650if test -d .libs; then
9651 lt_cv_objdir=.libs
9652else
9653 # MS-DOS does not allow filenames that begin with a dot.
9654 lt_cv_objdir=_libs
9655fi
9656rmdir .libs 2>/dev/null
9657fi
9658{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
9659$as_echo "$lt_cv_objdir" >&6; }
9660objdir=$lt_cv_objdir
9661
9662
9663
9664
9665
9666cat >>confdefs.h <<_ACEOF
9667#define LT_OBJDIR "$lt_cv_objdir/"
9668_ACEOF
9669
9670
9671
9672
9673case $host_os in
9674aix3*)
9675 # AIX sometimes has problems with the GCC collect2 program. For some
9676 # reason, if we set the COLLECT_NAMES environment variable, the problems
9677 # vanish in a puff of smoke.
9678 if test "X${COLLECT_NAMES+set}" != Xset; then
9679 COLLECT_NAMES=
9680 export COLLECT_NAMES
9681 fi
9682 ;;
9683esac
9684
9685# Global variables:
9686ofile=libtool
9687can_build_shared=yes
9688
9689# All known linkers require a `.a' archive for static linking (except MSVC,
9690# which needs '.lib').
9691libext=a
9692
9693with_gnu_ld="$lt_cv_prog_gnu_ld"
9694
9695old_CC="$CC"
9696old_CFLAGS="$CFLAGS"
9697
9698# Set sane defaults for various variables
9699test -z "$CC" && CC=cc
9700test -z "$LTCC" && LTCC=$CC
9701test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
9702test -z "$LD" && LD=ld
9703test -z "$ac_objext" && ac_objext=o
9704
9705for cc_temp in $compiler""; do
9706 case $cc_temp in
9707 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
9708 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
9709 \-*) ;;
9710 *) break;;
9711 esac
9712done
9713cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
9714
9715
9716# Only perform the check for file, if the check method requires it
9717test -z "$MAGIC_CMD" && MAGIC_CMD=file
9718case $deplibs_check_method in
9719file_magic*)
9720 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
9721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
9722$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
9723if ${lt_cv_path_MAGIC_CMD+:} false; then :
9724 $as_echo_n "(cached) " >&6
9725else
9726 case $MAGIC_CMD in
9727[\\/*] | ?:[\\/]*)
9728 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
9729 ;;
9730*)
9731 lt_save_MAGIC_CMD="$MAGIC_CMD"
9732 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
9733 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
9734 for ac_dir in $ac_dummy; do
9735 IFS="$lt_save_ifs"
9736 test -z "$ac_dir" && ac_dir=.
9737 if test -f $ac_dir/${ac_tool_prefix}file; then
9738 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
9739 if test -n "$file_magic_test_file"; then
9740 case $deplibs_check_method in
9741 "file_magic "*)
9742 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
9743 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
9744 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
9745 $EGREP "$file_magic_regex" > /dev/null; then
9746 :
9747 else
9748 cat <<_LT_EOF 1>&2
9749
9750*** Warning: the command libtool uses to detect shared libraries,
9751*** $file_magic_cmd, produces output that libtool cannot recognize.
9752*** The result is that libtool may fail to recognize shared libraries
9753*** as such. This will affect the creation of libtool libraries that
9754*** depend on shared libraries, but programs linked with such libtool
9755*** libraries will work regardless of this problem. Nevertheless, you
9756*** may want to report the problem to your system manager and/or to
9757*** bug-libtool@gnu.org
9758
9759_LT_EOF
9760 fi ;;
9761 esac
9762 fi
9763 break
9764 fi
9765 done
9766 IFS="$lt_save_ifs"
9767 MAGIC_CMD="$lt_save_MAGIC_CMD"
9768 ;;
9769esac
9770fi
9771
9772MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
9773if test -n "$MAGIC_CMD"; then
9774 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
9775$as_echo "$MAGIC_CMD" >&6; }
9776else
9777 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9778$as_echo "no" >&6; }
9779fi
9780
9781
9782
9783
9784
9785if test -z "$lt_cv_path_MAGIC_CMD"; then
9786 if test -n "$ac_tool_prefix"; then
9787 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
9788$as_echo_n "checking for file... " >&6; }
9789if ${lt_cv_path_MAGIC_CMD+:} false; then :
9790 $as_echo_n "(cached) " >&6
9791else
9792 case $MAGIC_CMD in
9793[\\/*] | ?:[\\/]*)
9794 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
9795 ;;
9796*)
9797 lt_save_MAGIC_CMD="$MAGIC_CMD"
9798 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
9799 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
9800 for ac_dir in $ac_dummy; do
9801 IFS="$lt_save_ifs"
9802 test -z "$ac_dir" && ac_dir=.
9803 if test -f $ac_dir/file; then
9804 lt_cv_path_MAGIC_CMD="$ac_dir/file"
9805 if test -n "$file_magic_test_file"; then
9806 case $deplibs_check_method in
9807 "file_magic "*)
9808 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
9809 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
9810 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
9811 $EGREP "$file_magic_regex" > /dev/null; then
9812 :
9813 else
9814 cat <<_LT_EOF 1>&2
9815
9816*** Warning: the command libtool uses to detect shared libraries,
9817*** $file_magic_cmd, produces output that libtool cannot recognize.
9818*** The result is that libtool may fail to recognize shared libraries
9819*** as such. This will affect the creation of libtool libraries that
9820*** depend on shared libraries, but programs linked with such libtool
9821*** libraries will work regardless of this problem. Nevertheless, you
9822*** may want to report the problem to your system manager and/or to
9823*** bug-libtool@gnu.org
9824
9825_LT_EOF
9826 fi ;;
9827 esac
9828 fi
9829 break
9830 fi
9831 done
9832 IFS="$lt_save_ifs"
9833 MAGIC_CMD="$lt_save_MAGIC_CMD"
9834 ;;
9835esac
9836fi
9837
9838MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
9839if test -n "$MAGIC_CMD"; then
9840 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
9841$as_echo "$MAGIC_CMD" >&6; }
9842else
9843 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9844$as_echo "no" >&6; }
9845fi
9846
9847
9848 else
9849 MAGIC_CMD=:
9850 fi
9851fi
9852
9853 fi
9854 ;;
9855esac
9856
9857# Use C for the default configuration in the libtool script
9858
9859lt_save_CC="$CC"
9860ac_ext=c
9861ac_cpp='$CPP $CPPFLAGS'
9862ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
9863ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
9864ac_compiler_gnu=$ac_cv_c_compiler_gnu
9865
9866
9867# Source file extension for C test sources.
9868ac_ext=c
9869
9870# Object file extension for compiled C test sources.
9871objext=o
9872objext=$objext
9873
9874# Code to be used in simple compile tests
9875lt_simple_compile_test_code="int some_variable = 0;"
9876
9877# Code to be used in simple link tests
9878lt_simple_link_test_code='int main(){return(0);}'
9879
9880
9881
9882
9883
9884
9885
9886# If no C compiler was specified, use CC.
9887LTCC=${LTCC-"$CC"}
9888
9889# If no C compiler flags were specified, use CFLAGS.
9890LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
9891
9892# Allow CC to be a program name with arguments.
9893compiler=$CC
9894
9895# Save the default compiler, since it gets overwritten when the other
9896# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9897compiler_DEFAULT=$CC
9898
9899# save warnings/boilerplate of simple test code
9900ac_outfile=conftest.$ac_objext
9901echo "$lt_simple_compile_test_code" >conftest.$ac_ext
9902eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9903_lt_compiler_boilerplate=`cat conftest.err`
9904$RM conftest*
9905
9906ac_outfile=conftest.$ac_objext
9907echo "$lt_simple_link_test_code" >conftest.$ac_ext
9908eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9909_lt_linker_boilerplate=`cat conftest.err`
9910$RM -r conftest*
9911
9912
9913if test -n "$compiler"; then
9914
9915lt_prog_compiler_no_builtin_flag=
9916
9917if test "$GCC" = yes; then
9918 case $cc_basename in
9919 nvcc*)
9920 lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
9921 *)
9922 lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
9923 esac
9924
9925 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
9926$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
9927if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
9928 $as_echo_n "(cached) " >&6
9929else
9930 lt_cv_prog_compiler_rtti_exceptions=no
9931 ac_outfile=conftest.$ac_objext
9932 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9933 lt_compiler_flag="-fno-rtti -fno-exceptions"
9934 # Insert the option either (1) after the last *FLAGS variable, or
9935 # (2) before a word containing "conftest.", or (3) at the end.
9936 # Note that $ac_compile itself does not contain backslashes and begins
9937 # with a dollar sign (not a hyphen), so the echo should work correctly.
9938 # The option is referenced via a variable to avoid confusing sed.
9939 lt_compile=`echo "$ac_compile" | $SED \
9940 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9941 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9942 -e 's:$: $lt_compiler_flag:'`
9943 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
9944 (eval "$lt_compile" 2>conftest.err)
9945 ac_status=$?
9946 cat conftest.err >&5
9947 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9948 if (exit $ac_status) && test -s "$ac_outfile"; then
9949 # The compiler can only warn and ignore the option if not recognized
9950 # So say no if there are warnings other than the usual output.
9951 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
9952 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9953 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
9954 lt_cv_prog_compiler_rtti_exceptions=yes
9955 fi
9956 fi
9957 $RM conftest*
9958
9959fi
9960{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
9961$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
9962
9963if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
9964 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
9965else
9966 :
9967fi
9968
9969fi
9970
9971
9972
9973
9974
9975
9976 lt_prog_compiler_wl=
9977lt_prog_compiler_pic=
9978lt_prog_compiler_static=
9979
9980
9981 if test "$GCC" = yes; then
9982 lt_prog_compiler_wl='-Wl,'
9983 lt_prog_compiler_static='-static'
9984
9985 case $host_os in
9986 aix*)
9987 # All AIX code is PIC.
9988 if test "$host_cpu" = ia64; then
9989 # AIX 5 now supports IA64 processor
9990 lt_prog_compiler_static='-Bstatic'
9991 fi
9992 ;;
9993
9994 amigaos*)
9995 case $host_cpu in
9996 powerpc)
9997 # see comment about AmigaOS4 .so support
9998 lt_prog_compiler_pic='-fPIC'
9999 ;;
10000 m68k)
10001 # FIXME: we need at least 68020 code to build shared libraries, but
10002 # adding the `-m68020' flag to GCC prevents building anything better,
10003 # like `-m68040'.
10004 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
10005 ;;
10006 esac
10007 ;;
10008
10009 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10010 # PIC is the default for these OSes.
10011 ;;
10012
10013 mingw* | cygwin* | pw32* | os2* | cegcc*)
10014 # This hack is so that the source file can tell whether it is being
10015 # built for inclusion in a dll (and should export symbols for example).
10016 # Although the cygwin gcc ignores -fPIC, still need this for old-style
10017 # (--disable-auto-import) libraries
10018 lt_prog_compiler_pic='-DDLL_EXPORT'
10019 ;;
10020
10021 darwin* | rhapsody*)
10022 # PIC is the default on this platform
10023 # Common symbols not allowed in MH_DYLIB files
10024 lt_prog_compiler_pic='-fno-common'
10025 ;;
10026
10027 haiku*)
10028 # PIC is the default for Haiku.
10029 # The "-static" flag exists, but is broken.
10030 lt_prog_compiler_static=
10031 ;;
10032
10033 hpux*)
10034 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
10035 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
10036 # sets the default TLS model and affects inlining.
10037 case $host_cpu in
10038 hppa*64*)
10039 # +Z the default
10040 ;;
10041 *)
10042 lt_prog_compiler_pic='-fPIC'
10043 ;;
10044 esac
10045 ;;
10046
10047 interix[3-9]*)
10048 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
10049 # Instead, we relocate shared libraries at runtime.
10050 ;;
10051
10052 msdosdjgpp*)
10053 # Just because we use GCC doesn't mean we suddenly get shared libraries
10054 # on systems that don't support them.
10055 lt_prog_compiler_can_build_shared=no
10056 enable_shared=no
10057 ;;
10058
10059 *nto* | *qnx*)
10060 # QNX uses GNU C++, but need to define -shared option too, otherwise
10061 # it will coredump.
10062 lt_prog_compiler_pic='-fPIC -shared'
10063 ;;
10064
10065 sysv4*MP*)
10066 if test -d /usr/nec; then
10067 lt_prog_compiler_pic=-Kconform_pic
10068 fi
10069 ;;
10070
10071 *)
10072 lt_prog_compiler_pic='-fPIC'
10073 ;;
10074 esac
10075
10076 case $cc_basename in
10077 nvcc*) # Cuda Compiler Driver 2.2
10078 lt_prog_compiler_wl='-Xlinker '
10079 if test -n "$lt_prog_compiler_pic"; then
10080 lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
10081 fi
10082 ;;
10083 esac
10084 else
10085 # PORTME Check for flag to pass linker flags through the system compiler.
10086 case $host_os in
10087 aix*)
10088 lt_prog_compiler_wl='-Wl,'
10089 if test "$host_cpu" = ia64; then
10090 # AIX 5 now supports IA64 processor
10091 lt_prog_compiler_static='-Bstatic'
10092 else
10093 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
10094 fi
10095 ;;
10096
10097 mingw* | cygwin* | pw32* | os2* | cegcc*)
10098 # This hack is so that the source file can tell whether it is being
10099 # built for inclusion in a dll (and should export symbols for example).
10100 lt_prog_compiler_pic='-DDLL_EXPORT'
10101 ;;
10102
10103 hpux9* | hpux10* | hpux11*)
10104 lt_prog_compiler_wl='-Wl,'
10105 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10106 # not for PA HP-UX.
10107 case $host_cpu in
10108 hppa*64*|ia64*)
10109 # +Z the default
10110 ;;
10111 *)
10112 lt_prog_compiler_pic='+Z'
10113 ;;
10114 esac
10115 # Is there a better lt_prog_compiler_static that works with the bundled CC?
10116 lt_prog_compiler_static='${wl}-a ${wl}archive'
10117 ;;
10118
10119 irix5* | irix6* | nonstopux*)
10120 lt_prog_compiler_wl='-Wl,'
10121 # PIC (with -KPIC) is the default.
10122 lt_prog_compiler_static='-non_shared'
10123 ;;
10124
10125 linux* | k*bsd*-gnu | kopensolaris*-gnu)
10126 case $cc_basename in
10127 # old Intel for x86_64 which still supported -KPIC.
10128 ecc*)
10129 lt_prog_compiler_wl='-Wl,'
10130 lt_prog_compiler_pic='-KPIC'
10131 lt_prog_compiler_static='-static'
10132 ;;
10133 # icc used to be incompatible with GCC.
10134 # ICC 10 doesn't accept -KPIC any more.
10135 icc* | ifort*)
10136 lt_prog_compiler_wl='-Wl,'
10137 lt_prog_compiler_pic='-fPIC'
10138 lt_prog_compiler_static='-static'
10139 ;;
10140 # Lahey Fortran 8.1.
10141 lf95*)
10142 lt_prog_compiler_wl='-Wl,'
10143 lt_prog_compiler_pic='--shared'
10144 lt_prog_compiler_static='--static'
10145 ;;
10146 nagfor*)
10147 # NAG Fortran compiler
10148 lt_prog_compiler_wl='-Wl,-Wl,,'
10149 lt_prog_compiler_pic='-PIC'
10150 lt_prog_compiler_static='-Bstatic'
10151 ;;
10152 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
10153 # Portland Group compilers (*not* the Pentium gcc compiler,
10154 # which looks to be a dead project)
10155 lt_prog_compiler_wl='-Wl,'
10156 lt_prog_compiler_pic='-fpic'
10157 lt_prog_compiler_static='-Bstatic'
10158 ;;
10159 ccc*)
10160 lt_prog_compiler_wl='-Wl,'
10161 # All Alpha code is PIC.
10162 lt_prog_compiler_static='-non_shared'
10163 ;;
10164 xl* | bgxl* | bgf* | mpixl*)
10165 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
10166 lt_prog_compiler_wl='-Wl,'
10167 lt_prog_compiler_pic='-qpic'
10168 lt_prog_compiler_static='-qstaticlink'
10169 ;;
10170 *)
10171 case `$CC -V 2>&1 | sed 5q` in
10172 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
10173 # Sun Fortran 8.3 passes all unrecognized flags to the linker
10174 lt_prog_compiler_pic='-KPIC'
10175 lt_prog_compiler_static='-Bstatic'
10176 lt_prog_compiler_wl=''
10177 ;;
10178 *Sun\ F* | *Sun*Fortran*)
10179 lt_prog_compiler_pic='-KPIC'
10180 lt_prog_compiler_static='-Bstatic'
10181 lt_prog_compiler_wl='-Qoption ld '
10182 ;;
10183 *Sun\ C*)
10184 # Sun C 5.9
10185 lt_prog_compiler_pic='-KPIC'
10186 lt_prog_compiler_static='-Bstatic'
10187 lt_prog_compiler_wl='-Wl,'
10188 ;;
10189 *Intel*\ [CF]*Compiler*)
10190 lt_prog_compiler_wl='-Wl,'
10191 lt_prog_compiler_pic='-fPIC'
10192 lt_prog_compiler_static='-static'
10193 ;;
10194 *Portland\ Group*)
10195 lt_prog_compiler_wl='-Wl,'
10196 lt_prog_compiler_pic='-fpic'
10197 lt_prog_compiler_static='-Bstatic'
10198 ;;
10199 esac
10200 ;;
10201 esac
10202 ;;
10203
10204 newsos6)
10205 lt_prog_compiler_pic='-KPIC'
10206 lt_prog_compiler_static='-Bstatic'
10207 ;;
10208
10209 *nto* | *qnx*)
10210 # QNX uses GNU C++, but need to define -shared option too, otherwise
10211 # it will coredump.
10212 lt_prog_compiler_pic='-fPIC -shared'
10213 ;;
10214
10215 osf3* | osf4* | osf5*)
10216 lt_prog_compiler_wl='-Wl,'
10217 # All OSF/1 code is PIC.
10218 lt_prog_compiler_static='-non_shared'
10219 ;;
10220
10221 rdos*)
10222 lt_prog_compiler_static='-non_shared'
10223 ;;
10224
10225 solaris*)
10226 lt_prog_compiler_pic='-KPIC'
10227 lt_prog_compiler_static='-Bstatic'
10228 case $cc_basename in
10229 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
10230 lt_prog_compiler_wl='-Qoption ld ';;
10231 *)
10232 lt_prog_compiler_wl='-Wl,';;
10233 esac
10234 ;;
10235
10236 sunos4*)
10237 lt_prog_compiler_wl='-Qoption ld '
10238 lt_prog_compiler_pic='-PIC'
10239 lt_prog_compiler_static='-Bstatic'
10240 ;;
10241
10242 sysv4 | sysv4.2uw2* | sysv4.3*)
10243 lt_prog_compiler_wl='-Wl,'
10244 lt_prog_compiler_pic='-KPIC'
10245 lt_prog_compiler_static='-Bstatic'
10246 ;;
10247
10248 sysv4*MP*)
10249 if test -d /usr/nec ;then
10250 lt_prog_compiler_pic='-Kconform_pic'
10251 lt_prog_compiler_static='-Bstatic'
10252 fi
10253 ;;
10254
10255 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
10256 lt_prog_compiler_wl='-Wl,'
10257 lt_prog_compiler_pic='-KPIC'
10258 lt_prog_compiler_static='-Bstatic'
10259 ;;
10260
10261 unicos*)
10262 lt_prog_compiler_wl='-Wl,'
10263 lt_prog_compiler_can_build_shared=no
10264 ;;
10265
10266 uts4*)
10267 lt_prog_compiler_pic='-pic'
10268 lt_prog_compiler_static='-Bstatic'
10269 ;;
10270
10271 *)
10272 lt_prog_compiler_can_build_shared=no
10273 ;;
10274 esac
10275 fi
10276
10277case $host_os in
10278 # For platforms which do not support PIC, -DPIC is meaningless:
10279 *djgpp*)
10280 lt_prog_compiler_pic=
10281 ;;
10282 *)
10283 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
10284 ;;
10285esac
10286
10287{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
10288$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
10289if ${lt_cv_prog_compiler_pic+:} false; then :
10290 $as_echo_n "(cached) " >&6
10291else
10292 lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
10293fi
10294{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
10295$as_echo "$lt_cv_prog_compiler_pic" >&6; }
10296lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
10297
10298#
10299# Check to make sure the PIC flag actually works.
10300#
10301if test -n "$lt_prog_compiler_pic"; then
10302 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
10303$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
10304if ${lt_cv_prog_compiler_pic_works+:} false; then :
10305 $as_echo_n "(cached) " >&6
10306else
10307 lt_cv_prog_compiler_pic_works=no
10308 ac_outfile=conftest.$ac_objext
10309 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10310 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
10311 # Insert the option either (1) after the last *FLAGS variable, or
10312 # (2) before a word containing "conftest.", or (3) at the end.
10313 # Note that $ac_compile itself does not contain backslashes and begins
10314 # with a dollar sign (not a hyphen), so the echo should work correctly.
10315 # The option is referenced via a variable to avoid confusing sed.
10316 lt_compile=`echo "$ac_compile" | $SED \
10317 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
10318 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
10319 -e 's:$: $lt_compiler_flag:'`
10320 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
10321 (eval "$lt_compile" 2>conftest.err)
10322 ac_status=$?
10323 cat conftest.err >&5
10324 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10325 if (exit $ac_status) && test -s "$ac_outfile"; then
10326 # The compiler can only warn and ignore the option if not recognized
10327 # So say no if there are warnings other than the usual output.
10328 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
10329 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
10330 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
10331 lt_cv_prog_compiler_pic_works=yes
10332 fi
10333 fi
10334 $RM conftest*
10335
10336fi
10337{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
10338$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
10339
10340if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
10341 case $lt_prog_compiler_pic in
10342 "" | " "*) ;;
10343 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
10344 esac
10345else
10346 lt_prog_compiler_pic=
10347 lt_prog_compiler_can_build_shared=no
10348fi
10349
10350fi
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362#
10363# Check to make sure the static flag actually works.
10364#
10365wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
10366{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
10367$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
10368if ${lt_cv_prog_compiler_static_works+:} false; then :
10369 $as_echo_n "(cached) " >&6
10370else
10371 lt_cv_prog_compiler_static_works=no
10372 save_LDFLAGS="$LDFLAGS"
10373 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
10374 echo "$lt_simple_link_test_code" > conftest.$ac_ext
10375 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
10376 # The linker can only warn and ignore the option if not recognized
10377 # So say no if there are warnings
10378 if test -s conftest.err; then
10379 # Append any errors to the config.log.
10380 cat conftest.err 1>&5
10381 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
10382 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
10383 if diff conftest.exp conftest.er2 >/dev/null; then
10384 lt_cv_prog_compiler_static_works=yes
10385 fi
10386 else
10387 lt_cv_prog_compiler_static_works=yes
10388 fi
10389 fi
10390 $RM -r conftest*
10391 LDFLAGS="$save_LDFLAGS"
10392
10393fi
10394{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
10395$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
10396
10397if test x"$lt_cv_prog_compiler_static_works" = xyes; then
10398 :
10399else
10400 lt_prog_compiler_static=
10401fi
10402
10403
10404
10405
10406
10407
10408
10409 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
10410$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
10411if ${lt_cv_prog_compiler_c_o+:} false; then :
10412 $as_echo_n "(cached) " >&6
10413else
10414 lt_cv_prog_compiler_c_o=no
10415 $RM -r conftest 2>/dev/null
10416 mkdir conftest
10417 cd conftest
10418 mkdir out
10419 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10420
10421 lt_compiler_flag="-o out/conftest2.$ac_objext"
10422 # Insert the option either (1) after the last *FLAGS variable, or
10423 # (2) before a word containing "conftest.", or (3) at the end.
10424 # Note that $ac_compile itself does not contain backslashes and begins
10425 # with a dollar sign (not a hyphen), so the echo should work correctly.
10426 lt_compile=`echo "$ac_compile" | $SED \
10427 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
10428 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
10429 -e 's:$: $lt_compiler_flag:'`
10430 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
10431 (eval "$lt_compile" 2>out/conftest.err)
10432 ac_status=$?
10433 cat out/conftest.err >&5
10434 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10435 if (exit $ac_status) && test -s out/conftest2.$ac_objext
10436 then
10437 # The compiler can only warn and ignore the option if not recognized
10438 # So say no if there are warnings
10439 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
10440 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
10441 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
10442 lt_cv_prog_compiler_c_o=yes
10443 fi
10444 fi
10445 chmod u+w . 2>&5
10446 $RM conftest*
10447 # SGI C++ compiler will create directory out/ii_files/ for
10448 # template instantiation
10449 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
10450 $RM out/* && rmdir out
10451 cd ..
10452 $RM -r conftest
10453 $RM conftest*
10454
10455fi
10456{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
10457$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
10458
10459
10460
10461
10462
10463
10464 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
10465$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
10466if ${lt_cv_prog_compiler_c_o+:} false; then :
10467 $as_echo_n "(cached) " >&6
10468else
10469 lt_cv_prog_compiler_c_o=no
10470 $RM -r conftest 2>/dev/null
10471 mkdir conftest
10472 cd conftest
10473 mkdir out
10474 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10475
10476 lt_compiler_flag="-o out/conftest2.$ac_objext"
10477 # Insert the option either (1) after the last *FLAGS variable, or
10478 # (2) before a word containing "conftest.", or (3) at the end.
10479 # Note that $ac_compile itself does not contain backslashes and begins
10480 # with a dollar sign (not a hyphen), so the echo should work correctly.
10481 lt_compile=`echo "$ac_compile" | $SED \
10482 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
10483 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
10484 -e 's:$: $lt_compiler_flag:'`
10485 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
10486 (eval "$lt_compile" 2>out/conftest.err)
10487 ac_status=$?
10488 cat out/conftest.err >&5
10489 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10490 if (exit $ac_status) && test -s out/conftest2.$ac_objext
10491 then
10492 # The compiler can only warn and ignore the option if not recognized
10493 # So say no if there are warnings
10494 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
10495 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
10496 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
10497 lt_cv_prog_compiler_c_o=yes
10498 fi
10499 fi
10500 chmod u+w . 2>&5
10501 $RM conftest*
10502 # SGI C++ compiler will create directory out/ii_files/ for
10503 # template instantiation
10504 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
10505 $RM out/* && rmdir out
10506 cd ..
10507 $RM -r conftest
10508 $RM conftest*
10509
10510fi
10511{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
10512$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
10513
10514
10515
10516
10517hard_links="nottested"
10518if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
10519 # do not overwrite the value of need_locks provided by the user
10520 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
10521$as_echo_n "checking if we can lock with hard links... " >&6; }
10522 hard_links=yes
10523 $RM conftest*
10524 ln conftest.a conftest.b 2>/dev/null && hard_links=no
10525 touch conftest.a
10526 ln conftest.a conftest.b 2>&5 || hard_links=no
10527 ln conftest.a conftest.b 2>/dev/null && hard_links=no
10528 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
10529$as_echo "$hard_links" >&6; }
10530 if test "$hard_links" = no; then
10531 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
10532$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
10533 need_locks=warn
10534 fi
10535else
10536 need_locks=no
10537fi
10538
10539
10540
10541
10542
10543
10544 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
10545$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
10546
10547 runpath_var=
10548 allow_undefined_flag=
10549 always_export_symbols=no
10550 archive_cmds=
10551 archive_expsym_cmds=
10552 compiler_needs_object=no
10553 enable_shared_with_static_runtimes=no
10554 export_dynamic_flag_spec=
10555 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10556 hardcode_automatic=no
10557 hardcode_direct=no
10558 hardcode_direct_absolute=no
10559 hardcode_libdir_flag_spec=
10560 hardcode_libdir_separator=
10561 hardcode_minus_L=no
10562 hardcode_shlibpath_var=unsupported
10563 inherit_rpath=no
10564 link_all_deplibs=unknown
10565 module_cmds=
10566 module_expsym_cmds=
10567 old_archive_from_new_cmds=
10568 old_archive_from_expsyms_cmds=
10569 thread_safe_flag_spec=
10570 whole_archive_flag_spec=
10571 # include_expsyms should be a list of space-separated symbols to be *always*
10572 # included in the symbol list
10573 include_expsyms=
10574 # exclude_expsyms can be an extended regexp of symbols to exclude
10575 # it will be wrapped by ` (' and `)$', so one must not match beginning or
10576 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
10577 # as well as any symbol that contains `d'.
10578 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
10579 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
10580 # platforms (ab)use it in PIC code, but their linkers get confused if
10581 # the symbol is explicitly referenced. Since portable code cannot
10582 # rely on this symbol name, it's probably fine to never include it in
10583 # preloaded symbol tables.
10584 # Exclude shared library initialization/finalization symbols.
10585 extract_expsyms_cmds=
10586
10587 case $host_os in
10588 cygwin* | mingw* | pw32* | cegcc*)
10589 # FIXME: the MSVC++ port hasn't been tested in a loooong time
10590 # When not using gcc, we currently assume that we are using
10591 # Microsoft Visual C++.
10592 if test "$GCC" != yes; then
10593 with_gnu_ld=no
10594 fi
10595 ;;
10596 interix*)
10597 # we just hope/assume this is gcc and not c89 (= MSVC++)
10598 with_gnu_ld=yes
10599 ;;
10600 openbsd*)
10601 with_gnu_ld=no
10602 ;;
10603 esac
10604
10605 ld_shlibs=yes
10606
10607 # On some targets, GNU ld is compatible enough with the native linker
10608 # that we're better off using the native interface for both.
10609 lt_use_gnu_ld_interface=no
10610 if test "$with_gnu_ld" = yes; then
10611 case $host_os in
10612 aix*)
10613 # The AIX port of GNU ld has always aspired to compatibility
10614 # with the native linker. However, as the warning in the GNU ld
10615 # block says, versions before 2.19.5* couldn't really create working
10616 # shared libraries, regardless of the interface used.
10617 case `$LD -v 2>&1` in
10618 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
10619 *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
10620 *\ \(GNU\ Binutils\)\ [3-9]*) ;;
10621 *)
10622 lt_use_gnu_ld_interface=yes
10623 ;;
10624 esac
10625 ;;
10626 *)
10627 lt_use_gnu_ld_interface=yes
10628 ;;
10629 esac
10630 fi
10631
10632 if test "$lt_use_gnu_ld_interface" = yes; then
10633 # If archive_cmds runs LD, not CC, wlarc should be empty
10634 wlarc='${wl}'
10635
10636 # Set some defaults for GNU ld with shared library support. These
10637 # are reset later if shared libraries are not supported. Putting them
10638 # here allows them to be overridden if necessary.
10639 runpath_var=LD_RUN_PATH
10640 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10641 export_dynamic_flag_spec='${wl}--export-dynamic'
10642 # ancient GNU ld didn't support --whole-archive et. al.
10643 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
10644 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
10645 else
10646 whole_archive_flag_spec=
10647 fi
10648 supports_anon_versioning=no
10649 case `$LD -v 2>&1` in
10650 *GNU\ gold*) supports_anon_versioning=yes ;;
10651 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
10652 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
10653 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
10654 *\ 2.11.*) ;; # other 2.11 versions
10655 *) supports_anon_versioning=yes ;;
10656 esac
10657
10658 # See if GNU ld supports shared libraries.
10659 case $host_os in
10660 aix[3-9]*)
10661 # On AIX/PPC, the GNU linker is very broken
10662 if test "$host_cpu" != ia64; then
10663 ld_shlibs=no
10664 cat <<_LT_EOF 1>&2
10665
10666*** Warning: the GNU linker, at least up to release 2.19, is reported
10667*** to be unable to reliably create shared libraries on AIX.
10668*** Therefore, libtool is disabling shared libraries support. If you
10669*** really care for shared libraries, you may want to install binutils
10670*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
10671*** You will then need to restart the configuration process.
10672
10673_LT_EOF
10674 fi
10675 ;;
10676
10677 amigaos*)
10678 case $host_cpu in
10679 powerpc)
10680 # see comment about AmigaOS4 .so support
10681 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10682 archive_expsym_cmds=''
10683 ;;
10684 m68k)
10685 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
10686 hardcode_libdir_flag_spec='-L$libdir'
10687 hardcode_minus_L=yes
10688 ;;
10689 esac
10690 ;;
10691
10692 beos*)
10693 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10694 allow_undefined_flag=unsupported
10695 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
10696 # support --undefined. This deserves some investigation. FIXME
10697 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10698 else
10699 ld_shlibs=no
10700 fi
10701 ;;
10702
10703 cygwin* | mingw* | pw32* | cegcc*)
10704 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
10705 # as there is no search path for DLLs.
10706 hardcode_libdir_flag_spec='-L$libdir'
10707 export_dynamic_flag_spec='${wl}--export-all-symbols'
10708 allow_undefined_flag=unsupported
10709 always_export_symbols=no
10710 enable_shared_with_static_runtimes=yes
10711 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
10712 exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
10713
10714 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
10715 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
10716 # If the export-symbols file already is a .def file (1st line
10717 # is EXPORTS), use it as is; otherwise, prepend...
10718 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
10719 cp $export_symbols $output_objdir/$soname.def;
10720 else
10721 echo EXPORTS > $output_objdir/$soname.def;
10722 cat $export_symbols >> $output_objdir/$soname.def;
10723 fi~
10724 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
10725 else
10726 ld_shlibs=no
10727 fi
10728 ;;
10729
10730 haiku*)
10731 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10732 link_all_deplibs=yes
10733 ;;
10734
10735 interix[3-9]*)
10736 hardcode_direct=no
10737 hardcode_shlibpath_var=no
10738 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
10739 export_dynamic_flag_spec='${wl}-E'
10740 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
10741 # Instead, shared libraries are loaded at an image base (0x10000000 by
10742 # default) and relocated if they conflict, which is a slow very memory
10743 # consuming and fragmenting process. To avoid this, we pick a random,
10744 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
10745 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
10746 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
10747 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
10748 ;;
10749
10750 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
10751 tmp_diet=no
10752 if test "$host_os" = linux-dietlibc; then
10753 case $cc_basename in
10754 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
10755 esac
10756 fi
10757 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
10758 && test "$tmp_diet" = no
10759 then
10760 tmp_addflag=' $pic_flag'
10761 tmp_sharedflag='-shared'
10762 case $cc_basename,$host_cpu in
10763 pgcc*) # Portland Group C compiler
10764 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
10765 tmp_addflag=' $pic_flag'
10766 ;;
10767 pgf77* | pgf90* | pgf95* | pgfortran*)
10768 # Portland Group f77 and f90 compilers
10769 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
10770 tmp_addflag=' $pic_flag -Mnomain' ;;
10771 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
10772 tmp_addflag=' -i_dynamic' ;;
10773 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
10774 tmp_addflag=' -i_dynamic -nofor_main' ;;
10775 ifc* | ifort*) # Intel Fortran compiler
10776 tmp_addflag=' -nofor_main' ;;
10777 lf95*) # Lahey Fortran 8.1
10778 whole_archive_flag_spec=
10779 tmp_sharedflag='--shared' ;;
10780 xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
10781 tmp_sharedflag='-qmkshrobj'
10782 tmp_addflag= ;;
10783 nvcc*) # Cuda Compiler Driver 2.2
10784 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
10785 compiler_needs_object=yes
10786 ;;
10787 esac
10788 case `$CC -V 2>&1 | sed 5q` in
10789 *Sun\ C*) # Sun C 5.9
10790 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
10791 compiler_needs_object=yes
10792 tmp_sharedflag='-G' ;;
10793 *Sun\ F*) # Sun Fortran 8.3
10794 tmp_sharedflag='-G' ;;
10795 esac
10796 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10797
10798 if test "x$supports_anon_versioning" = xyes; then
10799 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
10800 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10801 echo "local: *; };" >> $output_objdir/$libname.ver~
10802 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
10803 fi
10804
10805 case $cc_basename in
10806 xlf* | bgf* | bgxlf* | mpixlf*)
10807 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
10808 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
10809 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10810 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
10811 if test "x$supports_anon_versioning" = xyes; then
10812 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
10813 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10814 echo "local: *; };" >> $output_objdir/$libname.ver~
10815 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
10816 fi
10817 ;;
10818 esac
10819 else
10820 ld_shlibs=no
10821 fi
10822 ;;
10823
10824 netbsd*)
10825 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10826 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
10827 wlarc=
10828 else
10829 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10830 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10831 fi
10832 ;;
10833
10834 solaris*)
10835 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
10836 ld_shlibs=no
10837 cat <<_LT_EOF 1>&2
10838
10839*** Warning: The releases 2.8.* of the GNU linker cannot reliably
10840*** create shared libraries on Solaris systems. Therefore, libtool
10841*** is disabling shared libraries support. We urge you to upgrade GNU
10842*** binutils to release 2.9.1 or newer. Another option is to modify
10843*** your PATH or compiler configuration so that the native linker is
10844*** used, and then restart.
10845
10846_LT_EOF
10847 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10848 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10849 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10850 else
10851 ld_shlibs=no
10852 fi
10853 ;;
10854
10855 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
10856 case `$LD -v 2>&1` in
10857 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
10858 ld_shlibs=no
10859 cat <<_LT_EOF 1>&2
10860
10861*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
10862*** reliably create shared libraries on SCO systems. Therefore, libtool
10863*** is disabling shared libraries support. We urge you to upgrade GNU
10864*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
10865*** your PATH or compiler configuration so that the native linker is
10866*** used, and then restart.
10867
10868_LT_EOF
10869 ;;
10870 *)
10871 # For security reasons, it is highly recommended that you always
10872 # use absolute paths for naming shared libraries, and exclude the
10873 # DT_RUNPATH tag from executables and libraries. But doing so
10874 # requires that you compile everything twice, which is a pain.
10875 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10876 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
10877 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10878 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10879 else
10880 ld_shlibs=no
10881 fi
10882 ;;
10883 esac
10884 ;;
10885
10886 sunos4*)
10887 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10888 wlarc=
10889 hardcode_direct=yes
10890 hardcode_shlibpath_var=no
10891 ;;
10892
10893 *)
10894 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10895 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10896 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10897 else
10898 ld_shlibs=no
10899 fi
10900 ;;
10901 esac
10902
10903 if test "$ld_shlibs" = no; then
10904 runpath_var=
10905 hardcode_libdir_flag_spec=
10906 export_dynamic_flag_spec=
10907 whole_archive_flag_spec=
10908 fi
10909 else
10910 # PORTME fill in a description of your system's linker (not GNU ld)
10911 case $host_os in
10912 aix3*)
10913 allow_undefined_flag=unsupported
10914 always_export_symbols=yes
10915 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
10916 # Note: this linker hardcodes the directories in LIBPATH if there
10917 # are no directories specified by -L.
10918 hardcode_minus_L=yes
10919 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
10920 # Neither direct hardcoding nor static linking is supported with a
10921 # broken collect2.
10922 hardcode_direct=unsupported
10923 fi
10924 ;;
10925
10926 aix[4-9]*)
10927 if test "$host_cpu" = ia64; then
10928 # On IA64, the linker does run time linking by default, so we don't
10929 # have to do anything special.
10930 aix_use_runtimelinking=no
10931 exp_sym_flag='-Bexport'
10932 no_entry_flag=""
10933 else
10934 # If we're using GNU nm, then we don't want the "-C" option.
10935 # -C means demangle to AIX nm, but means don't demangle with GNU nm
10936 # Also, AIX nm treats weak defined symbols like other global
10937 # defined symbols, whereas GNU nm marks them as "W".
10938 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
10939 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
10940 else
10941 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
10942 fi
10943 aix_use_runtimelinking=no
10944
10945 # Test if we are trying to use run time linking or normal
10946 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
10947 # need to do runtime linking.
10948 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
10949 for ld_flag in $LDFLAGS; do
10950 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
10951 aix_use_runtimelinking=yes
10952 break
10953 fi
10954 done
10955 ;;
10956 esac
10957
10958 exp_sym_flag='-bexport'
10959 no_entry_flag='-bnoentry'
10960 fi
10961
10962 # When large executables or shared objects are built, AIX ld can
10963 # have problems creating the table of contents. If linking a library
10964 # or program results in "error TOC overflow" add -mminimal-toc to
10965 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
10966 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10967
10968 archive_cmds=''
10969 hardcode_direct=yes
10970 hardcode_direct_absolute=yes
10971 hardcode_libdir_separator=':'
10972 link_all_deplibs=yes
10973 file_list_spec='${wl}-f,'
10974
10975 if test "$GCC" = yes; then
10976 case $host_os in aix4.[012]|aix4.[012].*)
10977 # We only want to do this on AIX 4.2 and lower, the check
10978 # below for broken collect2 doesn't work under 4.3+
10979 collect2name=`${CC} -print-prog-name=collect2`
10980 if test -f "$collect2name" &&
10981 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
10982 then
10983 # We have reworked collect2
10984 :
10985 else
10986 # We have old collect2
10987 hardcode_direct=unsupported
10988 # It fails to find uninstalled libraries when the uninstalled
10989 # path is not listed in the libpath. Setting hardcode_minus_L
10990 # to unsupported forces relinking
10991 hardcode_minus_L=yes
10992 hardcode_libdir_flag_spec='-L$libdir'
10993 hardcode_libdir_separator=
10994 fi
10995 ;;
10996 esac
10997 shared_flag='-shared'
10998 if test "$aix_use_runtimelinking" = yes; then
10999 shared_flag="$shared_flag "'${wl}-G'
11000 fi
11001 else
11002 # not using gcc
11003 if test "$host_cpu" = ia64; then
11004 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
11005 # chokes on -Wl,-G. The following line is correct:
11006 shared_flag='-G'
11007 else
11008 if test "$aix_use_runtimelinking" = yes; then
11009 shared_flag='${wl}-G'
11010 else
11011 shared_flag='${wl}-bM:SRE'
11012 fi
11013 fi
11014 fi
11015
11016 export_dynamic_flag_spec='${wl}-bexpall'
11017 # It seems that -bexpall does not export symbols beginning with
11018 # underscore (_), so it is better to generate a list of symbols to export.
11019 always_export_symbols=yes
11020 if test "$aix_use_runtimelinking" = yes; then
11021 # Warning - without using the other runtime loading flags (-brtl),
11022 # -berok will link without error, but may produce a broken library.
11023 allow_undefined_flag='-berok'
11024 # Determine the default libpath from the value encoded in an
11025 # empty executable.
11026 if test "${lt_cv_aix_libpath+set}" = set; then
11027 aix_libpath=$lt_cv_aix_libpath
11028else
11029 if ${lt_cv_aix_libpath_+:} false; then :
11030 $as_echo_n "(cached) " >&6
11031else
11032 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11033/* end confdefs.h. */
11034
11035int
11036main ()
11037{
11038
11039 ;
11040 return 0;
11041}
11042_ACEOF
11043if ac_fn_c_try_link "$LINENO"; then :
11044
11045 lt_aix_libpath_sed='
11046 /Import File Strings/,/^$/ {
11047 /^0/ {
11048 s/^0 *\([^ ]*\) *$/\1/
11049 p
11050 }
11051 }'
11052 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11053 # Check for a 64-bit object if we didn't find anything.
11054 if test -z "$lt_cv_aix_libpath_"; then
11055 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11056 fi
11057fi
11058rm -f core conftest.err conftest.$ac_objext \
11059 conftest$ac_exeext conftest.$ac_ext
11060 if test -z "$lt_cv_aix_libpath_"; then
11061 lt_cv_aix_libpath_="/usr/lib:/lib"
11062 fi
11063
11064fi
11065
11066 aix_libpath=$lt_cv_aix_libpath_
11067fi
11068
11069 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
11070 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
11071 else
11072 if test "$host_cpu" = ia64; then
11073 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
11074 allow_undefined_flag="-z nodefs"
11075 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
11076 else
11077 # Determine the default libpath from the value encoded in an
11078 # empty executable.
11079 if test "${lt_cv_aix_libpath+set}" = set; then
11080 aix_libpath=$lt_cv_aix_libpath
11081else
11082 if ${lt_cv_aix_libpath_+:} false; then :
11083 $as_echo_n "(cached) " >&6
11084else
11085 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11086/* end confdefs.h. */
11087
11088int
11089main ()
11090{
11091
11092 ;
11093 return 0;
11094}
11095_ACEOF
11096if ac_fn_c_try_link "$LINENO"; then :
11097
11098 lt_aix_libpath_sed='
11099 /Import File Strings/,/^$/ {
11100 /^0/ {
11101 s/^0 *\([^ ]*\) *$/\1/
11102 p
11103 }
11104 }'
11105 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11106 # Check for a 64-bit object if we didn't find anything.
11107 if test -z "$lt_cv_aix_libpath_"; then
11108 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11109 fi
11110fi
11111rm -f core conftest.err conftest.$ac_objext \
11112 conftest$ac_exeext conftest.$ac_ext
11113 if test -z "$lt_cv_aix_libpath_"; then
11114 lt_cv_aix_libpath_="/usr/lib:/lib"
11115 fi
11116
11117fi
11118
11119 aix_libpath=$lt_cv_aix_libpath_
11120fi
11121
11122 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
11123 # Warning - without using the other run time loading flags,
11124 # -berok will link without error, but may produce a broken library.
11125 no_undefined_flag=' ${wl}-bernotok'
11126 allow_undefined_flag=' ${wl}-berok'
11127 if test "$with_gnu_ld" = yes; then
11128 # We only use this code for GNU lds that support --whole-archive.
11129 whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
11130 else
11131 # Exported symbols can be pulled into shared objects from archives
11132 whole_archive_flag_spec='$convenience'
11133 fi
11134 archive_cmds_need_lc=yes
11135 # This is similar to how AIX traditionally builds its shared libraries.
11136 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
11137 fi
11138 fi
11139 ;;
11140
11141 amigaos*)
11142 case $host_cpu in
11143 powerpc)
11144 # see comment about AmigaOS4 .so support
11145 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
11146 archive_expsym_cmds=''
11147 ;;
11148 m68k)
11149 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
11150 hardcode_libdir_flag_spec='-L$libdir'
11151 hardcode_minus_L=yes
11152 ;;
11153 esac
11154 ;;
11155
11156 bsdi[45]*)
11157 export_dynamic_flag_spec=-rdynamic
11158 ;;
11159
11160 cygwin* | mingw* | pw32* | cegcc*)
11161 # When not using gcc, we currently assume that we are using
11162 # Microsoft Visual C++.
11163 # hardcode_libdir_flag_spec is actually meaningless, as there is
11164 # no search path for DLLs.
11165 case $cc_basename in
11166 cl*)
11167 # Native MSVC
11168 hardcode_libdir_flag_spec=' '
11169 allow_undefined_flag=unsupported
11170 always_export_symbols=yes
11171 file_list_spec='@'
11172 # Tell ltmain to make .lib files, not .a files.
11173 libext=lib
11174 # Tell ltmain to make .dll files, not .so files.
11175 shrext_cmds=".dll"
11176 # FIXME: Setting linknames here is a bad hack.
11177 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
11178 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
11179 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
11180 else
11181 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
11182 fi~
11183 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
11184 linknames='
11185 # The linker will not automatically build a static lib if we build a DLL.
11186 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
11187 enable_shared_with_static_runtimes=yes
11188 exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
11189 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
11190 # Don't use ranlib
11191 old_postinstall_cmds='chmod 644 $oldlib'
11192 postlink_cmds='lt_outputfile="@OUTPUT@"~
11193 lt_tool_outputfile="@TOOL_OUTPUT@"~
11194 case $lt_outputfile in
11195 *.exe|*.EXE) ;;
11196 *)
11197 lt_outputfile="$lt_outputfile.exe"
11198 lt_tool_outputfile="$lt_tool_outputfile.exe"
11199 ;;
11200 esac~
11201 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
11202 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
11203 $RM "$lt_outputfile.manifest";
11204 fi'
11205 ;;
11206 *)
11207 # Assume MSVC wrapper
11208 hardcode_libdir_flag_spec=' '
11209 allow_undefined_flag=unsupported
11210 # Tell ltmain to make .lib files, not .a files.
11211 libext=lib
11212 # Tell ltmain to make .dll files, not .so files.
11213 shrext_cmds=".dll"
11214 # FIXME: Setting linknames here is a bad hack.
11215 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
11216 # The linker will automatically build a .lib file if we build a DLL.
11217 old_archive_from_new_cmds='true'
11218 # FIXME: Should let the user specify the lib program.
11219 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
11220 enable_shared_with_static_runtimes=yes
11221 ;;
11222 esac
11223 ;;
11224
11225 darwin* | rhapsody*)
11226
11227
11228 archive_cmds_need_lc=no
11229 hardcode_direct=no
11230 hardcode_automatic=yes
11231 hardcode_shlibpath_var=unsupported
11232 if test "$lt_cv_ld_force_load" = "yes"; then
11233 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
11234
11235 else
11236 whole_archive_flag_spec=''
11237 fi
11238 link_all_deplibs=yes
11239 allow_undefined_flag="$_lt_dar_allow_undefined"
11240 case $cc_basename in
11241 ifort*) _lt_dar_can_shared=yes ;;
11242 *) _lt_dar_can_shared=$GCC ;;
11243 esac
11244 if test "$_lt_dar_can_shared" = "yes"; then
11245 output_verbose_link_cmd=func_echo_all
11246 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
11247 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
11248 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
11249 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
11250
11251 else
11252 ld_shlibs=no
11253 fi
11254
11255 ;;
11256
11257 dgux*)
11258 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11259 hardcode_libdir_flag_spec='-L$libdir'
11260 hardcode_shlibpath_var=no
11261 ;;
11262
11263 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
11264 # support. Future versions do this automatically, but an explicit c++rt0.o
11265 # does not break anything, and helps significantly (at the cost of a little
11266 # extra space).
11267 freebsd2.2*)
11268 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
11269 hardcode_libdir_flag_spec='-R$libdir'
11270 hardcode_direct=yes
11271 hardcode_shlibpath_var=no
11272 ;;
11273
11274 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
11275 freebsd2.*)
11276 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11277 hardcode_direct=yes
11278 hardcode_minus_L=yes
11279 hardcode_shlibpath_var=no
11280 ;;
11281
11282 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
11283 freebsd* | dragonfly*)
11284 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
11285 hardcode_libdir_flag_spec='-R$libdir'
11286 hardcode_direct=yes
11287 hardcode_shlibpath_var=no
11288 ;;
11289
11290 hpux9*)
11291 if test "$GCC" = yes; then
11292 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
11293 else
11294 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
11295 fi
11296 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
11297 hardcode_libdir_separator=:
11298 hardcode_direct=yes
11299
11300 # hardcode_minus_L: Not really in the search PATH,
11301 # but as the default location of the library.
11302 hardcode_minus_L=yes
11303 export_dynamic_flag_spec='${wl}-E'
11304 ;;
11305
11306 hpux10*)
11307 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
11308 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
11309 else
11310 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
11311 fi
11312 if test "$with_gnu_ld" = no; then
11313 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
11314 hardcode_libdir_separator=:
11315 hardcode_direct=yes
11316 hardcode_direct_absolute=yes
11317 export_dynamic_flag_spec='${wl}-E'
11318 # hardcode_minus_L: Not really in the search PATH,
11319 # but as the default location of the library.
11320 hardcode_minus_L=yes
11321 fi
11322 ;;
11323
11324 hpux11*)
11325 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
11326 case $host_cpu in
11327 hppa*64*)
11328 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
11329 ;;
11330 ia64*)
11331 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
11332 ;;
11333 *)
11334 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
11335 ;;
11336 esac
11337 else
11338 case $host_cpu in
11339 hppa*64*)
11340 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
11341 ;;
11342 ia64*)
11343 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
11344 ;;
11345 *)
11346
11347 # Older versions of the 11.00 compiler do not understand -b yet
11348 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
11349 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
11350$as_echo_n "checking if $CC understands -b... " >&6; }
11351if ${lt_cv_prog_compiler__b+:} false; then :
11352 $as_echo_n "(cached) " >&6
11353else
11354 lt_cv_prog_compiler__b=no
11355 save_LDFLAGS="$LDFLAGS"
11356 LDFLAGS="$LDFLAGS -b"
11357 echo "$lt_simple_link_test_code" > conftest.$ac_ext
11358 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
11359 # The linker can only warn and ignore the option if not recognized
11360 # So say no if there are warnings
11361 if test -s conftest.err; then
11362 # Append any errors to the config.log.
11363 cat conftest.err 1>&5
11364 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
11365 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
11366 if diff conftest.exp conftest.er2 >/dev/null; then
11367 lt_cv_prog_compiler__b=yes
11368 fi
11369 else
11370 lt_cv_prog_compiler__b=yes
11371 fi
11372 fi
11373 $RM -r conftest*
11374 LDFLAGS="$save_LDFLAGS"
11375
11376fi
11377{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
11378$as_echo "$lt_cv_prog_compiler__b" >&6; }
11379
11380if test x"$lt_cv_prog_compiler__b" = xyes; then
11381 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
11382else
11383 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
11384fi
11385
11386 ;;
11387 esac
11388 fi
11389 if test "$with_gnu_ld" = no; then
11390 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
11391 hardcode_libdir_separator=:
11392
11393 case $host_cpu in
11394 hppa*64*|ia64*)
11395 hardcode_direct=no
11396 hardcode_shlibpath_var=no
11397 ;;
11398 *)
11399 hardcode_direct=yes
11400 hardcode_direct_absolute=yes
11401 export_dynamic_flag_spec='${wl}-E'
11402
11403 # hardcode_minus_L: Not really in the search PATH,
11404 # but as the default location of the library.
11405 hardcode_minus_L=yes
11406 ;;
11407 esac
11408 fi
11409 ;;
11410
11411 irix5* | irix6* | nonstopux*)
11412 if test "$GCC" = yes; then
11413 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11414 # Try to use the -exported_symbol ld option, if it does not
11415 # work, assume that -exports_file does not work either and
11416 # implicitly export all symbols.
11417 # This should be the same for all languages, so no per-tag cache variable.
11418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
11419$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
11420if ${lt_cv_irix_exported_symbol+:} false; then :
11421 $as_echo_n "(cached) " >&6
11422else
11423 save_LDFLAGS="$LDFLAGS"
11424 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
11425 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11426/* end confdefs.h. */
11427int foo (void) { return 0; }
11428_ACEOF
11429if ac_fn_c_try_link "$LINENO"; then :
11430 lt_cv_irix_exported_symbol=yes
11431else
11432 lt_cv_irix_exported_symbol=no
11433fi
11434rm -f core conftest.err conftest.$ac_objext \
11435 conftest$ac_exeext conftest.$ac_ext
11436 LDFLAGS="$save_LDFLAGS"
11437fi
11438{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
11439$as_echo "$lt_cv_irix_exported_symbol" >&6; }
11440 if test "$lt_cv_irix_exported_symbol" = yes; then
11441 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
11442 fi
11443 else
11444 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
11445 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
11446 fi
11447 archive_cmds_need_lc='no'
11448 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
11449 hardcode_libdir_separator=:
11450 inherit_rpath=yes
11451 link_all_deplibs=yes
11452 ;;
11453
11454 netbsd*)
11455 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11456 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
11457 else
11458 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
11459 fi
11460 hardcode_libdir_flag_spec='-R$libdir'
11461 hardcode_direct=yes
11462 hardcode_shlibpath_var=no
11463 ;;
11464
11465 newsos6)
11466 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11467 hardcode_direct=yes
11468 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
11469 hardcode_libdir_separator=:
11470 hardcode_shlibpath_var=no
11471 ;;
11472
11473 *nto* | *qnx*)
11474 ;;
11475
11476 openbsd*)
11477 if test -f /usr/libexec/ld.so; then
11478 hardcode_direct=yes
11479 hardcode_shlibpath_var=no
11480 hardcode_direct_absolute=yes
11481 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11482 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
11483 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
11484 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
11485 export_dynamic_flag_spec='${wl}-E'
11486 else
11487 case $host_os in
11488 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
11489 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11490 hardcode_libdir_flag_spec='-R$libdir'
11491 ;;
11492 *)
11493 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
11494 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
11495 ;;
11496 esac
11497 fi
11498 else
11499 ld_shlibs=no
11500 fi
11501 ;;
11502
11503 os2*)
11504 hardcode_libdir_flag_spec='-L$libdir'
11505 hardcode_minus_L=yes
11506 allow_undefined_flag=unsupported
11507 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
11508 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
11509 ;;
11510
11511 osf3*)
11512 if test "$GCC" = yes; then
11513 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
11514 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11515 else
11516 allow_undefined_flag=' -expect_unresolved \*'
11517 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
11518 fi
11519 archive_cmds_need_lc='no'
11520 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
11521 hardcode_libdir_separator=:
11522 ;;
11523
11524 osf4* | osf5*) # as osf3* with the addition of -msym flag
11525 if test "$GCC" = yes; then
11526 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
11527 archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11528 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
11529 else
11530 allow_undefined_flag=' -expect_unresolved \*'
11531 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
11532 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
11533 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
11534
11535 # Both c and cxx compiler support -rpath directly
11536 hardcode_libdir_flag_spec='-rpath $libdir'
11537 fi
11538 archive_cmds_need_lc='no'
11539 hardcode_libdir_separator=:
11540 ;;
11541
11542 solaris*)
11543 no_undefined_flag=' -z defs'
11544 if test "$GCC" = yes; then
11545 wlarc='${wl}'
11546 archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
11547 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11548 $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
11549 else
11550 case `$CC -V 2>&1` in
11551 *"Compilers 5.0"*)
11552 wlarc=''
11553 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11554 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11555 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
11556 ;;
11557 *)
11558 wlarc='${wl}'
11559 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
11560 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11561 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
11562 ;;
11563 esac
11564 fi
11565 hardcode_libdir_flag_spec='-R$libdir'
11566 hardcode_shlibpath_var=no
11567 case $host_os in
11568 solaris2.[0-5] | solaris2.[0-5].*) ;;
11569 *)
11570 # The compiler driver will combine and reorder linker options,
11571 # but understands `-z linker_flag'. GCC discards it without `$wl',
11572 # but is careful enough not to reorder.
11573 # Supported since Solaris 2.6 (maybe 2.5.1?)
11574 if test "$GCC" = yes; then
11575 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
11576 else
11577 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
11578 fi
11579 ;;
11580 esac
11581 link_all_deplibs=yes
11582 ;;
11583
11584 sunos4*)
11585 if test "x$host_vendor" = xsequent; then
11586 # Use $CC to link under sequent, because it throws in some extra .o
11587 # files that make .init and .fini sections work.
11588 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
11589 else
11590 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
11591 fi
11592 hardcode_libdir_flag_spec='-L$libdir'
11593 hardcode_direct=yes
11594 hardcode_minus_L=yes
11595 hardcode_shlibpath_var=no
11596 ;;
11597
11598 sysv4)
11599 case $host_vendor in
11600 sni)
11601 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11602 hardcode_direct=yes # is this really true???
11603 ;;
11604 siemens)
11605 ## LD is ld it makes a PLAMLIB
11606 ## CC just makes a GrossModule.
11607 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11608 reload_cmds='$CC -r -o $output$reload_objs'
11609 hardcode_direct=no
11610 ;;
11611 motorola)
11612 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11613 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
11614 ;;
11615 esac
11616 runpath_var='LD_RUN_PATH'
11617 hardcode_shlibpath_var=no
11618 ;;
11619
11620 sysv4.3*)
11621 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11622 hardcode_shlibpath_var=no
11623 export_dynamic_flag_spec='-Bexport'
11624 ;;
11625
11626 sysv4*MP*)
11627 if test -d /usr/nec; then
11628 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11629 hardcode_shlibpath_var=no
11630 runpath_var=LD_RUN_PATH
11631 hardcode_runpath_var=yes
11632 ld_shlibs=yes
11633 fi
11634 ;;
11635
11636 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
11637 no_undefined_flag='${wl}-z,text'
11638 archive_cmds_need_lc=no
11639 hardcode_shlibpath_var=no
11640 runpath_var='LD_RUN_PATH'
11641
11642 if test "$GCC" = yes; then
11643 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11644 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11645 else
11646 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11647 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11648 fi
11649 ;;
11650
11651 sysv5* | sco3.2v5* | sco5v6*)
11652 # Note: We can NOT use -z defs as we might desire, because we do not
11653 # link with -lc, and that would cause any symbols used from libc to
11654 # always be unresolved, which means just about no library would
11655 # ever link correctly. If we're not using GNU ld we use -z text
11656 # though, which does catch some bad symbols but isn't as heavy-handed
11657 # as -z defs.
11658 no_undefined_flag='${wl}-z,text'
11659 allow_undefined_flag='${wl}-z,nodefs'
11660 archive_cmds_need_lc=no
11661 hardcode_shlibpath_var=no
11662 hardcode_libdir_flag_spec='${wl}-R,$libdir'
11663 hardcode_libdir_separator=':'
11664 link_all_deplibs=yes
11665 export_dynamic_flag_spec='${wl}-Bexport'
11666 runpath_var='LD_RUN_PATH'
11667
11668 if test "$GCC" = yes; then
11669 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11670 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11671 else
11672 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11673 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11674 fi
11675 ;;
11676
11677 uts4*)
11678 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11679 hardcode_libdir_flag_spec='-L$libdir'
11680 hardcode_shlibpath_var=no
11681 ;;
11682
11683 *)
11684 ld_shlibs=no
11685 ;;
11686 esac
11687
11688 if test x$host_vendor = xsni; then
11689 case $host in
11690 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
11691 export_dynamic_flag_spec='${wl}-Blargedynsym'
11692 ;;
11693 esac
11694 fi
11695 fi
11696
11697{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
11698$as_echo "$ld_shlibs" >&6; }
11699test "$ld_shlibs" = no && can_build_shared=no
11700
11701with_gnu_ld=$with_gnu_ld
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717#
11718# Do we need to explicitly link libc?
11719#
11720case "x$archive_cmds_need_lc" in
11721x|xyes)
11722 # Assume -lc should be added
11723 archive_cmds_need_lc=yes
11724
11725 if test "$enable_shared" = yes && test "$GCC" = yes; then
11726 case $archive_cmds in
11727 *'~'*)
11728 # FIXME: we may have to deal with multi-command sequences.
11729 ;;
11730 '$CC '*)
11731 # Test whether the compiler implicitly links with -lc since on some
11732 # systems, -lgcc has to come before -lc. If gcc already passes -lc
11733 # to ld, don't add -lc before -lgcc.
11734 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
11735$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
11736if ${lt_cv_archive_cmds_need_lc+:} false; then :
11737 $as_echo_n "(cached) " >&6
11738else
11739 $RM conftest*
11740 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
11741
11742 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
11743 (eval $ac_compile) 2>&5
11744 ac_status=$?
11745 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11746 test $ac_status = 0; } 2>conftest.err; then
11747 soname=conftest
11748 lib=conftest
11749 libobjs=conftest.$ac_objext
11750 deplibs=
11751 wl=$lt_prog_compiler_wl
11752 pic_flag=$lt_prog_compiler_pic
11753 compiler_flags=-v
11754 linker_flags=-v
11755 verstring=
11756 output_objdir=.
11757 libname=conftest
11758 lt_save_allow_undefined_flag=$allow_undefined_flag
11759 allow_undefined_flag=
11760 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
11761 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
11762 ac_status=$?
11763 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11764 test $ac_status = 0; }
11765 then
11766 lt_cv_archive_cmds_need_lc=no
11767 else
11768 lt_cv_archive_cmds_need_lc=yes
11769 fi
11770 allow_undefined_flag=$lt_save_allow_undefined_flag
11771 else
11772 cat conftest.err 1>&5
11773 fi
11774 $RM conftest*
11775
11776fi
11777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
11778$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
11779 archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
11780 ;;
11781 esac
11782 fi
11783 ;;
11784esac
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
11938$as_echo_n "checking dynamic linker characteristics... " >&6; }
11939
11940if test "$GCC" = yes; then
11941 case $host_os in
11942 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
11943 *) lt_awk_arg="/^libraries:/" ;;
11944 esac
11945 case $host_os in
11946 mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
11947 *) lt_sed_strip_eq="s,=/,/,g" ;;
11948 esac
11949 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
11950 case $lt_search_path_spec in
11951 *\;*)
11952 # if the path contains ";" then we assume it to be the separator
11953 # otherwise default to the standard path separator (i.e. ":") - it is
11954 # assumed that no part of a normal pathname contains ";" but that should
11955 # okay in the real world where ";" in dirpaths is itself problematic.
11956 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
11957 ;;
11958 *)
11959 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
11960 ;;
11961 esac
11962 # Ok, now we have the path, separated by spaces, we can step through it
11963 # and add multilib dir if necessary.
11964 lt_tmp_lt_search_path_spec=
11965 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
11966 for lt_sys_path in $lt_search_path_spec; do
11967 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
11968 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
11969 else
11970 test -d "$lt_sys_path" && \
11971 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
11972 fi
11973 done
11974 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
11975BEGIN {RS=" "; FS="/|\n";} {
11976 lt_foo="";
11977 lt_count=0;
11978 for (lt_i = NF; lt_i > 0; lt_i--) {
11979 if ($lt_i != "" && $lt_i != ".") {
11980 if ($lt_i == "..") {
11981 lt_count++;
11982 } else {
11983 if (lt_count == 0) {
11984 lt_foo="/" $lt_i lt_foo;
11985 } else {
11986 lt_count--;
11987 }
11988 }
11989 }
11990 }
11991 if (lt_foo != "") { lt_freq[lt_foo]++; }
11992 if (lt_freq[lt_foo] == 1) { print lt_foo; }
11993}'`
11994 # AWK program above erroneously prepends '/' to C:/dos/paths
11995 # for these hosts.
11996 case $host_os in
11997 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
11998 $SED 's,/\([A-Za-z]:\),\1,g'` ;;
11999 esac
12000 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
12001else
12002 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
12003fi
12004library_names_spec=
12005libname_spec='lib$name'
12006soname_spec=
12007shrext_cmds=".so"
12008postinstall_cmds=
12009postuninstall_cmds=
12010finish_cmds=
12011finish_eval=
12012shlibpath_var=
12013shlibpath_overrides_runpath=unknown
12014version_type=none
12015dynamic_linker="$host_os ld.so"
12016sys_lib_dlsearch_path_spec="/lib /usr/lib"
12017need_lib_prefix=unknown
12018hardcode_into_libs=no
12019
12020# when you set need_version to no, make sure it does not cause -set_version
12021# flags to be left without arguments
12022need_version=unknown
12023
12024case $host_os in
12025aix3*)
12026 version_type=linux # correct to gnu/linux during the next big refactor
12027 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
12028 shlibpath_var=LIBPATH
12029
12030 # AIX 3 has no versioning support, so we append a major version to the name.
12031 soname_spec='${libname}${release}${shared_ext}$major'
12032 ;;
12033
12034aix[4-9]*)
12035 version_type=linux # correct to gnu/linux during the next big refactor
12036 need_lib_prefix=no
12037 need_version=no
12038 hardcode_into_libs=yes
12039 if test "$host_cpu" = ia64; then
12040 # AIX 5 supports IA64
12041 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
12042 shlibpath_var=LD_LIBRARY_PATH
12043 else
12044 # With GCC up to 2.95.x, collect2 would create an import file
12045 # for dependence libraries. The import file would start with
12046 # the line `#! .'. This would cause the generated library to
12047 # depend on `.', always an invalid library. This was fixed in
12048 # development snapshots of GCC prior to 3.0.
12049 case $host_os in
12050 aix4 | aix4.[01] | aix4.[01].*)
12051 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
12052 echo ' yes '
12053 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
12054 :
12055 else
12056 can_build_shared=no
12057 fi
12058 ;;
12059 esac
12060 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
12061 # soname into executable. Probably we can add versioning support to
12062 # collect2, so additional links can be useful in future.
12063 if test "$aix_use_runtimelinking" = yes; then
12064 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
12065 # instead of lib<name>.a to let people know that these are not
12066 # typical AIX shared libraries.
12067 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12068 else
12069 # We preserve .a as extension for shared libraries through AIX4.2
12070 # and later when we are not doing run time linking.
12071 library_names_spec='${libname}${release}.a $libname.a'
12072 soname_spec='${libname}${release}${shared_ext}$major'
12073 fi
12074 shlibpath_var=LIBPATH
12075 fi
12076 ;;
12077
12078amigaos*)
12079 case $host_cpu in
12080 powerpc)
12081 # Since July 2007 AmigaOS4 officially supports .so libraries.
12082 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
12083 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12084 ;;
12085 m68k)
12086 library_names_spec='$libname.ixlibrary $libname.a'
12087 # Create ${libname}_ixlibrary.a entries in /sys/libs.
12088 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
12089 ;;
12090 esac
12091 ;;
12092
12093beos*)
12094 library_names_spec='${libname}${shared_ext}'
12095 dynamic_linker="$host_os ld.so"
12096 shlibpath_var=LIBRARY_PATH
12097 ;;
12098
12099bsdi[45]*)
12100 version_type=linux # correct to gnu/linux during the next big refactor
12101 need_version=no
12102 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12103 soname_spec='${libname}${release}${shared_ext}$major'
12104 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
12105 shlibpath_var=LD_LIBRARY_PATH
12106 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
12107 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
12108 # the default ld.so.conf also contains /usr/contrib/lib and
12109 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
12110 # libtool to hard-code these into programs
12111 ;;
12112
12113cygwin* | mingw* | pw32* | cegcc*)
12114 version_type=windows
12115 shrext_cmds=".dll"
12116 need_version=no
12117 need_lib_prefix=no
12118
12119 case $GCC,$cc_basename in
12120 yes,*)
12121 # gcc
12122 library_names_spec='$libname.dll.a'
12123 # DLL is installed to $(libdir)/../bin by postinstall_cmds
12124 postinstall_cmds='base_file=`basename \${file}`~
12125 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
12126 dldir=$destdir/`dirname \$dlpath`~
12127 test -d \$dldir || mkdir -p \$dldir~
12128 $install_prog $dir/$dlname \$dldir/$dlname~
12129 chmod a+x \$dldir/$dlname~
12130 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
12131 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
12132 fi'
12133 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
12134 dlpath=$dir/\$dldll~
12135 $RM \$dlpath'
12136 shlibpath_overrides_runpath=yes
12137
12138 case $host_os in
12139 cygwin*)
12140 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
12141 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
12142
12143 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
12144 ;;
12145 mingw* | cegcc*)
12146 # MinGW DLLs use traditional 'lib' prefix
12147 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
12148 ;;
12149 pw32*)
12150 # pw32 DLLs use 'pw' prefix rather than 'lib'
12151 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
12152 ;;
12153 esac
12154 dynamic_linker='Win32 ld.exe'
12155 ;;
12156
12157 *,cl*)
12158 # Native MSVC
12159 libname_spec='$name'
12160 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
12161 library_names_spec='${libname}.dll.lib'
12162
12163 case $build_os in
12164 mingw*)
12165 sys_lib_search_path_spec=
12166 lt_save_ifs=$IFS
12167 IFS=';'
12168 for lt_path in $LIB
12169 do
12170 IFS=$lt_save_ifs
12171 # Let DOS variable expansion print the short 8.3 style file name.
12172 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
12173 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
12174 done
12175 IFS=$lt_save_ifs
12176 # Convert to MSYS style.
12177 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
12178 ;;
12179 cygwin*)
12180 # Convert to unix form, then to dos form, then back to unix form
12181 # but this time dos style (no spaces!) so that the unix form looks
12182 # like /cygdrive/c/PROGRA~1:/cygdr...
12183 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
12184 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
12185 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
12186 ;;
12187 *)
12188 sys_lib_search_path_spec="$LIB"
12189 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
12190 # It is most probably a Windows format PATH.
12191 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
12192 else
12193 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
12194 fi
12195 # FIXME: find the short name or the path components, as spaces are
12196 # common. (e.g. "Program Files" -> "PROGRA~1")
12197 ;;
12198 esac
12199
12200 # DLL is installed to $(libdir)/../bin by postinstall_cmds
12201 postinstall_cmds='base_file=`basename \${file}`~
12202 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
12203 dldir=$destdir/`dirname \$dlpath`~
12204 test -d \$dldir || mkdir -p \$dldir~
12205 $install_prog $dir/$dlname \$dldir/$dlname'
12206 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
12207 dlpath=$dir/\$dldll~
12208 $RM \$dlpath'
12209 shlibpath_overrides_runpath=yes
12210 dynamic_linker='Win32 link.exe'
12211 ;;
12212
12213 *)
12214 # Assume MSVC wrapper
12215 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
12216 dynamic_linker='Win32 ld.exe'
12217 ;;
12218 esac
12219 # FIXME: first we should search . and the directory the executable is in
12220 shlibpath_var=PATH
12221 ;;
12222
12223darwin* | rhapsody*)
12224 dynamic_linker="$host_os dyld"
12225 version_type=darwin
12226 need_lib_prefix=no
12227 need_version=no
12228 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
12229 soname_spec='${libname}${release}${major}$shared_ext'
12230 shlibpath_overrides_runpath=yes
12231 shlibpath_var=DYLD_LIBRARY_PATH
12232 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
12233
12234 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
12235 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
12236 ;;
12237
12238dgux*)
12239 version_type=linux # correct to gnu/linux during the next big refactor
12240 need_lib_prefix=no
12241 need_version=no
12242 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
12243 soname_spec='${libname}${release}${shared_ext}$major'
12244 shlibpath_var=LD_LIBRARY_PATH
12245 ;;
12246
12247freebsd* | dragonfly*)
12248 # DragonFly does not have aout. When/if they implement a new
12249 # versioning mechanism, adjust this.
12250 if test -x /usr/bin/objformat; then
12251 objformat=`/usr/bin/objformat`
12252 else
12253 case $host_os in
12254 freebsd[23].*) objformat=aout ;;
12255 *) objformat=elf ;;
12256 esac
12257 fi
12258 version_type=freebsd-$objformat
12259 case $version_type in
12260 freebsd-elf*)
12261 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
12262 need_version=no
12263 need_lib_prefix=no
12264 ;;
12265 freebsd-*)
12266 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
12267 need_version=yes
12268 ;;
12269 esac
12270 shlibpath_var=LD_LIBRARY_PATH
12271 case $host_os in
12272 freebsd2.*)
12273 shlibpath_overrides_runpath=yes
12274 ;;
12275 freebsd3.[01]* | freebsdelf3.[01]*)
12276 shlibpath_overrides_runpath=yes
12277 hardcode_into_libs=yes
12278 ;;
12279 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
12280 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
12281 shlibpath_overrides_runpath=no
12282 hardcode_into_libs=yes
12283 ;;
12284 *) # from 4.6 on, and DragonFly
12285 shlibpath_overrides_runpath=yes
12286 hardcode_into_libs=yes
12287 ;;
12288 esac
12289 ;;
12290
12291gnu*)
12292 version_type=linux # correct to gnu/linux during the next big refactor
12293 need_lib_prefix=no
12294 need_version=no
12295 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
12296 soname_spec='${libname}${release}${shared_ext}$major'
12297 shlibpath_var=LD_LIBRARY_PATH
12298 shlibpath_overrides_runpath=no
12299 hardcode_into_libs=yes
12300 ;;
12301
12302haiku*)
12303 version_type=linux # correct to gnu/linux during the next big refactor
12304 need_lib_prefix=no
12305 need_version=no
12306 dynamic_linker="$host_os runtime_loader"
12307 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
12308 soname_spec='${libname}${release}${shared_ext}$major'
12309 shlibpath_var=LIBRARY_PATH
12310 shlibpath_overrides_runpath=yes
12311 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
12312 hardcode_into_libs=yes
12313 ;;
12314
12315hpux9* | hpux10* | hpux11*)
12316 # Give a soname corresponding to the major version so that dld.sl refuses to
12317 # link against other versions.
12318 version_type=sunos
12319 need_lib_prefix=no
12320 need_version=no
12321 case $host_cpu in
12322 ia64*)
12323 shrext_cmds='.so'
12324 hardcode_into_libs=yes
12325 dynamic_linker="$host_os dld.so"
12326 shlibpath_var=LD_LIBRARY_PATH
12327 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
12328 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12329 soname_spec='${libname}${release}${shared_ext}$major'
12330 if test "X$HPUX_IA64_MODE" = X32; then
12331 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
12332 else
12333 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
12334 fi
12335 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
12336 ;;
12337 hppa*64*)
12338 shrext_cmds='.sl'
12339 hardcode_into_libs=yes
12340 dynamic_linker="$host_os dld.sl"
12341 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
12342 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
12343 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12344 soname_spec='${libname}${release}${shared_ext}$major'
12345 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
12346 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
12347 ;;
12348 *)
12349 shrext_cmds='.sl'
12350 dynamic_linker="$host_os dld.sl"
12351 shlibpath_var=SHLIB_PATH
12352 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
12353 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12354 soname_spec='${libname}${release}${shared_ext}$major'
12355 ;;
12356 esac
12357 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
12358 postinstall_cmds='chmod 555 $lib'
12359 # or fails outright, so override atomically:
12360 install_override_mode=555
12361 ;;
12362
12363interix[3-9]*)
12364 version_type=linux # correct to gnu/linux during the next big refactor
12365 need_lib_prefix=no
12366 need_version=no
12367 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
12368 soname_spec='${libname}${release}${shared_ext}$major'
12369 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
12370 shlibpath_var=LD_LIBRARY_PATH
12371 shlibpath_overrides_runpath=no
12372 hardcode_into_libs=yes
12373 ;;
12374
12375irix5* | irix6* | nonstopux*)
12376 case $host_os in
12377 nonstopux*) version_type=nonstopux ;;
12378 *)
12379 if test "$lt_cv_prog_gnu_ld" = yes; then
12380 version_type=linux # correct to gnu/linux during the next big refactor
12381 else
12382 version_type=irix
12383 fi ;;
12384 esac
12385 need_lib_prefix=no
12386 need_version=no
12387 soname_spec='${libname}${release}${shared_ext}$major'
12388 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
12389 case $host_os in
12390 irix5* | nonstopux*)
12391 libsuff= shlibsuff=
12392 ;;
12393 *)
12394 case $LD in # libtool.m4 will add one of these switches to LD
12395 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
12396 libsuff= shlibsuff= libmagic=32-bit;;
12397 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
12398 libsuff=32 shlibsuff=N32 libmagic=N32;;
12399 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
12400 libsuff=64 shlibsuff=64 libmagic=64-bit;;
12401 *) libsuff= shlibsuff= libmagic=never-match;;
12402 esac
12403 ;;
12404 esac
12405 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
12406 shlibpath_overrides_runpath=no
12407 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
12408 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
12409 hardcode_into_libs=yes
12410 ;;
12411
12412# No shared lib support for Linux oldld, aout, or coff.
12413linux*oldld* | linux*aout* | linux*coff*)
12414 dynamic_linker=no
12415 ;;
12416
12417# This must be glibc/ELF.
12418linux* | k*bsd*-gnu | kopensolaris*-gnu)
12419 version_type=linux # correct to gnu/linux during the next big refactor
12420 need_lib_prefix=no
12421 need_version=no
12422 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12423 soname_spec='${libname}${release}${shared_ext}$major'
12424 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
12425 shlibpath_var=LD_LIBRARY_PATH
12426 shlibpath_overrides_runpath=no
12427
12428 # Some binutils ld are patched to set DT_RUNPATH
12429 if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
12430 $as_echo_n "(cached) " >&6
12431else
12432 lt_cv_shlibpath_overrides_runpath=no
12433 save_LDFLAGS=$LDFLAGS
12434 save_libdir=$libdir
12435 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
12436 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
12437 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12438/* end confdefs.h. */
12439
12440int
12441main ()
12442{
12443
12444 ;
12445 return 0;
12446}
12447_ACEOF
12448if ac_fn_c_try_link "$LINENO"; then :
12449 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
12450 lt_cv_shlibpath_overrides_runpath=yes
12451fi
12452fi
12453rm -f core conftest.err conftest.$ac_objext \
12454 conftest$ac_exeext conftest.$ac_ext
12455 LDFLAGS=$save_LDFLAGS
12456 libdir=$save_libdir
12457
12458fi
12459
12460 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
12461
12462 # This implies no fast_install, which is unacceptable.
12463 # Some rework will be needed to allow for fast_install
12464 # before this can be enabled.
12465 hardcode_into_libs=yes
12466
12467 # Append ld.so.conf contents to the search path
12468 if test -f /etc/ld.so.conf; then
12469 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
12470 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
12471 fi
12472
12473 # We used to test for /lib/ld.so.1 and disable shared libraries on
12474 # powerpc, because MkLinux only supported shared libraries with the
12475 # GNU dynamic linker. Since this was broken with cross compilers,
12476 # most powerpc-linux boxes support dynamic linking these days and
12477 # people can always --disable-shared, the test was removed, and we
12478 # assume the GNU/Linux dynamic linker is in use.
12479 dynamic_linker='GNU/Linux ld.so'
12480 ;;
12481
12482netbsd*)
12483 version_type=sunos
12484 need_lib_prefix=no
12485 need_version=no
12486 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
12487 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
12488 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
12489 dynamic_linker='NetBSD (a.out) ld.so'
12490 else
12491 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
12492 soname_spec='${libname}${release}${shared_ext}$major'
12493 dynamic_linker='NetBSD ld.elf_so'
12494 fi
12495 shlibpath_var=LD_LIBRARY_PATH
12496 shlibpath_overrides_runpath=yes
12497 hardcode_into_libs=yes
12498 ;;
12499
12500newsos6)
12501 version_type=linux # correct to gnu/linux during the next big refactor
12502 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12503 shlibpath_var=LD_LIBRARY_PATH
12504 shlibpath_overrides_runpath=yes
12505 ;;
12506
12507*nto* | *qnx*)
12508 version_type=qnx
12509 need_lib_prefix=no
12510 need_version=no
12511 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12512 soname_spec='${libname}${release}${shared_ext}$major'
12513 shlibpath_var=LD_LIBRARY_PATH
12514 shlibpath_overrides_runpath=no
12515 hardcode_into_libs=yes
12516 dynamic_linker='ldqnx.so'
12517 ;;
12518
12519openbsd*)
12520 version_type=sunos
12521 sys_lib_dlsearch_path_spec="/usr/lib"
12522 need_lib_prefix=no
12523 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
12524 case $host_os in
12525 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
12526 *) need_version=no ;;
12527 esac
12528 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
12529 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
12530 shlibpath_var=LD_LIBRARY_PATH
12531 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
12532 case $host_os in
12533 openbsd2.[89] | openbsd2.[89].*)
12534 shlibpath_overrides_runpath=no
12535 ;;
12536 *)
12537 shlibpath_overrides_runpath=yes
12538 ;;
12539 esac
12540 else
12541 shlibpath_overrides_runpath=yes
12542 fi
12543 ;;
12544
12545os2*)
12546 libname_spec='$name'
12547 shrext_cmds=".dll"
12548 need_lib_prefix=no
12549 library_names_spec='$libname${shared_ext} $libname.a'
12550 dynamic_linker='OS/2 ld.exe'
12551 shlibpath_var=LIBPATH
12552 ;;
12553
12554osf3* | osf4* | osf5*)
12555 version_type=osf
12556 need_lib_prefix=no
12557 need_version=no
12558 soname_spec='${libname}${release}${shared_ext}$major'
12559 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12560 shlibpath_var=LD_LIBRARY_PATH
12561 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
12562 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
12563 ;;
12564
12565rdos*)
12566 dynamic_linker=no
12567 ;;
12568
12569solaris*)
12570 version_type=linux # correct to gnu/linux during the next big refactor
12571 need_lib_prefix=no
12572 need_version=no
12573 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12574 soname_spec='${libname}${release}${shared_ext}$major'
12575 shlibpath_var=LD_LIBRARY_PATH
12576 shlibpath_overrides_runpath=yes
12577 hardcode_into_libs=yes
12578 # ldd complains unless libraries are executable
12579 postinstall_cmds='chmod +x $lib'
12580 ;;
12581
12582sunos4*)
12583 version_type=sunos
12584 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
12585 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
12586 shlibpath_var=LD_LIBRARY_PATH
12587 shlibpath_overrides_runpath=yes
12588 if test "$with_gnu_ld" = yes; then
12589 need_lib_prefix=no
12590 fi
12591 need_version=yes
12592 ;;
12593
12594sysv4 | sysv4.3*)
12595 version_type=linux # correct to gnu/linux during the next big refactor
12596 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12597 soname_spec='${libname}${release}${shared_ext}$major'
12598 shlibpath_var=LD_LIBRARY_PATH
12599 case $host_vendor in
12600 sni)
12601 shlibpath_overrides_runpath=no
12602 need_lib_prefix=no
12603 runpath_var=LD_RUN_PATH
12604 ;;
12605 siemens)
12606 need_lib_prefix=no
12607 ;;
12608 motorola)
12609 need_lib_prefix=no
12610 need_version=no
12611 shlibpath_overrides_runpath=no
12612 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
12613 ;;
12614 esac
12615 ;;
12616
12617sysv4*MP*)
12618 if test -d /usr/nec ;then
12619 version_type=linux # correct to gnu/linux during the next big refactor
12620 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
12621 soname_spec='$libname${shared_ext}.$major'
12622 shlibpath_var=LD_LIBRARY_PATH
12623 fi
12624 ;;
12625
12626sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
12627 version_type=freebsd-elf
12628 need_lib_prefix=no
12629 need_version=no
12630 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
12631 soname_spec='${libname}${release}${shared_ext}$major'
12632 shlibpath_var=LD_LIBRARY_PATH
12633 shlibpath_overrides_runpath=yes
12634 hardcode_into_libs=yes
12635 if test "$with_gnu_ld" = yes; then
12636 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
12637 else
12638 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
12639 case $host_os in
12640 sco3.2v5*)
12641 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
12642 ;;
12643 esac
12644 fi
12645 sys_lib_dlsearch_path_spec='/usr/lib'
12646 ;;
12647
12648tpf*)
12649 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
12650 version_type=linux # correct to gnu/linux during the next big refactor
12651 need_lib_prefix=no
12652 need_version=no
12653 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12654 shlibpath_var=LD_LIBRARY_PATH
12655 shlibpath_overrides_runpath=no
12656 hardcode_into_libs=yes
12657 ;;
12658
12659uts4*)
12660 version_type=linux # correct to gnu/linux during the next big refactor
12661 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12662 soname_spec='${libname}${release}${shared_ext}$major'
12663 shlibpath_var=LD_LIBRARY_PATH
12664 ;;
12665
12666*)
12667 dynamic_linker=no
12668 ;;
12669esac
12670{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
12671$as_echo "$dynamic_linker" >&6; }
12672test "$dynamic_linker" = no && can_build_shared=no
12673
12674variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
12675if test "$GCC" = yes; then
12676 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
12677fi
12678
12679if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
12680 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
12681fi
12682if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
12683 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
12684fi
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
12778$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
12779hardcode_action=
12780if test -n "$hardcode_libdir_flag_spec" ||
12781 test -n "$runpath_var" ||
12782 test "X$hardcode_automatic" = "Xyes" ; then
12783
12784 # We can hardcode non-existent directories.
12785 if test "$hardcode_direct" != no &&
12786 # If the only mechanism to avoid hardcoding is shlibpath_var, we
12787 # have to relink, otherwise we might link with an installed library
12788 # when we should be linking with a yet-to-be-installed one
12789 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
12790 test "$hardcode_minus_L" != no; then
12791 # Linking always hardcodes the temporary library directory.
12792 hardcode_action=relink
12793 else
12794 # We can link without hardcoding, and we can hardcode nonexisting dirs.
12795 hardcode_action=immediate
12796 fi
12797else
12798 # We cannot hardcode anything, or else we can only hardcode existing
12799 # directories.
12800 hardcode_action=unsupported
12801fi
12802{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
12803$as_echo "$hardcode_action" >&6; }
12804
12805if test "$hardcode_action" = relink ||
12806 test "$inherit_rpath" = yes; then
12807 # Fast installation is not supported
12808 enable_fast_install=no
12809elif test "$shlibpath_overrides_runpath" = yes ||
12810 test "$enable_shared" = no; then
12811 # Fast installation is not necessary
12812 enable_fast_install=needless
12813fi
12814
12815
12816
12817
12818
12819
12820 if test "x$enable_dlopen" != xyes; then
12821 enable_dlopen=unknown
12822 enable_dlopen_self=unknown
12823 enable_dlopen_self_static=unknown
12824else
12825 lt_cv_dlopen=no
12826 lt_cv_dlopen_libs=
12827
12828 case $host_os in
12829 beos*)
12830 lt_cv_dlopen="load_add_on"
12831 lt_cv_dlopen_libs=
12832 lt_cv_dlopen_self=yes
12833 ;;
12834
12835 mingw* | pw32* | cegcc*)
12836 lt_cv_dlopen="LoadLibrary"
12837 lt_cv_dlopen_libs=
12838 ;;
12839
12840 cygwin*)
12841 lt_cv_dlopen="dlopen"
12842 lt_cv_dlopen_libs=
12843 ;;
12844
12845 darwin*)
12846 # if libdl is installed we need to link against it
12847 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
12848$as_echo_n "checking for dlopen in -ldl... " >&6; }
12849if ${ac_cv_lib_dl_dlopen+:} false; then :
12850 $as_echo_n "(cached) " >&6
12851else
12852 ac_check_lib_save_LIBS=$LIBS
12853LIBS="-ldl $LIBS"
12854cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12855/* end confdefs.h. */
12856
12857/* Override any GCC internal prototype to avoid an error.
12858 Use char because int might match the return type of a GCC
12859 builtin and then its argument prototype would still apply. */
12860#ifdef __cplusplus
12861extern "C"
12862#endif
12863char dlopen ();
12864int
12865main ()
12866{
12867return dlopen ();
12868 ;
12869 return 0;
12870}
12871_ACEOF
12872if ac_fn_c_try_link "$LINENO"; then :
12873 ac_cv_lib_dl_dlopen=yes
12874else
12875 ac_cv_lib_dl_dlopen=no
12876fi
12877rm -f core conftest.err conftest.$ac_objext \
12878 conftest$ac_exeext conftest.$ac_ext
12879LIBS=$ac_check_lib_save_LIBS
12880fi
12881{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
12882$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
12883if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
12884 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
12885else
12886
12887 lt_cv_dlopen="dyld"
12888 lt_cv_dlopen_libs=
12889 lt_cv_dlopen_self=yes
12890
12891fi
12892
12893 ;;
12894
12895 *)
12896 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
12897if test "x$ac_cv_func_shl_load" = xyes; then :
12898 lt_cv_dlopen="shl_load"
12899else
12900 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
12901$as_echo_n "checking for shl_load in -ldld... " >&6; }
12902if ${ac_cv_lib_dld_shl_load+:} false; then :
12903 $as_echo_n "(cached) " >&6
12904else
12905 ac_check_lib_save_LIBS=$LIBS
12906LIBS="-ldld $LIBS"
12907cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12908/* end confdefs.h. */
12909
12910/* Override any GCC internal prototype to avoid an error.
12911 Use char because int might match the return type of a GCC
12912 builtin and then its argument prototype would still apply. */
12913#ifdef __cplusplus
12914extern "C"
12915#endif
12916char shl_load ();
12917int
12918main ()
12919{
12920return shl_load ();
12921 ;
12922 return 0;
12923}
12924_ACEOF
12925if ac_fn_c_try_link "$LINENO"; then :
12926 ac_cv_lib_dld_shl_load=yes
12927else
12928 ac_cv_lib_dld_shl_load=no
12929fi
12930rm -f core conftest.err conftest.$ac_objext \
12931 conftest$ac_exeext conftest.$ac_ext
12932LIBS=$ac_check_lib_save_LIBS
12933fi
12934{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
12935$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
12936if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
12937 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
12938else
12939 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
12940if test "x$ac_cv_func_dlopen" = xyes; then :
12941 lt_cv_dlopen="dlopen"
12942else
12943 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
12944$as_echo_n "checking for dlopen in -ldl... " >&6; }
12945if ${ac_cv_lib_dl_dlopen+:} false; then :
12946 $as_echo_n "(cached) " >&6
12947else
12948 ac_check_lib_save_LIBS=$LIBS
12949LIBS="-ldl $LIBS"
12950cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12951/* end confdefs.h. */
12952
12953/* Override any GCC internal prototype to avoid an error.
12954 Use char because int might match the return type of a GCC
12955 builtin and then its argument prototype would still apply. */
12956#ifdef __cplusplus
12957extern "C"
12958#endif
12959char dlopen ();
12960int
12961main ()
12962{
12963return dlopen ();
12964 ;
12965 return 0;
12966}
12967_ACEOF
12968if ac_fn_c_try_link "$LINENO"; then :
12969 ac_cv_lib_dl_dlopen=yes
12970else
12971 ac_cv_lib_dl_dlopen=no
12972fi
12973rm -f core conftest.err conftest.$ac_objext \
12974 conftest$ac_exeext conftest.$ac_ext
12975LIBS=$ac_check_lib_save_LIBS
12976fi
12977{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
12978$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
12979if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
12980 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
12981else
12982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
12983$as_echo_n "checking for dlopen in -lsvld... " >&6; }
12984if ${ac_cv_lib_svld_dlopen+:} false; then :
12985 $as_echo_n "(cached) " >&6
12986else
12987 ac_check_lib_save_LIBS=$LIBS
12988LIBS="-lsvld $LIBS"
12989cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12990/* end confdefs.h. */
12991
12992/* Override any GCC internal prototype to avoid an error.
12993 Use char because int might match the return type of a GCC
12994 builtin and then its argument prototype would still apply. */
12995#ifdef __cplusplus
12996extern "C"
12997#endif
12998char dlopen ();
12999int
13000main ()
13001{
13002return dlopen ();
13003 ;
13004 return 0;
13005}
13006_ACEOF
13007if ac_fn_c_try_link "$LINENO"; then :
13008 ac_cv_lib_svld_dlopen=yes
13009else
13010 ac_cv_lib_svld_dlopen=no
13011fi
13012rm -f core conftest.err conftest.$ac_objext \
13013 conftest$ac_exeext conftest.$ac_ext
13014LIBS=$ac_check_lib_save_LIBS
13015fi
13016{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
13017$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
13018if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
13019 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
13020else
13021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
13022$as_echo_n "checking for dld_link in -ldld... " >&6; }
13023if ${ac_cv_lib_dld_dld_link+:} false; then :
13024 $as_echo_n "(cached) " >&6
13025else
13026 ac_check_lib_save_LIBS=$LIBS
13027LIBS="-ldld $LIBS"
13028cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13029/* end confdefs.h. */
13030
13031/* Override any GCC internal prototype to avoid an error.
13032 Use char because int might match the return type of a GCC
13033 builtin and then its argument prototype would still apply. */
13034#ifdef __cplusplus
13035extern "C"
13036#endif
13037char dld_link ();
13038int
13039main ()
13040{
13041return dld_link ();
13042 ;
13043 return 0;
13044}
13045_ACEOF
13046if ac_fn_c_try_link "$LINENO"; then :
13047 ac_cv_lib_dld_dld_link=yes
13048else
13049 ac_cv_lib_dld_dld_link=no
13050fi
13051rm -f core conftest.err conftest.$ac_objext \
13052 conftest$ac_exeext conftest.$ac_ext
13053LIBS=$ac_check_lib_save_LIBS
13054fi
13055{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
13056$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
13057if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
13058 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
13059fi
13060
13061
13062fi
13063
13064
13065fi
13066
13067
13068fi
13069
13070
13071fi
13072
13073
13074fi
13075
13076 ;;
13077 esac
13078
13079 if test "x$lt_cv_dlopen" != xno; then
13080 enable_dlopen=yes
13081 else
13082 enable_dlopen=no
13083 fi
13084
13085 case $lt_cv_dlopen in
13086 dlopen)
13087 save_CPPFLAGS="$CPPFLAGS"
13088 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
13089
13090 save_LDFLAGS="$LDFLAGS"
13091 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
13092
13093 save_LIBS="$LIBS"
13094 LIBS="$lt_cv_dlopen_libs $LIBS"
13095
13096 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
13097$as_echo_n "checking whether a program can dlopen itself... " >&6; }
13098if ${lt_cv_dlopen_self+:} false; then :
13099 $as_echo_n "(cached) " >&6
13100else
13101 if test "$cross_compiling" = yes; then :
13102 lt_cv_dlopen_self=cross
13103else
13104 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
13105 lt_status=$lt_dlunknown
13106 cat > conftest.$ac_ext <<_LT_EOF
13107#line $LINENO "configure"
13108#include "confdefs.h"
13109
13110#if HAVE_DLFCN_H
13111#include <dlfcn.h>
13112#endif
13113
13114#include <stdio.h>
13115
13116#ifdef RTLD_GLOBAL
13117# define LT_DLGLOBAL RTLD_GLOBAL
13118#else
13119# ifdef DL_GLOBAL
13120# define LT_DLGLOBAL DL_GLOBAL
13121# else
13122# define LT_DLGLOBAL 0
13123# endif
13124#endif
13125
13126/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
13127 find out it does not work in some platform. */
13128#ifndef LT_DLLAZY_OR_NOW
13129# ifdef RTLD_LAZY
13130# define LT_DLLAZY_OR_NOW RTLD_LAZY
13131# else
13132# ifdef DL_LAZY
13133# define LT_DLLAZY_OR_NOW DL_LAZY
13134# else
13135# ifdef RTLD_NOW
13136# define LT_DLLAZY_OR_NOW RTLD_NOW
13137# else
13138# ifdef DL_NOW
13139# define LT_DLLAZY_OR_NOW DL_NOW
13140# else
13141# define LT_DLLAZY_OR_NOW 0
13142# endif
13143# endif
13144# endif
13145# endif
13146#endif
13147
13148/* When -fvisbility=hidden is used, assume the code has been annotated
13149 correspondingly for the symbols needed. */
13150#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
13151int fnord () __attribute__((visibility("default")));
13152#endif
13153
13154int fnord () { return 42; }
13155int main ()
13156{
13157 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
13158 int status = $lt_dlunknown;
13159
13160 if (self)
13161 {
13162 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
13163 else
13164 {
13165 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
13166 else puts (dlerror ());
13167 }
13168 /* dlclose (self); */
13169 }
13170 else
13171 puts (dlerror ());
13172
13173 return status;
13174}
13175_LT_EOF
13176 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13177 (eval $ac_link) 2>&5
13178 ac_status=$?
13179 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13180 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
13181 (./conftest; exit; ) >&5 2>/dev/null
13182 lt_status=$?
13183 case x$lt_status in
13184 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
13185 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
13186 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
13187 esac
13188 else :
13189 # compilation failed
13190 lt_cv_dlopen_self=no
13191 fi
13192fi
13193rm -fr conftest*
13194
13195
13196fi
13197{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
13198$as_echo "$lt_cv_dlopen_self" >&6; }
13199
13200 if test "x$lt_cv_dlopen_self" = xyes; then
13201 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
13202 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
13203$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
13204if ${lt_cv_dlopen_self_static+:} false; then :
13205 $as_echo_n "(cached) " >&6
13206else
13207 if test "$cross_compiling" = yes; then :
13208 lt_cv_dlopen_self_static=cross
13209else
13210 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
13211 lt_status=$lt_dlunknown
13212 cat > conftest.$ac_ext <<_LT_EOF
13213#line $LINENO "configure"
13214#include "confdefs.h"
13215
13216#if HAVE_DLFCN_H
13217#include <dlfcn.h>
13218#endif
13219
13220#include <stdio.h>
13221
13222#ifdef RTLD_GLOBAL
13223# define LT_DLGLOBAL RTLD_GLOBAL
13224#else
13225# ifdef DL_GLOBAL
13226# define LT_DLGLOBAL DL_GLOBAL
13227# else
13228# define LT_DLGLOBAL 0
13229# endif
13230#endif
13231
13232/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
13233 find out it does not work in some platform. */
13234#ifndef LT_DLLAZY_OR_NOW
13235# ifdef RTLD_LAZY
13236# define LT_DLLAZY_OR_NOW RTLD_LAZY
13237# else
13238# ifdef DL_LAZY
13239# define LT_DLLAZY_OR_NOW DL_LAZY
13240# else
13241# ifdef RTLD_NOW
13242# define LT_DLLAZY_OR_NOW RTLD_NOW
13243# else
13244# ifdef DL_NOW
13245# define LT_DLLAZY_OR_NOW DL_NOW
13246# else
13247# define LT_DLLAZY_OR_NOW 0
13248# endif
13249# endif
13250# endif
13251# endif
13252#endif
13253
13254/* When -fvisbility=hidden is used, assume the code has been annotated
13255 correspondingly for the symbols needed. */
13256#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
13257int fnord () __attribute__((visibility("default")));
13258#endif
13259
13260int fnord () { return 42; }
13261int main ()
13262{
13263 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
13264 int status = $lt_dlunknown;
13265
13266 if (self)
13267 {
13268 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
13269 else
13270 {
13271 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
13272 else puts (dlerror ());
13273 }
13274 /* dlclose (self); */
13275 }
13276 else
13277 puts (dlerror ());
13278
13279 return status;
13280}
13281_LT_EOF
13282 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13283 (eval $ac_link) 2>&5
13284 ac_status=$?
13285 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13286 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
13287 (./conftest; exit; ) >&5 2>/dev/null
13288 lt_status=$?
13289 case x$lt_status in
13290 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
13291 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
13292 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
13293 esac
13294 else :
13295 # compilation failed
13296 lt_cv_dlopen_self_static=no
13297 fi
13298fi
13299rm -fr conftest*
13300
13301
13302fi
13303{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
13304$as_echo "$lt_cv_dlopen_self_static" >&6; }
13305 fi
13306
13307 CPPFLAGS="$save_CPPFLAGS"
13308 LDFLAGS="$save_LDFLAGS"
13309 LIBS="$save_LIBS"
13310 ;;
13311 esac
13312
13313 case $lt_cv_dlopen_self in
13314 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
13315 *) enable_dlopen_self=unknown ;;
13316 esac
13317
13318 case $lt_cv_dlopen_self_static in
13319 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
13320 *) enable_dlopen_self_static=unknown ;;
13321 esac
13322fi
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340striplib=
13341old_striplib=
13342{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
13343$as_echo_n "checking whether stripping libraries is possible... " >&6; }
13344if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
13345 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
13346 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
13347 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13348$as_echo "yes" >&6; }
13349else
13350# FIXME - insert some real tests, host_os isn't really good enough
13351 case $host_os in
13352 darwin*)
13353 if test -n "$STRIP" ; then
13354 striplib="$STRIP -x"
13355 old_striplib="$STRIP -S"
13356 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13357$as_echo "yes" >&6; }
13358 else
13359 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13360$as_echo "no" >&6; }
13361 fi
13362 ;;
13363 *)
13364 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13365$as_echo "no" >&6; }
13366 ;;
13367 esac
13368fi
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381 # Report which library types will actually be built
13382 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
13383$as_echo_n "checking if libtool supports shared libraries... " >&6; }
13384 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
13385$as_echo "$can_build_shared" >&6; }
13386
13387 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
13388$as_echo_n "checking whether to build shared libraries... " >&6; }
13389 test "$can_build_shared" = "no" && enable_shared=no
13390
13391 # On AIX, shared libraries and static libraries use the same namespace, and
13392 # are all built from PIC.
13393 case $host_os in
13394 aix3*)
13395 test "$enable_shared" = yes && enable_static=no
13396 if test -n "$RANLIB"; then
13397 archive_cmds="$archive_cmds~\$RANLIB \$lib"
13398 postinstall_cmds='$RANLIB $lib'
13399 fi
13400 ;;
13401
13402 aix[4-9]*)
13403 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
13404 test "$enable_shared" = yes && enable_static=no
13405 fi
13406 ;;
13407 esac
13408 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
13409$as_echo "$enable_shared" >&6; }
13410
13411 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
13412$as_echo_n "checking whether to build static libraries... " >&6; }
13413 # Make sure either enable_shared or enable_static is yes.
13414 test "$enable_shared" = yes || enable_static=yes
13415 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
13416$as_echo "$enable_static" >&6; }
13417
13418
13419
13420
13421fi
13422ac_ext=c
13423ac_cpp='$CPP $CPPFLAGS'
13424ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13425ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13426ac_compiler_gnu=$ac_cv_c_compiler_gnu
13427
13428CC="$lt_save_CC"
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444 ac_config_commands="$ac_config_commands libtool"
13445
13446
13447
13448
13449# Only expand once:
13450
13451
13452
13453# Select memory manager depending on user input.
13454# If no "-enable-maxmem", use jmemnobs
13455MEMORYMGR='jmemnobs'
13456MAXMEM="no"
13457# Check whether --enable-maxmem was given.
13458if test "${enable_maxmem+set}" = set; then :
13459 enableval=$enable_maxmem; MAXMEM="$enableval"
13460fi
13461
13462if test "x$MAXMEM" = xyes; then
13463 MAXMEM=1
13464fi
13465if test "x$MAXMEM" != xno; then
13466 if test -n "`echo $MAXMEM | sed 's/[0-9]//g'`"; then
13467 as_fn_error $? "non-numeric argument to --enable-maxmem" "$LINENO" 5
13468 fi
13469 DEFAULTMAXMEM=`expr $MAXMEM \* 1048576`
13470
13471cat >>confdefs.h <<_ACEOF
13472#define DEFAULT_MAX_MEM ${DEFAULTMAXMEM}
13473_ACEOF
13474
13475 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'tmpfile()'" >&5
13476$as_echo_n "checking for 'tmpfile()'... " >&6; }
13477 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13478/* end confdefs.h. */
13479#include <stdio.h>
13480int
13481main ()
13482{
13483 FILE * tfile = tmpfile();
13484 ;
13485 return 0;
13486}
13487_ACEOF
13488if ac_fn_c_try_link "$LINENO"; then :
13489 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13490$as_echo "yes" >&6; }
13491 MEMORYMGR='jmemansi'
13492else
13493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13494$as_echo "no" >&6; }
13495 MEMORYMGR='jmemname'
13496
13497 # Test for the need to remove temporary files using a signal handler
13498 # (for cjpeg/djpeg)
13499
13500$as_echo "#define NEED_SIGNAL_CATCHER 1" >>confdefs.h
13501
13502 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'mktemp()'" >&5
13503$as_echo_n "checking for 'mktemp()'... " >&6; }
13504 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13505/* end confdefs.h. */
13506
13507int
13508main ()
13509{
13510 char fname[80]; mktemp(fname);
13511 ;
13512 return 0;
13513}
13514_ACEOF
13515if ac_fn_c_try_link "$LINENO"; then :
13516 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13517$as_echo "yes" >&6; }
13518else
13519 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13520$as_echo "no" >&6; }
13521
13522$as_echo "#define NO_MKTEMP 1" >>confdefs.h
13523
13524fi
13525rm -f core conftest.err conftest.$ac_objext \
13526 conftest$ac_exeext conftest.$ac_ext
13527fi
13528rm -f core conftest.err conftest.$ac_objext \
13529 conftest$ac_exeext conftest.$ac_ext
13530fi
13531
13532
13533# Extract the library version IDs from jpeglib.h.
13534{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libjpeg version number" >&5
13535$as_echo_n "checking libjpeg version number... " >&6; }
13536major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`
13537minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`
13538JPEG_LIB_VERSION=`expr $major + $minor`:0:$minor
13539
13540{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JPEG_LIB_VERSION" >&5
13541$as_echo "$JPEG_LIB_VERSION" >&6; }
13542
13543ac_config_files="$ac_config_files Makefile"
13544
13545cat >confcache <<\_ACEOF
13546# This file is a shell script that caches the results of configure
13547# tests run on this system so they can be shared between configure
13548# scripts and configure runs, see configure's option --config-cache.
13549# It is not useful on other systems. If it contains results you don't
13550# want to keep, you may remove or edit it.
13551#
13552# config.status only pays attention to the cache file if you give it
13553# the --recheck option to rerun configure.
13554#
13555# `ac_cv_env_foo' variables (set or unset) will be overridden when
13556# loading this file, other *unset* `ac_cv_foo' will be assigned the
13557# following values.
13558
13559_ACEOF
13560
13561# The following way of writing the cache mishandles newlines in values,
13562# but we know of no workaround that is simple, portable, and efficient.
13563# So, we kill variables containing newlines.
13564# Ultrix sh set writes to stderr and can't be redirected directly,
13565# and sets the high bit in the cache file unless we assign to the vars.
13566(
13567 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
13568 eval ac_val=\$$ac_var
13569 case $ac_val in #(
13570 *${as_nl}*)
13571 case $ac_var in #(
13572 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
13573$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
13574 esac
13575 case $ac_var in #(
13576 _ | IFS | as_nl) ;; #(
13577 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
13578 *) { eval $ac_var=; unset $ac_var;} ;;
13579 esac ;;
13580 esac
13581 done
13582
13583 (set) 2>&1 |
13584 case $as_nl`(ac_space=' '; set) 2>&1` in #(
13585 *${as_nl}ac_space=\ *)
13586 # `set' does not quote correctly, so add quotes: double-quote
13587 # substitution turns \\\\ into \\, and sed turns \\ into \.
13588 sed -n \
13589 "s/'/'\\\\''/g;
13590 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13591 ;; #(
13592 *)
13593 # `set' quotes correctly as required by POSIX, so do not add quotes.
13594 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
13595 ;;
13596 esac |
13597 sort
13598) |
13599 sed '
13600 /^ac_cv_env_/b end
13601 t clear
13602 :clear
13603 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13604 t end
13605 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13606 :end' >>confcache
13607if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
13608 if test -w "$cache_file"; then
13609 if test "x$cache_file" != "x/dev/null"; then
13610 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
13611$as_echo "$as_me: updating cache $cache_file" >&6;}
13612 if test ! -f "$cache_file" || test -h "$cache_file"; then
13613 cat confcache >"$cache_file"
13614 else
13615 case $cache_file in #(
13616 */* | ?:*)
13617 mv -f confcache "$cache_file"$$ &&
13618 mv -f "$cache_file"$$ "$cache_file" ;; #(
13619 *)
13620 mv -f confcache "$cache_file" ;;
13621 esac
13622 fi
13623 fi
13624 else
13625 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
13626$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
13627 fi
13628fi
13629rm -f confcache
13630
13631test "x$prefix" = xNONE && prefix=$ac_default_prefix
13632# Let make expand exec_prefix.
13633test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13634
13635DEFS=-DHAVE_CONFIG_H
13636
13637ac_libobjs=
13638ac_ltlibobjs=
13639for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
13640 # 1. Remove the extension, and $U if already installed.
13641 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
13642 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
13643 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
13644 # will be set to the directory where LIBOBJS objects are built.
13645 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
13646 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
13647done
13648LIBOBJS=$ac_libobjs
13649
13650LTLIBOBJS=$ac_ltlibobjs
13651
13652
13653 if test -n "$EXEEXT"; then
13654 am__EXEEXT_TRUE=
13655 am__EXEEXT_FALSE='#'
13656else
13657 am__EXEEXT_TRUE='#'
13658 am__EXEEXT_FALSE=
13659fi
13660
13661if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
13662 as_fn_error $? "conditional \"AMDEP\" was never defined.
13663Usually this means the macro was only invoked conditionally." "$LINENO" 5
13664fi
13665if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
13666 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
13667Usually this means the macro was only invoked conditionally." "$LINENO" 5
13668fi
13669if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
13670 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
13671Usually this means the macro was only invoked conditionally." "$LINENO" 5
13672fi
13673if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
13674 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
13675Usually this means the macro was only invoked conditionally." "$LINENO" 5
13676fi
13677if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then
13678 as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined.
13679Usually this means the macro was only invoked conditionally." "$LINENO" 5
13680fi
13681
13682: "${CONFIG_STATUS=./config.status}"
13683ac_write_fail=0
13684ac_clean_files_save=$ac_clean_files
13685ac_clean_files="$ac_clean_files $CONFIG_STATUS"
13686{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
13687$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
13688as_write_fail=0
13689cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
13690#! $SHELL
13691# Generated by $as_me.
13692# Run this file to recreate the current configuration.
13693# Compiler output produced by configure, useful for debugging
13694# configure, is in config.log if it exists.
13695
13696debug=false
13697ac_cs_recheck=false
13698ac_cs_silent=false
13699
13700SHELL=\${CONFIG_SHELL-$SHELL}
13701export SHELL
13702_ASEOF
13703cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
13704## -------------------- ##
13705## M4sh Initialization. ##
13706## -------------------- ##
13707
13708# Be more Bourne compatible
13709DUALCASE=1; export DUALCASE # for MKS sh
13710if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
13711 emulate sh
13712 NULLCMD=:
13713 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
13714 # is contrary to our usage. Disable this feature.
13715 alias -g '${1+"$@"}'='"$@"'
13716 setopt NO_GLOB_SUBST
13717else
13718 case `(set -o) 2>/dev/null` in #(
13719 *posix*) :
13720 set -o posix ;; #(
13721 *) :
13722 ;;
13723esac
13724fi
13725
13726
13727as_nl='
13728'
13729export as_nl
13730# Printing a long string crashes Solaris 7 /usr/bin/printf.
13731as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
13732as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
13733as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
13734# Prefer a ksh shell builtin over an external printf program on Solaris,
13735# but without wasting forks for bash or zsh.
13736if test -z "$BASH_VERSION$ZSH_VERSION" \
13737 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
13738 as_echo='print -r --'
13739 as_echo_n='print -rn --'
13740elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
13741 as_echo='printf %s\n'
13742 as_echo_n='printf %s'
13743else
13744 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
13745 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
13746 as_echo_n='/usr/ucb/echo -n'
13747 else
13748 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
13749 as_echo_n_body='eval
13750 arg=$1;
13751 case $arg in #(
13752 *"$as_nl"*)
13753 expr "X$arg" : "X\\(.*\\)$as_nl";
13754 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
13755 esac;
13756 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
13757 '
13758 export as_echo_n_body
13759 as_echo_n='sh -c $as_echo_n_body as_echo'
13760 fi
13761 export as_echo_body
13762 as_echo='sh -c $as_echo_body as_echo'
13763fi
13764
13765# The user is always right.
13766if test "${PATH_SEPARATOR+set}" != set; then
13767 PATH_SEPARATOR=:
13768 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
13769 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
13770 PATH_SEPARATOR=';'
13771 }
13772fi
13773
13774
13775# IFS
13776# We need space, tab and new line, in precisely that order. Quoting is
13777# there to prevent editors from complaining about space-tab.
13778# (If _AS_PATH_WALK were called with IFS unset, it would disable word
13779# splitting by setting IFS to empty value.)
13780IFS=" "" $as_nl"
13781
13782# Find who we are. Look in the path if we contain no directory separator.
13783as_myself=
13784case $0 in #((
13785 *[\\/]* ) as_myself=$0 ;;
13786 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13787for as_dir in $PATH
13788do
13789 IFS=$as_save_IFS
13790 test -z "$as_dir" && as_dir=.
13791 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
13792 done
13793IFS=$as_save_IFS
13794
13795 ;;
13796esac
13797# We did not find ourselves, most probably we were run as `sh COMMAND'
13798# in which case we are not to be found in the path.
13799if test "x$as_myself" = x; then
13800 as_myself=$0
13801fi
13802if test ! -f "$as_myself"; then
13803 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
13804 exit 1
13805fi
13806
13807# Unset variables that we do not need and which cause bugs (e.g. in
13808# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
13809# suppresses any "Segmentation fault" message there. '((' could
13810# trigger a bug in pdksh 5.2.14.
13811for as_var in BASH_ENV ENV MAIL MAILPATH
13812do eval test x\${$as_var+set} = xset \
13813 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
13814done
13815PS1='$ '
13816PS2='> '
13817PS4='+ '
13818
13819# NLS nuisances.
13820LC_ALL=C
13821export LC_ALL
13822LANGUAGE=C
13823export LANGUAGE
13824
13825# CDPATH.
13826(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
13827
13828
13829# as_fn_error STATUS ERROR [LINENO LOG_FD]
13830# ----------------------------------------
13831# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
13832# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
13833# script with STATUS, using 1 if that was 0.
13834as_fn_error ()
13835{
13836 as_status=$1; test $as_status -eq 0 && as_status=1
13837 if test "$4"; then
13838 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
13839 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
13840 fi
13841 $as_echo "$as_me: error: $2" >&2
13842 as_fn_exit $as_status
13843} # as_fn_error
13844
13845
13846# as_fn_set_status STATUS
13847# -----------------------
13848# Set $? to STATUS, without forking.
13849as_fn_set_status ()
13850{
13851 return $1
13852} # as_fn_set_status
13853
13854# as_fn_exit STATUS
13855# -----------------
13856# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
13857as_fn_exit ()
13858{
13859 set +e
13860 as_fn_set_status $1
13861 exit $1
13862} # as_fn_exit
13863
13864# as_fn_unset VAR
13865# ---------------
13866# Portably unset VAR.
13867as_fn_unset ()
13868{
13869 { eval $1=; unset $1;}
13870}
13871as_unset=as_fn_unset
13872# as_fn_append VAR VALUE
13873# ----------------------
13874# Append the text in VALUE to the end of the definition contained in VAR. Take
13875# advantage of any shell optimizations that allow amortized linear growth over
13876# repeated appends, instead of the typical quadratic growth present in naive
13877# implementations.
13878if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
13879 eval 'as_fn_append ()
13880 {
13881 eval $1+=\$2
13882 }'
13883else
13884 as_fn_append ()
13885 {
13886 eval $1=\$$1\$2
13887 }
13888fi # as_fn_append
13889
13890# as_fn_arith ARG...
13891# ------------------
13892# Perform arithmetic evaluation on the ARGs, and store the result in the
13893# global $as_val. Take advantage of shells that can avoid forks. The arguments
13894# must be portable across $(()) and expr.
13895if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
13896 eval 'as_fn_arith ()
13897 {
13898 as_val=$(( $* ))
13899 }'
13900else
13901 as_fn_arith ()
13902 {
13903 as_val=`expr "$@" || test $? -eq 1`
13904 }
13905fi # as_fn_arith
13906
13907
13908if expr a : '\(a\)' >/dev/null 2>&1 &&
13909 test "X`expr 00001 : '.*\(...\)'`" = X001; then
13910 as_expr=expr
13911else
13912 as_expr=false
13913fi
13914
13915if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
13916 as_basename=basename
13917else
13918 as_basename=false
13919fi
13920
13921if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
13922 as_dirname=dirname
13923else
13924 as_dirname=false
13925fi
13926
13927as_me=`$as_basename -- "$0" ||
13928$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
13929 X"$0" : 'X\(//\)$' \| \
13930 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
13931$as_echo X/"$0" |
13932 sed '/^.*\/\([^/][^/]*\)\/*$/{
13933 s//\1/
13934 q
13935 }
13936 /^X\/\(\/\/\)$/{
13937 s//\1/
13938 q
13939 }
13940 /^X\/\(\/\).*/{
13941 s//\1/
13942 q
13943 }
13944 s/.*/./; q'`
13945
13946# Avoid depending upon Character Ranges.
13947as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13948as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13949as_cr_Letters=$as_cr_letters$as_cr_LETTERS
13950as_cr_digits='0123456789'
13951as_cr_alnum=$as_cr_Letters$as_cr_digits
13952
13953ECHO_C= ECHO_N= ECHO_T=
13954case `echo -n x` in #(((((
13955-n*)
13956 case `echo 'xy\c'` in
13957 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
13958 xy) ECHO_C='\c';;
13959 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
13960 ECHO_T=' ';;
13961 esac;;
13962*)
13963 ECHO_N='-n';;
13964esac
13965
13966rm -f conf$$ conf$$.exe conf$$.file
13967if test -d conf$$.dir; then
13968 rm -f conf$$.dir/conf$$.file
13969else
13970 rm -f conf$$.dir
13971 mkdir conf$$.dir 2>/dev/null
13972fi
13973if (echo >conf$$.file) 2>/dev/null; then
13974 if ln -s conf$$.file conf$$ 2>/dev/null; then
13975 as_ln_s='ln -s'
13976 # ... but there are two gotchas:
13977 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
13978 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
13979 # In both cases, we have to default to `cp -p'.
13980 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
13981 as_ln_s='cp -p'
13982 elif ln conf$$.file conf$$ 2>/dev/null; then
13983 as_ln_s=ln
13984 else
13985 as_ln_s='cp -p'
13986 fi
13987else
13988 as_ln_s='cp -p'
13989fi
13990rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
13991rmdir conf$$.dir 2>/dev/null
13992
13993
13994# as_fn_mkdir_p
13995# -------------
13996# Create "$as_dir" as a directory, including parents if necessary.
13997as_fn_mkdir_p ()
13998{
13999
14000 case $as_dir in #(
14001 -*) as_dir=./$as_dir;;
14002 esac
14003 test -d "$as_dir" || eval $as_mkdir_p || {
14004 as_dirs=
14005 while :; do
14006 case $as_dir in #(
14007 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
14008 *) as_qdir=$as_dir;;
14009 esac
14010 as_dirs="'$as_qdir' $as_dirs"
14011 as_dir=`$as_dirname -- "$as_dir" ||
14012$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14013 X"$as_dir" : 'X\(//\)[^/]' \| \
14014 X"$as_dir" : 'X\(//\)$' \| \
14015 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
14016$as_echo X"$as_dir" |
14017 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14018 s//\1/
14019 q
14020 }
14021 /^X\(\/\/\)[^/].*/{
14022 s//\1/
14023 q
14024 }
14025 /^X\(\/\/\)$/{
14026 s//\1/
14027 q
14028 }
14029 /^X\(\/\).*/{
14030 s//\1/
14031 q
14032 }
14033 s/.*/./; q'`
14034 test -d "$as_dir" && break
14035 done
14036 test -z "$as_dirs" || eval "mkdir $as_dirs"
14037 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
14038
14039
14040} # as_fn_mkdir_p
14041if mkdir -p . 2>/dev/null; then
14042 as_mkdir_p='mkdir -p "$as_dir"'
14043else
14044 test -d ./-p && rmdir ./-p
14045 as_mkdir_p=false
14046fi
14047
14048if test -x / >/dev/null 2>&1; then
14049 as_test_x='test -x'
14050else
14051 if ls -dL / >/dev/null 2>&1; then
14052 as_ls_L_option=L
14053 else
14054 as_ls_L_option=
14055 fi
14056 as_test_x='
14057 eval sh -c '\''
14058 if test -d "$1"; then
14059 test -d "$1/.";
14060 else
14061 case $1 in #(
14062 -*)set "./$1";;
14063 esac;
14064 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
14065 ???[sx]*):;;*)false;;esac;fi
14066 '\'' sh
14067 '
14068fi
14069as_executable_p=$as_test_x
14070
14071# Sed expression to map a string onto a valid CPP name.
14072as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
14073
14074# Sed expression to map a string onto a valid variable name.
14075as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
14076
14077
14078exec 6>&1
14079## ----------------------------------- ##
14080## Main body of $CONFIG_STATUS script. ##
14081## ----------------------------------- ##
14082_ASEOF
14083test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
14084
14085cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14086# Save the log message, to keep $0 and so on meaningful, and to
14087# report actual input values of CONFIG_FILES etc. instead of their
14088# values after options handling.
14089ac_log="
14090This file was extended by libjpeg $as_me 8.4.0, which was
14091generated by GNU Autoconf 2.68. Invocation command line was
14092
14093 CONFIG_FILES = $CONFIG_FILES
14094 CONFIG_HEADERS = $CONFIG_HEADERS
14095 CONFIG_LINKS = $CONFIG_LINKS
14096 CONFIG_COMMANDS = $CONFIG_COMMANDS
14097 $ $0 $@
14098
14099on `(hostname || uname -n) 2>/dev/null | sed 1q`
14100"
14101
14102_ACEOF
14103
14104case $ac_config_files in *"
14105"*) set x $ac_config_files; shift; ac_config_files=$*;;
14106esac
14107
14108case $ac_config_headers in *"
14109"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
14110esac
14111
14112
14113cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14114# Files that config.status was made for.
14115config_files="$ac_config_files"
14116config_headers="$ac_config_headers"
14117config_commands="$ac_config_commands"
14118
14119_ACEOF
14120
14121cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14122ac_cs_usage="\
14123\`$as_me' instantiates files and other configuration actions
14124from templates according to the current configuration. Unless the files
14125and actions are specified as TAGs, all are instantiated by default.
14126
14127Usage: $0 [OPTION]... [TAG]...
14128
14129 -h, --help print this help, then exit
14130 -V, --version print version number and configuration settings, then exit
14131 --config print configuration, then exit
14132 -q, --quiet, --silent
14133 do not print progress messages
14134 -d, --debug don't remove temporary files
14135 --recheck update $as_me by reconfiguring in the same conditions
14136 --file=FILE[:TEMPLATE]
14137 instantiate the configuration file FILE
14138 --header=FILE[:TEMPLATE]
14139 instantiate the configuration header FILE
14140
14141Configuration files:
14142$config_files
14143
14144Configuration headers:
14145$config_headers
14146
14147Configuration commands:
14148$config_commands
14149
14150Report bugs to the package provider."
14151
14152_ACEOF
14153cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14154ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
14155ac_cs_version="\\
14156libjpeg config.status 8.4.0
14157configured by $0, generated by GNU Autoconf 2.68,
14158 with options \\"\$ac_cs_config\\"
14159
14160Copyright (C) 2010 Free Software Foundation, Inc.
14161This config.status script is free software; the Free Software Foundation
14162gives unlimited permission to copy, distribute and modify it."
14163
14164ac_pwd='$ac_pwd'
14165srcdir='$srcdir'
14166INSTALL='$INSTALL'
14167MKDIR_P='$MKDIR_P'
14168AWK='$AWK'
14169test -n "\$AWK" || AWK=awk
14170_ACEOF
14171
14172cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14173# The default lists apply if the user does not specify any file.
14174ac_need_defaults=:
14175while test $# != 0
14176do
14177 case $1 in
14178 --*=?*)
14179 ac_option=`expr "X$1" : 'X\([^=]*\)='`
14180 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
14181 ac_shift=:
14182 ;;
14183 --*=)
14184 ac_option=`expr "X$1" : 'X\([^=]*\)='`
14185 ac_optarg=
14186 ac_shift=:
14187 ;;
14188 *)
14189 ac_option=$1
14190 ac_optarg=$2
14191 ac_shift=shift
14192 ;;
14193 esac
14194
14195 case $ac_option in
14196 # Handling of the options.
14197 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14198 ac_cs_recheck=: ;;
14199 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
14200 $as_echo "$ac_cs_version"; exit ;;
14201 --config | --confi | --conf | --con | --co | --c )
14202 $as_echo "$ac_cs_config"; exit ;;
14203 --debug | --debu | --deb | --de | --d | -d )
14204 debug=: ;;
14205 --file | --fil | --fi | --f )
14206 $ac_shift
14207 case $ac_optarg in
14208 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
14209 '') as_fn_error $? "missing file argument" ;;
14210 esac
14211 as_fn_append CONFIG_FILES " '$ac_optarg'"
14212 ac_need_defaults=false;;
14213 --header | --heade | --head | --hea )
14214 $ac_shift
14215 case $ac_optarg in
14216 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
14217 esac
14218 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
14219 ac_need_defaults=false;;
14220 --he | --h)
14221 # Conflict between --help and --header
14222 as_fn_error $? "ambiguous option: \`$1'
14223Try \`$0 --help' for more information.";;
14224 --help | --hel | -h )
14225 $as_echo "$ac_cs_usage"; exit ;;
14226 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
14227 | -silent | --silent | --silen | --sile | --sil | --si | --s)
14228 ac_cs_silent=: ;;
14229
14230 # This is an error.
14231 -*) as_fn_error $? "unrecognized option: \`$1'
14232Try \`$0 --help' for more information." ;;
14233
14234 *) as_fn_append ac_config_targets " $1"
14235 ac_need_defaults=false ;;
14236
14237 esac
14238 shift
14239done
14240
14241ac_configure_extra_args=
14242
14243if $ac_cs_silent; then
14244 exec 6>/dev/null
14245 ac_configure_extra_args="$ac_configure_extra_args --silent"
14246fi
14247
14248_ACEOF
14249cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14250if \$ac_cs_recheck; then
14251 set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
14252 shift
14253 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
14254 CONFIG_SHELL='$SHELL'
14255 export CONFIG_SHELL
14256 exec "\$@"
14257fi
14258
14259_ACEOF
14260cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14261exec 5>>config.log
14262{
14263 echo
14264 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
14265## Running $as_me. ##
14266_ASBOX
14267 $as_echo "$ac_log"
14268} >&5
14269
14270_ACEOF
14271cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14272#
14273# INIT-COMMANDS
14274#
14275AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
14276
14277
14278# The HP-UX ksh and POSIX shell print the target directory to stdout
14279# if CDPATH is set.
14280(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
14281
14282sed_quote_subst='$sed_quote_subst'
14283double_quote_subst='$double_quote_subst'
14284delay_variable_subst='$delay_variable_subst'
14285AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
14286DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
14287OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
14288macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
14289macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
14290enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
14291enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
14292pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
14293enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
14294SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
14295ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
14296PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
14297host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
14298host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
14299host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
14300build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
14301build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
14302build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
14303SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
14304Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
14305GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
14306EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
14307FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
14308LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
14309NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
14310LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
14311max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
14312ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
14313exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
14314lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
14315lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
14316lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
14317lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
14318lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
14319reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
14320reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
14321deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
14322file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
14323file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
14324want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
14325sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
14326AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
14327AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
14328archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
14329STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
14330RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
14331old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
14332old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
14333old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
14334lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
14335CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
14336CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
14337compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
14338GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
14339lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
14340lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
14341lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
14342lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
14343nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
14344lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
14345objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
14346MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
14347lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
14348lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
14349lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
14350lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
14351lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
14352need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
14353MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
14354DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
14355NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
14356LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
14357OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
14358OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
14359libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
14360shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
14361extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
14362archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
14363enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
14364export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
14365whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
14366compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
14367old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
14368old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
14369archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
14370archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
14371module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
14372module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
14373with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
14374allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
14375no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
14376hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
14377hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
14378hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
14379hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
14380hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
14381hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
14382hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
14383inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
14384link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
14385always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
14386export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
14387exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
14388include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
14389prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
14390postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
14391file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
14392variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
14393need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
14394need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
14395version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
14396runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
14397shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
14398shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
14399libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
14400library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
14401soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
14402install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
14403postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
14404postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
14405finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
14406finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
14407hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
14408sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
14409sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
14410hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
14411enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
14412enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
14413enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
14414old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
14415striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
14416
14417LTCC='$LTCC'
14418LTCFLAGS='$LTCFLAGS'
14419compiler='$compiler_DEFAULT'
14420
14421# A function that is used when there is no print builtin or printf.
14422func_fallback_echo ()
14423{
14424 eval 'cat <<_LTECHO_EOF
14425\$1
14426_LTECHO_EOF'
14427}
14428
14429# Quote evaled strings.
14430for var in AS \
14431DLLTOOL \
14432OBJDUMP \
14433SHELL \
14434ECHO \
14435PATH_SEPARATOR \
14436SED \
14437GREP \
14438EGREP \
14439FGREP \
14440LD \
14441NM \
14442LN_S \
14443lt_SP2NL \
14444lt_NL2SP \
14445reload_flag \
14446deplibs_check_method \
14447file_magic_cmd \
14448file_magic_glob \
14449want_nocaseglob \
14450sharedlib_from_linklib_cmd \
14451AR \
14452AR_FLAGS \
14453archiver_list_spec \
14454STRIP \
14455RANLIB \
14456CC \
14457CFLAGS \
14458compiler \
14459lt_cv_sys_global_symbol_pipe \
14460lt_cv_sys_global_symbol_to_cdecl \
14461lt_cv_sys_global_symbol_to_c_name_address \
14462lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
14463nm_file_list_spec \
14464lt_prog_compiler_no_builtin_flag \
14465lt_prog_compiler_pic \
14466lt_prog_compiler_wl \
14467lt_prog_compiler_static \
14468lt_cv_prog_compiler_c_o \
14469need_locks \
14470MANIFEST_TOOL \
14471DSYMUTIL \
14472NMEDIT \
14473LIPO \
14474OTOOL \
14475OTOOL64 \
14476shrext_cmds \
14477export_dynamic_flag_spec \
14478whole_archive_flag_spec \
14479compiler_needs_object \
14480with_gnu_ld \
14481allow_undefined_flag \
14482no_undefined_flag \
14483hardcode_libdir_flag_spec \
14484hardcode_libdir_separator \
14485exclude_expsyms \
14486include_expsyms \
14487file_list_spec \
14488variables_saved_for_relink \
14489libname_spec \
14490library_names_spec \
14491soname_spec \
14492install_override_mode \
14493finish_eval \
14494old_striplib \
14495striplib; do
14496 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
14497 *[\\\\\\\`\\"\\\$]*)
14498 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
14499 ;;
14500 *)
14501 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
14502 ;;
14503 esac
14504done
14505
14506# Double-quote double-evaled strings.
14507for var in reload_cmds \
14508old_postinstall_cmds \
14509old_postuninstall_cmds \
14510old_archive_cmds \
14511extract_expsyms_cmds \
14512old_archive_from_new_cmds \
14513old_archive_from_expsyms_cmds \
14514archive_cmds \
14515archive_expsym_cmds \
14516module_cmds \
14517module_expsym_cmds \
14518export_symbols_cmds \
14519prelink_cmds \
14520postlink_cmds \
14521postinstall_cmds \
14522postuninstall_cmds \
14523finish_cmds \
14524sys_lib_search_path_spec \
14525sys_lib_dlsearch_path_spec; do
14526 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
14527 *[\\\\\\\`\\"\\\$]*)
14528 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
14529 ;;
14530 *)
14531 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
14532 ;;
14533 esac
14534done
14535
14536ac_aux_dir='$ac_aux_dir'
14537xsi_shell='$xsi_shell'
14538lt_shell_append='$lt_shell_append'
14539
14540# See if we are running on zsh, and set the options which allow our
14541# commands through without removal of \ escapes INIT.
14542if test -n "\${ZSH_VERSION+set}" ; then
14543 setopt NO_GLOB_SUBST
14544fi
14545
14546
14547 PACKAGE='$PACKAGE'
14548 VERSION='$VERSION'
14549 TIMESTAMP='$TIMESTAMP'
14550 RM='$RM'
14551 ofile='$ofile'
14552
14553
14554
14555
14556_ACEOF
14557
14558cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14559
14560# Handling of arguments.
14561for ac_config_target in $ac_config_targets
14562do
14563 case $ac_config_target in
14564 "jconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS jconfig.h:jconfig.cfg" ;;
14565 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
14566 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
14567 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14568
14569 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
14570 esac
14571done
14572
14573
14574# If the user did not use the arguments to specify the items to instantiate,
14575# then the envvar interface is used. Set only those that are not.
14576# We use the long form for the default assignment because of an extremely
14577# bizarre bug on SunOS 4.1.3.
14578if $ac_need_defaults; then
14579 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14580 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14581 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14582fi
14583
14584# Have a temporary directory for convenience. Make it in the build tree
14585# simply because there is no reason against having it here, and in addition,
14586# creating and moving files from /tmp can sometimes cause problems.
14587# Hook for its removal unless debugging.
14588# Note that there is a small window in which the directory will not be cleaned:
14589# after its creation but before its name has been assigned to `$tmp'.
14590$debug ||
14591{
14592 tmp= ac_tmp=
14593 trap 'exit_status=$?
14594 : "${ac_tmp:=$tmp}"
14595 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
14596' 0
14597 trap 'as_fn_exit 1' 1 2 13 15
14598}
14599# Create a (secure) tmp directory for tmp files.
14600
14601{
14602 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
14603 test -d "$tmp"
14604} ||
14605{
14606 tmp=./conf$$-$RANDOM
14607 (umask 077 && mkdir "$tmp")
14608} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
14609ac_tmp=$tmp
14610
14611# Set up the scripts for CONFIG_FILES section.
14612# No need to generate them if there are no CONFIG_FILES.
14613# This happens for instance with `./config.status config.h'.
14614if test -n "$CONFIG_FILES"; then
14615
14616
14617ac_cr=`echo X | tr X '\015'`
14618# On cygwin, bash can eat \r inside `` if the user requested igncr.
14619# But we know of no other shell where ac_cr would be empty at this
14620# point, so we can use a bashism as a fallback.
14621if test "x$ac_cr" = x; then
14622 eval ac_cr=\$\'\\r\'
14623fi
14624ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
14625if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
14626 ac_cs_awk_cr='\\r'
14627else
14628 ac_cs_awk_cr=$ac_cr
14629fi
14630
14631echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
14632_ACEOF
14633
14634
14635{
14636 echo "cat >conf$$subs.awk <<_ACEOF" &&
14637 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
14638 echo "_ACEOF"
14639} >conf$$subs.sh ||
14640 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
14641ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
14642ac_delim='%!_!# '
14643for ac_last_try in false false false false false :; do
14644 . ./conf$$subs.sh ||
14645 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
14646
14647 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
14648 if test $ac_delim_n = $ac_delim_num; then
14649 break
14650 elif $ac_last_try; then
14651 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
14652 else
14653 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
14654 fi
14655done
14656rm -f conf$$subs.sh
14657
14658cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14659cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
14660_ACEOF
14661sed -n '
14662h
14663s/^/S["/; s/!.*/"]=/
14664p
14665g
14666s/^[^!]*!//
14667:repl
14668t repl
14669s/'"$ac_delim"'$//
14670t delim
14671:nl
14672h
14673s/\(.\{148\}\)..*/\1/
14674t more1
14675s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
14676p
14677n
14678b repl
14679:more1
14680s/["\\]/\\&/g; s/^/"/; s/$/"\\/
14681p
14682g
14683s/.\{148\}//
14684t nl
14685:delim
14686h
14687s/\(.\{148\}\)..*/\1/
14688t more2
14689s/["\\]/\\&/g; s/^/"/; s/$/"/
14690p
14691b
14692:more2
14693s/["\\]/\\&/g; s/^/"/; s/$/"\\/
14694p
14695g
14696s/.\{148\}//
14697t delim
14698' <conf$$subs.awk | sed '
14699/^[^""]/{
14700 N
14701 s/\n//
14702}
14703' >>$CONFIG_STATUS || ac_write_fail=1
14704rm -f conf$$subs.awk
14705cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14706_ACAWK
14707cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
14708 for (key in S) S_is_set[key] = 1
14709 FS = ""
14710
14711}
14712{
14713 line = $ 0
14714 nfields = split(line, field, "@")
14715 substed = 0
14716 len = length(field[1])
14717 for (i = 2; i < nfields; i++) {
14718 key = field[i]
14719 keylen = length(key)
14720 if (S_is_set[key]) {
14721 value = S[key]
14722 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
14723 len += length(value) + length(field[++i])
14724 substed = 1
14725 } else
14726 len += 1 + keylen
14727 }
14728
14729 print line
14730}
14731
14732_ACAWK
14733_ACEOF
14734cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14735if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
14736 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
14737else
14738 cat
14739fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
14740 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
14741_ACEOF
14742
14743# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
14744# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
14745# trailing colons and then remove the whole line if VPATH becomes empty
14746# (actually we leave an empty line to preserve line numbers).
14747if test "x$srcdir" = x.; then
14748 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
14749h
14750s///
14751s/^/:/
14752s/[ ]*$/:/
14753s/:\$(srcdir):/:/g
14754s/:\${srcdir}:/:/g
14755s/:@srcdir@:/:/g
14756s/^:*//
14757s/:*$//
14758x
14759s/\(=[ ]*\).*/\1/
14760G
14761s/\n//
14762s/^[^=]*=[ ]*$//
14763}'
14764fi
14765
14766cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14767fi # test -n "$CONFIG_FILES"
14768
14769# Set up the scripts for CONFIG_HEADERS section.
14770# No need to generate them if there are no CONFIG_HEADERS.
14771# This happens for instance with `./config.status Makefile'.
14772if test -n "$CONFIG_HEADERS"; then
14773cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
14774BEGIN {
14775_ACEOF
14776
14777# Transform confdefs.h into an awk script `defines.awk', embedded as
14778# here-document in config.status, that substitutes the proper values into
14779# config.h.in to produce config.h.
14780
14781# Create a delimiter string that does not exist in confdefs.h, to ease
14782# handling of long lines.
14783ac_delim='%!_!# '
14784for ac_last_try in false false :; do
14785 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
14786 if test -z "$ac_tt"; then
14787 break
14788 elif $ac_last_try; then
14789 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
14790 else
14791 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
14792 fi
14793done
14794
14795# For the awk script, D is an array of macro values keyed by name,
14796# likewise P contains macro parameters if any. Preserve backslash
14797# newline sequences.
14798
14799ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
14800sed -n '
14801s/.\{148\}/&'"$ac_delim"'/g
14802t rset
14803:rset
14804s/^[ ]*#[ ]*define[ ][ ]*/ /
14805t def
14806d
14807:def
14808s/\\$//
14809t bsnl
14810s/["\\]/\\&/g
14811s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
14812D["\1"]=" \3"/p
14813s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
14814d
14815:bsnl
14816s/["\\]/\\&/g
14817s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
14818D["\1"]=" \3\\\\\\n"\\/p
14819t cont
14820s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
14821t cont
14822d
14823:cont
14824n
14825s/.\{148\}/&'"$ac_delim"'/g
14826t clear
14827:clear
14828s/\\$//
14829t bsnlc
14830s/["\\]/\\&/g; s/^/"/; s/$/"/p
14831d
14832:bsnlc
14833s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
14834b cont
14835' <confdefs.h | sed '
14836s/'"$ac_delim"'/"\\\
14837"/g' >>$CONFIG_STATUS || ac_write_fail=1
14838
14839cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14840 for (key in D) D_is_set[key] = 1
14841 FS = ""
14842}
14843/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
14844 line = \$ 0
14845 split(line, arg, " ")
14846 if (arg[1] == "#") {
14847 defundef = arg[2]
14848 mac1 = arg[3]
14849 } else {
14850 defundef = substr(arg[1], 2)
14851 mac1 = arg[2]
14852 }
14853 split(mac1, mac2, "(") #)
14854 macro = mac2[1]
14855 prefix = substr(line, 1, index(line, defundef) - 1)
14856 if (D_is_set[macro]) {
14857 # Preserve the white space surrounding the "#".
14858 print prefix "define", macro P[macro] D[macro]
14859 next
14860 } else {
14861 # Replace #undef with comments. This is necessary, for example,
14862 # in the case of _POSIX_SOURCE, which is predefined and required
14863 # on some systems where configure will not decide to define it.
14864 if (defundef == "undef") {
14865 print "/*", prefix defundef, macro, "*/"
14866 next
14867 }
14868 }
14869}
14870{ print }
14871_ACAWK
14872_ACEOF
14873cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
14874 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
14875fi # test -n "$CONFIG_HEADERS"
14876
14877
14878eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
14879shift
14880for ac_tag
14881do
14882 case $ac_tag in
14883 :[FHLC]) ac_mode=$ac_tag; continue;;
14884 esac
14885 case $ac_mode$ac_tag in
14886 :[FHL]*:*);;
14887 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
14888 :[FH]-) ac_tag=-:-;;
14889 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
14890 esac
14891 ac_save_IFS=$IFS
14892 IFS=:
14893 set x $ac_tag
14894 IFS=$ac_save_IFS
14895 shift
14896 ac_file=$1
14897 shift
14898
14899 case $ac_mode in
14900 :L) ac_source=$1;;
14901 :[FH])
14902 ac_file_inputs=
14903 for ac_f
14904 do
14905 case $ac_f in
14906 -) ac_f="$ac_tmp/stdin";;
14907 *) # Look for the file first in the build tree, then in the source tree
14908 # (if the path is not absolute). The absolute path cannot be DOS-style,
14909 # because $ac_f cannot contain `:'.
14910 test -f "$ac_f" ||
14911 case $ac_f in
14912 [\\/$]*) false;;
14913 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
14914 esac ||
14915 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
14916 esac
14917 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
14918 as_fn_append ac_file_inputs " '$ac_f'"
14919 done
14920
14921 # Let's still pretend it is `configure' which instantiates (i.e., don't
14922 # use $as_me), people would be surprised to read:
14923 # /* config.h. Generated by config.status. */
14924 configure_input='Generated from '`
14925 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
14926 `' by configure.'
14927 if test x"$ac_file" != x-; then
14928 configure_input="$ac_file. $configure_input"
14929 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
14930$as_echo "$as_me: creating $ac_file" >&6;}
14931 fi
14932 # Neutralize special characters interpreted by sed in replacement strings.
14933 case $configure_input in #(
14934 *\&* | *\|* | *\\* )
14935 ac_sed_conf_input=`$as_echo "$configure_input" |
14936 sed 's/[\\\\&|]/\\\\&/g'`;; #(
14937 *) ac_sed_conf_input=$configure_input;;
14938 esac
14939
14940 case $ac_tag in
14941 *:-:* | *:-) cat >"$ac_tmp/stdin" \
14942 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
14943 esac
14944 ;;
14945 esac
14946
14947 ac_dir=`$as_dirname -- "$ac_file" ||
14948$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14949 X"$ac_file" : 'X\(//\)[^/]' \| \
14950 X"$ac_file" : 'X\(//\)$' \| \
14951 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
14952$as_echo X"$ac_file" |
14953 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14954 s//\1/
14955 q
14956 }
14957 /^X\(\/\/\)[^/].*/{
14958 s//\1/
14959 q
14960 }
14961 /^X\(\/\/\)$/{
14962 s//\1/
14963 q
14964 }
14965 /^X\(\/\).*/{
14966 s//\1/
14967 q
14968 }
14969 s/.*/./; q'`
14970 as_dir="$ac_dir"; as_fn_mkdir_p
14971 ac_builddir=.
14972
14973case "$ac_dir" in
14974.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
14975*)
14976 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
14977 # A ".." for each directory in $ac_dir_suffix.
14978 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
14979 case $ac_top_builddir_sub in
14980 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
14981 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
14982 esac ;;
14983esac
14984ac_abs_top_builddir=$ac_pwd
14985ac_abs_builddir=$ac_pwd$ac_dir_suffix
14986# for backward compatibility:
14987ac_top_builddir=$ac_top_build_prefix
14988
14989case $srcdir in
14990 .) # We are building in place.
14991 ac_srcdir=.
14992 ac_top_srcdir=$ac_top_builddir_sub
14993 ac_abs_top_srcdir=$ac_pwd ;;
14994 [\\/]* | ?:[\\/]* ) # Absolute name.
14995 ac_srcdir=$srcdir$ac_dir_suffix;
14996 ac_top_srcdir=$srcdir
14997 ac_abs_top_srcdir=$srcdir ;;
14998 *) # Relative name.
14999 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
15000 ac_top_srcdir=$ac_top_build_prefix$srcdir
15001 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
15002esac
15003ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
15004
15005
15006 case $ac_mode in
15007 :F)
15008 #
15009 # CONFIG_FILE
15010 #
15011
15012 case $INSTALL in
15013 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15014 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
15015 esac
15016 ac_MKDIR_P=$MKDIR_P
15017 case $MKDIR_P in
15018 [\\/$]* | ?:[\\/]* ) ;;
15019 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
15020 esac
15021_ACEOF
15022
15023cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15024# If the template does not know about datarootdir, expand it.
15025# FIXME: This hack should be removed a few years after 2.60.
15026ac_datarootdir_hack=; ac_datarootdir_seen=
15027ac_sed_dataroot='
15028/datarootdir/ {
15029 p
15030 q
15031}
15032/@datadir@/p
15033/@docdir@/p
15034/@infodir@/p
15035/@localedir@/p
15036/@mandir@/p'
15037case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
15038*datarootdir*) ac_datarootdir_seen=yes;;
15039*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
15040 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
15041$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
15042_ACEOF
15043cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15044 ac_datarootdir_hack='
15045 s&@datadir@&$datadir&g
15046 s&@docdir@&$docdir&g
15047 s&@infodir@&$infodir&g
15048 s&@localedir@&$localedir&g
15049 s&@mandir@&$mandir&g
15050 s&\\\${datarootdir}&$datarootdir&g' ;;
15051esac
15052_ACEOF
15053
15054# Neutralize VPATH when `$srcdir' = `.'.
15055# Shell code in configure.ac might set extrasub.
15056# FIXME: do we really want to maintain this feature?
15057cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15058ac_sed_extra="$ac_vpsub
15059$extrasub
15060_ACEOF
15061cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15062:t
15063/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15064s|@configure_input@|$ac_sed_conf_input|;t t
15065s&@top_builddir@&$ac_top_builddir_sub&;t t
15066s&@top_build_prefix@&$ac_top_build_prefix&;t t
15067s&@srcdir@&$ac_srcdir&;t t
15068s&@abs_srcdir@&$ac_abs_srcdir&;t t
15069s&@top_srcdir@&$ac_top_srcdir&;t t
15070s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
15071s&@builddir@&$ac_builddir&;t t
15072s&@abs_builddir@&$ac_abs_builddir&;t t
15073s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
15074s&@INSTALL@&$ac_INSTALL&;t t
15075s&@MKDIR_P@&$ac_MKDIR_P&;t t
15076$ac_datarootdir_hack
15077"
15078eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
15079 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15080
15081test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
15082 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
15083 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
15084 "$ac_tmp/out"`; test -z "$ac_out"; } &&
15085 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
15086which seems to be undefined. Please make sure it is defined" >&5
15087$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
15088which seems to be undefined. Please make sure it is defined" >&2;}
15089
15090 rm -f "$ac_tmp/stdin"
15091 case $ac_file in
15092 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
15093 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
15094 esac \
15095 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15096 ;;
15097 :H)
15098 #
15099 # CONFIG_HEADER
15100 #
15101 if test x"$ac_file" != x-; then
15102 {
15103 $as_echo "/* $configure_input */" \
15104 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
15105 } >"$ac_tmp/config.h" \
15106 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15107 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
15108 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
15109$as_echo "$as_me: $ac_file is unchanged" >&6;}
15110 else
15111 rm -f "$ac_file"
15112 mv "$ac_tmp/config.h" "$ac_file" \
15113 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
15114 fi
15115 else
15116 $as_echo "/* $configure_input */" \
15117 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
15118 || as_fn_error $? "could not create -" "$LINENO" 5
15119 fi
15120# Compute "$ac_file"'s index in $config_headers.
15121_am_arg="$ac_file"
15122_am_stamp_count=1
15123for _am_header in $config_headers :; do
15124 case $_am_header in
15125 $_am_arg | $_am_arg:* )
15126 break ;;
15127 * )
15128 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
15129 esac
15130done
15131echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
15132$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15133 X"$_am_arg" : 'X\(//\)[^/]' \| \
15134 X"$_am_arg" : 'X\(//\)$' \| \
15135 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
15136$as_echo X"$_am_arg" |
15137 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15138 s//\1/
15139 q
15140 }
15141 /^X\(\/\/\)[^/].*/{
15142 s//\1/
15143 q
15144 }
15145 /^X\(\/\/\)$/{
15146 s//\1/
15147 q
15148 }
15149 /^X\(\/\).*/{
15150 s//\1/
15151 q
15152 }
15153 s/.*/./; q'`/stamp-h$_am_stamp_count
15154 ;;
15155
15156 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
15157$as_echo "$as_me: executing $ac_file commands" >&6;}
15158 ;;
15159 esac
15160
15161
15162 case $ac_file$ac_mode in
15163 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
15164 # Autoconf 2.62 quotes --file arguments for eval, but not when files
15165 # are listed without --file. Let's play safe and only enable the eval
15166 # if we detect the quoting.
15167 case $CONFIG_FILES in
15168 *\'*) eval set x "$CONFIG_FILES" ;;
15169 *) set x $CONFIG_FILES ;;
15170 esac
15171 shift
15172 for mf
15173 do
15174 # Strip MF so we end up with the name of the file.
15175 mf=`echo "$mf" | sed -e 's/:.*$//'`
15176 # Check whether this is an Automake generated Makefile or not.
15177 # We used to match only the files named `Makefile.in', but
15178 # some people rename them; so instead we look at the file content.
15179 # Grep'ing the first line is not enough: some people post-process
15180 # each Makefile.in and add a new line on top of each file to say so.
15181 # Grep'ing the whole file is not good either: AIX grep has a line
15182 # limit of 2048, but all sed's we know have understand at least 4000.
15183 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
15184 dirpart=`$as_dirname -- "$mf" ||
15185$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15186 X"$mf" : 'X\(//\)[^/]' \| \
15187 X"$mf" : 'X\(//\)$' \| \
15188 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
15189$as_echo X"$mf" |
15190 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15191 s//\1/
15192 q
15193 }
15194 /^X\(\/\/\)[^/].*/{
15195 s//\1/
15196 q
15197 }
15198 /^X\(\/\/\)$/{
15199 s//\1/
15200 q
15201 }
15202 /^X\(\/\).*/{
15203 s//\1/
15204 q
15205 }
15206 s/.*/./; q'`
15207 else
15208 continue
15209 fi
15210 # Extract the definition of DEPDIR, am__include, and am__quote
15211 # from the Makefile without running `make'.
15212 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
15213 test -z "$DEPDIR" && continue
15214 am__include=`sed -n 's/^am__include = //p' < "$mf"`
15215 test -z "am__include" && continue
15216 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
15217 # When using ansi2knr, U may be empty or an underscore; expand it
15218 U=`sed -n 's/^U = //p' < "$mf"`
15219 # Find all dependency output files, they are included files with
15220 # $(DEPDIR) in their names. We invoke sed twice because it is the
15221 # simplest approach to changing $(DEPDIR) to its actual value in the
15222 # expansion.
15223 for file in `sed -n "
15224 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
15225 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
15226 # Make sure the directory exists.
15227 test -f "$dirpart/$file" && continue
15228 fdir=`$as_dirname -- "$file" ||
15229$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15230 X"$file" : 'X\(//\)[^/]' \| \
15231 X"$file" : 'X\(//\)$' \| \
15232 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
15233$as_echo X"$file" |
15234 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
15235 s//\1/
15236 q
15237 }
15238 /^X\(\/\/\)[^/].*/{
15239 s//\1/
15240 q
15241 }
15242 /^X\(\/\/\)$/{
15243 s//\1/
15244 q
15245 }
15246 /^X\(\/\).*/{
15247 s//\1/
15248 q
15249 }
15250 s/.*/./; q'`
15251 as_dir=$dirpart/$fdir; as_fn_mkdir_p
15252 # echo "creating $dirpart/$file"
15253 echo '# dummy' > "$dirpart/$file"
15254 done
15255 done
15256}
15257 ;;
15258 "libtool":C)
15259
15260 # See if we are running on zsh, and set the options which allow our
15261 # commands through without removal of \ escapes.
15262 if test -n "${ZSH_VERSION+set}" ; then
15263 setopt NO_GLOB_SUBST
15264 fi
15265
15266 cfgfile="${ofile}T"
15267 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
15268 $RM "$cfgfile"
15269
15270 cat <<_LT_EOF >> "$cfgfile"
15271#! $SHELL
15272
15273# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
15274# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
15275# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15276# NOTE: Changes made to this file will be lost: look at ltmain.sh.
15277#
15278# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
15279# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
15280# Foundation, Inc.
15281# Written by Gordon Matzigkeit, 1996
15282#
15283# This file is part of GNU Libtool.
15284#
15285# GNU Libtool is free software; you can redistribute it and/or
15286# modify it under the terms of the GNU General Public License as
15287# published by the Free Software Foundation; either version 2 of
15288# the License, or (at your option) any later version.
15289#
15290# As a special exception to the GNU General Public License,
15291# if you distribute this file as part of a program or library that
15292# is built using GNU Libtool, you may include this file under the
15293# same distribution terms that you use for the rest of that program.
15294#
15295# GNU Libtool is distributed in the hope that it will be useful,
15296# but WITHOUT ANY WARRANTY; without even the implied warranty of
15297# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15298# GNU General Public License for more details.
15299#
15300# You should have received a copy of the GNU General Public License
15301# along with GNU Libtool; see the file COPYING. If not, a copy
15302# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
15303# obtained by writing to the Free Software Foundation, Inc.,
15304# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15305
15306
15307# The names of the tagged configurations supported by this script.
15308available_tags=""
15309
15310# ### BEGIN LIBTOOL CONFIG
15311
15312# Assembler program.
15313AS=$lt_AS
15314
15315# DLL creation program.
15316DLLTOOL=$lt_DLLTOOL
15317
15318# Object dumper program.
15319OBJDUMP=$lt_OBJDUMP
15320
15321# Which release of libtool.m4 was used?
15322macro_version=$macro_version
15323macro_revision=$macro_revision
15324
15325# Whether or not to build shared libraries.
15326build_libtool_libs=$enable_shared
15327
15328# Whether or not to build static libraries.
15329build_old_libs=$enable_static
15330
15331# What type of objects to build.
15332pic_mode=$pic_mode
15333
15334# Whether or not to optimize for fast installation.
15335fast_install=$enable_fast_install
15336
15337# Shell to use when invoking shell scripts.
15338SHELL=$lt_SHELL
15339
15340# An echo program that protects backslashes.
15341ECHO=$lt_ECHO
15342
15343# The PATH separator for the build system.
15344PATH_SEPARATOR=$lt_PATH_SEPARATOR
15345
15346# The host system.
15347host_alias=$host_alias
15348host=$host
15349host_os=$host_os
15350
15351# The build system.
15352build_alias=$build_alias
15353build=$build
15354build_os=$build_os
15355
15356# A sed program that does not truncate output.
15357SED=$lt_SED
15358
15359# Sed that helps us avoid accidentally triggering echo(1) options like -n.
15360Xsed="\$SED -e 1s/^X//"
15361
15362# A grep program that handles long lines.
15363GREP=$lt_GREP
15364
15365# An ERE matcher.
15366EGREP=$lt_EGREP
15367
15368# A literal string matcher.
15369FGREP=$lt_FGREP
15370
15371# A BSD- or MS-compatible name lister.
15372NM=$lt_NM
15373
15374# Whether we need soft or hard links.
15375LN_S=$lt_LN_S
15376
15377# What is the maximum length of a command?
15378max_cmd_len=$max_cmd_len
15379
15380# Object file suffix (normally "o").
15381objext=$ac_objext
15382
15383# Executable file suffix (normally "").
15384exeext=$exeext
15385
15386# whether the shell understands "unset".
15387lt_unset=$lt_unset
15388
15389# turn spaces into newlines.
15390SP2NL=$lt_lt_SP2NL
15391
15392# turn newlines into spaces.
15393NL2SP=$lt_lt_NL2SP
15394
15395# convert \$build file names to \$host format.
15396to_host_file_cmd=$lt_cv_to_host_file_cmd
15397
15398# convert \$build files to toolchain format.
15399to_tool_file_cmd=$lt_cv_to_tool_file_cmd
15400
15401# Method to check whether dependent libraries are shared objects.
15402deplibs_check_method=$lt_deplibs_check_method
15403
15404# Command to use when deplibs_check_method = "file_magic".
15405file_magic_cmd=$lt_file_magic_cmd
15406
15407# How to find potential files when deplibs_check_method = "file_magic".
15408file_magic_glob=$lt_file_magic_glob
15409
15410# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
15411want_nocaseglob=$lt_want_nocaseglob
15412
15413# Command to associate shared and link libraries.
15414sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
15415
15416# The archiver.
15417AR=$lt_AR
15418
15419# Flags to create an archive.
15420AR_FLAGS=$lt_AR_FLAGS
15421
15422# How to feed a file listing to the archiver.
15423archiver_list_spec=$lt_archiver_list_spec
15424
15425# A symbol stripping program.
15426STRIP=$lt_STRIP
15427
15428# Commands used to install an old-style archive.
15429RANLIB=$lt_RANLIB
15430old_postinstall_cmds=$lt_old_postinstall_cmds
15431old_postuninstall_cmds=$lt_old_postuninstall_cmds
15432
15433# Whether to use a lock for old archive extraction.
15434lock_old_archive_extraction=$lock_old_archive_extraction
15435
15436# A C compiler.
15437LTCC=$lt_CC
15438
15439# LTCC compiler flags.
15440LTCFLAGS=$lt_CFLAGS
15441
15442# Take the output of nm and produce a listing of raw symbols and C names.
15443global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
15444
15445# Transform the output of nm in a proper C declaration.
15446global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
15447
15448# Transform the output of nm in a C name address pair.
15449global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
15450
15451# Transform the output of nm in a C name address pair when lib prefix is needed.
15452global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
15453
15454# Specify filename containing input files for \$NM.
15455nm_file_list_spec=$lt_nm_file_list_spec
15456
15457# The root where to search for dependent libraries,and in which our libraries should be installed.
15458lt_sysroot=$lt_sysroot
15459
15460# The name of the directory that contains temporary libtool files.
15461objdir=$objdir
15462
15463# Used to examine libraries when file_magic_cmd begins with "file".
15464MAGIC_CMD=$MAGIC_CMD
15465
15466# Must we lock files when doing compilation?
15467need_locks=$lt_need_locks
15468
15469# Manifest tool.
15470MANIFEST_TOOL=$lt_MANIFEST_TOOL
15471
15472# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
15473DSYMUTIL=$lt_DSYMUTIL
15474
15475# Tool to change global to local symbols on Mac OS X.
15476NMEDIT=$lt_NMEDIT
15477
15478# Tool to manipulate fat objects and archives on Mac OS X.
15479LIPO=$lt_LIPO
15480
15481# ldd/readelf like tool for Mach-O binaries on Mac OS X.
15482OTOOL=$lt_OTOOL
15483
15484# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
15485OTOOL64=$lt_OTOOL64
15486
15487# Old archive suffix (normally "a").
15488libext=$libext
15489
15490# Shared library suffix (normally ".so").
15491shrext_cmds=$lt_shrext_cmds
15492
15493# The commands to extract the exported symbol list from a shared archive.
15494extract_expsyms_cmds=$lt_extract_expsyms_cmds
15495
15496# Variables whose values should be saved in libtool wrapper scripts and
15497# restored at link time.
15498variables_saved_for_relink=$lt_variables_saved_for_relink
15499
15500# Do we need the "lib" prefix for modules?
15501need_lib_prefix=$need_lib_prefix
15502
15503# Do we need a version for libraries?
15504need_version=$need_version
15505
15506# Library versioning type.
15507version_type=$version_type
15508
15509# Shared library runtime path variable.
15510runpath_var=$runpath_var
15511
15512# Shared library path variable.
15513shlibpath_var=$shlibpath_var
15514
15515# Is shlibpath searched before the hard-coded library search path?
15516shlibpath_overrides_runpath=$shlibpath_overrides_runpath
15517
15518# Format of library name prefix.
15519libname_spec=$lt_libname_spec
15520
15521# List of archive names. First name is the real one, the rest are links.
15522# The last name is the one that the linker finds with -lNAME
15523library_names_spec=$lt_library_names_spec
15524
15525# The coded name of the library, if different from the real name.
15526soname_spec=$lt_soname_spec
15527
15528# Permission mode override for installation of shared libraries.
15529install_override_mode=$lt_install_override_mode
15530
15531# Command to use after installation of a shared archive.
15532postinstall_cmds=$lt_postinstall_cmds
15533
15534# Command to use after uninstallation of a shared archive.
15535postuninstall_cmds=$lt_postuninstall_cmds
15536
15537# Commands used to finish a libtool library installation in a directory.
15538finish_cmds=$lt_finish_cmds
15539
15540# As "finish_cmds", except a single script fragment to be evaled but
15541# not shown.
15542finish_eval=$lt_finish_eval
15543
15544# Whether we should hardcode library paths into libraries.
15545hardcode_into_libs=$hardcode_into_libs
15546
15547# Compile-time system search path for libraries.
15548sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
15549
15550# Run-time system search path for libraries.
15551sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
15552
15553# Whether dlopen is supported.
15554dlopen_support=$enable_dlopen
15555
15556# Whether dlopen of programs is supported.
15557dlopen_self=$enable_dlopen_self
15558
15559# Whether dlopen of statically linked programs is supported.
15560dlopen_self_static=$enable_dlopen_self_static
15561
15562# Commands to strip libraries.
15563old_striplib=$lt_old_striplib
15564striplib=$lt_striplib
15565
15566
15567# The linker used to build libraries.
15568LD=$lt_LD
15569
15570# How to create reloadable object files.
15571reload_flag=$lt_reload_flag
15572reload_cmds=$lt_reload_cmds
15573
15574# Commands used to build an old-style archive.
15575old_archive_cmds=$lt_old_archive_cmds
15576
15577# A language specific compiler.
15578CC=$lt_compiler
15579
15580# Is the compiler the GNU compiler?
15581with_gcc=$GCC
15582
15583# Compiler flag to turn off builtin functions.
15584no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
15585
15586# Additional compiler flags for building library objects.
15587pic_flag=$lt_lt_prog_compiler_pic
15588
15589# How to pass a linker flag through the compiler.
15590wl=$lt_lt_prog_compiler_wl
15591
15592# Compiler flag to prevent dynamic linking.
15593link_static_flag=$lt_lt_prog_compiler_static
15594
15595# Does compiler simultaneously support -c and -o options?
15596compiler_c_o=$lt_lt_cv_prog_compiler_c_o
15597
15598# Whether or not to add -lc for building shared libraries.
15599build_libtool_need_lc=$archive_cmds_need_lc
15600
15601# Whether or not to disallow shared libs when runtime libs are static.
15602allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
15603
15604# Compiler flag to allow reflexive dlopens.
15605export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
15606
15607# Compiler flag to generate shared objects directly from archives.
15608whole_archive_flag_spec=$lt_whole_archive_flag_spec
15609
15610# Whether the compiler copes with passing no objects directly.
15611compiler_needs_object=$lt_compiler_needs_object
15612
15613# Create an old-style archive from a shared archive.
15614old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
15615
15616# Create a temporary old-style archive to link instead of a shared archive.
15617old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
15618
15619# Commands used to build a shared archive.
15620archive_cmds=$lt_archive_cmds
15621archive_expsym_cmds=$lt_archive_expsym_cmds
15622
15623# Commands used to build a loadable module if different from building
15624# a shared archive.
15625module_cmds=$lt_module_cmds
15626module_expsym_cmds=$lt_module_expsym_cmds
15627
15628# Whether we are building with GNU ld or not.
15629with_gnu_ld=$lt_with_gnu_ld
15630
15631# Flag that allows shared libraries with undefined symbols to be built.
15632allow_undefined_flag=$lt_allow_undefined_flag
15633
15634# Flag that enforces no undefined symbols.
15635no_undefined_flag=$lt_no_undefined_flag
15636
15637# Flag to hardcode \$libdir into a binary during linking.
15638# This must work even if \$libdir does not exist
15639hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
15640
15641# Whether we need a single "-rpath" flag with a separated argument.
15642hardcode_libdir_separator=$lt_hardcode_libdir_separator
15643
15644# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
15645# DIR into the resulting binary.
15646hardcode_direct=$hardcode_direct
15647
15648# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
15649# DIR into the resulting binary and the resulting library dependency is
15650# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
15651# library is relocated.
15652hardcode_direct_absolute=$hardcode_direct_absolute
15653
15654# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
15655# into the resulting binary.
15656hardcode_minus_L=$hardcode_minus_L
15657
15658# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
15659# into the resulting binary.
15660hardcode_shlibpath_var=$hardcode_shlibpath_var
15661
15662# Set to "yes" if building a shared library automatically hardcodes DIR
15663# into the library and all subsequent libraries and executables linked
15664# against it.
15665hardcode_automatic=$hardcode_automatic
15666
15667# Set to yes if linker adds runtime paths of dependent libraries
15668# to runtime path list.
15669inherit_rpath=$inherit_rpath
15670
15671# Whether libtool must link a program against all its dependency libraries.
15672link_all_deplibs=$link_all_deplibs
15673
15674# Set to "yes" if exported symbols are required.
15675always_export_symbols=$always_export_symbols
15676
15677# The commands to list exported symbols.
15678export_symbols_cmds=$lt_export_symbols_cmds
15679
15680# Symbols that should not be listed in the preloaded symbols.
15681exclude_expsyms=$lt_exclude_expsyms
15682
15683# Symbols that must always be exported.
15684include_expsyms=$lt_include_expsyms
15685
15686# Commands necessary for linking programs (against libraries) with templates.
15687prelink_cmds=$lt_prelink_cmds
15688
15689# Commands necessary for finishing linking programs.
15690postlink_cmds=$lt_postlink_cmds
15691
15692# Specify filename containing input files.
15693file_list_spec=$lt_file_list_spec
15694
15695# How to hardcode a shared library path into an executable.
15696hardcode_action=$hardcode_action
15697
15698# ### END LIBTOOL CONFIG
15699
15700_LT_EOF
15701
15702 case $host_os in
15703 aix3*)
15704 cat <<\_LT_EOF >> "$cfgfile"
15705# AIX sometimes has problems with the GCC collect2 program. For some
15706# reason, if we set the COLLECT_NAMES environment variable, the problems
15707# vanish in a puff of smoke.
15708if test "X${COLLECT_NAMES+set}" != Xset; then
15709 COLLECT_NAMES=
15710 export COLLECT_NAMES
15711fi
15712_LT_EOF
15713 ;;
15714 esac
15715
15716
15717ltmain="$ac_aux_dir/ltmain.sh"
15718
15719
15720 # We use sed instead of cat because bash on DJGPP gets confused if
15721 # if finds mixed CR/LF and LF-only lines. Since sed operates in
15722 # text mode, it properly converts lines to CR/LF. This bash problem
15723 # is reportedly fixed, but why not run on old versions too?
15724 sed '$q' "$ltmain" >> "$cfgfile" \
15725 || (rm -f "$cfgfile"; exit 1)
15726
15727 if test x"$xsi_shell" = xyes; then
15728 sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
15729func_dirname ()\
15730{\
15731\ case ${1} in\
15732\ */*) func_dirname_result="${1%/*}${2}" ;;\
15733\ * ) func_dirname_result="${3}" ;;\
15734\ esac\
15735} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
15736 && mv -f "$cfgfile.tmp" "$cfgfile" \
15737 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15738test 0 -eq $? || _lt_function_replace_fail=:
15739
15740
15741 sed -e '/^func_basename ()$/,/^} # func_basename /c\
15742func_basename ()\
15743{\
15744\ func_basename_result="${1##*/}"\
15745} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
15746 && mv -f "$cfgfile.tmp" "$cfgfile" \
15747 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15748test 0 -eq $? || _lt_function_replace_fail=:
15749
15750
15751 sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
15752func_dirname_and_basename ()\
15753{\
15754\ case ${1} in\
15755\ */*) func_dirname_result="${1%/*}${2}" ;;\
15756\ * ) func_dirname_result="${3}" ;;\
15757\ esac\
15758\ func_basename_result="${1##*/}"\
15759} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
15760 && mv -f "$cfgfile.tmp" "$cfgfile" \
15761 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15762test 0 -eq $? || _lt_function_replace_fail=:
15763
15764
15765 sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
15766func_stripname ()\
15767{\
15768\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
15769\ # positional parameters, so assign one to ordinary parameter first.\
15770\ func_stripname_result=${3}\
15771\ func_stripname_result=${func_stripname_result#"${1}"}\
15772\ func_stripname_result=${func_stripname_result%"${2}"}\
15773} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
15774 && mv -f "$cfgfile.tmp" "$cfgfile" \
15775 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15776test 0 -eq $? || _lt_function_replace_fail=:
15777
15778
15779 sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
15780func_split_long_opt ()\
15781{\
15782\ func_split_long_opt_name=${1%%=*}\
15783\ func_split_long_opt_arg=${1#*=}\
15784} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
15785 && mv -f "$cfgfile.tmp" "$cfgfile" \
15786 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15787test 0 -eq $? || _lt_function_replace_fail=:
15788
15789
15790 sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
15791func_split_short_opt ()\
15792{\
15793\ func_split_short_opt_arg=${1#??}\
15794\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
15795} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
15796 && mv -f "$cfgfile.tmp" "$cfgfile" \
15797 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15798test 0 -eq $? || _lt_function_replace_fail=:
15799
15800
15801 sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
15802func_lo2o ()\
15803{\
15804\ case ${1} in\
15805\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
15806\ *) func_lo2o_result=${1} ;;\
15807\ esac\
15808} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
15809 && mv -f "$cfgfile.tmp" "$cfgfile" \
15810 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15811test 0 -eq $? || _lt_function_replace_fail=:
15812
15813
15814 sed -e '/^func_xform ()$/,/^} # func_xform /c\
15815func_xform ()\
15816{\
15817 func_xform_result=${1%.*}.lo\
15818} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
15819 && mv -f "$cfgfile.tmp" "$cfgfile" \
15820 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15821test 0 -eq $? || _lt_function_replace_fail=:
15822
15823
15824 sed -e '/^func_arith ()$/,/^} # func_arith /c\
15825func_arith ()\
15826{\
15827 func_arith_result=$(( $* ))\
15828} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
15829 && mv -f "$cfgfile.tmp" "$cfgfile" \
15830 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15831test 0 -eq $? || _lt_function_replace_fail=:
15832
15833
15834 sed -e '/^func_len ()$/,/^} # func_len /c\
15835func_len ()\
15836{\
15837 func_len_result=${#1}\
15838} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
15839 && mv -f "$cfgfile.tmp" "$cfgfile" \
15840 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15841test 0 -eq $? || _lt_function_replace_fail=:
15842
15843fi
15844
15845if test x"$lt_shell_append" = xyes; then
15846 sed -e '/^func_append ()$/,/^} # func_append /c\
15847func_append ()\
15848{\
15849 eval "${1}+=\\${2}"\
15850} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
15851 && mv -f "$cfgfile.tmp" "$cfgfile" \
15852 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15853test 0 -eq $? || _lt_function_replace_fail=:
15854
15855
15856 sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
15857func_append_quoted ()\
15858{\
15859\ func_quote_for_eval "${2}"\
15860\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
15861} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
15862 && mv -f "$cfgfile.tmp" "$cfgfile" \
15863 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15864test 0 -eq $? || _lt_function_replace_fail=:
15865
15866
15867 # Save a `func_append' function call where possible by direct use of '+='
15868 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
15869 && mv -f "$cfgfile.tmp" "$cfgfile" \
15870 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15871 test 0 -eq $? || _lt_function_replace_fail=:
15872else
15873 # Save a `func_append' function call even when '+=' is not available
15874 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
15875 && mv -f "$cfgfile.tmp" "$cfgfile" \
15876 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15877 test 0 -eq $? || _lt_function_replace_fail=:
15878fi
15879
15880if test x"$_lt_function_replace_fail" = x":"; then
15881 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
15882$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
15883fi
15884
15885
15886 mv -f "$cfgfile" "$ofile" ||
15887 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
15888 chmod +x "$ofile"
15889
15890 ;;
15891
15892 esac
15893done # for ac_tag
15894
15895
15896as_fn_exit 0
15897_ACEOF
15898ac_clean_files=$ac_clean_files_save
15899
15900test $ac_write_fail = 0 ||
15901 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
15902
15903
15904# configure is writing to config.log, and then calls config.status.
15905# config.status does its own redirection, appending to config.log.
15906# Unfortunately, on DOS this fails, as config.log is still kept open
15907# by configure, so config.status won't be able to write to it; its
15908# output is simply discarded. So we exec the FD to /dev/null,
15909# effectively closing config.log, so it can be properly (re)opened and
15910# appended to by config.status. When coming back to configure, we
15911# need to make the FD available again.
15912if test "$no_create" != yes; then
15913 ac_cs_success=:
15914 ac_config_status_args=
15915 test "$silent" = yes &&
15916 ac_config_status_args="$ac_config_status_args --quiet"
15917 exec 5>/dev/null
15918 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
15919 exec 5>>config.log
15920 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15921 # would make configure fail if this is the last instruction.
15922 $ac_cs_success || as_fn_exit 1
15923fi
15924if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
15925 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
15926$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
15927fi
15928
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac
new file mode 100644
index 0000000..c3c3d81
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac
@@ -0,0 +1,356 @@
1# IJG auto-configuration source file.
2# Process this file with autoconf to produce a configure script.
3
4#
5# Configure script for IJG libjpeg
6#
7
8AC_INIT([libjpeg], [8.4.0])
9
10# Directory where autotools helper scripts lives.
11AC_CONFIG_AUX_DIR([.])
12
13# Generate configuration headers.
14AC_CONFIG_HEADERS([jconfig.h:jconfig.cfg])
15
16# Hack: disable autoheader so that it doesn't overwrite our cfg template.
17AUTOHEADER="echo autoheader ignored"
18
19# Check system type
20AC_CANONICAL_TARGET
21
22# Initialize Automake
23# Don't require all the GNU mandated files
24AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete ansi2knr no-dist foreign])
25
26# Make --enable-silent-rules the default.
27# To get verbose build output you may configure
28# with --disable-silent-rules or use "make V=1".
29AM_SILENT_RULES([yes])
30
31# This is required when using the de-ANSI-fication feature.
32AM_C_PROTOTYPES
33
34# Add configure option --enable-maintainer-mode which enables
35# dependency checking and generation useful to package maintainers.
36# This is made an option to avoid confusing end users.
37AM_MAINTAINER_MODE
38
39# Check for programs
40AC_PROG_CC
41AC_PROG_CC_STDC
42AC_PROG_CPP
43AC_PROG_INSTALL
44AC_PROG_MAKE_SET
45AC_PROG_LN_S
46
47# Check if LD supports linker scripts,
48# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.
49AC_ARG_ENABLE([ld-version-script],
50 AS_HELP_STRING([--enable-ld-version-script],
51 [enable linker version script (default is enabled when possible)]),
52 [have_ld_version_script=$enableval], [])
53if test -z "$have_ld_version_script"; then
54 AC_MSG_CHECKING([if LD -Wl,--version-script works])
55 save_LDFLAGS="$LDFLAGS"
56 LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
57 cat > conftest.map <<EOF
58VERS_1 {
59 global: sym;
60};
61
62VERS_2 {
63 global: sym;
64} VERS_1;
65EOF
66 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
67 [have_ld_version_script=yes], [have_ld_version_script=no])
68 rm -f conftest.map
69 LDFLAGS="$save_LDFLAGS"
70 AC_MSG_RESULT($have_ld_version_script)
71fi
72AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
73
74# See if compiler supports prototypes.
75AC_MSG_CHECKING([for function prototypes])
76AC_CACHE_VAL([ijg_cv_have_prototypes],
77[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
78int testfunction (int arg1, int * arg2); /* check prototypes */
79struct methods_struct { /* check method-pointer declarations */
80 int (*error_exit) (char *msgtext);
81 int (*trace_message) (char *msgtext);
82 int (*another_method) (void);
83};
84int testfunction (int arg1, int * arg2) /* check definitions */
85{ return arg2[arg1]; }
86int test2function (void) /* check void arg list */
87{ return 0; }
88]])],
89 [ijg_cv_have_prototypes=yes],
90 [ijg_cv_have_prototypes=no])])
91AC_MSG_RESULT([$ijg_cv_have_prototypes])
92if test $ijg_cv_have_prototypes = yes; then
93 AC_DEFINE([HAVE_PROTOTYPES],[1],[Compiler supports function prototypes.])
94else
95 AC_MSG_WARN([Your compiler does not seem to know about function prototypes.
96 Perhaps it needs a special switch to enable ANSI C mode.
97 If so, we recommend running configure like this:
98 ./configure CC='cc -switch'
99 where -switch is the proper switch.])
100fi
101
102# Check header files
103AC_CHECK_HEADERS([stddef.h stdlib.h locale.h])
104AC_CHECK_HEADER([string.h], [],
105 [AC_DEFINE([NEED_BSD_STRINGS], [1],
106 [Compiler has <strings.h> rather than standard <string.h>.])])
107
108# See whether type size_t is defined in any ANSI-standard places;
109# if not, perhaps it is defined in <sys/types.h>.
110AC_MSG_CHECKING([for size_t])
111AC_TRY_COMPILE([
112#ifdef HAVE_STDDEF_H
113#include <stddef.h>
114#endif
115#ifdef HAVE_STDLIB_H
116#include <stdlib.h>
117#endif
118#include <stdio.h>
119#ifdef NEED_BSD_STRINGS
120#include <strings.h>
121#else
122#include <string.h>
123#endif
124typedef size_t my_size_t;
125],
126 [ my_size_t foovar; ],
127 [ijg_size_t_ok=yes],
128 [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"])
129AC_MSG_RESULT([$ijg_size_t_ok])
130if test "$ijg_size_t_ok" != yes; then
131 AC_CHECK_HEADER([sys/types.h],
132 [AC_DEFINE([NEED_SYS_TYPES_H], [1],
133 [Need to include <sys/types.h> in order to obtain size_t.])
134 AC_EGREP_CPP([size_t], [#include <sys/types.h>],
135 [ijg_size_t_ok="size_t is in sys/types.h"],
136 [ijg_size_t_ok=no])],
137 [ijg_size_t_ok=no])
138 AC_MSG_RESULT([$ijg_size_t_ok])
139 if test "$ijg_size_t_ok" = no; then
140 AC_MSG_WARN([Type size_t is not defined in any of the usual places.
141 Try putting '"typedef unsigned int size_t;"' in jconfig.h.])
142 fi
143fi
144
145# Check compiler characteristics
146AC_MSG_CHECKING([for type unsigned char])
147AC_TRY_COMPILE([], [ unsigned char un_char; ],
148 [AC_MSG_RESULT(yes)
149 AC_DEFINE([HAVE_UNSIGNED_CHAR], [1],
150 [Compiler supports 'unsigned char'.])],
151 [AC_MSG_RESULT(no)])
152
153AC_MSG_CHECKING([for type unsigned short])
154AC_TRY_COMPILE([], [ unsigned short un_short; ],
155 [AC_MSG_RESULT(yes)
156 AC_DEFINE([HAVE_UNSIGNED_SHORT], [1],
157 [Compiler supports 'unsigned short'.])],
158 [AC_MSG_RESULT(no)])
159
160AC_MSG_CHECKING([for type void])
161AC_TRY_COMPILE([
162/* Caution: a C++ compiler will insist on valid prototypes */
163typedef void * void_ptr; /* check void * */
164#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */
165typedef void (*void_func) (int a, int b);
166#else
167typedef void (*void_func) ();
168#endif
169
170#ifdef HAVE_PROTOTYPES /* check void function result */
171void test3function (void_ptr arg1, void_func arg2)
172#else
173void test3function (arg1, arg2)
174 void_ptr arg1;
175 void_func arg2;
176#endif
177{
178 char * locptr = (char *) arg1; /* check casting to and from void * */
179 arg1 = (void *) locptr;
180 (*arg2) (1, 2); /* check call of fcn returning void */
181}
182], [ ],
183 [AC_MSG_RESULT(yes)],
184 [AC_MSG_RESULT(no)
185 AC_DEFINE([void], [char],
186 [Define 'void' as 'char' for archaic compilers
187 that don't understand it.])])
188AC_C_CONST
189
190# Check for non-broken inline under various spellings
191AC_MSG_CHECKING([for inline])
192ijg_cv_inline=""
193AC_TRY_COMPILE([], [} __inline__ int foo() { return 0; }
194int bar() { return foo();], ijg_cv_inline="__inline__",
195[AC_TRY_COMPILE(, [} __inline int foo() { return 0; }
196int bar() { return foo();], ijg_cv_inline="__inline",
197[AC_TRY_COMPILE(, [} inline int foo() { return 0; }
198int bar() { return foo();], ijg_cv_inline="inline")])])
199AC_MSG_RESULT($ijg_cv_inline)
200AC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline],
201 [How to obtain function inlining.])
202
203# We cannot check for bogus warnings, but at least we can check for errors
204AC_MSG_CHECKING([for broken incomplete types])
205AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ],
206 [],
207 [AC_MSG_RESULT(ok)],
208 [AC_MSG_RESULT(broken)
209 AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
210 [Compiler does not support pointers to unspecified
211 structures.])])
212
213# Test whether global names are unique to at least 15 chars
214AC_MSG_CHECKING([for short external names])
215AC_TRY_LINK([
216int possibly_duplicate_function () { return 0; }
217int possibly_dupli_function () { return 1; }
218], [],
219 [AC_MSG_RESULT(ok)],
220 [AC_MSG_RESULT(short)
221 AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1],
222 [Linker requires that global names be unique in
223 first 15 characters.])])
224
225# Run-time checks
226AC_MSG_CHECKING([to see if char is signed])
227AC_TRY_RUN([
228#ifdef HAVE_PROTOTYPES
229int is_char_signed (int arg)
230#else
231int is_char_signed (arg)
232 int arg;
233#endif
234{
235 if (arg == 189) { /* expected result for unsigned char */
236 return 0; /* type char is unsigned */
237 }
238 else if (arg != -67) { /* expected result for signed char */
239 printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
240 printf("I fear the JPEG software will not work at all.\n\n");
241 }
242 return 1; /* assume char is signed otherwise */
243}
244char signed_char_check = (char) (-67);
245int main() {
246 exit(is_char_signed((int) signed_char_check));
247}], [AC_MSG_RESULT(no)
248 AC_DEFINE([CHAR_IS_UNSIGNED], [1],
249 [Characters are unsigned])],
250 [AC_MSG_RESULT(yes)],
251[AC_MSG_WARN([Assuming that char is signed on target machine.
252 If it is unsigned, this will be a little bit inefficient.])
253])
254
255AC_MSG_CHECKING([to see if right shift is signed])
256AC_TRY_RUN([
257#ifdef HAVE_PROTOTYPES
258int is_shifting_signed (long arg)
259#else
260int is_shifting_signed (arg)
261 long arg;
262#endif
263/* See whether right-shift on a long is signed or not. */
264{
265 long res = arg >> 4;
266
267 if (res == -0x7F7E80CL) { /* expected result for signed shift */
268 return 1; /* right shift is signed */
269 }
270 /* see if unsigned-shift hack will fix it. */
271 /* we can't just test exact value since it depends on width of long... */
272 res |= (~0L) << (32-4);
273 if (res == -0x7F7E80CL) { /* expected result now? */
274 return 0; /* right shift is unsigned */
275 }
276 printf("Right shift isn't acting as I expect it to.\n");
277 printf("I fear the JPEG software will not work at all.\n\n");
278 return 0; /* try it with unsigned anyway */
279}
280int main() {
281 exit(is_shifting_signed(-0x7F7E80B1L));
282}],
283 [AC_MSG_RESULT(no)
284 AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1],
285 [Broken compiler shifts signed values as an unsigned shift.])],
286 [AC_MSG_RESULT(yes)],
287 [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
288
289AC_MSG_CHECKING([to see if fopen accepts b spec])
290AC_TRY_RUN([
291#include <stdio.h>
292int main() {
293 if (fopen("conftestdata", "wb") != NULL)
294 exit(0);
295 exit(1);
296}],
297 [AC_MSG_RESULT(yes)],
298 [AC_MSG_RESULT(no)
299 AC_DEFINE([DONT_USE_B_MODE], [1],
300 [Don't open files in binary mode.])],
301 [AC_MSG_RESULT(Assuming that it does.)])
302
303# Configure libtool
304AC_LIBTOOL_WIN32_DLL
305AC_PROG_LIBTOOL
306
307# Select memory manager depending on user input.
308# If no "-enable-maxmem", use jmemnobs
309MEMORYMGR='jmemnobs'
310MAXMEM="no"
311AC_ARG_ENABLE([maxmem],
312[ --enable-maxmem[=N] enable use of temp files, set max mem usage to N MB],
313[MAXMEM="$enableval"])
314dnl [# support --with-maxmem for backwards compatibility with IJG V5.]
315dnl AC_ARG_WITH(maxmem, , MAXMEM="$withval")
316if test "x$MAXMEM" = xyes; then
317 MAXMEM=1
318fi
319if test "x$MAXMEM" != xno; then
320 if test -n "`echo $MAXMEM | sed 's/[[0-9]]//g'`"; then
321 AC_MSG_ERROR(non-numeric argument to --enable-maxmem)
322 fi
323 DEFAULTMAXMEM=`expr $MAXMEM \* 1048576`
324 AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}],
325 [Maximum data space library will allocate.])
326 AC_MSG_CHECKING([for 'tmpfile()'])
327 AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ],
328 [AC_MSG_RESULT(yes)
329 MEMORYMGR='jmemansi'],
330 [AC_MSG_RESULT(no)
331 dnl if tmpfile is not present, must use jmemname.
332 MEMORYMGR='jmemname'
333
334 # Test for the need to remove temporary files using a signal handler
335 # (for cjpeg/djpeg)
336 AC_DEFINE([NEED_SIGNAL_CATCHER], [1],
337 [Need signal handler to clean up temporary files.])
338 AC_MSG_CHECKING([for 'mktemp()'])
339 AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ],
340 [AC_MSG_RESULT(yes)],
341 [AC_MSG_RESULT(no)
342 AC_DEFINE([NO_MKTEMP], [1],
343 [The mktemp() function is not available.])])])
344fi
345AC_SUBST([MEMORYMGR])
346
347# Extract the library version IDs from jpeglib.h.
348AC_MSG_CHECKING([libjpeg version number])
349[major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`
350minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`]
351AC_SUBST([JPEG_LIB_VERSION],
352 [`expr $major + $minor`:0:$minor])
353AC_MSG_RESULT([$JPEG_LIB_VERSION])
354
355AC_CONFIG_FILES([Makefile])
356AC_OUTPUT
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/depcomp b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/depcomp
new file mode 100644
index 0000000..2c491ab
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/depcomp
@@ -0,0 +1,688 @@
1#! /bin/sh
2# depcomp - compile a program generating dependencies as side-effects
3
4scriptversion=2011-12-04.11; # UTC
5
6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
7# 2011 Free Software Foundation, Inc.
8
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2, or (at your option)
12# any later version.
13
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program.
26
27# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
28
29case $1 in
30 '')
31 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
32 exit 1;
33 ;;
34 -h | --h*)
35 cat <<\EOF
36Usage: depcomp [--help] [--version] PROGRAM [ARGS]
37
38Run PROGRAMS ARGS to compile a file, generating dependencies
39as side-effects.
40
41Environment variables:
42 depmode Dependency tracking mode.
43 source Source file read by `PROGRAMS ARGS'.
44 object Object file output by `PROGRAMS ARGS'.
45 DEPDIR directory where to store dependencies.
46 depfile Dependency file to output.
47 tmpdepfile Temporary file to use when outputting dependencies.
48 libtool Whether libtool is used (yes/no).
49
50Report bugs to <bug-automake@gnu.org>.
51EOF
52 exit $?
53 ;;
54 -v | --v*)
55 echo "depcomp $scriptversion"
56 exit $?
57 ;;
58esac
59
60if test -z "$depmode" || test -z "$source" || test -z "$object"; then
61 echo "depcomp: Variables source, object and depmode must be set" 1>&2
62 exit 1
63fi
64
65# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
66depfile=${depfile-`echo "$object" |
67 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
68tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
69
70rm -f "$tmpdepfile"
71
72# Some modes work just like other modes, but use different flags. We
73# parameterize here, but still list the modes in the big case below,
74# to make depend.m4 easier to write. Note that we *cannot* use a case
75# here, because this file can only contain one case statement.
76if test "$depmode" = hp; then
77 # HP compiler uses -M and no extra arg.
78 gccflag=-M
79 depmode=gcc
80fi
81
82if test "$depmode" = dashXmstdout; then
83 # This is just like dashmstdout with a different argument.
84 dashmflag=-xM
85 depmode=dashmstdout
86fi
87
88cygpath_u="cygpath -u -f -"
89if test "$depmode" = msvcmsys; then
90 # This is just like msvisualcpp but w/o cygpath translation.
91 # Just convert the backslash-escaped backslashes to single forward
92 # slashes to satisfy depend.m4
93 cygpath_u='sed s,\\\\,/,g'
94 depmode=msvisualcpp
95fi
96
97if test "$depmode" = msvc7msys; then
98 # This is just like msvc7 but w/o cygpath translation.
99 # Just convert the backslash-escaped backslashes to single forward
100 # slashes to satisfy depend.m4
101 cygpath_u='sed s,\\\\,/,g'
102 depmode=msvc7
103fi
104
105case "$depmode" in
106gcc3)
107## gcc 3 implements dependency tracking that does exactly what
108## we want. Yay! Note: for some reason libtool 1.4 doesn't like
109## it if -MD -MP comes after the -MF stuff. Hmm.
110## Unfortunately, FreeBSD c89 acceptance of flags depends upon
111## the command line argument order; so add the flags where they
112## appear in depend2.am. Note that the slowdown incurred here
113## affects only configure: in makefiles, %FASTDEP% shortcuts this.
114 for arg
115 do
116 case $arg in
117 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
118 *) set fnord "$@" "$arg" ;;
119 esac
120 shift # fnord
121 shift # $arg
122 done
123 "$@"
124 stat=$?
125 if test $stat -eq 0; then :
126 else
127 rm -f "$tmpdepfile"
128 exit $stat
129 fi
130 mv "$tmpdepfile" "$depfile"
131 ;;
132
133gcc)
134## There are various ways to get dependency output from gcc. Here's
135## why we pick this rather obscure method:
136## - Don't want to use -MD because we'd like the dependencies to end
137## up in a subdir. Having to rename by hand is ugly.
138## (We might end up doing this anyway to support other compilers.)
139## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
140## -MM, not -M (despite what the docs say).
141## - Using -M directly means running the compiler twice (even worse
142## than renaming).
143 if test -z "$gccflag"; then
144 gccflag=-MD,
145 fi
146 "$@" -Wp,"$gccflag$tmpdepfile"
147 stat=$?
148 if test $stat -eq 0; then :
149 else
150 rm -f "$tmpdepfile"
151 exit $stat
152 fi
153 rm -f "$depfile"
154 echo "$object : \\" > "$depfile"
155 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
156## The second -e expression handles DOS-style file names with drive letters.
157 sed -e 's/^[^:]*: / /' \
158 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
159## This next piece of magic avoids the `deleted header file' problem.
160## The problem is that when a header file which appears in a .P file
161## is deleted, the dependency causes make to die (because there is
162## typically no way to rebuild the header). We avoid this by adding
163## dummy dependencies for each header file. Too bad gcc doesn't do
164## this for us directly.
165 tr ' ' '
166' < "$tmpdepfile" |
167## Some versions of gcc put a space before the `:'. On the theory
168## that the space means something, we add a space to the output as
169## well. hp depmode also adds that space, but also prefixes the VPATH
170## to the object. Take care to not repeat it in the output.
171## Some versions of the HPUX 10.20 sed can't process this invocation
172## correctly. Breaking it into two sed invocations is a workaround.
173 sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
174 | sed -e 's/$/ :/' >> "$depfile"
175 rm -f "$tmpdepfile"
176 ;;
177
178hp)
179 # This case exists only to let depend.m4 do its work. It works by
180 # looking at the text of this script. This case will never be run,
181 # since it is checked for above.
182 exit 1
183 ;;
184
185sgi)
186 if test "$libtool" = yes; then
187 "$@" "-Wp,-MDupdate,$tmpdepfile"
188 else
189 "$@" -MDupdate "$tmpdepfile"
190 fi
191 stat=$?
192 if test $stat -eq 0; then :
193 else
194 rm -f "$tmpdepfile"
195 exit $stat
196 fi
197 rm -f "$depfile"
198
199 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
200 echo "$object : \\" > "$depfile"
201
202 # Clip off the initial element (the dependent). Don't try to be
203 # clever and replace this with sed code, as IRIX sed won't handle
204 # lines with more than a fixed number of characters (4096 in
205 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
206 # the IRIX cc adds comments like `#:fec' to the end of the
207 # dependency line.
208 tr ' ' '
209' < "$tmpdepfile" \
210 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
211 tr '
212' ' ' >> "$depfile"
213 echo >> "$depfile"
214
215 # The second pass generates a dummy entry for each header file.
216 tr ' ' '
217' < "$tmpdepfile" \
218 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
219 >> "$depfile"
220 else
221 # The sourcefile does not contain any dependencies, so just
222 # store a dummy comment line, to avoid errors with the Makefile
223 # "include basename.Plo" scheme.
224 echo "#dummy" > "$depfile"
225 fi
226 rm -f "$tmpdepfile"
227 ;;
228
229aix)
230 # The C for AIX Compiler uses -M and outputs the dependencies
231 # in a .u file. In older versions, this file always lives in the
232 # current directory. Also, the AIX compiler puts `$object:' at the
233 # start of each line; $object doesn't have directory information.
234 # Version 6 uses the directory in both cases.
235 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
236 test "x$dir" = "x$object" && dir=
237 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
238 if test "$libtool" = yes; then
239 tmpdepfile1=$dir$base.u
240 tmpdepfile2=$base.u
241 tmpdepfile3=$dir.libs/$base.u
242 "$@" -Wc,-M
243 else
244 tmpdepfile1=$dir$base.u
245 tmpdepfile2=$dir$base.u
246 tmpdepfile3=$dir$base.u
247 "$@" -M
248 fi
249 stat=$?
250
251 if test $stat -eq 0; then :
252 else
253 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
254 exit $stat
255 fi
256
257 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
258 do
259 test -f "$tmpdepfile" && break
260 done
261 if test -f "$tmpdepfile"; then
262 # Each line is of the form `foo.o: dependent.h'.
263 # Do two passes, one to just change these to
264 # `$object: dependent.h' and one to simply `dependent.h:'.
265 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
266 # That's a tab and a space in the [].
267 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
268 else
269 # The sourcefile does not contain any dependencies, so just
270 # store a dummy comment line, to avoid errors with the Makefile
271 # "include basename.Plo" scheme.
272 echo "#dummy" > "$depfile"
273 fi
274 rm -f "$tmpdepfile"
275 ;;
276
277icc)
278 # Intel's C compiler understands `-MD -MF file'. However on
279 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
280 # ICC 7.0 will fill foo.d with something like
281 # foo.o: sub/foo.c
282 # foo.o: sub/foo.h
283 # which is wrong. We want:
284 # sub/foo.o: sub/foo.c
285 # sub/foo.o: sub/foo.h
286 # sub/foo.c:
287 # sub/foo.h:
288 # ICC 7.1 will output
289 # foo.o: sub/foo.c sub/foo.h
290 # and will wrap long lines using \ :
291 # foo.o: sub/foo.c ... \
292 # sub/foo.h ... \
293 # ...
294
295 "$@" -MD -MF "$tmpdepfile"
296 stat=$?
297 if test $stat -eq 0; then :
298 else
299 rm -f "$tmpdepfile"
300 exit $stat
301 fi
302 rm -f "$depfile"
303 # Each line is of the form `foo.o: dependent.h',
304 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
305 # Do two passes, one to just change these to
306 # `$object: dependent.h' and one to simply `dependent.h:'.
307 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
308 # Some versions of the HPUX 10.20 sed can't process this invocation
309 # correctly. Breaking it into two sed invocations is a workaround.
310 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
311 sed -e 's/$/ :/' >> "$depfile"
312 rm -f "$tmpdepfile"
313 ;;
314
315hp2)
316 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
317 # compilers, which have integrated preprocessors. The correct option
318 # to use with these is +Maked; it writes dependencies to a file named
319 # 'foo.d', which lands next to the object file, wherever that
320 # happens to be.
321 # Much of this is similar to the tru64 case; see comments there.
322 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
323 test "x$dir" = "x$object" && dir=
324 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
325 if test "$libtool" = yes; then
326 tmpdepfile1=$dir$base.d
327 tmpdepfile2=$dir.libs/$base.d
328 "$@" -Wc,+Maked
329 else
330 tmpdepfile1=$dir$base.d
331 tmpdepfile2=$dir$base.d
332 "$@" +Maked
333 fi
334 stat=$?
335 if test $stat -eq 0; then :
336 else
337 rm -f "$tmpdepfile1" "$tmpdepfile2"
338 exit $stat
339 fi
340
341 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
342 do
343 test -f "$tmpdepfile" && break
344 done
345 if test -f "$tmpdepfile"; then
346 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
347 # Add `dependent.h:' lines.
348 sed -ne '2,${
349 s/^ *//
350 s/ \\*$//
351 s/$/:/
352 p
353 }' "$tmpdepfile" >> "$depfile"
354 else
355 echo "#dummy" > "$depfile"
356 fi
357 rm -f "$tmpdepfile" "$tmpdepfile2"
358 ;;
359
360tru64)
361 # The Tru64 compiler uses -MD to generate dependencies as a side
362 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
363 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
364 # dependencies in `foo.d' instead, so we check for that too.
365 # Subdirectories are respected.
366 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
367 test "x$dir" = "x$object" && dir=
368 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
369
370 if test "$libtool" = yes; then
371 # With Tru64 cc, shared objects can also be used to make a
372 # static library. This mechanism is used in libtool 1.4 series to
373 # handle both shared and static libraries in a single compilation.
374 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
375 #
376 # With libtool 1.5 this exception was removed, and libtool now
377 # generates 2 separate objects for the 2 libraries. These two
378 # compilations output dependencies in $dir.libs/$base.o.d and
379 # in $dir$base.o.d. We have to check for both files, because
380 # one of the two compilations can be disabled. We should prefer
381 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
382 # automatically cleaned when .libs/ is deleted, while ignoring
383 # the former would cause a distcleancheck panic.
384 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
385 tmpdepfile2=$dir$base.o.d # libtool 1.5
386 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
387 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
388 "$@" -Wc,-MD
389 else
390 tmpdepfile1=$dir$base.o.d
391 tmpdepfile2=$dir$base.d
392 tmpdepfile3=$dir$base.d
393 tmpdepfile4=$dir$base.d
394 "$@" -MD
395 fi
396
397 stat=$?
398 if test $stat -eq 0; then :
399 else
400 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
401 exit $stat
402 fi
403
404 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
405 do
406 test -f "$tmpdepfile" && break
407 done
408 if test -f "$tmpdepfile"; then
409 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
410 # That's a tab and a space in the [].
411 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
412 else
413 echo "#dummy" > "$depfile"
414 fi
415 rm -f "$tmpdepfile"
416 ;;
417
418msvc7)
419 if test "$libtool" = yes; then
420 showIncludes=-Wc,-showIncludes
421 else
422 showIncludes=-showIncludes
423 fi
424 "$@" $showIncludes > "$tmpdepfile"
425 stat=$?
426 grep -v '^Note: including file: ' "$tmpdepfile"
427 if test "$stat" = 0; then :
428 else
429 rm -f "$tmpdepfile"
430 exit $stat
431 fi
432 rm -f "$depfile"
433 echo "$object : \\" > "$depfile"
434 # The first sed program below extracts the file names and escapes
435 # backslashes for cygpath. The second sed program outputs the file
436 # name when reading, but also accumulates all include files in the
437 # hold buffer in order to output them again at the end. This only
438 # works with sed implementations that can handle large buffers.
439 sed < "$tmpdepfile" -n '
440/^Note: including file: *\(.*\)/ {
441 s//\1/
442 s/\\/\\\\/g
443 p
444}' | $cygpath_u | sort -u | sed -n '
445s/ /\\ /g
446s/\(.*\)/ \1 \\/p
447s/.\(.*\) \\/\1:/
448H
449$ {
450 s/.*/ /
451 G
452 p
453}' >> "$depfile"
454 rm -f "$tmpdepfile"
455 ;;
456
457msvc7msys)
458 # This case exists only to let depend.m4 do its work. It works by
459 # looking at the text of this script. This case will never be run,
460 # since it is checked for above.
461 exit 1
462 ;;
463
464#nosideeffect)
465 # This comment above is used by automake to tell side-effect
466 # dependency tracking mechanisms from slower ones.
467
468dashmstdout)
469 # Important note: in order to support this mode, a compiler *must*
470 # always write the preprocessed file to stdout, regardless of -o.
471 "$@" || exit $?
472
473 # Remove the call to Libtool.
474 if test "$libtool" = yes; then
475 while test "X$1" != 'X--mode=compile'; do
476 shift
477 done
478 shift
479 fi
480
481 # Remove `-o $object'.
482 IFS=" "
483 for arg
484 do
485 case $arg in
486 -o)
487 shift
488 ;;
489 $object)
490 shift
491 ;;
492 *)
493 set fnord "$@" "$arg"
494 shift # fnord
495 shift # $arg
496 ;;
497 esac
498 done
499
500 test -z "$dashmflag" && dashmflag=-M
501 # Require at least two characters before searching for `:'
502 # in the target name. This is to cope with DOS-style filenames:
503 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
504 "$@" $dashmflag |
505 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
506 rm -f "$depfile"
507 cat < "$tmpdepfile" > "$depfile"
508 tr ' ' '
509' < "$tmpdepfile" | \
510## Some versions of the HPUX 10.20 sed can't process this invocation
511## correctly. Breaking it into two sed invocations is a workaround.
512 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
513 rm -f "$tmpdepfile"
514 ;;
515
516dashXmstdout)
517 # This case only exists to satisfy depend.m4. It is never actually
518 # run, as this mode is specially recognized in the preamble.
519 exit 1
520 ;;
521
522makedepend)
523 "$@" || exit $?
524 # Remove any Libtool call
525 if test "$libtool" = yes; then
526 while test "X$1" != 'X--mode=compile'; do
527 shift
528 done
529 shift
530 fi
531 # X makedepend
532 shift
533 cleared=no eat=no
534 for arg
535 do
536 case $cleared in
537 no)
538 set ""; shift
539 cleared=yes ;;
540 esac
541 if test $eat = yes; then
542 eat=no
543 continue
544 fi
545 case "$arg" in
546 -D*|-I*)
547 set fnord "$@" "$arg"; shift ;;
548 # Strip any option that makedepend may not understand. Remove
549 # the object too, otherwise makedepend will parse it as a source file.
550 -arch)
551 eat=yes ;;
552 -*|$object)
553 ;;
554 *)
555 set fnord "$@" "$arg"; shift ;;
556 esac
557 done
558 obj_suffix=`echo "$object" | sed 's/^.*\././'`
559 touch "$tmpdepfile"
560 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
561 rm -f "$depfile"
562 # makedepend may prepend the VPATH from the source file name to the object.
563 # No need to regex-escape $object, excess matching of '.' is harmless.
564 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
565 sed '1,2d' "$tmpdepfile" | tr ' ' '
566' | \
567## Some versions of the HPUX 10.20 sed can't process this invocation
568## correctly. Breaking it into two sed invocations is a workaround.
569 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
570 rm -f "$tmpdepfile" "$tmpdepfile".bak
571 ;;
572
573cpp)
574 # Important note: in order to support this mode, a compiler *must*
575 # always write the preprocessed file to stdout.
576 "$@" || exit $?
577
578 # Remove the call to Libtool.
579 if test "$libtool" = yes; then
580 while test "X$1" != 'X--mode=compile'; do
581 shift
582 done
583 shift
584 fi
585
586 # Remove `-o $object'.
587 IFS=" "
588 for arg
589 do
590 case $arg in
591 -o)
592 shift
593 ;;
594 $object)
595 shift
596 ;;
597 *)
598 set fnord "$@" "$arg"
599 shift # fnord
600 shift # $arg
601 ;;
602 esac
603 done
604
605 "$@" -E |
606 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
607 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
608 sed '$ s: \\$::' > "$tmpdepfile"
609 rm -f "$depfile"
610 echo "$object : \\" > "$depfile"
611 cat < "$tmpdepfile" >> "$depfile"
612 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
613 rm -f "$tmpdepfile"
614 ;;
615
616msvisualcpp)
617 # Important note: in order to support this mode, a compiler *must*
618 # always write the preprocessed file to stdout.
619 "$@" || exit $?
620
621 # Remove the call to Libtool.
622 if test "$libtool" = yes; then
623 while test "X$1" != 'X--mode=compile'; do
624 shift
625 done
626 shift
627 fi
628
629 IFS=" "
630 for arg
631 do
632 case "$arg" in
633 -o)
634 shift
635 ;;
636 $object)
637 shift
638 ;;
639 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
640 set fnord "$@"
641 shift
642 shift
643 ;;
644 *)
645 set fnord "$@" "$arg"
646 shift
647 shift
648 ;;
649 esac
650 done
651 "$@" -E 2>/dev/null |
652 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
653 rm -f "$depfile"
654 echo "$object : \\" > "$depfile"
655 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
656 echo " " >> "$depfile"
657 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
658 rm -f "$tmpdepfile"
659 ;;
660
661msvcmsys)
662 # This case exists only to let depend.m4 do its work. It works by
663 # looking at the text of this script. This case will never be run,
664 # since it is checked for above.
665 exit 1
666 ;;
667
668none)
669 exec "$@"
670 ;;
671
672*)
673 echo "Unknown depmode $depmode" 1>&2
674 exit 1
675 ;;
676esac
677
678exit 0
679
680# Local Variables:
681# mode: shell-script
682# sh-indentation: 2
683# eval: (add-hook 'write-file-hooks 'time-stamp)
684# time-stamp-start: "scriptversion="
685# time-stamp-format: "%:y-%02m-%02d.%02H"
686# time-stamp-time-zone: "UTC"
687# time-stamp-end: "; # UTC"
688# End:
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.1 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.1
new file mode 100644
index 0000000..9f7038f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.1
@@ -0,0 +1,252 @@
1.TH DJPEG 1 "3 October 2009"
2.SH NAME
3djpeg \- decompress a JPEG file to an image file
4.SH SYNOPSIS
5.B djpeg
6[
7.I options
8]
9[
10.I filename
11]
12.LP
13.SH DESCRIPTION
14.LP
15.B djpeg
16decompresses the named JPEG file, or the standard input if no file is named,
17and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
18GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
19(RLE is supported only if the URT library is available.)
20.SH OPTIONS
21All switch names may be abbreviated; for example,
22.B \-grayscale
23may be written
24.B \-gray
25or
26.BR \-gr .
27Most of the "basic" switches can be abbreviated to as little as one letter.
28Upper and lower case are equivalent (thus
29.B \-BMP
30is the same as
31.BR \-bmp ).
32British spellings are also accepted (e.g.,
33.BR \-greyscale ),
34though for brevity these are not mentioned below.
35.PP
36The basic switches are:
37.TP
38.BI \-colors " N"
39Reduce image to at most N colors. This reduces the number of colors used in
40the output image, so that it can be displayed on a colormapped display or
41stored in a colormapped file format. For example, if you have an 8-bit
42display, you'd need to reduce to 256 or fewer colors.
43.TP
44.BI \-quantize " N"
45Same as
46.BR \-colors .
47.B \-colors
48is the recommended name,
49.B \-quantize
50is provided only for backwards compatibility.
51.TP
52.B \-fast
53Select recommended processing options for fast, low quality output. (The
54default options are chosen for highest quality output.) Currently, this is
55equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
56.TP
57.B \-grayscale
58Force gray-scale output even if JPEG file is color. Useful for viewing on
59monochrome displays; also,
60.B djpeg
61runs noticeably faster in this mode.
62.TP
63.BI \-scale " M/N"
64Scale the output image by a factor M/N. Currently supported scale factors are
65M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
66baseline JPEG. If the /N part is omitted, then M specifies the DCT scaled
67size to be applied on the given input. For baseline JPEG this is equivalent
68to M/8 scaling, since the source DCT size for baseline JPEG is 8.
69Scaling is handy if the image is larger than your screen; also,
70.B djpeg
71runs much faster when scaling down the output.
72.TP
73.B \-bmp
74Select BMP output format (Windows flavor). 8-bit colormapped format is
75emitted if
76.B \-colors
77or
78.B \-grayscale
79is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
80format is emitted.
81.TP
82.B \-gif
83Select GIF output format. Since GIF does not support more than 256 colors,
84.B \-colors 256
85is assumed (unless you specify a smaller number of colors).
86.TP
87.B \-os2
88Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is
89emitted if
90.B \-colors
91or
92.B \-grayscale
93is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
94format is emitted.
95.TP
96.B \-pnm
97Select PBMPLUS (PPM/PGM) output format (this is the default format).
98PGM is emitted if the JPEG file is gray-scale or if
99.B \-grayscale
100is specified; otherwise PPM is emitted.
101.TP
102.B \-rle
103Select RLE output format. (Requires URT library.)
104.TP
105.B \-targa
106Select Targa output format. Gray-scale format is emitted if the JPEG file is
107gray-scale or if
108.B \-grayscale
109is specified; otherwise, colormapped format is emitted if
110.B \-colors
111is specified; otherwise, 24-bit full-color format is emitted.
112.PP
113Switches for advanced users:
114.TP
115.B \-dct int
116Use integer DCT method (default).
117.TP
118.B \-dct fast
119Use fast integer DCT (less accurate).
120.TP
121.B \-dct float
122Use floating-point DCT method.
123The float method is very slightly more accurate than the int method, but is
124much slower unless your machine has very fast floating-point hardware. Also
125note that results of the floating-point method may vary slightly across
126machines, while the integer methods should give the same results everywhere.
127The fast integer method is much less accurate than the other two.
128.TP
129.B \-dither fs
130Use Floyd-Steinberg dithering in color quantization.
131.TP
132.B \-dither ordered
133Use ordered dithering in color quantization.
134.TP
135.B \-dither none
136Do not use dithering in color quantization.
137By default, Floyd-Steinberg dithering is applied when quantizing colors; this
138is slow but usually produces the best results. Ordered dither is a compromise
139between speed and quality; no dithering is fast but usually looks awful. Note
140that these switches have no effect unless color quantization is being done.
141Ordered dither is only available in
142.B \-onepass
143mode.
144.TP
145.BI \-map " file"
146Quantize to the colors used in the specified image file. This is useful for
147producing multiple files with identical color maps, or for forcing a
148predefined set of colors to be used. The
149.I file
150must be a GIF or PPM file. This option overrides
151.B \-colors
152and
153.BR \-onepass .
154.TP
155.B \-nosmooth
156Don't use high-quality upsampling.
157.TP
158.B \-onepass
159Use one-pass instead of two-pass color quantization. The one-pass method is
160faster and needs less memory, but it produces a lower-quality image.
161.B \-onepass
162is ignored unless you also say
163.B \-colors
164.IR N .
165Also, the one-pass method is always used for gray-scale output (the two-pass
166method is no improvement then).
167.TP
168.BI \-maxmemory " N"
169Set limit for amount of memory to use in processing large images. Value is
170in thousands of bytes, or millions of bytes if "M" is attached to the
171number. For example,
172.B \-max 4m
173selects 4000000 bytes. If more space is needed, temporary files will be used.
174.TP
175.BI \-outfile " name"
176Send output image to the named file, not to standard output.
177.TP
178.B \-verbose
179Enable debug printout. More
180.BR \-v 's
181give more output. Also, version information is printed at startup.
182.TP
183.B \-debug
184Same as
185.BR \-verbose .
186.SH EXAMPLES
187.LP
188This example decompresses the JPEG file foo.jpg, quantizes it to
189256 colors, and saves the output in 8-bit BMP format in foo.bmp:
190.IP
191.B djpeg \-colors 256 \-bmp
192.I foo.jpg
193.B >
194.I foo.bmp
195.SH HINTS
196To get a quick preview of an image, use the
197.B \-grayscale
198and/or
199.B \-scale
200switches.
201.B \-grayscale \-scale 1/8
202is the fastest case.
203.PP
204Several options are available that trade off image quality to gain speed.
205.B \-fast
206turns on the recommended settings.
207.PP
208.B \-dct fast
209and/or
210.B \-nosmooth
211gain speed at a small sacrifice in quality.
212When producing a color-quantized image,
213.B \-onepass \-dither ordered
214is fast but much lower quality than the default behavior.
215.B \-dither none
216may give acceptable results in two-pass mode, but is seldom tolerable in
217one-pass mode.
218.PP
219If you are fortunate enough to have very fast floating point hardware,
220\fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most
221machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
222not worth using, because its theoretical accuracy advantage is too small to be
223significant in practice.
224.SH ENVIRONMENT
225.TP
226.B JPEGMEM
227If this environment variable is set, its value is the default memory limit.
228The value is specified as described for the
229.B \-maxmemory
230switch.
231.B JPEGMEM
232overrides the default value specified when the program was compiled, and
233itself is overridden by an explicit
234.BR \-maxmemory .
235.SH SEE ALSO
236.BR cjpeg (1),
237.BR jpegtran (1),
238.BR rdjpgcom (1),
239.BR wrjpgcom (1)
240.br
241.BR ppm (5),
242.BR pgm (5)
243.br
244Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
245Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
246.SH AUTHOR
247Independent JPEG Group
248.SH BUGS
249To avoid the Unisys LZW patent,
250.B djpeg
251produces uncompressed GIF files. These are larger than they should be, but
252are readable by standard GIF decoders.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.c
new file mode 100644
index 0000000..363c628
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/djpeg.c
@@ -0,0 +1,617 @@
1/*
2 * djpeg.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a command-line user interface for the JPEG decompressor.
10 * It should work on any system with Unix- or MS-DOS-style command lines.
11 *
12 * Two different command line styles are permitted, depending on the
13 * compile-time switch TWO_FILE_COMMANDLINE:
14 * djpeg [options] inputfile outputfile
15 * djpeg [options] [inputfile]
16 * In the second style, output is always to standard output, which you'd
17 * normally redirect to a file or pipe to some other program. Input is
18 * either from a named file or from standard input (typically redirected).
19 * The second style is convenient on Unix but is unhelpful on systems that
20 * don't support pipes. Also, you MUST use the first style if your system
21 * doesn't do binary I/O to stdin/stdout.
22 * To simplify script writing, the "-outfile" switch is provided. The syntax
23 * djpeg [options] -outfile outputfile inputfile
24 * works regardless of which command line style is used.
25 */
26
27#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
28#include "jversion.h" /* for version message */
29
30#include <ctype.h> /* to declare isprint() */
31
32#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
33#ifdef __MWERKS__
34#include <SIOUX.h> /* Metrowerks needs this */
35#include <console.h> /* ... and this */
36#endif
37#ifdef THINK_C
38#include <console.h> /* Think declares it here */
39#endif
40#endif
41
42
43/* Create the add-on message string table. */
44
45#define JMESSAGE(code,string) string ,
46
47static const char * const cdjpeg_message_table[] = {
48#include "cderror.h"
49 NULL
50};
51
52
53/*
54 * This list defines the known output image formats
55 * (not all of which need be supported by a given version).
56 * You can change the default output format by defining DEFAULT_FMT;
57 * indeed, you had better do so if you undefine PPM_SUPPORTED.
58 */
59
60typedef enum {
61 FMT_BMP, /* BMP format (Windows flavor) */
62 FMT_GIF, /* GIF format */
63 FMT_OS2, /* BMP format (OS/2 flavor) */
64 FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
65 FMT_RLE, /* RLE format */
66 FMT_TARGA, /* Targa format */
67 FMT_TIFF /* TIFF format */
68} IMAGE_FORMATS;
69
70#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
71#define DEFAULT_FMT FMT_PPM
72#endif
73
74static IMAGE_FORMATS requested_fmt;
75
76
77/*
78 * Argument-parsing code.
79 * The switch parser is designed to be useful with DOS-style command line
80 * syntax, ie, intermixed switches and file names, where only the switches
81 * to the left of a given file name affect processing of that file.
82 * The main program in this file doesn't actually use this capability...
83 */
84
85
86static const char * progname; /* program name for error messages */
87static char * outfilename; /* for -outfile switch */
88
89
90LOCAL(void)
91usage (void)
92/* complain about bad command line */
93{
94 fprintf(stderr, "usage: %s [switches] ", progname);
95#ifdef TWO_FILE_COMMANDLINE
96 fprintf(stderr, "inputfile outputfile\n");
97#else
98 fprintf(stderr, "[inputfile]\n");
99#endif
100
101 fprintf(stderr, "Switches (names may be abbreviated):\n");
102 fprintf(stderr, " -colors N Reduce image to no more than N colors\n");
103 fprintf(stderr, " -fast Fast, low-quality processing\n");
104 fprintf(stderr, " -grayscale Force grayscale output\n");
105#ifdef IDCT_SCALING_SUPPORTED
106 fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
107#endif
108#ifdef BMP_SUPPORTED
109 fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n",
110 (DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
111#endif
112#ifdef GIF_SUPPORTED
113 fprintf(stderr, " -gif Select GIF output format%s\n",
114 (DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
115#endif
116#ifdef BMP_SUPPORTED
117 fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n",
118 (DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
119#endif
120#ifdef PPM_SUPPORTED
121 fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n",
122 (DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
123#endif
124#ifdef RLE_SUPPORTED
125 fprintf(stderr, " -rle Select Utah RLE output format%s\n",
126 (DEFAULT_FMT == FMT_RLE ? " (default)" : ""));
127#endif
128#ifdef TARGA_SUPPORTED
129 fprintf(stderr, " -targa Select Targa output format%s\n",
130 (DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
131#endif
132 fprintf(stderr, "Switches for advanced users:\n");
133#ifdef DCT_ISLOW_SUPPORTED
134 fprintf(stderr, " -dct int Use integer DCT method%s\n",
135 (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
136#endif
137#ifdef DCT_IFAST_SUPPORTED
138 fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
139 (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
140#endif
141#ifdef DCT_FLOAT_SUPPORTED
142 fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
143 (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
144#endif
145 fprintf(stderr, " -dither fs Use F-S dithering (default)\n");
146 fprintf(stderr, " -dither none Don't use dithering in quantization\n");
147 fprintf(stderr, " -dither ordered Use ordered dither (medium speed, quality)\n");
148#ifdef QUANT_2PASS_SUPPORTED
149 fprintf(stderr, " -map FILE Map to colors used in named image file\n");
150#endif
151 fprintf(stderr, " -nosmooth Don't use high-quality upsampling\n");
152#ifdef QUANT_1PASS_SUPPORTED
153 fprintf(stderr, " -onepass Use 1-pass quantization (fast, low quality)\n");
154#endif
155 fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
156 fprintf(stderr, " -outfile name Specify name for output file\n");
157 fprintf(stderr, " -verbose or -debug Emit debug output\n");
158 exit(EXIT_FAILURE);
159}
160
161
162LOCAL(int)
163parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
164 int last_file_arg_seen, boolean for_real)
165/* Parse optional switches.
166 * Returns argv[] index of first file-name argument (== argc if none).
167 * Any file names with indexes <= last_file_arg_seen are ignored;
168 * they have presumably been processed in a previous iteration.
169 * (Pass 0 for last_file_arg_seen on the first or only iteration.)
170 * for_real is FALSE on the first (dummy) pass; we may skip any expensive
171 * processing.
172 */
173{
174 int argn;
175 char * arg;
176
177 /* Set up default JPEG parameters. */
178 requested_fmt = DEFAULT_FMT; /* set default output file format */
179 outfilename = NULL;
180 cinfo->err->trace_level = 0;
181
182 /* Scan command line options, adjust parameters */
183
184 for (argn = 1; argn < argc; argn++) {
185 arg = argv[argn];
186 if (*arg != '-') {
187 /* Not a switch, must be a file name argument */
188 if (argn <= last_file_arg_seen) {
189 outfilename = NULL; /* -outfile applies to just one input file */
190 continue; /* ignore this name if previously processed */
191 }
192 break; /* else done parsing switches */
193 }
194 arg++; /* advance past switch marker character */
195
196 if (keymatch(arg, "bmp", 1)) {
197 /* BMP output format. */
198 requested_fmt = FMT_BMP;
199
200 } else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
201 keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
202 /* Do color quantization. */
203 int val;
204
205 if (++argn >= argc) /* advance to next argument */
206 usage();
207 if (sscanf(argv[argn], "%d", &val) != 1)
208 usage();
209 cinfo->desired_number_of_colors = val;
210 cinfo->quantize_colors = TRUE;
211
212 } else if (keymatch(arg, "dct", 2)) {
213 /* Select IDCT algorithm. */
214 if (++argn >= argc) /* advance to next argument */
215 usage();
216 if (keymatch(argv[argn], "int", 1)) {
217 cinfo->dct_method = JDCT_ISLOW;
218 } else if (keymatch(argv[argn], "fast", 2)) {
219 cinfo->dct_method = JDCT_IFAST;
220 } else if (keymatch(argv[argn], "float", 2)) {
221 cinfo->dct_method = JDCT_FLOAT;
222 } else
223 usage();
224
225 } else if (keymatch(arg, "dither", 2)) {
226 /* Select dithering algorithm. */
227 if (++argn >= argc) /* advance to next argument */
228 usage();
229 if (keymatch(argv[argn], "fs", 2)) {
230 cinfo->dither_mode = JDITHER_FS;
231 } else if (keymatch(argv[argn], "none", 2)) {
232 cinfo->dither_mode = JDITHER_NONE;
233 } else if (keymatch(argv[argn], "ordered", 2)) {
234 cinfo->dither_mode = JDITHER_ORDERED;
235 } else
236 usage();
237
238 } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
239 /* Enable debug printouts. */
240 /* On first -d, print version identification */
241 static boolean printed_version = FALSE;
242
243 if (! printed_version) {
244 fprintf(stderr, "Independent JPEG Group's DJPEG, version %s\n%s\n",
245 JVERSION, JCOPYRIGHT);
246 printed_version = TRUE;
247 }
248 cinfo->err->trace_level++;
249
250 } else if (keymatch(arg, "fast", 1)) {
251 /* Select recommended processing options for quick-and-dirty output. */
252 cinfo->two_pass_quantize = FALSE;
253 cinfo->dither_mode = JDITHER_ORDERED;
254 if (! cinfo->quantize_colors) /* don't override an earlier -colors */
255 cinfo->desired_number_of_colors = 216;
256 cinfo->dct_method = JDCT_FASTEST;
257 cinfo->do_fancy_upsampling = FALSE;
258
259 } else if (keymatch(arg, "gif", 1)) {
260 /* GIF output format. */
261 requested_fmt = FMT_GIF;
262
263 } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
264 /* Force monochrome output. */
265 cinfo->out_color_space = JCS_GRAYSCALE;
266
267 } else if (keymatch(arg, "map", 3)) {
268 /* Quantize to a color map taken from an input file. */
269 if (++argn >= argc) /* advance to next argument */
270 usage();
271 if (for_real) { /* too expensive to do twice! */
272#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
273 FILE * mapfile;
274
275 if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
276 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
277 exit(EXIT_FAILURE);
278 }
279 read_color_map(cinfo, mapfile);
280 fclose(mapfile);
281 cinfo->quantize_colors = TRUE;
282#else
283 ERREXIT(cinfo, JERR_NOT_COMPILED);
284#endif
285 }
286
287 } else if (keymatch(arg, "maxmemory", 3)) {
288 /* Maximum memory in Kb (or Mb with 'm'). */
289 long lval;
290 char ch = 'x';
291
292 if (++argn >= argc) /* advance to next argument */
293 usage();
294 if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
295 usage();
296 if (ch == 'm' || ch == 'M')
297 lval *= 1000L;
298 cinfo->mem->max_memory_to_use = lval * 1000L;
299
300 } else if (keymatch(arg, "nosmooth", 3)) {
301 /* Suppress fancy upsampling */
302 cinfo->do_fancy_upsampling = FALSE;
303
304 } else if (keymatch(arg, "onepass", 3)) {
305 /* Use fast one-pass quantization. */
306 cinfo->two_pass_quantize = FALSE;
307
308 } else if (keymatch(arg, "os2", 3)) {
309 /* BMP output format (OS/2 flavor). */
310 requested_fmt = FMT_OS2;
311
312 } else if (keymatch(arg, "outfile", 4)) {
313 /* Set output file name. */
314 if (++argn >= argc) /* advance to next argument */
315 usage();
316 outfilename = argv[argn]; /* save it away for later use */
317
318 } else if (keymatch(arg, "pnm", 1) || keymatch(arg, "ppm", 1)) {
319 /* PPM/PGM output format. */
320 requested_fmt = FMT_PPM;
321
322 } else if (keymatch(arg, "rle", 1)) {
323 /* RLE output format. */
324 requested_fmt = FMT_RLE;
325
326 } else if (keymatch(arg, "scale", 1)) {
327 /* Scale the output image by a fraction M/N. */
328 if (++argn >= argc) /* advance to next argument */
329 usage();
330 if (sscanf(argv[argn], "%d/%d",
331 &cinfo->scale_num, &cinfo->scale_denom) < 1)
332 usage();
333
334 } else if (keymatch(arg, "targa", 1)) {
335 /* Targa output format. */
336 requested_fmt = FMT_TARGA;
337
338 } else {
339 usage(); /* bogus switch */
340 }
341 }
342
343 return argn; /* return index of next arg (file name) */
344}
345
346
347/*
348 * Marker processor for COM and interesting APPn markers.
349 * This replaces the library's built-in processor, which just skips the marker.
350 * We want to print out the marker as text, to the extent possible.
351 * Note this code relies on a non-suspending data source.
352 */
353
354LOCAL(unsigned int)
355jpeg_getc (j_decompress_ptr cinfo)
356/* Read next byte */
357{
358 struct jpeg_source_mgr * datasrc = cinfo->src;
359
360 if (datasrc->bytes_in_buffer == 0) {
361 if (! (*datasrc->fill_input_buffer) (cinfo))
362 ERREXIT(cinfo, JERR_CANT_SUSPEND);
363 }
364 datasrc->bytes_in_buffer--;
365 return GETJOCTET(*datasrc->next_input_byte++);
366}
367
368
369METHODDEF(boolean)
370print_text_marker (j_decompress_ptr cinfo)
371{
372 boolean traceit = (cinfo->err->trace_level >= 1);
373 INT32 length;
374 unsigned int ch;
375 unsigned int lastch = 0;
376
377 length = jpeg_getc(cinfo) << 8;
378 length += jpeg_getc(cinfo);
379 length -= 2; /* discount the length word itself */
380
381 if (traceit) {
382 if (cinfo->unread_marker == JPEG_COM)
383 fprintf(stderr, "Comment, length %ld:\n", (long) length);
384 else /* assume it is an APPn otherwise */
385 fprintf(stderr, "APP%d, length %ld:\n",
386 cinfo->unread_marker - JPEG_APP0, (long) length);
387 }
388
389 while (--length >= 0) {
390 ch = jpeg_getc(cinfo);
391 if (traceit) {
392 /* Emit the character in a readable form.
393 * Nonprintables are converted to \nnn form,
394 * while \ is converted to \\.
395 * Newlines in CR, CR/LF, or LF form will be printed as one newline.
396 */
397 if (ch == '\r') {
398 fprintf(stderr, "\n");
399 } else if (ch == '\n') {
400 if (lastch != '\r')
401 fprintf(stderr, "\n");
402 } else if (ch == '\\') {
403 fprintf(stderr, "\\\\");
404 } else if (isprint(ch)) {
405 putc(ch, stderr);
406 } else {
407 fprintf(stderr, "\\%03o", ch);
408 }
409 lastch = ch;
410 }
411 }
412
413 if (traceit)
414 fprintf(stderr, "\n");
415
416 return TRUE;
417}
418
419
420/*
421 * The main program.
422 */
423
424int
425main (int argc, char **argv)
426{
427 struct jpeg_decompress_struct cinfo;
428 struct jpeg_error_mgr jerr;
429#ifdef PROGRESS_REPORT
430 struct cdjpeg_progress_mgr progress;
431#endif
432 int file_index;
433 djpeg_dest_ptr dest_mgr = NULL;
434 FILE * input_file;
435 FILE * output_file;
436 JDIMENSION num_scanlines;
437
438 /* On Mac, fetch a command line. */
439#ifdef USE_CCOMMAND
440 argc = ccommand(&argv);
441#endif
442
443 progname = argv[0];
444 if (progname == NULL || progname[0] == 0)
445 progname = "djpeg"; /* in case C library doesn't provide it */
446
447 /* Initialize the JPEG decompression object with default error handling. */
448 cinfo.err = jpeg_std_error(&jerr);
449 jpeg_create_decompress(&cinfo);
450 /* Add some application-specific error messages (from cderror.h) */
451 jerr.addon_message_table = cdjpeg_message_table;
452 jerr.first_addon_message = JMSG_FIRSTADDONCODE;
453 jerr.last_addon_message = JMSG_LASTADDONCODE;
454
455 /* Insert custom marker processor for COM and APP12.
456 * APP12 is used by some digital camera makers for textual info,
457 * so we provide the ability to display it as text.
458 * If you like, additional APPn marker types can be selected for display,
459 * but don't try to override APP0 or APP14 this way (see libjpeg.doc).
460 */
461 jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
462 jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
463
464 /* Now safe to enable signal catcher. */
465#ifdef NEED_SIGNAL_CATCHER
466 enable_signal_catcher((j_common_ptr) &cinfo);
467#endif
468
469 /* Scan command line to find file names. */
470 /* It is convenient to use just one switch-parsing routine, but the switch
471 * values read here are ignored; we will rescan the switches after opening
472 * the input file.
473 * (Exception: tracing level set here controls verbosity for COM markers
474 * found during jpeg_read_header...)
475 */
476
477 file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);
478
479#ifdef TWO_FILE_COMMANDLINE
480 /* Must have either -outfile switch or explicit output file name */
481 if (outfilename == NULL) {
482 if (file_index != argc-2) {
483 fprintf(stderr, "%s: must name one input and one output file\n",
484 progname);
485 usage();
486 }
487 outfilename = argv[file_index+1];
488 } else {
489 if (file_index != argc-1) {
490 fprintf(stderr, "%s: must name one input and one output file\n",
491 progname);
492 usage();
493 }
494 }
495#else
496 /* Unix style: expect zero or one file name */
497 if (file_index < argc-1) {
498 fprintf(stderr, "%s: only one input file\n", progname);
499 usage();
500 }
501#endif /* TWO_FILE_COMMANDLINE */
502
503 /* Open the input file. */
504 if (file_index < argc) {
505 if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
506 fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
507 exit(EXIT_FAILURE);
508 }
509 } else {
510 /* default input file is stdin */
511 input_file = read_stdin();
512 }
513
514 /* Open the output file. */
515 if (outfilename != NULL) {
516 if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
517 fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
518 exit(EXIT_FAILURE);
519 }
520 } else {
521 /* default output file is stdout */
522 output_file = write_stdout();
523 }
524
525#ifdef PROGRESS_REPORT
526 start_progress_monitor((j_common_ptr) &cinfo, &progress);
527#endif
528
529 /* Specify data source for decompression */
530 jpeg_stdio_src(&cinfo, input_file);
531
532 /* Read file header, set default decompression parameters */
533 (void) jpeg_read_header(&cinfo, TRUE);
534
535 /* Adjust default decompression parameters by re-parsing the options */
536 file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
537
538 /* Initialize the output module now to let it override any crucial
539 * option settings (for instance, GIF wants to force color quantization).
540 */
541 switch (requested_fmt) {
542#ifdef BMP_SUPPORTED
543 case FMT_BMP:
544 dest_mgr = jinit_write_bmp(&cinfo, FALSE);
545 break;
546 case FMT_OS2:
547 dest_mgr = jinit_write_bmp(&cinfo, TRUE);
548 break;
549#endif
550#ifdef GIF_SUPPORTED
551 case FMT_GIF:
552 dest_mgr = jinit_write_gif(&cinfo);
553 break;
554#endif
555#ifdef PPM_SUPPORTED
556 case FMT_PPM:
557 dest_mgr = jinit_write_ppm(&cinfo);
558 break;
559#endif
560#ifdef RLE_SUPPORTED
561 case FMT_RLE:
562 dest_mgr = jinit_write_rle(&cinfo);
563 break;
564#endif
565#ifdef TARGA_SUPPORTED
566 case FMT_TARGA:
567 dest_mgr = jinit_write_targa(&cinfo);
568 break;
569#endif
570 default:
571 ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
572 break;
573 }
574 dest_mgr->output_file = output_file;
575
576 /* Start decompressor */
577 (void) jpeg_start_decompress(&cinfo);
578
579 /* Write output file header */
580 (*dest_mgr->start_output) (&cinfo, dest_mgr);
581
582 /* Process data */
583 while (cinfo.output_scanline < cinfo.output_height) {
584 num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
585 dest_mgr->buffer_height);
586 (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
587 }
588
589#ifdef PROGRESS_REPORT
590 /* Hack: count final pass as done in case finish_output does an extra pass.
591 * The library won't have updated completed_passes.
592 */
593 progress.pub.completed_passes = progress.pub.total_passes;
594#endif
595
596 /* Finish decompression and release memory.
597 * I must do it in this order because output module has allocated memory
598 * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.
599 */
600 (*dest_mgr->finish_output) (&cinfo, dest_mgr);
601 (void) jpeg_finish_decompress(&cinfo);
602 jpeg_destroy_decompress(&cinfo);
603
604 /* Close files, if we opened them */
605 if (input_file != stdin)
606 fclose(input_file);
607 if (output_file != stdout)
608 fclose(output_file);
609
610#ifdef PROGRESS_REPORT
611 end_progress_monitor((j_common_ptr) &cinfo);
612#endif
613
614 /* All done. */
615 exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
616 return 0; /* suppress no-return-value warnings */
617}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/example.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/example.c
new file mode 100644
index 0000000..e21cf12
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/example.c
@@ -0,0 +1,433 @@
1/*
2 * example.c
3 *
4 * This file illustrates how to use the IJG code as a subroutine library
5 * to read or write JPEG image files. You should look at this code in
6 * conjunction with the documentation file libjpeg.txt.
7 *
8 * This code will not do anything useful as-is, but it may be helpful as a
9 * skeleton for constructing routines that call the JPEG library.
10 *
11 * We present these routines in the same coding style used in the JPEG code
12 * (ANSI function definitions, etc); but you are of course free to code your
13 * routines in a different style if you prefer.
14 */
15
16#include <stdio.h>
17
18/*
19 * Include file for users of JPEG library.
20 * You will need to have included system headers that define at least
21 * the typedefs FILE and size_t before you can include jpeglib.h.
22 * (stdio.h is sufficient on ANSI-conforming systems.)
23 * You may also wish to include "jerror.h".
24 */
25
26#include "jpeglib.h"
27
28/*
29 * <setjmp.h> is used for the optional error recovery mechanism shown in
30 * the second part of the example.
31 */
32
33#include <setjmp.h>
34
35
36
37/******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/
38
39/* This half of the example shows how to feed data into the JPEG compressor.
40 * We present a minimal version that does not worry about refinements such
41 * as error recovery (the JPEG code will just exit() if it gets an error).
42 */
43
44
45/*
46 * IMAGE DATA FORMATS:
47 *
48 * The standard input image format is a rectangular array of pixels, with
49 * each pixel having the same number of "component" values (color channels).
50 * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).
51 * If you are working with color data, then the color values for each pixel
52 * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit
53 * RGB color.
54 *
55 * For this example, we'll assume that this data structure matches the way
56 * our application has stored the image in memory, so we can just pass a
57 * pointer to our image buffer. In particular, let's say that the image is
58 * RGB color and is described by:
59 */
60
61extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */
62extern int image_height; /* Number of rows in image */
63extern int image_width; /* Number of columns in image */
64
65
66/*
67 * Sample routine for JPEG compression. We assume that the target file name
68 * and a compression quality factor are passed in.
69 */
70
71GLOBAL(void)
72write_JPEG_file (char * filename, int quality)
73{
74 /* This struct contains the JPEG compression parameters and pointers to
75 * working space (which is allocated as needed by the JPEG library).
76 * It is possible to have several such structures, representing multiple
77 * compression/decompression processes, in existence at once. We refer
78 * to any one struct (and its associated working data) as a "JPEG object".
79 */
80 struct jpeg_compress_struct cinfo;
81 /* This struct represents a JPEG error handler. It is declared separately
82 * because applications often want to supply a specialized error handler
83 * (see the second half of this file for an example). But here we just
84 * take the easy way out and use the standard error handler, which will
85 * print a message on stderr and call exit() if compression fails.
86 * Note that this struct must live as long as the main JPEG parameter
87 * struct, to avoid dangling-pointer problems.
88 */
89 struct jpeg_error_mgr jerr;
90 /* More stuff */
91 FILE * outfile; /* target file */
92 JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
93 int row_stride; /* physical row width in image buffer */
94
95 /* Step 1: allocate and initialize JPEG compression object */
96
97 /* We have to set up the error handler first, in case the initialization
98 * step fails. (Unlikely, but it could happen if you are out of memory.)
99 * This routine fills in the contents of struct jerr, and returns jerr's
100 * address which we place into the link field in cinfo.
101 */
102 cinfo.err = jpeg_std_error(&jerr);
103 /* Now we can initialize the JPEG compression object. */
104 jpeg_create_compress(&cinfo);
105
106 /* Step 2: specify data destination (eg, a file) */
107 /* Note: steps 2 and 3 can be done in either order. */
108
109 /* Here we use the library-supplied code to send compressed data to a
110 * stdio stream. You can also write your own code to do something else.
111 * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
112 * requires it in order to write binary files.
113 */
114 if ((outfile = fopen(filename, "wb")) == NULL) {
115 fprintf(stderr, "can't open %s\n", filename);
116 exit(1);
117 }
118 jpeg_stdio_dest(&cinfo, outfile);
119
120 /* Step 3: set parameters for compression */
121
122 /* First we supply a description of the input image.
123 * Four fields of the cinfo struct must be filled in:
124 */
125 cinfo.image_width = image_width; /* image width and height, in pixels */
126 cinfo.image_height = image_height;
127 cinfo.input_components = 3; /* # of color components per pixel */
128 cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
129 /* Now use the library's routine to set default compression parameters.
130 * (You must set at least cinfo.in_color_space before calling this,
131 * since the defaults depend on the source color space.)
132 */
133 jpeg_set_defaults(&cinfo);
134 /* Now you can set any non-default parameters you wish to.
135 * Here we just illustrate the use of quality (quantization table) scaling:
136 */
137 jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
138
139 /* Step 4: Start compressor */
140
141 /* TRUE ensures that we will write a complete interchange-JPEG file.
142 * Pass TRUE unless you are very sure of what you're doing.
143 */
144 jpeg_start_compress(&cinfo, TRUE);
145
146 /* Step 5: while (scan lines remain to be written) */
147 /* jpeg_write_scanlines(...); */
148
149 /* Here we use the library's state variable cinfo.next_scanline as the
150 * loop counter, so that we don't have to keep track ourselves.
151 * To keep things simple, we pass one scanline per call; you can pass
152 * more if you wish, though.
153 */
154 row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
155
156 while (cinfo.next_scanline < cinfo.image_height) {
157 /* jpeg_write_scanlines expects an array of pointers to scanlines.
158 * Here the array is only one element long, but you could pass
159 * more than one scanline at a time if that's more convenient.
160 */
161 row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
162 (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
163 }
164
165 /* Step 6: Finish compression */
166
167 jpeg_finish_compress(&cinfo);
168 /* After finish_compress, we can close the output file. */
169 fclose(outfile);
170
171 /* Step 7: release JPEG compression object */
172
173 /* This is an important step since it will release a good deal of memory. */
174 jpeg_destroy_compress(&cinfo);
175
176 /* And we're done! */
177}
178
179
180/*
181 * SOME FINE POINTS:
182 *
183 * In the above loop, we ignored the return value of jpeg_write_scanlines,
184 * which is the number of scanlines actually written. We could get away
185 * with this because we were only relying on the value of cinfo.next_scanline,
186 * which will be incremented correctly. If you maintain additional loop
187 * variables then you should be careful to increment them properly.
188 * Actually, for output to a stdio stream you needn't worry, because
189 * then jpeg_write_scanlines will write all the lines passed (or else exit
190 * with a fatal error). Partial writes can only occur if you use a data
191 * destination module that can demand suspension of the compressor.
192 * (If you don't know what that's for, you don't need it.)
193 *
194 * If the compressor requires full-image buffers (for entropy-coding
195 * optimization or a multi-scan JPEG file), it will create temporary
196 * files for anything that doesn't fit within the maximum-memory setting.
197 * (Note that temp files are NOT needed if you use the default parameters.)
198 * On some systems you may need to set up a signal handler to ensure that
199 * temporary files are deleted if the program is interrupted. See libjpeg.txt.
200 *
201 * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG
202 * files to be compatible with everyone else's. If you cannot readily read
203 * your data in that order, you'll need an intermediate array to hold the
204 * image. See rdtarga.c or rdbmp.c for examples of handling bottom-to-top
205 * source data using the JPEG code's internal virtual-array mechanisms.
206 */
207
208
209
210/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/
211
212/* This half of the example shows how to read data from the JPEG decompressor.
213 * It's a bit more refined than the above, in that we show:
214 * (a) how to modify the JPEG library's standard error-reporting behavior;
215 * (b) how to allocate workspace using the library's memory manager.
216 *
217 * Just to make this example a little different from the first one, we'll
218 * assume that we do not intend to put the whole image into an in-memory
219 * buffer, but to send it line-by-line someplace else. We need a one-
220 * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG
221 * memory manager allocate it for us. This approach is actually quite useful
222 * because we don't need to remember to deallocate the buffer separately: it
223 * will go away automatically when the JPEG object is cleaned up.
224 */
225
226
227/*
228 * ERROR HANDLING:
229 *
230 * The JPEG library's standard error handler (jerror.c) is divided into
231 * several "methods" which you can override individually. This lets you
232 * adjust the behavior without duplicating a lot of code, which you might
233 * have to update with each future release.
234 *
235 * Our example here shows how to override the "error_exit" method so that
236 * control is returned to the library's caller when a fatal error occurs,
237 * rather than calling exit() as the standard error_exit method does.
238 *
239 * We use C's setjmp/longjmp facility to return control. This means that the
240 * routine which calls the JPEG library must first execute a setjmp() call to
241 * establish the return point. We want the replacement error_exit to do a
242 * longjmp(). But we need to make the setjmp buffer accessible to the
243 * error_exit routine. To do this, we make a private extension of the
244 * standard JPEG error handler object. (If we were using C++, we'd say we
245 * were making a subclass of the regular error handler.)
246 *
247 * Here's the extended error handler struct:
248 */
249
250struct my_error_mgr {
251 struct jpeg_error_mgr pub; /* "public" fields */
252
253 jmp_buf setjmp_buffer; /* for return to caller */
254};
255
256typedef struct my_error_mgr * my_error_ptr;
257
258/*
259 * Here's the routine that will replace the standard error_exit method:
260 */
261
262METHODDEF(void)
263my_error_exit (j_common_ptr cinfo)
264{
265 /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
266 my_error_ptr myerr = (my_error_ptr) cinfo->err;
267
268 /* Always display the message. */
269 /* We could postpone this until after returning, if we chose. */
270 (*cinfo->err->output_message) (cinfo);
271
272 /* Return control to the setjmp point */
273 longjmp(myerr->setjmp_buffer, 1);
274}
275
276
277/*
278 * Sample routine for JPEG decompression. We assume that the source file name
279 * is passed in. We want to return 1 on success, 0 on error.
280 */
281
282
283GLOBAL(int)
284read_JPEG_file (char * filename)
285{
286 /* This struct contains the JPEG decompression parameters and pointers to
287 * working space (which is allocated as needed by the JPEG library).
288 */
289 struct jpeg_decompress_struct cinfo;
290 /* We use our private extension JPEG error handler.
291 * Note that this struct must live as long as the main JPEG parameter
292 * struct, to avoid dangling-pointer problems.
293 */
294 struct my_error_mgr jerr;
295 /* More stuff */
296 FILE * infile; /* source file */
297 JSAMPARRAY buffer; /* Output row buffer */
298 int row_stride; /* physical row width in output buffer */
299
300 /* In this example we want to open the input file before doing anything else,
301 * so that the setjmp() error recovery below can assume the file is open.
302 * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
303 * requires it in order to read binary files.
304 */
305
306 if ((infile = fopen(filename, "rb")) == NULL) {
307 fprintf(stderr, "can't open %s\n", filename);
308 return 0;
309 }
310
311 /* Step 1: allocate and initialize JPEG decompression object */
312
313 /* We set up the normal JPEG error routines, then override error_exit. */
314 cinfo.err = jpeg_std_error(&jerr.pub);
315 jerr.pub.error_exit = my_error_exit;
316 /* Establish the setjmp return context for my_error_exit to use. */
317 if (setjmp(jerr.setjmp_buffer)) {
318 /* If we get here, the JPEG code has signaled an error.
319 * We need to clean up the JPEG object, close the input file, and return.
320 */
321 jpeg_destroy_decompress(&cinfo);
322 fclose(infile);
323 return 0;
324 }
325 /* Now we can initialize the JPEG decompression object. */
326 jpeg_create_decompress(&cinfo);
327
328 /* Step 2: specify data source (eg, a file) */
329
330 jpeg_stdio_src(&cinfo, infile);
331
332 /* Step 3: read file parameters with jpeg_read_header() */
333
334 (void) jpeg_read_header(&cinfo, TRUE);
335 /* We can ignore the return value from jpeg_read_header since
336 * (a) suspension is not possible with the stdio data source, and
337 * (b) we passed TRUE to reject a tables-only JPEG file as an error.
338 * See libjpeg.txt for more info.
339 */
340
341 /* Step 4: set parameters for decompression */
342
343 /* In this example, we don't need to change any of the defaults set by
344 * jpeg_read_header(), so we do nothing here.
345 */
346
347 /* Step 5: Start decompressor */
348
349 (void) jpeg_start_decompress(&cinfo);
350 /* We can ignore the return value since suspension is not possible
351 * with the stdio data source.
352 */
353
354 /* We may need to do some setup of our own at this point before reading
355 * the data. After jpeg_start_decompress() we have the correct scaled
356 * output image dimensions available, as well as the output colormap
357 * if we asked for color quantization.
358 * In this example, we need to make an output work buffer of the right size.
359 */
360 /* JSAMPLEs per row in output buffer */
361 row_stride = cinfo.output_width * cinfo.output_components;
362 /* Make a one-row-high sample array that will go away when done with image */
363 buffer = (*cinfo.mem->alloc_sarray)
364 ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
365
366 /* Step 6: while (scan lines remain to be read) */
367 /* jpeg_read_scanlines(...); */
368
369 /* Here we use the library's state variable cinfo.output_scanline as the
370 * loop counter, so that we don't have to keep track ourselves.
371 */
372 while (cinfo.output_scanline < cinfo.output_height) {
373 /* jpeg_read_scanlines expects an array of pointers to scanlines.
374 * Here the array is only one element long, but you could ask for
375 * more than one scanline at a time if that's more convenient.
376 */
377 (void) jpeg_read_scanlines(&cinfo, buffer, 1);
378 /* Assume put_scanline_someplace wants a pointer and sample count. */
379 put_scanline_someplace(buffer[0], row_stride);
380 }
381
382 /* Step 7: Finish decompression */
383
384 (void) jpeg_finish_decompress(&cinfo);
385 /* We can ignore the return value since suspension is not possible
386 * with the stdio data source.
387 */
388
389 /* Step 8: Release JPEG decompression object */
390
391 /* This is an important step since it will release a good deal of memory. */
392 jpeg_destroy_decompress(&cinfo);
393
394 /* After finish_decompress, we can close the input file.
395 * Here we postpone it until after no more JPEG errors are possible,
396 * so as to simplify the setjmp error logic above. (Actually, I don't
397 * think that jpeg_destroy can do an error exit, but why assume anything...)
398 */
399 fclose(infile);
400
401 /* At this point you may want to check to see whether any corrupt-data
402 * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
403 */
404
405 /* And we're done! */
406 return 1;
407}
408
409
410/*
411 * SOME FINE POINTS:
412 *
413 * In the above code, we ignored the return value of jpeg_read_scanlines,
414 * which is the number of scanlines actually read. We could get away with
415 * this because we asked for only one line at a time and we weren't using
416 * a suspending data source. See libjpeg.txt for more info.
417 *
418 * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();
419 * we should have done it beforehand to ensure that the space would be
420 * counted against the JPEG max_memory setting. In some systems the above
421 * code would risk an out-of-memory error. However, in general we don't
422 * know the output image dimensions before jpeg_start_decompress(), unless we
423 * call jpeg_calc_output_dimensions(). See libjpeg.txt for more about this.
424 *
425 * Scanlines are returned in the same order as they appear in the JPEG file,
426 * which is standardly top-to-bottom. If you must emit data bottom-to-top,
427 * you can use one of the virtual arrays provided by the JPEG memory manager
428 * to invert the data. See wrbmp.c for an example.
429 *
430 * As with compression, some operating modes may require temporary files.
431 * On some systems you may need to set up a signal handler to ensure that
432 * temporary files are deleted if the program is interrupted. See libjpeg.txt.
433 */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/filelist.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/filelist.txt
new file mode 100644
index 0000000..040abff
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/filelist.txt
@@ -0,0 +1,215 @@
1IJG JPEG LIBRARY: FILE LIST
2
3Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding.
4This file is part of the Independent JPEG Group's software.
5For conditions of distribution and use, see the accompanying README file.
6
7
8Here is a road map to the files in the IJG JPEG distribution. The
9distribution includes the JPEG library proper, plus two application
10programs ("cjpeg" and "djpeg") which use the library to convert JPEG
11files to and from some other popular image formats. A third application
12"jpegtran" uses the library to do lossless conversion between different
13variants of JPEG. There are also two stand-alone applications,
14"rdjpgcom" and "wrjpgcom".
15
16
17THE JPEG LIBRARY
18================
19
20Include files:
21
22jpeglib.h JPEG library's exported data and function declarations.
23jconfig.h Configuration declarations. Note: this file is not present
24 in the distribution; it is generated during installation.
25jmorecfg.h Additional configuration declarations; need not be changed
26 for a standard installation.
27jerror.h Declares JPEG library's error and trace message codes.
28jinclude.h Central include file used by all IJG .c files to reference
29 system include files.
30jpegint.h JPEG library's internal data structures.
31jdct.h Private declarations for forward & reverse DCT subsystems.
32jmemsys.h Private declarations for memory management subsystem.
33jversion.h Version information.
34
35Applications using the library should include jpeglib.h (which in turn
36includes jconfig.h and jmorecfg.h). Optionally, jerror.h may be included
37if the application needs to reference individual JPEG error codes. The
38other include files are intended for internal use and would not normally
39be included by an application program. (cjpeg/djpeg/etc do use jinclude.h,
40since its function is to improve portability of the whole IJG distribution.
41Most other applications will directly include the system include files they
42want, and hence won't need jinclude.h.)
43
44
45C source code files:
46
47These files contain most of the functions intended to be called directly by
48an application program:
49
50jcapimin.c Application program interface: core routines for compression.
51jcapistd.c Application program interface: standard compression.
52jdapimin.c Application program interface: core routines for decompression.
53jdapistd.c Application program interface: standard decompression.
54jcomapi.c Application program interface routines common to compression
55 and decompression.
56jcparam.c Compression parameter setting helper routines.
57jctrans.c API and library routines for transcoding compression.
58jdtrans.c API and library routines for transcoding decompression.
59
60Compression side of the library:
61
62jcinit.c Initialization: determines which other modules to use.
63jcmaster.c Master control: setup and inter-pass sequencing logic.
64jcmainct.c Main buffer controller (preprocessor => JPEG compressor).
65jcprepct.c Preprocessor buffer controller.
66jccoefct.c Buffer controller for DCT coefficient buffer.
67jccolor.c Color space conversion.
68jcsample.c Downsampling.
69jcdctmgr.c DCT manager (DCT implementation selection & control).
70jfdctint.c Forward DCT using slow-but-accurate integer method.
71jfdctfst.c Forward DCT using faster, less accurate integer method.
72jfdctflt.c Forward DCT using floating-point arithmetic.
73jchuff.c Huffman entropy coding.
74jcarith.c Arithmetic entropy coding.
75jcmarker.c JPEG marker writing.
76jdatadst.c Data destination managers for memory and stdio output.
77
78Decompression side of the library:
79
80jdmaster.c Master control: determines which other modules to use.
81jdinput.c Input controller: controls input processing modules.
82jdmainct.c Main buffer controller (JPEG decompressor => postprocessor).
83jdcoefct.c Buffer controller for DCT coefficient buffer.
84jdpostct.c Postprocessor buffer controller.
85jdmarker.c JPEG marker reading.
86jdhuff.c Huffman entropy decoding.
87jdarith.c Arithmetic entropy decoding.
88jddctmgr.c IDCT manager (IDCT implementation selection & control).
89jidctint.c Inverse DCT using slow-but-accurate integer method.
90jidctfst.c Inverse DCT using faster, less accurate integer method.
91jidctflt.c Inverse DCT using floating-point arithmetic.
92jdsample.c Upsampling.
93jdcolor.c Color space conversion.
94jdmerge.c Merged upsampling/color conversion (faster, lower quality).
95jquant1.c One-pass color quantization using a fixed-spacing colormap.
96jquant2.c Two-pass color quantization using a custom-generated colormap.
97 Also handles one-pass quantization to an externally given map.
98jdatasrc.c Data source managers for memory and stdio input.
99
100Support files for both compression and decompression:
101
102jaricom.c Tables for common use in arithmetic entropy encoding and
103 decoding routines.
104jerror.c Standard error handling routines (application replaceable).
105jmemmgr.c System-independent (more or less) memory management code.
106jutils.c Miscellaneous utility routines.
107
108jmemmgr.c relies on a system-dependent memory management module. The IJG
109distribution includes the following implementations of the system-dependent
110module:
111
112jmemnobs.c "No backing store": assumes adequate virtual memory exists.
113jmemansi.c Makes temporary files with ANSI-standard routine tmpfile().
114jmemname.c Makes temporary files with program-generated file names.
115jmemdos.c Custom implementation for MS-DOS (16-bit environment only):
116 can use extended and expanded memory as well as temp files.
117jmemmac.c Custom implementation for Apple Macintosh.
118
119Exactly one of the system-dependent modules should be configured into an
120installed JPEG library (see install.txt for hints about which one to use).
121On unusual systems you may find it worthwhile to make a special
122system-dependent memory manager.
123
124
125Non-C source code files:
126
127jmemdosa.asm 80x86 assembly code support for jmemdos.c; used only in
128 MS-DOS-specific configurations of the JPEG library.
129
130
131CJPEG/DJPEG/JPEGTRAN
132====================
133
134Include files:
135
136cdjpeg.h Declarations shared by cjpeg/djpeg/jpegtran modules.
137cderror.h Additional error and trace message codes for cjpeg et al.
138transupp.h Declarations for jpegtran support routines in transupp.c.
139
140C source code files:
141
142cjpeg.c Main program for cjpeg.
143djpeg.c Main program for djpeg.
144jpegtran.c Main program for jpegtran.
145cdjpeg.c Utility routines used by all three programs.
146rdcolmap.c Code to read a colormap file for djpeg's "-map" switch.
147rdswitch.c Code to process some of cjpeg's more complex switches.
148 Also used by jpegtran.
149transupp.c Support code for jpegtran: lossless image manipulations.
150
151Image file reader modules for cjpeg:
152
153rdbmp.c BMP file input.
154rdgif.c GIF file input (now just a stub).
155rdppm.c PPM/PGM file input.
156rdrle.c Utah RLE file input.
157rdtarga.c Targa file input.
158
159Image file writer modules for djpeg:
160
161wrbmp.c BMP file output.
162wrgif.c GIF file output (a mere shadow of its former self).
163wrppm.c PPM/PGM file output.
164wrrle.c Utah RLE file output.
165wrtarga.c Targa file output.
166
167
168RDJPGCOM/WRJPGCOM
169=================
170
171C source code files:
172
173rdjpgcom.c Stand-alone rdjpgcom application.
174wrjpgcom.c Stand-alone wrjpgcom application.
175
176These programs do not depend on the IJG library. They do use
177jconfig.h and jinclude.h, only to improve portability.
178
179
180ADDITIONAL FILES
181================
182
183Documentation (see README for a guide to the documentation files):
184
185README Master documentation file.
186*.txt Other documentation files.
187*.1 Documentation in Unix man page format.
188change.log Version-to-version change highlights.
189example.c Sample code for calling JPEG library.
190
191Configuration/installation files and programs (see install.txt for more info):
192
193configure Unix shell script to perform automatic configuration.
194configure.ac Source file for use with Autoconf to generate configure.
195ltmain.sh Support scripts for configure (from GNU libtool).
196config.guess
197config.sub
198depcomp
199missing
200install-sh Install shell script for those Unix systems lacking one.
201Makefile.in Makefile input for configure.
202Makefile.am Source file for use with Automake to generate Makefile.in.
203ckconfig.c Program to generate jconfig.h on non-Unix systems.
204jconfig.txt Template for making jconfig.h by hand.
205mak*.* Sample makefiles for particular systems.
206jconfig.* Sample jconfig.h for particular systems.
207libjpeg.map Script to generate shared library with versioned symbols.
208aclocal.m4 M4 macro definitions for use with Autoconf.
209ansi2knr.c De-ANSIfier for pre-ANSI C compilers (courtesy of
210 L. Peter Deutsch and Aladdin Enterprises).
211
212Test files (see install.txt for test procedure):
213
214test*.* Source and comparison files for confidence test.
215 These are binary image files, NOT text files.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install-sh b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install-sh
new file mode 100644
index 0000000..9c04de2
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install-sh
@@ -0,0 +1,527 @@
1#!/bin/sh
2# install - install a program, script, or datafile
3
4scriptversion=2011-01-19.21; # UTC
5
6# This originates from X11R5 (mit/util/scripts/install.sh), which was
7# later released in X11R6 (xc/config/util/install.sh) with the
8# following copyright and license.
9#
10# Copyright (C) 1994 X Consortium
11#
12# Permission is hereby granted, free of charge, to any person obtaining a copy
13# of this software and associated documentation files (the "Software"), to
14# deal in the Software without restriction, including without limitation the
15# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16# sell copies of the Software, and to permit persons to whom the Software is
17# furnished to do so, subject to the following conditions:
18#
19# The above copyright notice and this permission notice shall be included in
20# all copies or substantial portions of the Software.
21#
22# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
27# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28#
29# Except as contained in this notice, the name of the X Consortium shall not
30# be used in advertising or otherwise to promote the sale, use or other deal-
31# ings in this Software without prior written authorization from the X Consor-
32# tium.
33#
34#
35# FSF changes to this file are in the public domain.
36#
37# Calling this script install-sh is preferred over install.sh, to prevent
38# `make' implicit rules from creating a file called install from it
39# when there is no Makefile.
40#
41# This script is compatible with the BSD install script, but was written
42# from scratch.
43
44nl='
45'
46IFS=" "" $nl"
47
48# set DOITPROG to echo to test this script
49
50# Don't use :- since 4.3BSD and earlier shells don't like it.
51doit=${DOITPROG-}
52if test -z "$doit"; then
53 doit_exec=exec
54else
55 doit_exec=$doit
56fi
57
58# Put in absolute file names if you don't have them in your path;
59# or use environment vars.
60
61chgrpprog=${CHGRPPROG-chgrp}
62chmodprog=${CHMODPROG-chmod}
63chownprog=${CHOWNPROG-chown}
64cmpprog=${CMPPROG-cmp}
65cpprog=${CPPROG-cp}
66mkdirprog=${MKDIRPROG-mkdir}
67mvprog=${MVPROG-mv}
68rmprog=${RMPROG-rm}
69stripprog=${STRIPPROG-strip}
70
71posix_glob='?'
72initialize_posix_glob='
73 test "$posix_glob" != "?" || {
74 if (set -f) 2>/dev/null; then
75 posix_glob=
76 else
77 posix_glob=:
78 fi
79 }
80'
81
82posix_mkdir=
83
84# Desired mode of installed file.
85mode=0755
86
87chgrpcmd=
88chmodcmd=$chmodprog
89chowncmd=
90mvcmd=$mvprog
91rmcmd="$rmprog -f"
92stripcmd=
93
94src=
95dst=
96dir_arg=
97dst_arg=
98
99copy_on_change=false
100no_target_directory=
101
102usage="\
103Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
104 or: $0 [OPTION]... SRCFILES... DIRECTORY
105 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
106 or: $0 [OPTION]... -d DIRECTORIES...
107
108In the 1st form, copy SRCFILE to DSTFILE.
109In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
110In the 4th, create DIRECTORIES.
111
112Options:
113 --help display this help and exit.
114 --version display version info and exit.
115
116 -c (ignored)
117 -C install only if different (preserve the last data modification time)
118 -d create directories instead of installing files.
119 -g GROUP $chgrpprog installed files to GROUP.
120 -m MODE $chmodprog installed files to MODE.
121 -o USER $chownprog installed files to USER.
122 -s $stripprog installed files.
123 -t DIRECTORY install into DIRECTORY.
124 -T report an error if DSTFILE is a directory.
125
126Environment variables override the default commands:
127 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
128 RMPROG STRIPPROG
129"
130
131while test $# -ne 0; do
132 case $1 in
133 -c) ;;
134
135 -C) copy_on_change=true;;
136
137 -d) dir_arg=true;;
138
139 -g) chgrpcmd="$chgrpprog $2"
140 shift;;
141
142 --help) echo "$usage"; exit $?;;
143
144 -m) mode=$2
145 case $mode in
146 *' '* | *' '* | *'
147'* | *'*'* | *'?'* | *'['*)
148 echo "$0: invalid mode: $mode" >&2
149 exit 1;;
150 esac
151 shift;;
152
153 -o) chowncmd="$chownprog $2"
154 shift;;
155
156 -s) stripcmd=$stripprog;;
157
158 -t) dst_arg=$2
159 # Protect names problematic for `test' and other utilities.
160 case $dst_arg in
161 -* | [=\(\)!]) dst_arg=./$dst_arg;;
162 esac
163 shift;;
164
165 -T) no_target_directory=true;;
166
167 --version) echo "$0 $scriptversion"; exit $?;;
168
169 --) shift
170 break;;
171
172 -*) echo "$0: invalid option: $1" >&2
173 exit 1;;
174
175 *) break;;
176 esac
177 shift
178done
179
180if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
181 # When -d is used, all remaining arguments are directories to create.
182 # When -t is used, the destination is already specified.
183 # Otherwise, the last argument is the destination. Remove it from $@.
184 for arg
185 do
186 if test -n "$dst_arg"; then
187 # $@ is not empty: it contains at least $arg.
188 set fnord "$@" "$dst_arg"
189 shift # fnord
190 fi
191 shift # arg
192 dst_arg=$arg
193 # Protect names problematic for `test' and other utilities.
194 case $dst_arg in
195 -* | [=\(\)!]) dst_arg=./$dst_arg;;
196 esac
197 done
198fi
199
200if test $# -eq 0; then
201 if test -z "$dir_arg"; then
202 echo "$0: no input file specified." >&2
203 exit 1
204 fi
205 # It's OK to call `install-sh -d' without argument.
206 # This can happen when creating conditional directories.
207 exit 0
208fi
209
210if test -z "$dir_arg"; then
211 do_exit='(exit $ret); exit $ret'
212 trap "ret=129; $do_exit" 1
213 trap "ret=130; $do_exit" 2
214 trap "ret=141; $do_exit" 13
215 trap "ret=143; $do_exit" 15
216
217 # Set umask so as not to create temps with too-generous modes.
218 # However, 'strip' requires both read and write access to temps.
219 case $mode in
220 # Optimize common cases.
221 *644) cp_umask=133;;
222 *755) cp_umask=22;;
223
224 *[0-7])
225 if test -z "$stripcmd"; then
226 u_plus_rw=
227 else
228 u_plus_rw='% 200'
229 fi
230 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
231 *)
232 if test -z "$stripcmd"; then
233 u_plus_rw=
234 else
235 u_plus_rw=,u+rw
236 fi
237 cp_umask=$mode$u_plus_rw;;
238 esac
239fi
240
241for src
242do
243 # Protect names problematic for `test' and other utilities.
244 case $src in
245 -* | [=\(\)!]) src=./$src;;
246 esac
247
248 if test -n "$dir_arg"; then
249 dst=$src
250 dstdir=$dst
251 test -d "$dstdir"
252 dstdir_status=$?
253 else
254
255 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
256 # might cause directories to be created, which would be especially bad
257 # if $src (and thus $dsttmp) contains '*'.
258 if test ! -f "$src" && test ! -d "$src"; then
259 echo "$0: $src does not exist." >&2
260 exit 1
261 fi
262
263 if test -z "$dst_arg"; then
264 echo "$0: no destination specified." >&2
265 exit 1
266 fi
267 dst=$dst_arg
268
269 # If destination is a directory, append the input filename; won't work
270 # if double slashes aren't ignored.
271 if test -d "$dst"; then
272 if test -n "$no_target_directory"; then
273 echo "$0: $dst_arg: Is a directory" >&2
274 exit 1
275 fi
276 dstdir=$dst
277 dst=$dstdir/`basename "$src"`
278 dstdir_status=0
279 else
280 # Prefer dirname, but fall back on a substitute if dirname fails.
281 dstdir=`
282 (dirname "$dst") 2>/dev/null ||
283 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
284 X"$dst" : 'X\(//\)[^/]' \| \
285 X"$dst" : 'X\(//\)$' \| \
286 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
287 echo X"$dst" |
288 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
289 s//\1/
290 q
291 }
292 /^X\(\/\/\)[^/].*/{
293 s//\1/
294 q
295 }
296 /^X\(\/\/\)$/{
297 s//\1/
298 q
299 }
300 /^X\(\/\).*/{
301 s//\1/
302 q
303 }
304 s/.*/./; q'
305 `
306
307 test -d "$dstdir"
308 dstdir_status=$?
309 fi
310 fi
311
312 obsolete_mkdir_used=false
313
314 if test $dstdir_status != 0; then
315 case $posix_mkdir in
316 '')
317 # Create intermediate dirs using mode 755 as modified by the umask.
318 # This is like FreeBSD 'install' as of 1997-10-28.
319 umask=`umask`
320 case $stripcmd.$umask in
321 # Optimize common cases.
322 *[2367][2367]) mkdir_umask=$umask;;
323 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
324
325 *[0-7])
326 mkdir_umask=`expr $umask + 22 \
327 - $umask % 100 % 40 + $umask % 20 \
328 - $umask % 10 % 4 + $umask % 2
329 `;;
330 *) mkdir_umask=$umask,go-w;;
331 esac
332
333 # With -d, create the new directory with the user-specified mode.
334 # Otherwise, rely on $mkdir_umask.
335 if test -n "$dir_arg"; then
336 mkdir_mode=-m$mode
337 else
338 mkdir_mode=
339 fi
340
341 posix_mkdir=false
342 case $umask in
343 *[123567][0-7][0-7])
344 # POSIX mkdir -p sets u+wx bits regardless of umask, which
345 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
346 ;;
347 *)
348 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
349 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
350
351 if (umask $mkdir_umask &&
352 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
353 then
354 if test -z "$dir_arg" || {
355 # Check for POSIX incompatibilities with -m.
356 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
357 # other-writeable bit of parent directory when it shouldn't.
358 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
359 ls_ld_tmpdir=`ls -ld "$tmpdir"`
360 case $ls_ld_tmpdir in
361 d????-?r-*) different_mode=700;;
362 d????-?--*) different_mode=755;;
363 *) false;;
364 esac &&
365 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
366 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
367 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
368 }
369 }
370 then posix_mkdir=:
371 fi
372 rmdir "$tmpdir/d" "$tmpdir"
373 else
374 # Remove any dirs left behind by ancient mkdir implementations.
375 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
376 fi
377 trap '' 0;;
378 esac;;
379 esac
380
381 if
382 $posix_mkdir && (
383 umask $mkdir_umask &&
384 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
385 )
386 then :
387 else
388
389 # The umask is ridiculous, or mkdir does not conform to POSIX,
390 # or it failed possibly due to a race condition. Create the
391 # directory the slow way, step by step, checking for races as we go.
392
393 case $dstdir in
394 /*) prefix='/';;
395 [-=\(\)!]*) prefix='./';;
396 *) prefix='';;
397 esac
398
399 eval "$initialize_posix_glob"
400
401 oIFS=$IFS
402 IFS=/
403 $posix_glob set -f
404 set fnord $dstdir
405 shift
406 $posix_glob set +f
407 IFS=$oIFS
408
409 prefixes=
410
411 for d
412 do
413 test X"$d" = X && continue
414
415 prefix=$prefix$d
416 if test -d "$prefix"; then
417 prefixes=
418 else
419 if $posix_mkdir; then
420 (umask=$mkdir_umask &&
421 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
422 # Don't fail if two instances are running concurrently.
423 test -d "$prefix" || exit 1
424 else
425 case $prefix in
426 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
427 *) qprefix=$prefix;;
428 esac
429 prefixes="$prefixes '$qprefix'"
430 fi
431 fi
432 prefix=$prefix/
433 done
434
435 if test -n "$prefixes"; then
436 # Don't fail if two instances are running concurrently.
437 (umask $mkdir_umask &&
438 eval "\$doit_exec \$mkdirprog $prefixes") ||
439 test -d "$dstdir" || exit 1
440 obsolete_mkdir_used=true
441 fi
442 fi
443 fi
444
445 if test -n "$dir_arg"; then
446 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
447 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
448 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
449 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
450 else
451
452 # Make a couple of temp file names in the proper directory.
453 dsttmp=$dstdir/_inst.$$_
454 rmtmp=$dstdir/_rm.$$_
455
456 # Trap to clean up those temp files at exit.
457 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
458
459 # Copy the file name to the temp name.
460 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
461
462 # and set any options; do chmod last to preserve setuid bits.
463 #
464 # If any of these fail, we abort the whole thing. If we want to
465 # ignore errors from any of these, just make sure not to ignore
466 # errors from the above "$doit $cpprog $src $dsttmp" command.
467 #
468 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
469 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
470 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
471 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
472
473 # If -C, don't bother to copy if it wouldn't change the file.
474 if $copy_on_change &&
475 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
476 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
477
478 eval "$initialize_posix_glob" &&
479 $posix_glob set -f &&
480 set X $old && old=:$2:$4:$5:$6 &&
481 set X $new && new=:$2:$4:$5:$6 &&
482 $posix_glob set +f &&
483
484 test "$old" = "$new" &&
485 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
486 then
487 rm -f "$dsttmp"
488 else
489 # Rename the file to the real destination.
490 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
491
492 # The rename failed, perhaps because mv can't rename something else
493 # to itself, or perhaps because mv is so ancient that it does not
494 # support -f.
495 {
496 # Now remove or move aside any old file at destination location.
497 # We try this two ways since rm can't unlink itself on some
498 # systems and the destination file might be busy for other
499 # reasons. In this case, the final cleanup might fail but the new
500 # file should still install successfully.
501 {
502 test ! -f "$dst" ||
503 $doit $rmcmd -f "$dst" 2>/dev/null ||
504 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
505 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
506 } ||
507 { echo "$0: cannot unlink or rename $dst" >&2
508 (exit 1); exit 1
509 }
510 } &&
511
512 # Now rename the file to the real destination.
513 $doit $mvcmd "$dsttmp" "$dst"
514 }
515 fi || exit 1
516
517 trap '' 0
518 fi
519done
520
521# Local variables:
522# eval: (add-hook 'write-file-hooks 'time-stamp)
523# time-stamp-start: "scriptversion="
524# time-stamp-format: "%:y-%02m-%02d.%02H"
525# time-stamp-time-zone: "UTC"
526# time-stamp-end: "; # UTC"
527# End:
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install.txt
new file mode 100644
index 0000000..d8f2495
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/install.txt
@@ -0,0 +1,1096 @@
1INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software
2
3Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.
4This file is part of the Independent JPEG Group's software.
5For conditions of distribution and use, see the accompanying README file.
6
7
8This file explains how to configure and install the IJG software. We have
9tried to make this software extremely portable and flexible, so that it can be
10adapted to almost any environment. The downside of this decision is that the
11installation process is complicated. We have provided shortcuts to simplify
12the task on common systems. But in any case, you will need at least a little
13familiarity with C programming and program build procedures for your system.
14
15If you are only using this software as part of a larger program, the larger
16program's installation procedure may take care of configuring the IJG code.
17For example, Ghostscript's installation script will configure the IJG code.
18You don't need to read this file if you just want to compile Ghostscript.
19
20If you are on a Unix machine, you may not need to read this file at all.
21Try doing
22 ./configure
23 make
24 make test
25If that doesn't complain, do
26 make install
27(better do "make -n install" first to see if the makefile will put the files
28where you want them). Read further if you run into snags or want to customize
29the code for your system.
30
31
32TABLE OF CONTENTS
33-----------------
34
35Before you start
36Configuring the software:
37 using the automatic "configure" script
38 using one of the supplied jconfig and makefile files
39 by hand
40Building the software
41Testing the software
42Installing the software
43Optional stuff
44Optimization
45Hints for specific systems
46
47
48BEFORE YOU START
49================
50
51Before installing the software you must unpack the distributed source code.
52Since you are reading this file, you have probably already succeeded in this
53task. However, there is a potential for error if you needed to convert the
54files to the local standard text file format (for example, if you are on
55MS-DOS you may have converted LF end-of-line to CR/LF). You must apply
56such conversion to all the files EXCEPT those whose names begin with "test".
57The test files contain binary data; if you change them in any way then the
58self-test will give bad results.
59
60Please check the last section of this file to see if there are hints for the
61specific machine or compiler you are using.
62
63
64CONFIGURING THE SOFTWARE
65========================
66
67To configure the IJG code for your system, you need to create two files:
68 * jconfig.h: contains values for system-dependent #define symbols.
69 * Makefile: controls the compilation process.
70(On a non-Unix machine, you may create "project files" or some other
71substitute for a Makefile. jconfig.h is needed in any environment.)
72
73We provide three different ways to generate these files:
74 * On a Unix system, you can just run the "configure" script.
75 * We provide sample jconfig files and makefiles for popular machines;
76 if your machine matches one of the samples, just copy the right sample
77 files to jconfig.h and Makefile.
78 * If all else fails, read the instructions below and make your own files.
79
80
81Configuring the software using the automatic "configure" script
82---------------------------------------------------------------
83
84If you are on a Unix machine, you can just type
85 ./configure
86and let the configure script construct appropriate configuration files.
87If you're using "csh" on an old version of System V, you might need to type
88 sh configure
89instead to prevent csh from trying to execute configure itself.
90Expect configure to run for a few minutes, particularly on slower machines;
91it works by compiling a series of test programs.
92
93Configure was created with GNU Autoconf and it follows the usual conventions
94for GNU configure scripts. It makes a few assumptions that you may want to
95override. You can do this by providing optional switches to configure:
96
97* Configure will build both static and shared libraries, if possible.
98If you want to build libjpeg only as a static library, say
99 ./configure --disable-shared
100If you want to build libjpeg only as a shared library, say
101 ./configure --disable-static
102Configure uses GNU libtool to take care of system-dependent shared library
103building methods.
104
105* Configure will use gcc (GNU C compiler) if it's available, otherwise cc.
106To force a particular compiler to be selected, use the CC option, for example
107 ./configure CC='cc'
108The same method can be used to include any unusual compiler switches.
109For example, on HP-UX you probably want to say
110 ./configure CC='cc -Aa'
111to get HP's compiler to run in ANSI mode.
112
113* The default CFLAGS setting is "-g" for non-gcc compilers, "-g -O2" for gcc.
114You can override this by saying, for example,
115 ./configure CFLAGS='-O2'
116if you want to compile without debugging support.
117
118* Configure will set up the makefile so that "make install" will install files
119into /usr/local/bin, /usr/local/man, etc. You can specify an installation
120prefix other than "/usr/local" by giving configure the option "--prefix=PATH".
121
122* If you don't have a lot of swap space, you may need to enable the IJG
123software's internal virtual memory mechanism. To do this, give the option
124"--enable-maxmem=N" where N is the default maxmemory limit in megabytes.
125This is discussed in more detail under "Selecting a memory manager", below.
126You probably don't need to worry about this on reasonably-sized Unix machines,
127unless you plan to process very large images.
128
129Configure has some other features that are useful if you are cross-compiling
130or working in a network of multiple machine types; but if you need those
131features, you probably already know how to use them.
132
133
134Configuring the software using one of the supplied jconfig and makefile files
135-----------------------------------------------------------------------------
136
137If you have one of these systems, you can just use the provided configuration
138files:
139
140Makefile jconfig file System and/or compiler
141
142makefile.manx jconfig.manx Amiga, Manx Aztec C
143makefile.sas jconfig.sas Amiga, SAS C
144makeproj.mac jconfig.mac Apple Macintosh, Metrowerks CodeWarrior
145mak*jpeg.st jconfig.st Atari ST/STE/TT, Pure C or Turbo C
146makefile.bcc jconfig.bcc MS-DOS or OS/2, Borland C
147makefile.dj jconfig.dj MS-DOS, DJGPP (Delorie's port of GNU C)
148makefile.mc6 jconfig.mc6 MS-DOS, Microsoft C (16-bit only)
149makefile.wat jconfig.wat MS-DOS, OS/2, or Windows NT, Watcom C
150makefile.vc jconfig.vc Windows NT/95, MS Visual C++
151make*.vc6 jconfig.vc Windows NT/95, MS Visual C++ 6
152make*.v10 jconfig.vc Windows NT/95, MS Visual C++ 2010 (v10)
153makefile.mms jconfig.vms Digital VMS, with MMS software
154makefile.vms jconfig.vms Digital VMS, without MMS software
155
156Copy the proper jconfig file to jconfig.h and the makefile to Makefile (or
157whatever your system uses as the standard makefile name). For more info see
158the appropriate system-specific hints section near the end of this file.
159
160
161Configuring the software by hand
162--------------------------------
163
164First, generate a jconfig.h file. If you are moderately familiar with C,
165the comments in jconfig.txt should be enough information to do this; just
166copy jconfig.txt to jconfig.h and edit it appropriately. Otherwise, you may
167prefer to use the ckconfig.c program. You will need to compile and execute
168ckconfig.c by hand --- we hope you know at least enough to do that.
169ckconfig.c may not compile the first try (in fact, the whole idea is for it
170to fail if anything is going to). If you get compile errors, fix them by
171editing ckconfig.c according to the directions given in ckconfig.c. Once
172you get it to run, it will write a suitable jconfig.h file, and will also
173print out some advice about which makefile to use.
174
175You may also want to look at the canned jconfig files, if there is one for a
176system similar to yours.
177
178Second, select a makefile and copy it to Makefile (or whatever your system
179uses as the standard makefile name). The most generic makefiles we provide
180are
181 makefile.ansi: if your C compiler supports function prototypes
182 makefile.unix: if not.
183(You have function prototypes if ckconfig.c put "#define HAVE_PROTOTYPES"
184in jconfig.h.) You may want to start from one of the other makefiles if
185there is one for a system similar to yours.
186
187Look over the selected Makefile and adjust options as needed. In particular
188you may want to change the CC and CFLAGS definitions. For instance, if you
189are using GCC, set CC=gcc. If you had to use any compiler switches to get
190ckconfig.c to work, make sure the same switches are in CFLAGS.
191
192If you are on a system that doesn't use makefiles, you'll need to set up
193project files (or whatever you do use) to compile all the source files and
194link them into executable files cjpeg, djpeg, jpegtran, rdjpgcom, and wrjpgcom.
195See the file lists in any of the makefiles to find out which files go into
196each program. Note that the provided makefiles all make a "library" file
197libjpeg first, but you don't have to do that if you don't want to; the file
198lists identify which source files are actually needed for compression,
199decompression, or both. As a last resort, you can make a batch script that
200just compiles everything and links it all together; makefile.vms is an example
201of this (it's for VMS systems that have no make-like utility).
202
203Here are comments about some specific configuration decisions you'll
204need to make:
205
206Command line style
207------------------
208
209These programs can use a Unix-like command line style which supports
210redirection and piping, like this:
211 cjpeg inputfile >outputfile
212 cjpeg <inputfile >outputfile
213 source program | cjpeg >outputfile
214The simpler "two file" command line style is just
215 cjpeg inputfile outputfile
216You may prefer the two-file style, particularly if you don't have pipes.
217
218You MUST use two-file style on any system that doesn't cope well with binary
219data fed through stdin/stdout; this is true for some MS-DOS compilers, for
220example. If you're not on a Unix system, it's safest to assume you need
221two-file style. (But if your compiler provides either the Posix-standard
222fdopen() library routine or a Microsoft-compatible setmode() routine, you
223can safely use the Unix command line style, by defining USE_FDOPEN or
224USE_SETMODE respectively.)
225
226To use the two-file style, make jconfig.h say "#define TWO_FILE_COMMANDLINE".
227
228Selecting a memory manager
229--------------------------
230
231The IJG code is capable of working on images that are too big to fit in main
232memory; data is swapped out to temporary files as necessary. However, the
233code to do this is rather system-dependent. We provide five different
234memory managers:
235
236* jmemansi.c This version uses the ANSI-standard library routine tmpfile(),
237 which not all non-ANSI systems have. On some systems
238 tmpfile() may put the temporary file in a non-optimal
239 location; if you don't like what it does, use jmemname.c.
240
241* jmemname.c This version creates named temporary files. For anything
242 except a Unix machine, you'll need to configure the
243 select_file_name() routine appropriately; see the comments
244 near the head of jmemname.c. If you use this version, define
245 NEED_SIGNAL_CATCHER in jconfig.h to make sure the temp files
246 are removed if the program is aborted.
247
248* jmemnobs.c (That stands for No Backing Store :-).) This will compile on
249 almost any system, but it assumes you have enough main memory
250 or virtual memory to hold the biggest images you work with.
251
252* jmemdos.c This should be used with most 16-bit MS-DOS compilers.
253 See the system-specific notes about MS-DOS for more info.
254 IMPORTANT: if you use this, define USE_MSDOS_MEMMGR in
255 jconfig.h, and include the assembly file jmemdosa.asm in the
256 programs. The supplied makefiles and jconfig files for
257 16-bit MS-DOS compilers already do both.
258
259* jmemmac.c Custom version for Apple Macintosh; see the system-specific
260 notes for Macintosh for more info.
261
262To use a particular memory manager, change the SYSDEPMEM variable in your
263makefile to equal the corresponding object file name (for example, jmemansi.o
264or jmemansi.obj for jmemansi.c).
265
266If you have plenty of (real or virtual) main memory, just use jmemnobs.c.
267"Plenty" means about ten bytes for every pixel in the largest images
268you plan to process, so a lot of systems don't meet this criterion.
269If yours doesn't, try jmemansi.c first. If that doesn't compile, you'll have
270to use jmemname.c; be sure to adjust select_file_name() for local conditions.
271You may also need to change unlink() to remove() in close_backing_store().
272
273Except with jmemnobs.c or jmemmac.c, you need to adjust the DEFAULT_MAX_MEM
274setting to a reasonable value for your system (either by adding a #define for
275DEFAULT_MAX_MEM to jconfig.h, or by adding a -D switch to the Makefile).
276This value limits the amount of data space the program will attempt to
277allocate. Code and static data space isn't counted, so the actual memory
278needs for cjpeg or djpeg are typically 100 to 150Kb more than the max-memory
279setting. Larger max-memory settings reduce the amount of I/O needed to
280process a large image, but too large a value can result in "insufficient
281memory" failures. On most Unix machines (and other systems with virtual
282memory), just set DEFAULT_MAX_MEM to several million and forget it. At the
283other end of the spectrum, for MS-DOS machines you probably can't go much
284above 300K to 400K. (On MS-DOS the value refers to conventional memory only.
285Extended/expanded memory is handled separately by jmemdos.c.)
286
287
288BUILDING THE SOFTWARE
289=====================
290
291Now you should be able to compile the software. Just say "make" (or
292whatever's necessary to start the compilation). Have a cup of coffee.
293
294Here are some things that could go wrong:
295
296If your compiler complains about undefined structures, you should be able to
297shut it up by putting "#define INCOMPLETE_TYPES_BROKEN" in jconfig.h.
298
299If you have trouble with missing system include files or inclusion of the
300wrong ones, read jinclude.h. This shouldn't happen if you used configure
301or ckconfig.c to set up jconfig.h.
302
303There are a fair number of routines that do not use all of their parameters;
304some compilers will issue warnings about this, which you can ignore. There
305are also a few configuration checks that may give "unreachable code" warnings.
306Any other warning deserves investigation.
307
308If you don't have a getenv() library routine, define NO_GETENV.
309
310Also see the system-specific hints, below.
311
312
313TESTING THE SOFTWARE
314====================
315
316As a quick test of functionality we've included a small sample image in
317several forms:
318 testorig.jpg Starting point for the djpeg tests.
319 testimg.ppm The output of djpeg testorig.jpg
320 testimg.bmp The output of djpeg -bmp -colors 256 testorig.jpg
321 testimg.jpg The output of cjpeg testimg.ppm
322 testprog.jpg Progressive-mode equivalent of testorig.jpg.
323 testimgp.jpg The output of cjpeg -progressive -optimize testimg.ppm
324(The first- and second-generation .jpg files aren't identical since the
325default compression parameters are lossy.) If you can generate duplicates
326of the testimg* files then you probably have working programs.
327
328With most of the makefiles, "make test" will perform the necessary
329comparisons.
330
331If you're using a makefile that doesn't provide the test option, run djpeg
332and cjpeg by hand and compare the output files to testimg* with whatever
333binary file comparison tool you have. The files should be bit-for-bit
334identical.
335
336If the programs complain "MAX_ALLOC_CHUNK is wrong, please fix", then you
337need to reduce MAX_ALLOC_CHUNK to a value that fits in type size_t.
338Try adding "#define MAX_ALLOC_CHUNK 65520L" to jconfig.h. A less likely
339configuration error is "ALIGN_TYPE is wrong, please fix": defining ALIGN_TYPE
340as long should take care of that one.
341
342If the cjpeg test run fails with "Missing Huffman code table entry", it's a
343good bet that you needed to define RIGHT_SHIFT_IS_UNSIGNED. Go back to the
344configuration step and run ckconfig.c. (This is a good plan for any other
345test failure, too.)
346
347If you are using Unix (one-file) command line style on a non-Unix system,
348it's a good idea to check that binary I/O through stdin/stdout actually
349works. You should get the same results from "djpeg <testorig.jpg >out.ppm"
350as from "djpeg -outfile out.ppm testorig.jpg". Note that the makefiles all
351use the latter style and therefore do not exercise stdin/stdout! If this
352check fails, try recompiling with USE_SETMODE or USE_FDOPEN defined.
353If it still doesn't work, better use two-file style.
354
355If you chose a memory manager other than jmemnobs.c, you should test that
356temporary-file usage works. Try "djpeg -bmp -colors 256 -max 0 testorig.jpg"
357and make sure its output matches testimg.bmp. If you have any really large
358images handy, try compressing them with -optimize and/or decompressing with
359-colors 256 to make sure your DEFAULT_MAX_MEM setting is not too large.
360
361NOTE: this is far from an exhaustive test of the JPEG software; some modules,
362such as 1-pass color quantization, are not exercised at all. It's just a
363quick test to give you some confidence that you haven't missed something
364major.
365
366
367INSTALLING THE SOFTWARE
368=======================
369
370Once you're done with the above steps, you can install the software by
371copying the executable files (cjpeg, djpeg, jpegtran, rdjpgcom, and wrjpgcom)
372to wherever you normally install programs. On Unix systems, you'll also want
373to put the man pages (cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1)
374in the man-page directory. The pre-fab makefiles don't support this step
375since there's such a wide variety of installation procedures on different
376systems.
377
378If you generated a Makefile with the "configure" script, you can just say
379 make install
380to install the programs and their man pages into the standard places.
381(You'll probably need to be root to do this.) We recommend first saying
382 make -n install
383to see where configure thought the files should go. You may need to edit
384the Makefile, particularly if your system's conventions for man page
385filenames don't match what configure expects.
386
387If you want to install the IJG library itself, for use in compiling other
388programs besides ours, then you need to put the four include files
389 jpeglib.h jerror.h jconfig.h jmorecfg.h
390into your include-file directory, and put the library file libjpeg.a
391(extension may vary depending on system) wherever library files go.
392If you generated a Makefile with "configure", it will do what it thinks
393is the right thing if you say
394 make install-lib
395
396
397OPTIONAL STUFF
398==============
399
400Progress monitor:
401
402If you like, you can #define PROGRESS_REPORT (in jconfig.h) to enable display
403of percent-done progress reports. The routine provided in cdjpeg.c merely
404prints percentages to stderr, but you can customize it to do something
405fancier.
406
407Utah RLE file format support:
408
409We distribute the software with support for RLE image files (Utah Raster
410Toolkit format) disabled, because the RLE support won't compile without the
411Utah library. If you have URT version 3.1 or later, you can enable RLE
412support as follows:
413 1. #define RLE_SUPPORTED in jconfig.h.
414 2. Add a -I option to CFLAGS in the Makefile for the directory
415 containing the URT .h files (typically the "include"
416 subdirectory of the URT distribution).
417 3. Add -L... -lrle to LDLIBS in the Makefile, where ... specifies
418 the directory containing the URT "librle.a" file (typically the
419 "lib" subdirectory of the URT distribution).
420
421Support for 12-bit-deep pixel data:
422
423The JPEG standard allows either 8-bit or 12-bit data precision. (For color,
424this means 8 or 12 bits per channel, of course.) If you need to work with
425deeper than 8-bit data, you can compile the IJG code for 12-bit operation.
426To do so:
427 1. In jmorecfg.h, define BITS_IN_JSAMPLE as 12 rather than 8.
428 2. In jconfig.h, undefine BMP_SUPPORTED, RLE_SUPPORTED, and TARGA_SUPPORTED,
429 because the code for those formats doesn't handle 12-bit data and won't
430 even compile. (The PPM code does work, as explained below. The GIF
431 code works too; it scales 8-bit GIF data to and from 12-bit depth
432 automatically.)
433 3. Compile. Don't expect "make test" to pass, since the supplied test
434 files are for 8-bit data.
435
436Currently, 12-bit support does not work on 16-bit-int machines.
437
438Note that a 12-bit version will not read 8-bit JPEG files, nor vice versa;
439so you'll want to keep around a regular 8-bit compilation as well.
440(Run-time selection of data depth, to allow a single copy that does both,
441is possible but would probably slow things down considerably; it's very low
442on our to-do list.)
443
444The PPM reader (rdppm.c) can read 12-bit data from either text-format or
445binary-format PPM and PGM files. Binary-format PPM/PGM files which have a
446maxval greater than 255 are assumed to use 2 bytes per sample, MSB first
447(big-endian order). As of early 1995, 2-byte binary format is not
448officially supported by the PBMPLUS library, but it is expected that a
449future release of PBMPLUS will support it. Note that the PPM reader will
450read files of any maxval regardless of the BITS_IN_JSAMPLE setting; incoming
451data is automatically rescaled to either maxval=255 or maxval=4095 as
452appropriate for the cjpeg bit depth.
453
454The PPM writer (wrppm.c) will normally write 2-byte binary PPM or PGM
455format, maxval 4095, when compiled with BITS_IN_JSAMPLE=12. Since this
456format is not yet widely supported, you can disable it by compiling wrppm.c
457with PPM_NORAWWORD defined; then the data is scaled down to 8 bits to make a
458standard 1-byte/sample PPM or PGM file. (Yes, this means still another copy
459of djpeg to keep around. But hopefully you won't need it for very long.
460Poskanzer's supposed to get that new PBMPLUS release out Real Soon Now.)
461
462Of course, if you are working with 12-bit data, you probably have it stored
463in some other, nonstandard format. In that case you'll probably want to
464write your own I/O modules to read and write your format.
465
466Note that a 12-bit version of cjpeg always runs in "-optimize" mode, in
467order to generate valid Huffman tables. This is necessary because our
468default Huffman tables only cover 8-bit data.
469
470Removing code:
471
472If you need to make a smaller version of the JPEG software, some optional
473functions can be removed at compile time. See the xxx_SUPPORTED #defines in
474jconfig.h and jmorecfg.h. If at all possible, we recommend that you leave in
475decoder support for all valid JPEG files, to ensure that you can read anyone's
476output. Taking out support for image file formats that you don't use is the
477most painless way to make the programs smaller. Another possibility is to
478remove some of the DCT methods: in particular, the "IFAST" method may not be
479enough faster than the others to be worth keeping on your machine. (If you
480do remove ISLOW or IFAST, be sure to redefine JDCT_DEFAULT or JDCT_FASTEST
481to a supported method, by adding a #define in jconfig.h.)
482
483
484OPTIMIZATION
485============
486
487Unless you own a Cray, you'll probably be interested in making the JPEG
488software go as fast as possible. This section covers some machine-dependent
489optimizations you may want to try. We suggest that before trying any of
490this, you first get the basic installation to pass the self-test step.
491Repeat the self-test after any optimization to make sure that you haven't
492broken anything.
493
494The integer DCT routines perform a lot of multiplications. These
495multiplications must yield 32-bit results, but none of their input values
496are more than 16 bits wide. On many machines, notably the 680x0 and 80x86
497CPUs, a 16x16=>32 bit multiply instruction is faster than a full 32x32=>32
498bit multiply. Unfortunately there is no portable way to specify such a
499multiplication in C, but some compilers can generate one when you use the
500right combination of casts. See the MULTIPLYxxx macro definitions in
501jdct.h. If your compiler makes "int" be 32 bits and "short" be 16 bits,
502defining SHORTxSHORT_32 is fairly likely to work. When experimenting with
503alternate definitions, be sure to test not only whether the code still works
504(use the self-test), but also whether it is actually faster --- on some
505compilers, alternate definitions may compute the right answer, yet be slower
506than the default. Timing cjpeg on a large PGM (grayscale) input file is the
507best way to check this, as the DCT will be the largest fraction of the runtime
508in that mode. (Note: some of the distributed compiler-specific jconfig files
509already contain #define switches to select appropriate MULTIPLYxxx
510definitions.)
511
512If your machine has sufficiently fast floating point hardware, you may find
513that the float DCT method is faster than the integer DCT methods, even
514after tweaking the integer multiply macros. In that case you may want to
515make the float DCT be the default method. (The only objection to this is
516that float DCT results may vary slightly across machines.) To do that, add
517"#define JDCT_DEFAULT JDCT_FLOAT" to jconfig.h. Even if you don't change
518the default, you should redefine JDCT_FASTEST, which is the method selected
519by djpeg's -fast switch. Don't forget to update the documentation files
520(usage.txt and/or cjpeg.1, djpeg.1) to agree with what you've done.
521
522If access to "short" arrays is slow on your machine, it may be a win to
523define type JCOEF as int rather than short. This will cost a good deal of
524memory though, particularly in some multi-pass modes, so don't do it unless
525you have memory to burn and short is REALLY slow.
526
527If your compiler can compile function calls in-line, make sure the INLINE
528macro in jmorecfg.h is defined as the keyword that marks a function
529inline-able. Some compilers have a switch that tells the compiler to inline
530any function it thinks is profitable (e.g., -finline-functions for gcc).
531Enabling such a switch is likely to make the compiled code bigger but faster.
532
533In general, it's worth trying the maximum optimization level of your compiler,
534and experimenting with any optional optimizations such as loop unrolling.
535(Unfortunately, far too many compilers have optimizer bugs ... be prepared to
536back off if the code fails self-test.) If you do any experimentation along
537these lines, please report the optimal settings to jpeg-info@jpegclub.org so
538we can mention them in future releases. Be sure to specify your machine and
539compiler version.
540
541
542HINTS FOR SPECIFIC SYSTEMS
543==========================
544
545We welcome reports on changes needed for systems not mentioned here. Submit
546'em to jpeg-info@jpegclub.org. Also, if configure or ckconfig.c is wrong
547about how to configure the JPEG software for your system, please let us know.
548
549
550Acorn RISC OS:
551
552(Thanks to Simon Middleton for these hints on compiling with Desktop C.)
553After renaming the files according to Acorn conventions, take a copy of
554makefile.ansi, change all occurrences of 'libjpeg.a' to 'libjpeg.o' and
555change these definitions as indicated:
556
557CFLAGS= -throwback -IC: -Wn
558LDLIBS=C:o.Stubs
559SYSDEPMEM=jmemansi.o
560LN=Link
561AR=LibFile -c -o
562
563Also add a new line '.c.o:; $(cc) $< $(cflags) -c -o $@'. Remove the
564lines '$(RM) libjpeg.o' and '$(AR2) libjpeg.o' and the 'jconfig.h'
565dependency section.
566
567Copy jconfig.txt to jconfig.h. Edit jconfig.h to define TWO_FILE_COMMANDLINE
568and CHAR_IS_UNSIGNED.
569
570Run the makefile using !AMU not !Make. If you want to use the 'clean' and
571'test' makefile entries then you will have to fiddle with the syntax a bit
572and rename the test files.
573
574
575Amiga:
576
577SAS C 6.50 reportedly is too buggy to compile the IJG code properly.
578A patch to update to 6.51 is available from SAS or AmiNet FTP sites.
579
580The supplied config files are set up to use jmemname.c as the memory
581manager, with temporary files being created on the device named by
582"JPEGTMP:".
583
584
585Atari ST/STE/TT:
586
587Copy the project files makcjpeg.st, makdjpeg.st, maktjpeg.st, and makljpeg.st
588to cjpeg.prj, djpeg.prj, jpegtran.prj, and libjpeg.prj respectively. The
589project files should work as-is with Pure C. For Turbo C, change library
590filenames "pc..." to "tc..." in each project file. Note that libjpeg.prj
591selects jmemansi.c as the recommended memory manager. You'll probably want to
592adjust the DEFAULT_MAX_MEM setting --- you want it to be a couple hundred K
593less than your normal free memory. Put "#define DEFAULT_MAX_MEM nnnn" into
594jconfig.h to do this.
595
596To use the 68881/68882 coprocessor for the floating point DCT, add the
597compiler option "-8" to the project files and replace pcfltlib.lib with
598pc881lib.lib in cjpeg.prj and djpeg.prj. Or if you don't have a
599coprocessor, you may prefer to remove the float DCT code by undefining
600DCT_FLOAT_SUPPORTED in jmorecfg.h (since without a coprocessor, the float
601code will be too slow to be useful). In that case, you can delete
602pcfltlib.lib from the project files.
603
604Note that you must make libjpeg.lib before making cjpeg.ttp, djpeg.ttp,
605or jpegtran.ttp. You'll have to perform the self-test by hand.
606
607We haven't bothered to include project files for rdjpgcom and wrjpgcom.
608Those source files should just be compiled by themselves; they don't
609depend on the JPEG library. You can use the default.prj project file
610of the Pure C distribution to make the programs.
611
612There is a bug in some older versions of the Turbo C library which causes the
613space used by temporary files created with "tmpfile()" not to be freed after
614an abnormal program exit. If you check your disk afterwards, you will find
615cluster chains that are allocated but not used by a file. This should not
616happen in cjpeg/djpeg/jpegtran, since we enable a signal catcher to explicitly
617close temp files before exiting. But if you use the JPEG library with your
618own code, be sure to supply a signal catcher, or else use a different
619system-dependent memory manager.
620
621
622Cray:
623
624Should you be so fortunate as to be running JPEG on a Cray YMP, there is a
625compiler bug in old versions of Cray's Standard C (prior to 3.1). If you
626still have an old compiler, you'll need to insert a line reading
627"#pragma novector" just before the loop
628 for (i = 1; i <= (int) htbl->bits[l]; i++)
629 huffsize[p++] = (char) l;
630in fix_huff_tbl (in V5beta1, line 204 of jchuff.c and line 176 of jdhuff.c).
631[This bug may or may not still occur with the current IJG code, but it's
632probably a dead issue anyway...]
633
634
635HP-UX:
636
637If you have HP-UX 7.05 or later with the "software development" C compiler,
638you should run the compiler in ANSI mode. If using the configure script,
639say
640 ./configure CC='cc -Aa'
641(or -Ae if you prefer). If configuring by hand, use makefile.ansi and add
642"-Aa" to the CFLAGS line in the makefile.
643
644If you have a pre-7.05 system, or if you are using the non-ANSI C compiler
645delivered with a minimum HP-UX system, then you must use makefile.unix
646(and do NOT add -Aa); or just run configure without the CC option.
647
648On HP 9000 series 800 machines, the HP C compiler is buggy in revisions prior
649to A.08.07. If you get complaints about "not a typedef name", you'll have to
650use makefile.unix, or run configure without the CC option.
651
652
653Macintosh, generic comments:
654
655The supplied user-interface files (cjpeg.c, djpeg.c, etc) are set up to
656provide a Unix-style command line interface. You can use this interface on
657the Mac by means of the ccommand() library routine provided by Metrowerks
658CodeWarrior or Think C. This is only appropriate for testing the library,
659however; to make a user-friendly equivalent of cjpeg/djpeg you'd really want
660to develop a Mac-style user interface. There isn't a complete example
661available at the moment, but there are some helpful starting points:
6621. Sam Bushell's free "To JPEG" applet provides drag-and-drop conversion to
663JPEG under System 7 and later. This only illustrates how to use the
664compression half of the library, but it does a very nice job of that part.
665The CodeWarrior source code is available from http://www.pobox.com/~jsam.
6662. Jim Brunner prepared a Mac-style user interface for both compression and
667decompression. Unfortunately, it hasn't been updated since IJG v4, and
668the library's API has changed considerably since then. Still it may be of
669some help, particularly as a guide to compiling the IJG code under Think C.
670Jim's code is available from the Info-Mac archives, at sumex-aim.stanford.edu
671or mirrors thereof; see file /info-mac/dev/src/jpeg-convert-c.hqx.
672
673jmemmac.c is the recommended memory manager back end for Macintosh. It uses
674NewPtr/DisposePtr instead of malloc/free, and has a Mac-specific
675implementation of jpeg_mem_available(). It also creates temporary files that
676follow Mac conventions. (That part of the code relies on System-7-or-later OS
677functions. See the comments in jmemmac.c if you need to run it on System 6.)
678NOTE that USE_MAC_MEMMGR must be defined in jconfig.h to use jmemmac.c.
679
680You can also use jmemnobs.c, if you don't care about handling images larger
681than available memory. If you use any memory manager back end other than
682jmemmac.c, we recommend replacing "malloc" and "free" by "NewPtr" and
683"DisposePtr", because Mac C libraries often have peculiar implementations of
684malloc/free. (For instance, free() may not return the freed space to the
685Mac Memory Manager. This is undesirable for the IJG code because jmemmgr.c
686already clumps space requests.)
687
688
689Macintosh, Metrowerks CodeWarrior:
690
691The Unix-command-line-style interface can be used by defining USE_CCOMMAND.
692You'll also need to define TWO_FILE_COMMANDLINE to avoid stdin/stdout.
693This means that when using the cjpeg/djpeg programs, you'll have to type the
694input and output file names in the "Arguments" text-edit box, rather than
695using the file radio buttons. (Perhaps USE_FDOPEN or USE_SETMODE would
696eliminate the problem, but I haven't heard from anyone who's tried it.)
697
698On 680x0 Macs, Metrowerks defines type "double" as a 10-byte IEEE extended
699float. jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power
700of 2. Add "#define ALIGN_TYPE long" to jconfig.h to eliminate the complaint.
701
702The supplied configuration file jconfig.mac can be used for your jconfig.h;
703it includes all the recommended symbol definitions. If you have AppleScript
704installed, you can run the supplied script makeproj.mac to create CodeWarrior
705project files for the library and the testbed applications, then build the
706library and applications. (Thanks to Dan Sears and Don Agro for this nifty
707hack, which saves us from trying to maintain CodeWarrior project files as part
708of the IJG distribution...)
709
710
711Macintosh, Think C:
712
713The documentation in Jim Brunner's "JPEG Convert" source code (see above)
714includes detailed build instructions for Think C; it's probably somewhat
715out of date for the current release, but may be helpful.
716
717If you want to build the minimal command line version, proceed as follows.
718You'll have to prepare project files for the programs; we don't include any
719in the distribution since they are not text files. Use the file lists in
720any of the supplied makefiles as a guide. Also add the ANSI and Unix C
721libraries in a separate segment. You may need to divide the JPEG files into
722more than one segment; we recommend dividing compression and decompression
723modules. Define USE_CCOMMAND in jconfig.h so that the ccommand() routine is
724called. You must also define TWO_FILE_COMMANDLINE because stdin/stdout
725don't handle binary data correctly.
726
727On 680x0 Macs, Think C defines type "double" as a 12-byte IEEE extended float.
728jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power of 2.
729Add "#define ALIGN_TYPE long" to jconfig.h to eliminate the complaint.
730
731jconfig.mac should work as a jconfig.h configuration file for Think C,
732but the makeproj.mac AppleScript script is specific to CodeWarrior. Sorry.
733
734
735MIPS R3000:
736
737MIPS's cc version 1.31 has a rather nasty optimization bug. Don't use -O
738if you have that compiler version. (Use "cc -V" to check the version.)
739Note that the R3000 chip is found in workstations from DEC and others.
740
741
742MS-DOS, generic comments for 16-bit compilers:
743
744The IJG code is designed to work well in 80x86 "small" or "medium" memory
745models (i.e., data pointers are 16 bits unless explicitly declared "far";
746code pointers can be either size). You may be able to use small model to
747compile cjpeg or djpeg by itself, but you will probably have to use medium
748model for any larger application. This won't make much difference in
749performance. You *will* take a noticeable performance hit if you use a
750large-data memory model, and you should avoid "huge" model if at all
751possible. Be sure that NEED_FAR_POINTERS is defined in jconfig.h if you use
752a small-data memory model; be sure it is NOT defined if you use a large-data
753model. (The supplied makefiles and jconfig files for Borland and Microsoft C
754compile in medium model and define NEED_FAR_POINTERS.)
755
756The DOS-specific memory manager, jmemdos.c, should be used if possible.
757It needs some assembly-code routines which are in jmemdosa.asm; make sure
758your makefile assembles that file and includes it in the library. If you
759don't have a suitable assembler, you can get pre-assembled object files for
760jmemdosa by FTP from ftp.uu.net:/graphics/jpeg/jdosaobj.zip. (DOS-oriented
761distributions of the IJG source code often include these object files.)
762
763When using jmemdos.c, jconfig.h must define USE_MSDOS_MEMMGR and must set
764MAX_ALLOC_CHUNK to less than 64K (65520L is a typical value). If your
765C library's far-heap malloc() can't allocate blocks that large, reduce
766MAX_ALLOC_CHUNK to whatever it can handle.
767
768If you can't use jmemdos.c for some reason --- for example, because you
769don't have an assembler to assemble jmemdosa.asm --- you'll have to fall
770back to jmemansi.c or jmemname.c. You'll probably still need to set
771MAX_ALLOC_CHUNK in jconfig.h, because most DOS C libraries won't malloc()
772more than 64K at a time. IMPORTANT: if you use jmemansi.c or jmemname.c,
773you will have to compile in a large-data memory model in order to get the
774right stdio library. Too bad.
775
776wrjpgcom needs to be compiled in large model, because it malloc()s a 64KB
777work area to hold the comment text. If your C library's malloc can't
778handle that, reduce MAX_COM_LENGTH as necessary in wrjpgcom.c.
779
780Most MS-DOS compilers treat stdin/stdout as text files, so you must use
781two-file command line style. But if your compiler has either fdopen() or
782setmode(), you can use one-file style if you like. To do this, define
783USE_SETMODE or USE_FDOPEN so that stdin/stdout will be set to binary mode.
784(USE_SETMODE seems to work with more DOS compilers than USE_FDOPEN.) You
785should test that I/O through stdin/stdout produces the same results as I/O
786to explicitly named files... the "make test" procedures in the supplied
787makefiles do NOT use stdin/stdout.
788
789
790MS-DOS, generic comments for 32-bit compilers:
791
792None of the above comments about memory models apply if you are using a
79332-bit flat-memory-space environment, such as DJGPP or Watcom C. (And you
794should use one if you have it, as performance will be much better than
7958086-compatible code!) For flat-memory-space compilers, do NOT define
796NEED_FAR_POINTERS, and do NOT use jmemdos.c. Use jmemnobs.c if the
797environment supplies adequate virtual memory, otherwise use jmemansi.c or
798jmemname.c.
799
800You'll still need to be careful about binary I/O through stdin/stdout.
801See the last paragraph of the previous section.
802
803
804MS-DOS, Borland C:
805
806Be sure to convert all the source files to DOS text format (CR/LF newlines).
807Although Borland C will often work OK with unmodified Unix (LF newlines)
808source files, sometimes it will give bogus compile errors.
809"Illegal character '#'" is the most common such error. (This is true with
810Borland C 3.1, but perhaps is fixed in newer releases.)
811
812If you want one-file command line style, just undefine TWO_FILE_COMMANDLINE.
813jconfig.bcc already includes #define USE_SETMODE to make this work.
814(fdopen does not work correctly.)
815
816
817MS-DOS, Microsoft C:
818
819makefile.mc6 works with Microsoft C, DOS Visual C++, etc. It should only
820be used if you want to build a 16-bit (small or medium memory model) program.
821
822If you want one-file command line style, just undefine TWO_FILE_COMMANDLINE.
823jconfig.mc6 already includes #define USE_SETMODE to make this work.
824(fdopen does not work correctly.)
825
826Note that this makefile assumes that the working copy of itself is called
827"makefile". If you want to call it something else, say "makefile.mak",
828be sure to adjust the dependency line that reads "$(RFILE) : makefile".
829Otherwise the make will fail because it doesn't know how to create "makefile".
830Worse, some releases of Microsoft's make utilities give an incorrect error
831message in this situation.
832
833Old versions of MS C fail with an "out of macro expansion space" error
834because they can't cope with the macro TRACEMS8 (defined in jerror.h).
835If this happens to you, the easiest solution is to change TRACEMS8 to
836expand to nothing. You'll lose the ability to dump out JPEG coefficient
837tables with djpeg -debug -debug, but at least you can compile.
838
839Original MS C 6.0 is very buggy; it compiles incorrect code unless you turn
840off optimization entirely (remove -O from CFLAGS). 6.00A is better, but it
841still generates bad code if you enable loop optimizations (-Ol or -Ox).
842
843MS C 8.0 crashes when compiling jquant1.c with optimization switch /Oo ...
844which is on by default. To work around this bug, compile that one file
845with /Oo-.
846
847
848Microsoft Windows (all versions), generic comments:
849
850Some Windows system include files define typedef boolean as "unsigned char".
851The IJG code also defines typedef boolean, but we make it "int" by default.
852This doesn't affect the IJG programs because we don't import those Windows
853include files. But if you use the JPEG library in your own program, and some
854of your program's files import one definition of boolean while some import the
855other, you can get all sorts of mysterious problems. A good preventive step
856is to make the IJG library use "unsigned char" for boolean. To do that,
857add something like this to your jconfig.h file:
858 /* Define "boolean" as unsigned char, not int, per Windows custom */
859 #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
860 typedef unsigned char boolean;
861 #endif
862 #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
863(This is already in jconfig.vc, by the way.)
864
865windef.h contains the declarations
866 #define far
867 #define FAR far
868Since jmorecfg.h tries to define FAR as empty, you may get a compiler
869warning if you include both jpeglib.h and windef.h (which windows.h
870includes). To suppress the warning, you can put "#ifndef FAR"/"#endif"
871around the line "#define FAR" in jmorecfg.h.
872(Something like this is already in jmorecfg.h, by the way.)
873
874When using the library in a Windows application, you will almost certainly
875want to modify or replace the error handler module jerror.c, since our
876default error handler does a couple of inappropriate things:
877 1. it tries to write error and warning messages on stderr;
878 2. in event of a fatal error, it exits by calling exit().
879
880A simple stopgap solution for problem 1 is to replace the line
881 fprintf(stderr, "%s\n", buffer);
882(in output_message in jerror.c) with
883 MessageBox(GetActiveWindow(),buffer,"JPEG Error",MB_OK|MB_ICONERROR);
884It's highly recommended that you at least do that much, since otherwise
885error messages will disappear into nowhere. (Beginning with IJG v6b, this
886code is already present in jerror.c; just define USE_WINDOWS_MESSAGEBOX in
887jconfig.h to enable it.)
888
889The proper solution for problem 2 is to return control to your calling
890application after a library error. This can be done with the setjmp/longjmp
891technique discussed in libjpeg.txt and illustrated in example.c. (NOTE:
892some older Windows C compilers provide versions of setjmp/longjmp that
893don't actually work under Windows. You may need to use the Windows system
894functions Catch and Throw instead.)
895
896The recommended memory manager under Windows is jmemnobs.c; in other words,
897let Windows do any virtual memory management needed. You should NOT use
898jmemdos.c nor jmemdosa.asm under Windows.
899
900For Windows 3.1, we recommend compiling in medium or large memory model;
901for newer Windows versions, use a 32-bit flat memory model. (See the MS-DOS
902sections above for more info about memory models.) In the 16-bit memory
903models only, you'll need to put
904 #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */
905into jconfig.h to limit allocation chunks to 64Kb. (Without that, you'd
906have to use huge memory model, which slows things down unnecessarily.)
907jmemnobs.c works without modification in large or flat memory models, but to
908use medium model, you need to modify its jpeg_get_large and jpeg_free_large
909routines to allocate far memory. In any case, you might like to replace
910its calls to malloc and free with direct calls on Windows memory allocation
911functions.
912
913You may also want to modify jdatasrc.c and jdatadst.c to use Windows file
914operations rather than fread/fwrite. This is only necessary if your C
915compiler doesn't provide a competent implementation of C stdio functions.
916
917You might want to tweak the RGB_xxx macros in jmorecfg.h so that the library
918will accept or deliver color pixels in BGR sample order, not RGB; BGR order
919is usually more convenient under Windows. Note that this change will break
920the sample applications cjpeg/djpeg, but the library itself works fine.
921
922
923Many people want to convert the IJG library into a DLL. This is reasonably
924straightforward, but watch out for the following:
925
926 1. Don't try to compile as a DLL in small or medium memory model; use
927large model, or even better, 32-bit flat model. Many places in the IJG code
928assume the address of a local variable is an ordinary (not FAR) pointer;
929that isn't true in a medium-model DLL.
930
931 2. Microsoft C cannot pass file pointers between applications and DLLs.
932(See Microsoft Knowledge Base, PSS ID Number Q50336.) So jdatasrc.c and
933jdatadst.c don't work if you open a file in your application and then pass
934the pointer to the DLL. One workaround is to make jdatasrc.c/jdatadst.c
935part of your main application rather than part of the DLL.
936
937 3. You'll probably need to modify the macros GLOBAL() and EXTERN() to
938attach suitable linkage keywords to the exported routine names. Similarly,
939you'll want to modify METHODDEF() and JMETHOD() to ensure function pointers
940are declared in a way that lets application routines be called back through
941the function pointers. These macros are in jmorecfg.h. Typical definitions
942for a 16-bit DLL are:
943 #define GLOBAL(type) type _far _pascal _loadds _export
944 #define EXTERN(type) extern type _far _pascal _loadds
945 #define METHODDEF(type) static type _far _pascal
946 #define JMETHOD(type,methodname,arglist) \
947 type (_far _pascal *methodname) arglist
948For a 32-bit DLL you may want something like
949 #define GLOBAL(type) __declspec(dllexport) type
950 #define EXTERN(type) extern __declspec(dllexport) type
951Although not all the GLOBAL routines are actually intended to be called by
952the application, the performance cost of making them all DLL entry points is
953negligible.
954
955The unmodified IJG library presents a very C-specific application interface,
956so the resulting DLL is only usable from C or C++ applications. There has
957been some talk of writing wrapper code that would present a simpler interface
958usable from other languages, such as Visual Basic. This is on our to-do list
959but hasn't been very high priority --- any volunteers out there?
960
961
962Microsoft Windows, Borland C:
963
964The provided jconfig.bcc should work OK in a 32-bit Windows environment,
965but you'll need to tweak it in a 16-bit environment (you'd need to define
966NEED_FAR_POINTERS and MAX_ALLOC_CHUNK). Beware that makefile.bcc will need
967alteration if you want to use it for Windows --- in particular, you should
968use jmemnobs.c not jmemdos.c under Windows.
969
970Borland C++ 4.5 fails with an internal compiler error when trying to compile
971jdmerge.c in 32-bit mode. If enough people complain, perhaps Borland will fix
972it. In the meantime, the simplest known workaround is to add a redundant
973definition of the variable range_limit in h2v1_merged_upsample(), at the head
974of the block that handles odd image width (about line 268 in v6 jdmerge.c):
975 /* If image width is odd, do the last output column separately */
976 if (cinfo->output_width & 1) {
977 register JSAMPLE * range_limit = cinfo->sample_range_limit; /* ADD THIS */
978 cb = GETJSAMPLE(*inptr1);
979Pretty bizarre, especially since the very similar routine h2v2_merged_upsample
980doesn't trigger the bug.
981Recent reports suggest that this bug does not occur with "bcc32a" (the
982Pentium-optimized version of the compiler).
983
984Another report from a user of Borland C 4.5 was that incorrect code (leading
985to a color shift in processed images) was produced if any of the following
986optimization switch combinations were used:
987 -Ot -Og
988 -Ot -Op
989 -Ot -Om
990So try backing off on optimization if you see such a problem. (Are there
991several different releases all numbered "4.5"??)
992
993
994Microsoft Windows, Microsoft Visual C++:
995
996jconfig.vc should work OK with any Microsoft compiler for a 32-bit memory
997model. makefile.vc is intended for command-line use. (If you are using
998the Developer Studio environment, you may prefer the DevStudio project
999files; see below.)
1000
1001IJG JPEG 7 adds extern "C" to jpeglib.h. This avoids the need to put
1002extern "C" { ... } around #include "jpeglib.h" in your C++ application.
1003You can also force VC++ to treat the library as C++ code by renaming
1004all the *.c files to *.cpp (and adjusting the makefile to match).
1005In this case you also need to define the symbol DONT_USE_EXTERN_C in
1006the configuration to prevent jpeglib.h from using extern "C".
1007
1008
1009Microsoft Windows, Microsoft Visual C++ 6 Developer Studio:
1010
1011We include makefiles that should work as project files in DevStudio 6.0 or
1012later. There is a library makefile that builds the IJG library as a static
1013Win32 library, and application makefiles that build the sample applications
1014as Win32 console applications. (Even if you only want the library, we
1015recommend building the applications so that you can run the self-test.)
1016
1017To use:
10181. Open the command prompt, change to the main directory and execute the
1019 command line
1020 NMAKE /f makefile.vc setup-vc6
1021 This will move jconfig.vc to jconfig.h and makefiles to project files.
1022 (Note that the renaming is critical!)
10232. Open the workspace file jpeg.dsw, build the library project.
1024 (If you are using DevStudio more recent than 6.0, you'll probably
1025 get a message saying that the project files are being updated.)
10263. Open the workspace file apps.dsw, build the application projects.
10274. To perform the self-test, execute the command line
1028 NMAKE /f makefile.vc test-build
10295. Move the application .exe files from `app`\Release to an
1030 appropriate location on your path.
1031
1032
1033Microsoft Windows, Microsoft Visual C++ 2010 Developer Studio (v10):
1034
1035We include makefiles that should work as project files in Visual Studio
10362010 or later. There is a library makefile that builds the IJG library
1037as a static Win32 library, and application makefiles that build the sample
1038applications as Win32 console applications. (Even if you only want the
1039library, we recommend building the applications so that you can run the
1040self-test.)
1041
1042To use:
10431. Open the command prompt, change to the main directory and execute the
1044 command line
1045 NMAKE /f makefile.vc setup-v10
1046 This will move jconfig.vc to jconfig.h and makefiles to project files.
1047 (Note that the renaming is critical!)
10482. Open the solution file jpeg.sln, build the library project.
1049 (If you are using Visual Studio more recent than 2010 (v10), you'll
1050 probably get a message saying that the project files are being updated.)
10513. Open the solution file apps.sln, build the application projects.
10524. To perform the self-test, execute the command line
1053 NMAKE /f makefile.vc test-build
10545. Move the application .exe files from `app`\Release to an
1055 appropriate location on your path.
1056
1057Note:
1058There seems to be an optimization bug in the compiler which causes the
1059self-test to fail with the color quantization option.
1060We have disabled optimization for the file jquant2.c in the library
1061project file which causes the self-test to pass properly.
1062
1063
1064OS/2, Borland C++:
1065
1066Watch out for optimization bugs in older Borland compilers; you may need
1067to back off the optimization switch settings. See the comments in
1068makefile.bcc.
1069
1070
1071SGI:
1072
1073On some SGI systems, you may need to set "AR2= ar -ts" in the Makefile.
1074If you are using configure, you can do this by saying
1075 ./configure RANLIB='ar -ts'
1076This change is not needed on all SGIs. Use it only if the make fails at the
1077stage of linking the completed programs.
1078
1079On the MIPS R4000 architecture (Indy, etc.), the compiler option "-mips2"
1080reportedly speeds up the float DCT method substantially, enough to make it
1081faster than the default int method (but still slower than the fast int
1082method). If you use -mips2, you may want to alter the default DCT method to
1083be float. To do this, put "#define JDCT_DEFAULT JDCT_FLOAT" in jconfig.h.
1084
1085
1086VMS:
1087
1088On an Alpha/VMS system with MMS, be sure to use the "/Marco=Alpha=1"
1089qualifier with MMS when building the JPEG package.
1090
1091VAX/VMS v5.5-1 may have problems with the test step of the build procedure
1092reporting differences when it compares the original and test images. If the
1093error points to the last block of the files, it is most likely bogus and may
1094be safely ignored. It seems to be because the files are Stream_LF and
1095Backup/Compare has difficulty with the (presumably) null padded files.
1096This problem was not observed on VAX/VMS v6.1 or AXP/VMS v6.1.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jaricom.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jaricom.c
new file mode 100644
index 0000000..50ad879
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jaricom.c
@@ -0,0 +1,153 @@
1/*
2 * jaricom.c
3 *
4 * Developed 1997-2011 by Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains probability estimation tables for common use in
9 * arithmetic entropy encoding and decoding routines.
10 *
11 * This data represents Table D.3 in the JPEG spec (D.2 in the draft),
12 * ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81, and Table 24
13 * in the JBIG spec, ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82.
14 */
15
16#define JPEG_INTERNALS
17#include "jinclude.h"
18#include "jpeglib.h"
19
20/* The following #define specifies the packing of the four components
21 * into the compact INT32 representation.
22 * Note that this formula must match the actual arithmetic encoder
23 * and decoder implementation. The implementation has to be changed
24 * if this formula is changed.
25 * The current organization is leaned on Markus Kuhn's JBIG
26 * implementation (jbig_tab.c).
27 */
28
29#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)
30
31const INT32 jpeg_aritab[113+1] = {
32/*
33 * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
34 */
35 V( 0, 0x5a1d, 1, 1, 1 ),
36 V( 1, 0x2586, 14, 2, 0 ),
37 V( 2, 0x1114, 16, 3, 0 ),
38 V( 3, 0x080b, 18, 4, 0 ),
39 V( 4, 0x03d8, 20, 5, 0 ),
40 V( 5, 0x01da, 23, 6, 0 ),
41 V( 6, 0x00e5, 25, 7, 0 ),
42 V( 7, 0x006f, 28, 8, 0 ),
43 V( 8, 0x0036, 30, 9, 0 ),
44 V( 9, 0x001a, 33, 10, 0 ),
45 V( 10, 0x000d, 35, 11, 0 ),
46 V( 11, 0x0006, 9, 12, 0 ),
47 V( 12, 0x0003, 10, 13, 0 ),
48 V( 13, 0x0001, 12, 13, 0 ),
49 V( 14, 0x5a7f, 15, 15, 1 ),
50 V( 15, 0x3f25, 36, 16, 0 ),
51 V( 16, 0x2cf2, 38, 17, 0 ),
52 V( 17, 0x207c, 39, 18, 0 ),
53 V( 18, 0x17b9, 40, 19, 0 ),
54 V( 19, 0x1182, 42, 20, 0 ),
55 V( 20, 0x0cef, 43, 21, 0 ),
56 V( 21, 0x09a1, 45, 22, 0 ),
57 V( 22, 0x072f, 46, 23, 0 ),
58 V( 23, 0x055c, 48, 24, 0 ),
59 V( 24, 0x0406, 49, 25, 0 ),
60 V( 25, 0x0303, 51, 26, 0 ),
61 V( 26, 0x0240, 52, 27, 0 ),
62 V( 27, 0x01b1, 54, 28, 0 ),
63 V( 28, 0x0144, 56, 29, 0 ),
64 V( 29, 0x00f5, 57, 30, 0 ),
65 V( 30, 0x00b7, 59, 31, 0 ),
66 V( 31, 0x008a, 60, 32, 0 ),
67 V( 32, 0x0068, 62, 33, 0 ),
68 V( 33, 0x004e, 63, 34, 0 ),
69 V( 34, 0x003b, 32, 35, 0 ),
70 V( 35, 0x002c, 33, 9, 0 ),
71 V( 36, 0x5ae1, 37, 37, 1 ),
72 V( 37, 0x484c, 64, 38, 0 ),
73 V( 38, 0x3a0d, 65, 39, 0 ),
74 V( 39, 0x2ef1, 67, 40, 0 ),
75 V( 40, 0x261f, 68, 41, 0 ),
76 V( 41, 0x1f33, 69, 42, 0 ),
77 V( 42, 0x19a8, 70, 43, 0 ),
78 V( 43, 0x1518, 72, 44, 0 ),
79 V( 44, 0x1177, 73, 45, 0 ),
80 V( 45, 0x0e74, 74, 46, 0 ),
81 V( 46, 0x0bfb, 75, 47, 0 ),
82 V( 47, 0x09f8, 77, 48, 0 ),
83 V( 48, 0x0861, 78, 49, 0 ),
84 V( 49, 0x0706, 79, 50, 0 ),
85 V( 50, 0x05cd, 48, 51, 0 ),
86 V( 51, 0x04de, 50, 52, 0 ),
87 V( 52, 0x040f, 50, 53, 0 ),
88 V( 53, 0x0363, 51, 54, 0 ),
89 V( 54, 0x02d4, 52, 55, 0 ),
90 V( 55, 0x025c, 53, 56, 0 ),
91 V( 56, 0x01f8, 54, 57, 0 ),
92 V( 57, 0x01a4, 55, 58, 0 ),
93 V( 58, 0x0160, 56, 59, 0 ),
94 V( 59, 0x0125, 57, 60, 0 ),
95 V( 60, 0x00f6, 58, 61, 0 ),
96 V( 61, 0x00cb, 59, 62, 0 ),
97 V( 62, 0x00ab, 61, 63, 0 ),
98 V( 63, 0x008f, 61, 32, 0 ),
99 V( 64, 0x5b12, 65, 65, 1 ),
100 V( 65, 0x4d04, 80, 66, 0 ),
101 V( 66, 0x412c, 81, 67, 0 ),
102 V( 67, 0x37d8, 82, 68, 0 ),
103 V( 68, 0x2fe8, 83, 69, 0 ),
104 V( 69, 0x293c, 84, 70, 0 ),
105 V( 70, 0x2379, 86, 71, 0 ),
106 V( 71, 0x1edf, 87, 72, 0 ),
107 V( 72, 0x1aa9, 87, 73, 0 ),
108 V( 73, 0x174e, 72, 74, 0 ),
109 V( 74, 0x1424, 72, 75, 0 ),
110 V( 75, 0x119c, 74, 76, 0 ),
111 V( 76, 0x0f6b, 74, 77, 0 ),
112 V( 77, 0x0d51, 75, 78, 0 ),
113 V( 78, 0x0bb6, 77, 79, 0 ),
114 V( 79, 0x0a40, 77, 48, 0 ),
115 V( 80, 0x5832, 80, 81, 1 ),
116 V( 81, 0x4d1c, 88, 82, 0 ),
117 V( 82, 0x438e, 89, 83, 0 ),
118 V( 83, 0x3bdd, 90, 84, 0 ),
119 V( 84, 0x34ee, 91, 85, 0 ),
120 V( 85, 0x2eae, 92, 86, 0 ),
121 V( 86, 0x299a, 93, 87, 0 ),
122 V( 87, 0x2516, 86, 71, 0 ),
123 V( 88, 0x5570, 88, 89, 1 ),
124 V( 89, 0x4ca9, 95, 90, 0 ),
125 V( 90, 0x44d9, 96, 91, 0 ),
126 V( 91, 0x3e22, 97, 92, 0 ),
127 V( 92, 0x3824, 99, 93, 0 ),
128 V( 93, 0x32b4, 99, 94, 0 ),
129 V( 94, 0x2e17, 93, 86, 0 ),
130 V( 95, 0x56a8, 95, 96, 1 ),
131 V( 96, 0x4f46, 101, 97, 0 ),
132 V( 97, 0x47e5, 102, 98, 0 ),
133 V( 98, 0x41cf, 103, 99, 0 ),
134 V( 99, 0x3c3d, 104, 100, 0 ),
135 V( 100, 0x375e, 99, 93, 0 ),
136 V( 101, 0x5231, 105, 102, 0 ),
137 V( 102, 0x4c0f, 106, 103, 0 ),
138 V( 103, 0x4639, 107, 104, 0 ),
139 V( 104, 0x415e, 103, 99, 0 ),
140 V( 105, 0x5627, 105, 106, 1 ),
141 V( 106, 0x50e7, 108, 107, 0 ),
142 V( 107, 0x4b85, 109, 103, 0 ),
143 V( 108, 0x5597, 110, 109, 0 ),
144 V( 109, 0x504f, 111, 107, 0 ),
145 V( 110, 0x5a10, 110, 111, 1 ),
146 V( 111, 0x5522, 112, 109, 0 ),
147 V( 112, 0x59eb, 112, 111, 1 ),
148/*
149 * This last entry is used for fixed probability estimate of 0.5
150 * as suggested in Section 10.3 Table 5 of ITU-T Rec. T.851.
151 */
152 V( 113, 0x5a1d, 113, 113, 0 )
153};
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapimin.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapimin.c
new file mode 100644
index 0000000..3382d91
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapimin.c
@@ -0,0 +1,288 @@
1/*
2 * jcapimin.c
3 *
4 * Copyright (C) 1994-1998, Thomas G. Lane.
5 * Modified 2003-2010 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains application interface code for the compression half
10 * of the JPEG library. These are the "minimum" API routines that may be
11 * needed in either the normal full-compression case or the transcoding-only
12 * case.
13 *
14 * Most of the routines intended to be called directly by an application
15 * are in this file or in jcapistd.c. But also see jcparam.c for
16 * parameter-setup helper routines, jcomapi.c for routines shared by
17 * compression and decompression, and jctrans.c for the transcoding case.
18 */
19
20#define JPEG_INTERNALS
21#include "jinclude.h"
22#include "jpeglib.h"
23
24
25/*
26 * Initialization of a JPEG compression object.
27 * The error manager must already be set up (in case memory manager fails).
28 */
29
30GLOBAL(void)
31jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
32{
33 int i;
34
35 /* Guard against version mismatches between library and caller. */
36 cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
37 if (version != JPEG_LIB_VERSION)
38 ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
39 if (structsize != SIZEOF(struct jpeg_compress_struct))
40 ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
41 (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
42
43 /* For debugging purposes, we zero the whole master structure.
44 * But the application has already set the err pointer, and may have set
45 * client_data, so we have to save and restore those fields.
46 * Note: if application hasn't set client_data, tools like Purify may
47 * complain here.
48 */
49 {
50 struct jpeg_error_mgr * err = cinfo->err;
51 void * client_data = cinfo->client_data; /* ignore Purify complaint here */
52 MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
53 cinfo->err = err;
54 cinfo->client_data = client_data;
55 }
56 cinfo->is_decompressor = FALSE;
57
58 /* Initialize a memory manager instance for this object */
59 jinit_memory_mgr((j_common_ptr) cinfo);
60
61 /* Zero out pointers to permanent structures. */
62 cinfo->progress = NULL;
63 cinfo->dest = NULL;
64
65 cinfo->comp_info = NULL;
66
67 for (i = 0; i < NUM_QUANT_TBLS; i++) {
68 cinfo->quant_tbl_ptrs[i] = NULL;
69 cinfo->q_scale_factor[i] = 100;
70 }
71
72 for (i = 0; i < NUM_HUFF_TBLS; i++) {
73 cinfo->dc_huff_tbl_ptrs[i] = NULL;
74 cinfo->ac_huff_tbl_ptrs[i] = NULL;
75 }
76
77 /* Must do it here for emit_dqt in case jpeg_write_tables is used */
78 cinfo->block_size = DCTSIZE;
79 cinfo->natural_order = jpeg_natural_order;
80 cinfo->lim_Se = DCTSIZE2-1;
81
82 cinfo->script_space = NULL;
83
84 cinfo->input_gamma = 1.0; /* in case application forgets */
85
86 /* OK, I'm ready */
87 cinfo->global_state = CSTATE_START;
88}
89
90
91/*
92 * Destruction of a JPEG compression object
93 */
94
95GLOBAL(void)
96jpeg_destroy_compress (j_compress_ptr cinfo)
97{
98 jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
99}
100
101
102/*
103 * Abort processing of a JPEG compression operation,
104 * but don't destroy the object itself.
105 */
106
107GLOBAL(void)
108jpeg_abort_compress (j_compress_ptr cinfo)
109{
110 jpeg_abort((j_common_ptr) cinfo); /* use common routine */
111}
112
113
114/*
115 * Forcibly suppress or un-suppress all quantization and Huffman tables.
116 * Marks all currently defined tables as already written (if suppress)
117 * or not written (if !suppress). This will control whether they get emitted
118 * by a subsequent jpeg_start_compress call.
119 *
120 * This routine is exported for use by applications that want to produce
121 * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but
122 * since it is called by jpeg_start_compress, we put it here --- otherwise
123 * jcparam.o would be linked whether the application used it or not.
124 */
125
126GLOBAL(void)
127jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
128{
129 int i;
130 JQUANT_TBL * qtbl;
131 JHUFF_TBL * htbl;
132
133 for (i = 0; i < NUM_QUANT_TBLS; i++) {
134 if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
135 qtbl->sent_table = suppress;
136 }
137
138 for (i = 0; i < NUM_HUFF_TBLS; i++) {
139 if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
140 htbl->sent_table = suppress;
141 if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
142 htbl->sent_table = suppress;
143 }
144}
145
146
147/*
148 * Finish JPEG compression.
149 *
150 * If a multipass operating mode was selected, this may do a great deal of
151 * work including most of the actual output.
152 */
153
154GLOBAL(void)
155jpeg_finish_compress (j_compress_ptr cinfo)
156{
157 JDIMENSION iMCU_row;
158
159 if (cinfo->global_state == CSTATE_SCANNING ||
160 cinfo->global_state == CSTATE_RAW_OK) {
161 /* Terminate first pass */
162 if (cinfo->next_scanline < cinfo->image_height)
163 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
164 (*cinfo->master->finish_pass) (cinfo);
165 } else if (cinfo->global_state != CSTATE_WRCOEFS)
166 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
167 /* Perform any remaining passes */
168 while (! cinfo->master->is_last_pass) {
169 (*cinfo->master->prepare_for_pass) (cinfo);
170 for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
171 if (cinfo->progress != NULL) {
172 cinfo->progress->pass_counter = (long) iMCU_row;
173 cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
174 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
175 }
176 /* We bypass the main controller and invoke coef controller directly;
177 * all work is being done from the coefficient buffer.
178 */
179 if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
180 ERREXIT(cinfo, JERR_CANT_SUSPEND);
181 }
182 (*cinfo->master->finish_pass) (cinfo);
183 }
184 /* Write EOI, do final cleanup */
185 (*cinfo->marker->write_file_trailer) (cinfo);
186 (*cinfo->dest->term_destination) (cinfo);
187 /* We can use jpeg_abort to release memory and reset global_state */
188 jpeg_abort((j_common_ptr) cinfo);
189}
190
191
192/*
193 * Write a special marker.
194 * This is only recommended for writing COM or APPn markers.
195 * Must be called after jpeg_start_compress() and before
196 * first call to jpeg_write_scanlines() or jpeg_write_raw_data().
197 */
198
199GLOBAL(void)
200jpeg_write_marker (j_compress_ptr cinfo, int marker,
201 const JOCTET *dataptr, unsigned int datalen)
202{
203 JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
204
205 if (cinfo->next_scanline != 0 ||
206 (cinfo->global_state != CSTATE_SCANNING &&
207 cinfo->global_state != CSTATE_RAW_OK &&
208 cinfo->global_state != CSTATE_WRCOEFS))
209 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
210
211 (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
212 write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
213 while (datalen--) {
214 (*write_marker_byte) (cinfo, *dataptr);
215 dataptr++;
216 }
217}
218
219/* Same, but piecemeal. */
220
221GLOBAL(void)
222jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
223{
224 if (cinfo->next_scanline != 0 ||
225 (cinfo->global_state != CSTATE_SCANNING &&
226 cinfo->global_state != CSTATE_RAW_OK &&
227 cinfo->global_state != CSTATE_WRCOEFS))
228 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
229
230 (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
231}
232
233GLOBAL(void)
234jpeg_write_m_byte (j_compress_ptr cinfo, int val)
235{
236 (*cinfo->marker->write_marker_byte) (cinfo, val);
237}
238
239
240/*
241 * Alternate compression function: just write an abbreviated table file.
242 * Before calling this, all parameters and a data destination must be set up.
243 *
244 * To produce a pair of files containing abbreviated tables and abbreviated
245 * image data, one would proceed as follows:
246 *
247 * initialize JPEG object
248 * set JPEG parameters
249 * set destination to table file
250 * jpeg_write_tables(cinfo);
251 * set destination to image file
252 * jpeg_start_compress(cinfo, FALSE);
253 * write data...
254 * jpeg_finish_compress(cinfo);
255 *
256 * jpeg_write_tables has the side effect of marking all tables written
257 * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
258 * will not re-emit the tables unless it is passed write_all_tables=TRUE.
259 */
260
261GLOBAL(void)
262jpeg_write_tables (j_compress_ptr cinfo)
263{
264 if (cinfo->global_state != CSTATE_START)
265 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
266
267 /* (Re)initialize error mgr and destination modules */
268 (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
269 (*cinfo->dest->init_destination) (cinfo);
270 /* Initialize the marker writer ... bit of a crock to do it here. */
271 jinit_marker_writer(cinfo);
272 /* Write them tables! */
273 (*cinfo->marker->write_tables_only) (cinfo);
274 /* And clean up. */
275 (*cinfo->dest->term_destination) (cinfo);
276 /*
277 * In library releases up through v6a, we called jpeg_abort() here to free
278 * any working memory allocated by the destination manager and marker
279 * writer. Some applications had a problem with that: they allocated space
280 * of their own from the library memory manager, and didn't want it to go
281 * away during write_tables. So now we do nothing. This will cause a
282 * memory leak if an app calls write_tables repeatedly without doing a full
283 * compression cycle or otherwise resetting the JPEG object. However, that
284 * seems less bad than unexpectedly freeing memory in the normal case.
285 * An app that prefers the old behavior can call jpeg_abort for itself after
286 * each call to jpeg_write_tables().
287 */
288}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapistd.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapistd.c
new file mode 100644
index 0000000..fed66ca
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcapistd.c
@@ -0,0 +1,161 @@
1/*
2 * jcapistd.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains application interface code for the compression half
9 * of the JPEG library. These are the "standard" API routines that are
10 * used in the normal full-compression case. They are not used by a
11 * transcoding-only application. Note that if an application links in
12 * jpeg_start_compress, it will end up linking in the entire compressor.
13 * We thus must separate this file from jcapimin.c to avoid linking the
14 * whole compression library into a transcoder.
15 */
16
17#define JPEG_INTERNALS
18#include "jinclude.h"
19#include "jpeglib.h"
20
21
22/*
23 * Compression initialization.
24 * Before calling this, all parameters and a data destination must be set up.
25 *
26 * We require a write_all_tables parameter as a failsafe check when writing
27 * multiple datastreams from the same compression object. Since prior runs
28 * will have left all the tables marked sent_table=TRUE, a subsequent run
29 * would emit an abbreviated stream (no tables) by default. This may be what
30 * is wanted, but for safety's sake it should not be the default behavior:
31 * programmers should have to make a deliberate choice to emit abbreviated
32 * images. Therefore the documentation and examples should encourage people
33 * to pass write_all_tables=TRUE; then it will take active thought to do the
34 * wrong thing.
35 */
36
37GLOBAL(void)
38jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
39{
40 if (cinfo->global_state != CSTATE_START)
41 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
42
43 if (write_all_tables)
44 jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
45
46 /* (Re)initialize error mgr and destination modules */
47 (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
48 (*cinfo->dest->init_destination) (cinfo);
49 /* Perform master selection of active modules */
50 jinit_compress_master(cinfo);
51 /* Set up for the first pass */
52 (*cinfo->master->prepare_for_pass) (cinfo);
53 /* Ready for application to drive first pass through jpeg_write_scanlines
54 * or jpeg_write_raw_data.
55 */
56 cinfo->next_scanline = 0;
57 cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
58}
59
60
61/*
62 * Write some scanlines of data to the JPEG compressor.
63 *
64 * The return value will be the number of lines actually written.
65 * This should be less than the supplied num_lines only in case that
66 * the data destination module has requested suspension of the compressor,
67 * or if more than image_height scanlines are passed in.
68 *
69 * Note: we warn about excess calls to jpeg_write_scanlines() since
70 * this likely signals an application programmer error. However,
71 * excess scanlines passed in the last valid call are *silently* ignored,
72 * so that the application need not adjust num_lines for end-of-image
73 * when using a multiple-scanline buffer.
74 */
75
76GLOBAL(JDIMENSION)
77jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
78 JDIMENSION num_lines)
79{
80 JDIMENSION row_ctr, rows_left;
81
82 if (cinfo->global_state != CSTATE_SCANNING)
83 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
84 if (cinfo->next_scanline >= cinfo->image_height)
85 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
86
87 /* Call progress monitor hook if present */
88 if (cinfo->progress != NULL) {
89 cinfo->progress->pass_counter = (long) cinfo->next_scanline;
90 cinfo->progress->pass_limit = (long) cinfo->image_height;
91 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
92 }
93
94 /* Give master control module another chance if this is first call to
95 * jpeg_write_scanlines. This lets output of the frame/scan headers be
96 * delayed so that application can write COM, etc, markers between
97 * jpeg_start_compress and jpeg_write_scanlines.
98 */
99 if (cinfo->master->call_pass_startup)
100 (*cinfo->master->pass_startup) (cinfo);
101
102 /* Ignore any extra scanlines at bottom of image. */
103 rows_left = cinfo->image_height - cinfo->next_scanline;
104 if (num_lines > rows_left)
105 num_lines = rows_left;
106
107 row_ctr = 0;
108 (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
109 cinfo->next_scanline += row_ctr;
110 return row_ctr;
111}
112
113
114/*
115 * Alternate entry point to write raw data.
116 * Processes exactly one iMCU row per call, unless suspended.
117 */
118
119GLOBAL(JDIMENSION)
120jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
121 JDIMENSION num_lines)
122{
123 JDIMENSION lines_per_iMCU_row;
124
125 if (cinfo->global_state != CSTATE_RAW_OK)
126 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
127 if (cinfo->next_scanline >= cinfo->image_height) {
128 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
129 return 0;
130 }
131
132 /* Call progress monitor hook if present */
133 if (cinfo->progress != NULL) {
134 cinfo->progress->pass_counter = (long) cinfo->next_scanline;
135 cinfo->progress->pass_limit = (long) cinfo->image_height;
136 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
137 }
138
139 /* Give master control module another chance if this is first call to
140 * jpeg_write_raw_data. This lets output of the frame/scan headers be
141 * delayed so that application can write COM, etc, markers between
142 * jpeg_start_compress and jpeg_write_raw_data.
143 */
144 if (cinfo->master->call_pass_startup)
145 (*cinfo->master->pass_startup) (cinfo);
146
147 /* Verify that at least one iMCU row has been passed. */
148 lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
149 if (num_lines < lines_per_iMCU_row)
150 ERREXIT(cinfo, JERR_BUFFER_SIZE);
151
152 /* Directly compress the row. */
153 if (! (*cinfo->coef->compress_data) (cinfo, data)) {
154 /* If compressor did not consume the whole row, suspend processing. */
155 return 0;
156 }
157
158 /* OK, we processed one iMCU row. */
159 cinfo->next_scanline += lines_per_iMCU_row;
160 return lines_per_iMCU_row;
161}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcarith.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcarith.c
new file mode 100644
index 0000000..60c0ed7
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcarith.c
@@ -0,0 +1,937 @@
1/*
2 * jcarith.c
3 *
4 * Developed 1997-2011 by Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains portable arithmetic entropy encoding routines for JPEG
9 * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
10 *
11 * Both sequential and progressive modes are supported in this single module.
12 *
13 * Suspension is not currently supported in this module.
14 */
15
16#define JPEG_INTERNALS
17#include "jinclude.h"
18#include "jpeglib.h"
19
20
21/* Expanded entropy encoder object for arithmetic encoding. */
22
23typedef struct {
24 struct jpeg_entropy_encoder pub; /* public fields */
25
26 INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */
27 INT32 a; /* A register, normalized size of coding interval */
28 INT32 sc; /* counter for stacked 0xFF values which might overflow */
29 INT32 zc; /* counter for pending 0x00 output values which might *
30 * be discarded at the end ("Pacman" termination) */
31 int ct; /* bit shift counter, determines when next byte will be written */
32 int buffer; /* buffer for most recent output byte != 0xFF */
33
34 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
35 int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
36
37 unsigned int restarts_to_go; /* MCUs left in this restart interval */
38 int next_restart_num; /* next restart number to write (0-7) */
39
40 /* Pointers to statistics areas (these workspaces have image lifespan) */
41 unsigned char * dc_stats[NUM_ARITH_TBLS];
42 unsigned char * ac_stats[NUM_ARITH_TBLS];
43
44 /* Statistics bin for coding with fixed probability 0.5 */
45 unsigned char fixed_bin[4];
46} arith_entropy_encoder;
47
48typedef arith_entropy_encoder * arith_entropy_ptr;
49
50/* The following two definitions specify the allocation chunk size
51 * for the statistics area.
52 * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
53 * 49 statistics bins for DC, and 245 statistics bins for AC coding.
54 *
55 * We use a compact representation with 1 byte per statistics bin,
56 * thus the numbers directly represent byte sizes.
57 * This 1 byte per statistics bin contains the meaning of the MPS
58 * (more probable symbol) in the highest bit (mask 0x80), and the
59 * index into the probability estimation state machine table
60 * in the lower bits (mask 0x7F).
61 */
62
63#define DC_STAT_BINS 64
64#define AC_STAT_BINS 256
65
66/* NOTE: Uncomment the following #define if you want to use the
67 * given formula for calculating the AC conditioning parameter Kx
68 * for spectral selection progressive coding in section G.1.3.2
69 * of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).
70 * Although the spec and P&M authors claim that this "has proven
71 * to give good results for 8 bit precision samples", I'm not
72 * convinced yet that this is really beneficial.
73 * Early tests gave only very marginal compression enhancements
74 * (a few - around 5 or so - bytes even for very large files),
75 * which would turn out rather negative if we'd suppress the
76 * DAC (Define Arithmetic Conditioning) marker segments for
77 * the default parameters in the future.
78 * Note that currently the marker writing module emits 12-byte
79 * DAC segments for a full-component scan in a color image.
80 * This is not worth worrying about IMHO. However, since the
81 * spec defines the default values to be used if the tables
82 * are omitted (unlike Huffman tables, which are required
83 * anyway), one might optimize this behaviour in the future,
84 * and then it would be disadvantageous to use custom tables if
85 * they don't provide sufficient gain to exceed the DAC size.
86 *
87 * On the other hand, I'd consider it as a reasonable result
88 * that the conditioning has no significant influence on the
89 * compression performance. This means that the basic
90 * statistical model is already rather stable.
91 *
92 * Thus, at the moment, we use the default conditioning values
93 * anyway, and do not use the custom formula.
94 *
95#define CALCULATE_SPECTRAL_CONDITIONING
96 */
97
98/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
99 * We assume that int right shift is unsigned if INT32 right shift is,
100 * which should be safe.
101 */
102
103#ifdef RIGHT_SHIFT_IS_UNSIGNED
104#define ISHIFT_TEMPS int ishift_temp;
105#define IRIGHT_SHIFT(x,shft) \
106 ((ishift_temp = (x)) < 0 ? \
107 (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
108 (ishift_temp >> (shft)))
109#else
110#define ISHIFT_TEMPS
111#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
112#endif
113
114
115LOCAL(void)
116emit_byte (int val, j_compress_ptr cinfo)
117/* Write next output byte; we do not support suspension in this module. */
118{
119 struct jpeg_destination_mgr * dest = cinfo->dest;
120
121 *dest->next_output_byte++ = (JOCTET) val;
122 if (--dest->free_in_buffer == 0)
123 if (! (*dest->empty_output_buffer) (cinfo))
124 ERREXIT(cinfo, JERR_CANT_SUSPEND);
125}
126
127
128/*
129 * Finish up at the end of an arithmetic-compressed scan.
130 */
131
132METHODDEF(void)
133finish_pass (j_compress_ptr cinfo)
134{
135 arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
136 INT32 temp;
137
138 /* Section D.1.8: Termination of encoding */
139
140 /* Find the e->c in the coding interval with the largest
141 * number of trailing zero bits */
142 if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)
143 e->c = temp + 0x8000L;
144 else
145 e->c = temp;
146 /* Send remaining bytes to output */
147 e->c <<= e->ct;
148 if (e->c & 0xF8000000L) {
149 /* One final overflow has to be handled */
150 if (e->buffer >= 0) {
151 if (e->zc)
152 do emit_byte(0x00, cinfo);
153 while (--e->zc);
154 emit_byte(e->buffer + 1, cinfo);
155 if (e->buffer + 1 == 0xFF)
156 emit_byte(0x00, cinfo);
157 }
158 e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
159 e->sc = 0;
160 } else {
161 if (e->buffer == 0)
162 ++e->zc;
163 else if (e->buffer >= 0) {
164 if (e->zc)
165 do emit_byte(0x00, cinfo);
166 while (--e->zc);
167 emit_byte(e->buffer, cinfo);
168 }
169 if (e->sc) {
170 if (e->zc)
171 do emit_byte(0x00, cinfo);
172 while (--e->zc);
173 do {
174 emit_byte(0xFF, cinfo);
175 emit_byte(0x00, cinfo);
176 } while (--e->sc);
177 }
178 }
179 /* Output final bytes only if they are not 0x00 */
180 if (e->c & 0x7FFF800L) {
181 if (e->zc) /* output final pending zero bytes */
182 do emit_byte(0x00, cinfo);
183 while (--e->zc);
184 emit_byte((e->c >> 19) & 0xFF, cinfo);
185 if (((e->c >> 19) & 0xFF) == 0xFF)
186 emit_byte(0x00, cinfo);
187 if (e->c & 0x7F800L) {
188 emit_byte((e->c >> 11) & 0xFF, cinfo);
189 if (((e->c >> 11) & 0xFF) == 0xFF)
190 emit_byte(0x00, cinfo);
191 }
192 }
193}
194
195
196/*
197 * The core arithmetic encoding routine (common in JPEG and JBIG).
198 * This needs to go as fast as possible.
199 * Machine-dependent optimization facilities
200 * are not utilized in this portable implementation.
201 * However, this code should be fairly efficient and
202 * may be a good base for further optimizations anyway.
203 *
204 * Parameter 'val' to be encoded may be 0 or 1 (binary decision).
205 *
206 * Note: I've added full "Pacman" termination support to the
207 * byte output routines, which is equivalent to the optional
208 * Discard_final_zeros procedure (Figure D.15) in the spec.
209 * Thus, we always produce the shortest possible output
210 * stream compliant to the spec (no trailing zero bytes,
211 * except for FF stuffing).
212 *
213 * I've also introduced a new scheme for accessing
214 * the probability estimation state machine table,
215 * derived from Markus Kuhn's JBIG implementation.
216 */
217
218LOCAL(void)
219arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
220{
221 register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
222 register unsigned char nl, nm;
223 register INT32 qe, temp;
224 register int sv;
225
226 /* Fetch values from our compact representation of Table D.3(D.2):
227 * Qe values and probability estimation state machine
228 */
229 sv = *st;
230 qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
231 nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
232 nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
233
234 /* Encode & estimation procedures per sections D.1.4 & D.1.5 */
235 e->a -= qe;
236 if (val != (sv >> 7)) {
237 /* Encode the less probable symbol */
238 if (e->a >= qe) {
239 /* If the interval size (qe) for the less probable symbol (LPS)
240 * is larger than the interval size for the MPS, then exchange
241 * the two symbols for coding efficiency, otherwise code the LPS
242 * as usual: */
243 e->c += e->a;
244 e->a = qe;
245 }
246 *st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
247 } else {
248 /* Encode the more probable symbol */
249 if (e->a >= 0x8000L)
250 return; /* A >= 0x8000 -> ready, no renormalization required */
251 if (e->a < qe) {
252 /* If the interval size (qe) for the less probable symbol (LPS)
253 * is larger than the interval size for the MPS, then exchange
254 * the two symbols for coding efficiency: */
255 e->c += e->a;
256 e->a = qe;
257 }
258 *st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
259 }
260
261 /* Renormalization & data output per section D.1.6 */
262 do {
263 e->a <<= 1;
264 e->c <<= 1;
265 if (--e->ct == 0) {
266 /* Another byte is ready for output */
267 temp = e->c >> 19;
268 if (temp > 0xFF) {
269 /* Handle overflow over all stacked 0xFF bytes */
270 if (e->buffer >= 0) {
271 if (e->zc)
272 do emit_byte(0x00, cinfo);
273 while (--e->zc);
274 emit_byte(e->buffer + 1, cinfo);
275 if (e->buffer + 1 == 0xFF)
276 emit_byte(0x00, cinfo);
277 }
278 e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
279 e->sc = 0;
280 /* Note: The 3 spacer bits in the C register guarantee
281 * that the new buffer byte can't be 0xFF here
282 * (see page 160 in the P&M JPEG book). */
283 e->buffer = temp & 0xFF; /* new output byte, might overflow later */
284 } else if (temp == 0xFF) {
285 ++e->sc; /* stack 0xFF byte (which might overflow later) */
286 } else {
287 /* Output all stacked 0xFF bytes, they will not overflow any more */
288 if (e->buffer == 0)
289 ++e->zc;
290 else if (e->buffer >= 0) {
291 if (e->zc)
292 do emit_byte(0x00, cinfo);
293 while (--e->zc);
294 emit_byte(e->buffer, cinfo);
295 }
296 if (e->sc) {
297 if (e->zc)
298 do emit_byte(0x00, cinfo);
299 while (--e->zc);
300 do {
301 emit_byte(0xFF, cinfo);
302 emit_byte(0x00, cinfo);
303 } while (--e->sc);
304 }
305 e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
306 }
307 e->c &= 0x7FFFFL;
308 e->ct += 8;
309 }
310 } while (e->a < 0x8000L);
311}
312
313
314/*
315 * Emit a restart marker & resynchronize predictions.
316 */
317
318LOCAL(void)
319emit_restart (j_compress_ptr cinfo, int restart_num)
320{
321 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
322 int ci;
323 jpeg_component_info * compptr;
324
325 finish_pass(cinfo);
326
327 emit_byte(0xFF, cinfo);
328 emit_byte(JPEG_RST0 + restart_num, cinfo);
329
330 /* Re-initialize statistics areas */
331 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
332 compptr = cinfo->cur_comp_info[ci];
333 /* DC needs no table for refinement scan */
334 if (cinfo->Ss == 0 && cinfo->Ah == 0) {
335 MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
336 /* Reset DC predictions to 0 */
337 entropy->last_dc_val[ci] = 0;
338 entropy->dc_context[ci] = 0;
339 }
340 /* AC needs no table when not present */
341 if (cinfo->Se) {
342 MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
343 }
344 }
345
346 /* Reset arithmetic encoding variables */
347 entropy->c = 0;
348 entropy->a = 0x10000L;
349 entropy->sc = 0;
350 entropy->zc = 0;
351 entropy->ct = 11;
352 entropy->buffer = -1; /* empty */
353}
354
355
356/*
357 * MCU encoding for DC initial scan (either spectral selection,
358 * or first pass of successive approximation).
359 */
360
361METHODDEF(boolean)
362encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
363{
364 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
365 JBLOCKROW block;
366 unsigned char *st;
367 int blkn, ci, tbl;
368 int v, v2, m;
369 ISHIFT_TEMPS
370
371 /* Emit restart marker if needed */
372 if (cinfo->restart_interval) {
373 if (entropy->restarts_to_go == 0) {
374 emit_restart(cinfo, entropy->next_restart_num);
375 entropy->restarts_to_go = cinfo->restart_interval;
376 entropy->next_restart_num++;
377 entropy->next_restart_num &= 7;
378 }
379 entropy->restarts_to_go--;
380 }
381
382 /* Encode the MCU data blocks */
383 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
384 block = MCU_data[blkn];
385 ci = cinfo->MCU_membership[blkn];
386 tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
387
388 /* Compute the DC value after the required point transform by Al.
389 * This is simply an arithmetic right shift.
390 */
391 m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al);
392
393 /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
394
395 /* Table F.4: Point to statistics bin S0 for DC coefficient coding */
396 st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
397
398 /* Figure F.4: Encode_DC_DIFF */
399 if ((v = m - entropy->last_dc_val[ci]) == 0) {
400 arith_encode(cinfo, st, 0);
401 entropy->dc_context[ci] = 0; /* zero diff category */
402 } else {
403 entropy->last_dc_val[ci] = m;
404 arith_encode(cinfo, st, 1);
405 /* Figure F.6: Encoding nonzero value v */
406 /* Figure F.7: Encoding the sign of v */
407 if (v > 0) {
408 arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
409 st += 2; /* Table F.4: SP = S0 + 2 */
410 entropy->dc_context[ci] = 4; /* small positive diff category */
411 } else {
412 v = -v;
413 arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
414 st += 3; /* Table F.4: SN = S0 + 3 */
415 entropy->dc_context[ci] = 8; /* small negative diff category */
416 }
417 /* Figure F.8: Encoding the magnitude category of v */
418 m = 0;
419 if (v -= 1) {
420 arith_encode(cinfo, st, 1);
421 m = 1;
422 v2 = v;
423 st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
424 while (v2 >>= 1) {
425 arith_encode(cinfo, st, 1);
426 m <<= 1;
427 st += 1;
428 }
429 }
430 arith_encode(cinfo, st, 0);
431 /* Section F.1.4.4.1.2: Establish dc_context conditioning category */
432 if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
433 entropy->dc_context[ci] = 0; /* zero diff category */
434 else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
435 entropy->dc_context[ci] += 8; /* large diff category */
436 /* Figure F.9: Encoding the magnitude bit pattern of v */
437 st += 14;
438 while (m >>= 1)
439 arith_encode(cinfo, st, (m & v) ? 1 : 0);
440 }
441 }
442
443 return TRUE;
444}
445
446
447/*
448 * MCU encoding for AC initial scan (either spectral selection,
449 * or first pass of successive approximation).
450 */
451
452METHODDEF(boolean)
453encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
454{
455 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
456 JBLOCKROW block;
457 unsigned char *st;
458 int tbl, k, ke;
459 int v, v2, m;
460 const int * natural_order;
461
462 /* Emit restart marker if needed */
463 if (cinfo->restart_interval) {
464 if (entropy->restarts_to_go == 0) {
465 emit_restart(cinfo, entropy->next_restart_num);
466 entropy->restarts_to_go = cinfo->restart_interval;
467 entropy->next_restart_num++;
468 entropy->next_restart_num &= 7;
469 }
470 entropy->restarts_to_go--;
471 }
472
473 natural_order = cinfo->natural_order;
474
475 /* Encode the MCU data block */
476 block = MCU_data[0];
477 tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
478
479 /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
480
481 /* Establish EOB (end-of-block) index */
482 for (ke = cinfo->Se; ke > 0; ke--)
483 /* We must apply the point transform by Al. For AC coefficients this
484 * is an integer division with rounding towards 0. To do this portably
485 * in C, we shift after obtaining the absolute value.
486 */
487 if ((v = (*block)[natural_order[ke]]) >= 0) {
488 if (v >>= cinfo->Al) break;
489 } else {
490 v = -v;
491 if (v >>= cinfo->Al) break;
492 }
493
494 /* Figure F.5: Encode_AC_Coefficients */
495 for (k = cinfo->Ss; k <= ke; k++) {
496 st = entropy->ac_stats[tbl] + 3 * (k - 1);
497 arith_encode(cinfo, st, 0); /* EOB decision */
498 for (;;) {
499 if ((v = (*block)[natural_order[k]]) >= 0) {
500 if (v >>= cinfo->Al) {
501 arith_encode(cinfo, st + 1, 1);
502 arith_encode(cinfo, entropy->fixed_bin, 0);
503 break;
504 }
505 } else {
506 v = -v;
507 if (v >>= cinfo->Al) {
508 arith_encode(cinfo, st + 1, 1);
509 arith_encode(cinfo, entropy->fixed_bin, 1);
510 break;
511 }
512 }
513 arith_encode(cinfo, st + 1, 0); st += 3; k++;
514 }
515 st += 2;
516 /* Figure F.8: Encoding the magnitude category of v */
517 m = 0;
518 if (v -= 1) {
519 arith_encode(cinfo, st, 1);
520 m = 1;
521 v2 = v;
522 if (v2 >>= 1) {
523 arith_encode(cinfo, st, 1);
524 m <<= 1;
525 st = entropy->ac_stats[tbl] +
526 (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
527 while (v2 >>= 1) {
528 arith_encode(cinfo, st, 1);
529 m <<= 1;
530 st += 1;
531 }
532 }
533 }
534 arith_encode(cinfo, st, 0);
535 /* Figure F.9: Encoding the magnitude bit pattern of v */
536 st += 14;
537 while (m >>= 1)
538 arith_encode(cinfo, st, (m & v) ? 1 : 0);
539 }
540 /* Encode EOB decision only if k <= cinfo->Se */
541 if (k <= cinfo->Se) {
542 st = entropy->ac_stats[tbl] + 3 * (k - 1);
543 arith_encode(cinfo, st, 1);
544 }
545
546 return TRUE;
547}
548
549
550/*
551 * MCU encoding for DC successive approximation refinement scan.
552 */
553
554METHODDEF(boolean)
555encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
556{
557 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
558 unsigned char *st;
559 int Al, blkn;
560
561 /* Emit restart marker if needed */
562 if (cinfo->restart_interval) {
563 if (entropy->restarts_to_go == 0) {
564 emit_restart(cinfo, entropy->next_restart_num);
565 entropy->restarts_to_go = cinfo->restart_interval;
566 entropy->next_restart_num++;
567 entropy->next_restart_num &= 7;
568 }
569 entropy->restarts_to_go--;
570 }
571
572 st = entropy->fixed_bin; /* use fixed probability estimation */
573 Al = cinfo->Al;
574
575 /* Encode the MCU data blocks */
576 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
577 /* We simply emit the Al'th bit of the DC coefficient value. */
578 arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);
579 }
580
581 return TRUE;
582}
583
584
585/*
586 * MCU encoding for AC successive approximation refinement scan.
587 */
588
589METHODDEF(boolean)
590encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
591{
592 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
593 JBLOCKROW block;
594 unsigned char *st;
595 int tbl, k, ke, kex;
596 int v;
597 const int * natural_order;
598
599 /* Emit restart marker if needed */
600 if (cinfo->restart_interval) {
601 if (entropy->restarts_to_go == 0) {
602 emit_restart(cinfo, entropy->next_restart_num);
603 entropy->restarts_to_go = cinfo->restart_interval;
604 entropy->next_restart_num++;
605 entropy->next_restart_num &= 7;
606 }
607 entropy->restarts_to_go--;
608 }
609
610 natural_order = cinfo->natural_order;
611
612 /* Encode the MCU data block */
613 block = MCU_data[0];
614 tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
615
616 /* Section G.1.3.3: Encoding of AC coefficients */
617
618 /* Establish EOB (end-of-block) index */
619 for (ke = cinfo->Se; ke > 0; ke--)
620 /* We must apply the point transform by Al. For AC coefficients this
621 * is an integer division with rounding towards 0. To do this portably
622 * in C, we shift after obtaining the absolute value.
623 */
624 if ((v = (*block)[natural_order[ke]]) >= 0) {
625 if (v >>= cinfo->Al) break;
626 } else {
627 v = -v;
628 if (v >>= cinfo->Al) break;
629 }
630
631 /* Establish EOBx (previous stage end-of-block) index */
632 for (kex = ke; kex > 0; kex--)
633 if ((v = (*block)[natural_order[kex]]) >= 0) {
634 if (v >>= cinfo->Ah) break;
635 } else {
636 v = -v;
637 if (v >>= cinfo->Ah) break;
638 }
639
640 /* Figure G.10: Encode_AC_Coefficients_SA */
641 for (k = cinfo->Ss; k <= ke; k++) {
642 st = entropy->ac_stats[tbl] + 3 * (k - 1);
643 if (k > kex)
644 arith_encode(cinfo, st, 0); /* EOB decision */
645 for (;;) {
646 if ((v = (*block)[natural_order[k]]) >= 0) {
647 if (v >>= cinfo->Al) {
648 if (v >> 1) /* previously nonzero coef */
649 arith_encode(cinfo, st + 2, (v & 1));
650 else { /* newly nonzero coef */
651 arith_encode(cinfo, st + 1, 1);
652 arith_encode(cinfo, entropy->fixed_bin, 0);
653 }
654 break;
655 }
656 } else {
657 v = -v;
658 if (v >>= cinfo->Al) {
659 if (v >> 1) /* previously nonzero coef */
660 arith_encode(cinfo, st + 2, (v & 1));
661 else { /* newly nonzero coef */
662 arith_encode(cinfo, st + 1, 1);
663 arith_encode(cinfo, entropy->fixed_bin, 1);
664 }
665 break;
666 }
667 }
668 arith_encode(cinfo, st + 1, 0); st += 3; k++;
669 }
670 }
671 /* Encode EOB decision only if k <= cinfo->Se */
672 if (k <= cinfo->Se) {
673 st = entropy->ac_stats[tbl] + 3 * (k - 1);
674 arith_encode(cinfo, st, 1);
675 }
676
677 return TRUE;
678}
679
680
681/*
682 * Encode and output one MCU's worth of arithmetic-compressed coefficients.
683 */
684
685METHODDEF(boolean)
686encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
687{
688 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
689 jpeg_component_info * compptr;
690 JBLOCKROW block;
691 unsigned char *st;
692 int blkn, ci, tbl, k, ke;
693 int v, v2, m;
694 const int * natural_order;
695
696 /* Emit restart marker if needed */
697 if (cinfo->restart_interval) {
698 if (entropy->restarts_to_go == 0) {
699 emit_restart(cinfo, entropy->next_restart_num);
700 entropy->restarts_to_go = cinfo->restart_interval;
701 entropy->next_restart_num++;
702 entropy->next_restart_num &= 7;
703 }
704 entropy->restarts_to_go--;
705 }
706
707 natural_order = cinfo->natural_order;
708
709 /* Encode the MCU data blocks */
710 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
711 block = MCU_data[blkn];
712 ci = cinfo->MCU_membership[blkn];
713 compptr = cinfo->cur_comp_info[ci];
714
715 /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
716
717 tbl = compptr->dc_tbl_no;
718
719 /* Table F.4: Point to statistics bin S0 for DC coefficient coding */
720 st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
721
722 /* Figure F.4: Encode_DC_DIFF */
723 if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {
724 arith_encode(cinfo, st, 0);
725 entropy->dc_context[ci] = 0; /* zero diff category */
726 } else {
727 entropy->last_dc_val[ci] = (*block)[0];
728 arith_encode(cinfo, st, 1);
729 /* Figure F.6: Encoding nonzero value v */
730 /* Figure F.7: Encoding the sign of v */
731 if (v > 0) {
732 arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
733 st += 2; /* Table F.4: SP = S0 + 2 */
734 entropy->dc_context[ci] = 4; /* small positive diff category */
735 } else {
736 v = -v;
737 arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
738 st += 3; /* Table F.4: SN = S0 + 3 */
739 entropy->dc_context[ci] = 8; /* small negative diff category */
740 }
741 /* Figure F.8: Encoding the magnitude category of v */
742 m = 0;
743 if (v -= 1) {
744 arith_encode(cinfo, st, 1);
745 m = 1;
746 v2 = v;
747 st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
748 while (v2 >>= 1) {
749 arith_encode(cinfo, st, 1);
750 m <<= 1;
751 st += 1;
752 }
753 }
754 arith_encode(cinfo, st, 0);
755 /* Section F.1.4.4.1.2: Establish dc_context conditioning category */
756 if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
757 entropy->dc_context[ci] = 0; /* zero diff category */
758 else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
759 entropy->dc_context[ci] += 8; /* large diff category */
760 /* Figure F.9: Encoding the magnitude bit pattern of v */
761 st += 14;
762 while (m >>= 1)
763 arith_encode(cinfo, st, (m & v) ? 1 : 0);
764 }
765
766 /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
767
768 if ((ke = cinfo->lim_Se) == 0) continue;
769 tbl = compptr->ac_tbl_no;
770
771 /* Establish EOB (end-of-block) index */
772 do {
773 if ((*block)[natural_order[ke]]) break;
774 } while (--ke);
775
776 /* Figure F.5: Encode_AC_Coefficients */
777 for (k = 0; k < ke;) {
778 st = entropy->ac_stats[tbl] + 3 * k;
779 arith_encode(cinfo, st, 0); /* EOB decision */
780 while ((v = (*block)[natural_order[++k]]) == 0) {
781 arith_encode(cinfo, st + 1, 0);
782 st += 3;
783 }
784 arith_encode(cinfo, st + 1, 1);
785 /* Figure F.6: Encoding nonzero value v */
786 /* Figure F.7: Encoding the sign of v */
787 if (v > 0) {
788 arith_encode(cinfo, entropy->fixed_bin, 0);
789 } else {
790 v = -v;
791 arith_encode(cinfo, entropy->fixed_bin, 1);
792 }
793 st += 2;
794 /* Figure F.8: Encoding the magnitude category of v */
795 m = 0;
796 if (v -= 1) {
797 arith_encode(cinfo, st, 1);
798 m = 1;
799 v2 = v;
800 if (v2 >>= 1) {
801 arith_encode(cinfo, st, 1);
802 m <<= 1;
803 st = entropy->ac_stats[tbl] +
804 (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
805 while (v2 >>= 1) {
806 arith_encode(cinfo, st, 1);
807 m <<= 1;
808 st += 1;
809 }
810 }
811 }
812 arith_encode(cinfo, st, 0);
813 /* Figure F.9: Encoding the magnitude bit pattern of v */
814 st += 14;
815 while (m >>= 1)
816 arith_encode(cinfo, st, (m & v) ? 1 : 0);
817 }
818 /* Encode EOB decision only if k < cinfo->lim_Se */
819 if (k < cinfo->lim_Se) {
820 st = entropy->ac_stats[tbl] + 3 * k;
821 arith_encode(cinfo, st, 1);
822 }
823 }
824
825 return TRUE;
826}
827
828
829/*
830 * Initialize for an arithmetic-compressed scan.
831 */
832
833METHODDEF(void)
834start_pass (j_compress_ptr cinfo, boolean gather_statistics)
835{
836 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
837 int ci, tbl;
838 jpeg_component_info * compptr;
839
840 if (gather_statistics)
841 /* Make sure to avoid that in the master control logic!
842 * We are fully adaptive here and need no extra
843 * statistics gathering pass!
844 */
845 ERREXIT(cinfo, JERR_NOT_COMPILED);
846
847 /* We assume jcmaster.c already validated the progressive scan parameters. */
848
849 /* Select execution routines */
850 if (cinfo->progressive_mode) {
851 if (cinfo->Ah == 0) {
852 if (cinfo->Ss == 0)
853 entropy->pub.encode_mcu = encode_mcu_DC_first;
854 else
855 entropy->pub.encode_mcu = encode_mcu_AC_first;
856 } else {
857 if (cinfo->Ss == 0)
858 entropy->pub.encode_mcu = encode_mcu_DC_refine;
859 else
860 entropy->pub.encode_mcu = encode_mcu_AC_refine;
861 }
862 } else
863 entropy->pub.encode_mcu = encode_mcu;
864
865 /* Allocate & initialize requested statistics areas */
866 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
867 compptr = cinfo->cur_comp_info[ci];
868 /* DC needs no table for refinement scan */
869 if (cinfo->Ss == 0 && cinfo->Ah == 0) {
870 tbl = compptr->dc_tbl_no;
871 if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
872 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
873 if (entropy->dc_stats[tbl] == NULL)
874 entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
875 ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);
876 MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
877 /* Initialize DC predictions to 0 */
878 entropy->last_dc_val[ci] = 0;
879 entropy->dc_context[ci] = 0;
880 }
881 /* AC needs no table when not present */
882 if (cinfo->Se) {
883 tbl = compptr->ac_tbl_no;
884 if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
885 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
886 if (entropy->ac_stats[tbl] == NULL)
887 entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
888 ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);
889 MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
890#ifdef CALCULATE_SPECTRAL_CONDITIONING
891 if (cinfo->progressive_mode)
892 /* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
893 cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);
894#endif
895 }
896 }
897
898 /* Initialize arithmetic encoding variables */
899 entropy->c = 0;
900 entropy->a = 0x10000L;
901 entropy->sc = 0;
902 entropy->zc = 0;
903 entropy->ct = 11;
904 entropy->buffer = -1; /* empty */
905
906 /* Initialize restart stuff */
907 entropy->restarts_to_go = cinfo->restart_interval;
908 entropy->next_restart_num = 0;
909}
910
911
912/*
913 * Module initialization routine for arithmetic entropy encoding.
914 */
915
916GLOBAL(void)
917jinit_arith_encoder (j_compress_ptr cinfo)
918{
919 arith_entropy_ptr entropy;
920 int i;
921
922 entropy = (arith_entropy_ptr)
923 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
924 SIZEOF(arith_entropy_encoder));
925 cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
926 entropy->pub.start_pass = start_pass;
927 entropy->pub.finish_pass = finish_pass;
928
929 /* Mark tables unallocated */
930 for (i = 0; i < NUM_ARITH_TBLS; i++) {
931 entropy->dc_stats[i] = NULL;
932 entropy->ac_stats[i] = NULL;
933 }
934
935 /* Initialize index for fixed probability estimation */
936 entropy->fixed_bin[0] = 113;
937}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccoefct.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccoefct.c
new file mode 100644
index 0000000..b64b46e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccoefct.c
@@ -0,0 +1,454 @@
1/*
2 * jccoefct.c
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * Modified 2003-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains the coefficient buffer controller for compression.
10 * This controller is the top level of the JPEG compressor proper.
11 * The coefficient buffer lies between forward-DCT and entropy encoding steps.
12 */
13
14#define JPEG_INTERNALS
15#include "jinclude.h"
16#include "jpeglib.h"
17
18
19/* We use a full-image coefficient buffer when doing Huffman optimization,
20 * and also for writing multiple-scan JPEG files. In all cases, the DCT
21 * step is run during the first pass, and subsequent passes need only read
22 * the buffered coefficients.
23 */
24#ifdef ENTROPY_OPT_SUPPORTED
25#define FULL_COEF_BUFFER_SUPPORTED
26#else
27#ifdef C_MULTISCAN_FILES_SUPPORTED
28#define FULL_COEF_BUFFER_SUPPORTED
29#endif
30#endif
31
32
33/* Private buffer controller object */
34
35typedef struct {
36 struct jpeg_c_coef_controller pub; /* public fields */
37
38 JDIMENSION iMCU_row_num; /* iMCU row # within image */
39 JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
40 int MCU_vert_offset; /* counts MCU rows within iMCU row */
41 int MCU_rows_per_iMCU_row; /* number of such rows needed */
42
43 /* For single-pass compression, it's sufficient to buffer just one MCU
44 * (although this may prove a bit slow in practice). We allocate a
45 * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
46 * MCU constructed and sent. (On 80x86, the workspace is FAR even though
47 * it's not really very big; this is to keep the module interfaces unchanged
48 * when a large coefficient buffer is necessary.)
49 * In multi-pass modes, this array points to the current MCU's blocks
50 * within the virtual arrays.
51 */
52 JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
53
54 /* In multi-pass modes, we need a virtual block array for each component. */
55 jvirt_barray_ptr whole_image[MAX_COMPONENTS];
56} my_coef_controller;
57
58typedef my_coef_controller * my_coef_ptr;
59
60
61/* Forward declarations */
62METHODDEF(boolean) compress_data
63 JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
64#ifdef FULL_COEF_BUFFER_SUPPORTED
65METHODDEF(boolean) compress_first_pass
66 JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
67METHODDEF(boolean) compress_output
68 JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
69#endif
70
71
72LOCAL(void)
73start_iMCU_row (j_compress_ptr cinfo)
74/* Reset within-iMCU-row counters for a new row */
75{
76 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
77
78 /* In an interleaved scan, an MCU row is the same as an iMCU row.
79 * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
80 * But at the bottom of the image, process only what's left.
81 */
82 if (cinfo->comps_in_scan > 1) {
83 coef->MCU_rows_per_iMCU_row = 1;
84 } else {
85 if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
86 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
87 else
88 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
89 }
90
91 coef->mcu_ctr = 0;
92 coef->MCU_vert_offset = 0;
93}
94
95
96/*
97 * Initialize for a processing pass.
98 */
99
100METHODDEF(void)
101start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
102{
103 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
104
105 coef->iMCU_row_num = 0;
106 start_iMCU_row(cinfo);
107
108 switch (pass_mode) {
109 case JBUF_PASS_THRU:
110 if (coef->whole_image[0] != NULL)
111 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
112 coef->pub.compress_data = compress_data;
113 break;
114#ifdef FULL_COEF_BUFFER_SUPPORTED
115 case JBUF_SAVE_AND_PASS:
116 if (coef->whole_image[0] == NULL)
117 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
118 coef->pub.compress_data = compress_first_pass;
119 break;
120 case JBUF_CRANK_DEST:
121 if (coef->whole_image[0] == NULL)
122 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
123 coef->pub.compress_data = compress_output;
124 break;
125#endif
126 default:
127 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
128 break;
129 }
130}
131
132
133/*
134 * Process some data in the single-pass case.
135 * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
136 * per call, ie, v_samp_factor block rows for each component in the image.
137 * Returns TRUE if the iMCU row is completed, FALSE if suspended.
138 *
139 * NB: input_buf contains a plane for each component in image,
140 * which we index according to the component's SOF position.
141 */
142
143METHODDEF(boolean)
144compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
145{
146 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
147 JDIMENSION MCU_col_num; /* index of current MCU within row */
148 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
149 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
150 int blkn, bi, ci, yindex, yoffset, blockcnt;
151 JDIMENSION ypos, xpos;
152 jpeg_component_info *compptr;
153 forward_DCT_ptr forward_DCT;
154
155 /* Loop to write as much as one whole iMCU row */
156 for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
157 yoffset++) {
158 for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
159 MCU_col_num++) {
160 /* Determine where data comes from in input_buf and do the DCT thing.
161 * Each call on forward_DCT processes a horizontal row of DCT blocks
162 * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
163 * sequentially. Dummy blocks at the right or bottom edge are filled in
164 * specially. The data in them does not matter for image reconstruction,
165 * so we fill them with values that will encode to the smallest amount of
166 * data, viz: all zeroes in the AC entries, DC entries equal to previous
167 * block's DC value. (Thanks to Thomas Kinsman for this idea.)
168 */
169 blkn = 0;
170 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
171 compptr = cinfo->cur_comp_info[ci];
172 forward_DCT = cinfo->fdct->forward_DCT[compptr->component_index];
173 blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
174 : compptr->last_col_width;
175 xpos = MCU_col_num * compptr->MCU_sample_width;
176 ypos = yoffset * compptr->DCT_v_scaled_size;
177 /* ypos == (yoffset+yindex) * DCTSIZE */
178 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
179 if (coef->iMCU_row_num < last_iMCU_row ||
180 yoffset+yindex < compptr->last_row_height) {
181 (*forward_DCT) (cinfo, compptr,
182 input_buf[compptr->component_index],
183 coef->MCU_buffer[blkn],
184 ypos, xpos, (JDIMENSION) blockcnt);
185 if (blockcnt < compptr->MCU_width) {
186 /* Create some dummy blocks at the right edge of the image. */
187 FMEMZERO((void FAR *) coef->MCU_buffer[blkn + blockcnt],
188 (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
189 for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
190 coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
191 }
192 }
193 } else {
194 /* Create a row of dummy blocks at the bottom of the image. */
195 FMEMZERO((void FAR *) coef->MCU_buffer[blkn],
196 compptr->MCU_width * SIZEOF(JBLOCK));
197 for (bi = 0; bi < compptr->MCU_width; bi++) {
198 coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
199 }
200 }
201 blkn += compptr->MCU_width;
202 ypos += compptr->DCT_v_scaled_size;
203 }
204 }
205 /* Try to write the MCU. In event of a suspension failure, we will
206 * re-DCT the MCU on restart (a bit inefficient, could be fixed...)
207 */
208 if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
209 /* Suspension forced; update state counters and exit */
210 coef->MCU_vert_offset = yoffset;
211 coef->mcu_ctr = MCU_col_num;
212 return FALSE;
213 }
214 }
215 /* Completed an MCU row, but perhaps not an iMCU row */
216 coef->mcu_ctr = 0;
217 }
218 /* Completed the iMCU row, advance counters for next one */
219 coef->iMCU_row_num++;
220 start_iMCU_row(cinfo);
221 return TRUE;
222}
223
224
225#ifdef FULL_COEF_BUFFER_SUPPORTED
226
227/*
228 * Process some data in the first pass of a multi-pass case.
229 * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
230 * per call, ie, v_samp_factor block rows for each component in the image.
231 * This amount of data is read from the source buffer, DCT'd and quantized,
232 * and saved into the virtual arrays. We also generate suitable dummy blocks
233 * as needed at the right and lower edges. (The dummy blocks are constructed
234 * in the virtual arrays, which have been padded appropriately.) This makes
235 * it possible for subsequent passes not to worry about real vs. dummy blocks.
236 *
237 * We must also emit the data to the entropy encoder. This is conveniently
238 * done by calling compress_output() after we've loaded the current strip
239 * of the virtual arrays.
240 *
241 * NB: input_buf contains a plane for each component in image. All
242 * components are DCT'd and loaded into the virtual arrays in this pass.
243 * However, it may be that only a subset of the components are emitted to
244 * the entropy encoder during this first pass; be careful about looking
245 * at the scan-dependent variables (MCU dimensions, etc).
246 */
247
248METHODDEF(boolean)
249compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
250{
251 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
252 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
253 JDIMENSION blocks_across, MCUs_across, MCUindex;
254 int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
255 JCOEF lastDC;
256 jpeg_component_info *compptr;
257 JBLOCKARRAY buffer;
258 JBLOCKROW thisblockrow, lastblockrow;
259 forward_DCT_ptr forward_DCT;
260
261 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
262 ci++, compptr++) {
263 /* Align the virtual buffer for this component. */
264 buffer = (*cinfo->mem->access_virt_barray)
265 ((j_common_ptr) cinfo, coef->whole_image[ci],
266 coef->iMCU_row_num * compptr->v_samp_factor,
267 (JDIMENSION) compptr->v_samp_factor, TRUE);
268 /* Count non-dummy DCT block rows in this iMCU row. */
269 if (coef->iMCU_row_num < last_iMCU_row)
270 block_rows = compptr->v_samp_factor;
271 else {
272 /* NB: can't use last_row_height here, since may not be set! */
273 block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
274 if (block_rows == 0) block_rows = compptr->v_samp_factor;
275 }
276 blocks_across = compptr->width_in_blocks;
277 h_samp_factor = compptr->h_samp_factor;
278 /* Count number of dummy blocks to be added at the right margin. */
279 ndummy = (int) (blocks_across % h_samp_factor);
280 if (ndummy > 0)
281 ndummy = h_samp_factor - ndummy;
282 forward_DCT = cinfo->fdct->forward_DCT[ci];
283 /* Perform DCT for all non-dummy blocks in this iMCU row. Each call
284 * on forward_DCT processes a complete horizontal row of DCT blocks.
285 */
286 for (block_row = 0; block_row < block_rows; block_row++) {
287 thisblockrow = buffer[block_row];
288 (*forward_DCT) (cinfo, compptr, input_buf[ci], thisblockrow,
289 (JDIMENSION) (block_row * compptr->DCT_v_scaled_size),
290 (JDIMENSION) 0, blocks_across);
291 if (ndummy > 0) {
292 /* Create dummy blocks at the right edge of the image. */
293 thisblockrow += blocks_across; /* => first dummy block */
294 FMEMZERO((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
295 lastDC = thisblockrow[-1][0];
296 for (bi = 0; bi < ndummy; bi++) {
297 thisblockrow[bi][0] = lastDC;
298 }
299 }
300 }
301 /* If at end of image, create dummy block rows as needed.
302 * The tricky part here is that within each MCU, we want the DC values
303 * of the dummy blocks to match the last real block's DC value.
304 * This squeezes a few more bytes out of the resulting file...
305 */
306 if (coef->iMCU_row_num == last_iMCU_row) {
307 blocks_across += ndummy; /* include lower right corner */
308 MCUs_across = blocks_across / h_samp_factor;
309 for (block_row = block_rows; block_row < compptr->v_samp_factor;
310 block_row++) {
311 thisblockrow = buffer[block_row];
312 lastblockrow = buffer[block_row-1];
313 FMEMZERO((void FAR *) thisblockrow,
314 (size_t) (blocks_across * SIZEOF(JBLOCK)));
315 for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
316 lastDC = lastblockrow[h_samp_factor-1][0];
317 for (bi = 0; bi < h_samp_factor; bi++) {
318 thisblockrow[bi][0] = lastDC;
319 }
320 thisblockrow += h_samp_factor; /* advance to next MCU in row */
321 lastblockrow += h_samp_factor;
322 }
323 }
324 }
325 }
326 /* NB: compress_output will increment iMCU_row_num if successful.
327 * A suspension return will result in redoing all the work above next time.
328 */
329
330 /* Emit data to the entropy encoder, sharing code with subsequent passes */
331 return compress_output(cinfo, input_buf);
332}
333
334
335/*
336 * Process some data in subsequent passes of a multi-pass case.
337 * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
338 * per call, ie, v_samp_factor block rows for each component in the scan.
339 * The data is obtained from the virtual arrays and fed to the entropy coder.
340 * Returns TRUE if the iMCU row is completed, FALSE if suspended.
341 *
342 * NB: input_buf is ignored; it is likely to be a NULL pointer.
343 */
344
345METHODDEF(boolean)
346compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
347{
348 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
349 JDIMENSION MCU_col_num; /* index of current MCU within row */
350 int blkn, ci, xindex, yindex, yoffset;
351 JDIMENSION start_col;
352 JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
353 JBLOCKROW buffer_ptr;
354 jpeg_component_info *compptr;
355
356 /* Align the virtual buffers for the components used in this scan.
357 * NB: during first pass, this is safe only because the buffers will
358 * already be aligned properly, so jmemmgr.c won't need to do any I/O.
359 */
360 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
361 compptr = cinfo->cur_comp_info[ci];
362 buffer[ci] = (*cinfo->mem->access_virt_barray)
363 ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
364 coef->iMCU_row_num * compptr->v_samp_factor,
365 (JDIMENSION) compptr->v_samp_factor, FALSE);
366 }
367
368 /* Loop to process one whole iMCU row */
369 for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
370 yoffset++) {
371 for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
372 MCU_col_num++) {
373 /* Construct list of pointers to DCT blocks belonging to this MCU */
374 blkn = 0; /* index of current DCT block within MCU */
375 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
376 compptr = cinfo->cur_comp_info[ci];
377 start_col = MCU_col_num * compptr->MCU_width;
378 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
379 buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
380 for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
381 coef->MCU_buffer[blkn++] = buffer_ptr++;
382 }
383 }
384 }
385 /* Try to write the MCU. */
386 if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
387 /* Suspension forced; update state counters and exit */
388 coef->MCU_vert_offset = yoffset;
389 coef->mcu_ctr = MCU_col_num;
390 return FALSE;
391 }
392 }
393 /* Completed an MCU row, but perhaps not an iMCU row */
394 coef->mcu_ctr = 0;
395 }
396 /* Completed the iMCU row, advance counters for next one */
397 coef->iMCU_row_num++;
398 start_iMCU_row(cinfo);
399 return TRUE;
400}
401
402#endif /* FULL_COEF_BUFFER_SUPPORTED */
403
404
405/*
406 * Initialize coefficient buffer controller.
407 */
408
409GLOBAL(void)
410jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
411{
412 my_coef_ptr coef;
413
414 coef = (my_coef_ptr)
415 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
416 SIZEOF(my_coef_controller));
417 cinfo->coef = (struct jpeg_c_coef_controller *) coef;
418 coef->pub.start_pass = start_pass_coef;
419
420 /* Create the coefficient buffer. */
421 if (need_full_buffer) {
422#ifdef FULL_COEF_BUFFER_SUPPORTED
423 /* Allocate a full-image virtual array for each component, */
424 /* padded to a multiple of samp_factor DCT blocks in each direction. */
425 int ci;
426 jpeg_component_info *compptr;
427
428 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
429 ci++, compptr++) {
430 coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
431 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
432 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
433 (long) compptr->h_samp_factor),
434 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
435 (long) compptr->v_samp_factor),
436 (JDIMENSION) compptr->v_samp_factor);
437 }
438#else
439 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
440#endif
441 } else {
442 /* We only need a single-MCU buffer. */
443 JBLOCKROW buffer;
444 int i;
445
446 buffer = (JBLOCKROW)
447 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
448 C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
449 for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
450 coef->MCU_buffer[i] = buffer + i;
451 }
452 coef->whole_image[0] = NULL; /* flag for no virtual arrays */
453 }
454}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccolor.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccolor.c
new file mode 100644
index 0000000..12d35f4
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jccolor.c
@@ -0,0 +1,490 @@
1/*
2 * jccolor.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modified 2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains input colorspace conversion routines.
10 */
11
12#define JPEG_INTERNALS
13#include "jinclude.h"
14#include "jpeglib.h"
15
16
17/* Private subobject */
18
19typedef struct {
20 struct jpeg_color_converter pub; /* public fields */
21
22 /* Private state for RGB->YCC conversion */
23 INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
24} my_color_converter;
25
26typedef my_color_converter * my_cconvert_ptr;
27
28
29/**************** RGB -> YCbCr conversion: most common case **************/
30
31/*
32 * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
33 * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
34 * The conversion equations to be implemented are therefore
35 * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
36 * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
37 * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
38 * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
39 * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
40 * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
41 * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
42 * were not represented exactly. Now we sacrifice exact representation of
43 * maximum red and maximum blue in order to get exact grayscales.
44 *
45 * To avoid floating-point arithmetic, we represent the fractional constants
46 * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
47 * the products by 2^16, with appropriate rounding, to get the correct answer.
48 *
49 * For even more speed, we avoid doing any multiplications in the inner loop
50 * by precalculating the constants times R,G,B for all possible values.
51 * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
52 * for 12-bit samples it is still acceptable. It's not very reasonable for
53 * 16-bit samples, but if you want lossless storage you shouldn't be changing
54 * colorspace anyway.
55 * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
56 * in the tables to save adding them separately in the inner loop.
57 */
58
59#define SCALEBITS 16 /* speediest right-shift on some machines */
60#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
61#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
62#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
63
64/* We allocate one big table and divide it up into eight parts, instead of
65 * doing eight alloc_small requests. This lets us use a single table base
66 * address, which can be held in a register in the inner loops on many
67 * machines (more than can hold all eight addresses, anyway).
68 */
69
70#define R_Y_OFF 0 /* offset to R => Y section */
71#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
72#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
73#define R_CB_OFF (3*(MAXJSAMPLE+1))
74#define G_CB_OFF (4*(MAXJSAMPLE+1))
75#define B_CB_OFF (5*(MAXJSAMPLE+1))
76#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
77#define G_CR_OFF (6*(MAXJSAMPLE+1))
78#define B_CR_OFF (7*(MAXJSAMPLE+1))
79#define TABLE_SIZE (8*(MAXJSAMPLE+1))
80
81
82/*
83 * Initialize for RGB->YCC colorspace conversion.
84 */
85
86METHODDEF(void)
87rgb_ycc_start (j_compress_ptr cinfo)
88{
89 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
90 INT32 * rgb_ycc_tab;
91 INT32 i;
92
93 /* Allocate and fill in the conversion tables. */
94 cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
95 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
96 (TABLE_SIZE * SIZEOF(INT32)));
97
98 for (i = 0; i <= MAXJSAMPLE; i++) {
99 rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
100 rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
101 rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
102 rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
103 rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
104 /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
105 * This ensures that the maximum output will round to MAXJSAMPLE
106 * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
107 */
108 rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
109/* B=>Cb and R=>Cr tables are the same
110 rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
111*/
112 rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
113 rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
114 }
115}
116
117
118/*
119 * Convert some rows of samples to the JPEG colorspace.
120 *
121 * Note that we change from the application's interleaved-pixel format
122 * to our internal noninterleaved, one-plane-per-component format.
123 * The input buffer is therefore three times as wide as the output buffer.
124 *
125 * A starting row offset is provided only for the output buffer. The caller
126 * can easily adjust the passed input_buf value to accommodate any row
127 * offset required on that side.
128 */
129
130METHODDEF(void)
131rgb_ycc_convert (j_compress_ptr cinfo,
132 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
133 JDIMENSION output_row, int num_rows)
134{
135 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
136 register int r, g, b;
137 register INT32 * ctab = cconvert->rgb_ycc_tab;
138 register JSAMPROW inptr;
139 register JSAMPROW outptr0, outptr1, outptr2;
140 register JDIMENSION col;
141 JDIMENSION num_cols = cinfo->image_width;
142
143 while (--num_rows >= 0) {
144 inptr = *input_buf++;
145 outptr0 = output_buf[0][output_row];
146 outptr1 = output_buf[1][output_row];
147 outptr2 = output_buf[2][output_row];
148 output_row++;
149 for (col = 0; col < num_cols; col++) {
150 r = GETJSAMPLE(inptr[RGB_RED]);
151 g = GETJSAMPLE(inptr[RGB_GREEN]);
152 b = GETJSAMPLE(inptr[RGB_BLUE]);
153 inptr += RGB_PIXELSIZE;
154 /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
155 * must be too; we do not need an explicit range-limiting operation.
156 * Hence the value being shifted is never negative, and we don't
157 * need the general RIGHT_SHIFT macro.
158 */
159 /* Y */
160 outptr0[col] = (JSAMPLE)
161 ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
162 >> SCALEBITS);
163 /* Cb */
164 outptr1[col] = (JSAMPLE)
165 ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
166 >> SCALEBITS);
167 /* Cr */
168 outptr2[col] = (JSAMPLE)
169 ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
170 >> SCALEBITS);
171 }
172 }
173}
174
175
176/**************** Cases other than RGB -> YCbCr **************/
177
178
179/*
180 * Convert some rows of samples to the JPEG colorspace.
181 * This version handles RGB->grayscale conversion, which is the same
182 * as the RGB->Y portion of RGB->YCbCr.
183 * We assume rgb_ycc_start has been called (we only use the Y tables).
184 */
185
186METHODDEF(void)
187rgb_gray_convert (j_compress_ptr cinfo,
188 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
189 JDIMENSION output_row, int num_rows)
190{
191 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
192 register int r, g, b;
193 register INT32 * ctab = cconvert->rgb_ycc_tab;
194 register JSAMPROW inptr;
195 register JSAMPROW outptr;
196 register JDIMENSION col;
197 JDIMENSION num_cols = cinfo->image_width;
198
199 while (--num_rows >= 0) {
200 inptr = *input_buf++;
201 outptr = output_buf[0][output_row];
202 output_row++;
203 for (col = 0; col < num_cols; col++) {
204 r = GETJSAMPLE(inptr[RGB_RED]);
205 g = GETJSAMPLE(inptr[RGB_GREEN]);
206 b = GETJSAMPLE(inptr[RGB_BLUE]);
207 inptr += RGB_PIXELSIZE;
208 /* Y */
209 outptr[col] = (JSAMPLE)
210 ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
211 >> SCALEBITS);
212 }
213 }
214}
215
216
217/*
218 * Convert some rows of samples to the JPEG colorspace.
219 * This version handles Adobe-style CMYK->YCCK conversion,
220 * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
221 * conversion as above, while passing K (black) unchanged.
222 * We assume rgb_ycc_start has been called.
223 */
224
225METHODDEF(void)
226cmyk_ycck_convert (j_compress_ptr cinfo,
227 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
228 JDIMENSION output_row, int num_rows)
229{
230 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
231 register int r, g, b;
232 register INT32 * ctab = cconvert->rgb_ycc_tab;
233 register JSAMPROW inptr;
234 register JSAMPROW outptr0, outptr1, outptr2, outptr3;
235 register JDIMENSION col;
236 JDIMENSION num_cols = cinfo->image_width;
237
238 while (--num_rows >= 0) {
239 inptr = *input_buf++;
240 outptr0 = output_buf[0][output_row];
241 outptr1 = output_buf[1][output_row];
242 outptr2 = output_buf[2][output_row];
243 outptr3 = output_buf[3][output_row];
244 output_row++;
245 for (col = 0; col < num_cols; col++) {
246 r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
247 g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
248 b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
249 /* K passes through as-is */
250 outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
251 inptr += 4;
252 /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
253 * must be too; we do not need an explicit range-limiting operation.
254 * Hence the value being shifted is never negative, and we don't
255 * need the general RIGHT_SHIFT macro.
256 */
257 /* Y */
258 outptr0[col] = (JSAMPLE)
259 ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
260 >> SCALEBITS);
261 /* Cb */
262 outptr1[col] = (JSAMPLE)
263 ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
264 >> SCALEBITS);
265 /* Cr */
266 outptr2[col] = (JSAMPLE)
267 ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
268 >> SCALEBITS);
269 }
270 }
271}
272
273
274/*
275 * Convert some rows of samples to the JPEG colorspace.
276 * This version handles grayscale output with no conversion.
277 * The source can be either plain grayscale or YCbCr (since Y == gray).
278 */
279
280METHODDEF(void)
281grayscale_convert (j_compress_ptr cinfo,
282 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
283 JDIMENSION output_row, int num_rows)
284{
285 register JSAMPROW inptr;
286 register JSAMPROW outptr;
287 register JDIMENSION col;
288 JDIMENSION num_cols = cinfo->image_width;
289 int instride = cinfo->input_components;
290
291 while (--num_rows >= 0) {
292 inptr = *input_buf++;
293 outptr = output_buf[0][output_row];
294 output_row++;
295 for (col = 0; col < num_cols; col++) {
296 outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
297 inptr += instride;
298 }
299 }
300}
301
302
303/*
304 * Convert some rows of samples to the JPEG colorspace.
305 * No colorspace conversion, but change from interleaved
306 * to separate-planes representation.
307 */
308
309METHODDEF(void)
310rgb_convert (j_compress_ptr cinfo,
311 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
312 JDIMENSION output_row, int num_rows)
313{
314 register JSAMPROW inptr;
315 register JSAMPROW outptr0, outptr1, outptr2;
316 register JDIMENSION col;
317 JDIMENSION num_cols = cinfo->image_width;
318
319 while (--num_rows >= 0) {
320 inptr = *input_buf++;
321 outptr0 = output_buf[0][output_row];
322 outptr1 = output_buf[1][output_row];
323 outptr2 = output_buf[2][output_row];
324 output_row++;
325 for (col = 0; col < num_cols; col++) {
326 /* We can dispense with GETJSAMPLE() here */
327 outptr0[col] = inptr[RGB_RED];
328 outptr1[col] = inptr[RGB_GREEN];
329 outptr2[col] = inptr[RGB_BLUE];
330 inptr += RGB_PIXELSIZE;
331 }
332 }
333}
334
335
336/*
337 * Convert some rows of samples to the JPEG colorspace.
338 * This version handles multi-component colorspaces without conversion.
339 * We assume input_components == num_components.
340 */
341
342METHODDEF(void)
343null_convert (j_compress_ptr cinfo,
344 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
345 JDIMENSION output_row, int num_rows)
346{
347 register JSAMPROW inptr;
348 register JSAMPROW outptr;
349 register JDIMENSION col;
350 register int ci;
351 int nc = cinfo->num_components;
352 JDIMENSION num_cols = cinfo->image_width;
353
354 while (--num_rows >= 0) {
355 /* It seems fastest to make a separate pass for each component. */
356 for (ci = 0; ci < nc; ci++) {
357 inptr = *input_buf;
358 outptr = output_buf[ci][output_row];
359 for (col = 0; col < num_cols; col++) {
360 outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
361 inptr += nc;
362 }
363 }
364 input_buf++;
365 output_row++;
366 }
367}
368
369
370/*
371 * Empty method for start_pass.
372 */
373
374METHODDEF(void)
375null_method (j_compress_ptr cinfo)
376{
377 /* no work needed */
378}
379
380
381/*
382 * Module initialization routine for input colorspace conversion.
383 */
384
385GLOBAL(void)
386jinit_color_converter (j_compress_ptr cinfo)
387{
388 my_cconvert_ptr cconvert;
389
390 cconvert = (my_cconvert_ptr)
391 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
392 SIZEOF(my_color_converter));
393 cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
394 /* set start_pass to null method until we find out differently */
395 cconvert->pub.start_pass = null_method;
396
397 /* Make sure input_components agrees with in_color_space */
398 switch (cinfo->in_color_space) {
399 case JCS_GRAYSCALE:
400 if (cinfo->input_components != 1)
401 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
402 break;
403
404 case JCS_RGB:
405 if (cinfo->input_components != RGB_PIXELSIZE)
406 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
407 break;
408
409 case JCS_YCbCr:
410 if (cinfo->input_components != 3)
411 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
412 break;
413
414 case JCS_CMYK:
415 case JCS_YCCK:
416 if (cinfo->input_components != 4)
417 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
418 break;
419
420 default: /* JCS_UNKNOWN can be anything */
421 if (cinfo->input_components < 1)
422 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
423 break;
424 }
425
426 /* Check num_components, set conversion method based on requested space */
427 switch (cinfo->jpeg_color_space) {
428 case JCS_GRAYSCALE:
429 if (cinfo->num_components != 1)
430 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
431 if (cinfo->in_color_space == JCS_GRAYSCALE ||
432 cinfo->in_color_space == JCS_YCbCr)
433 cconvert->pub.color_convert = grayscale_convert;
434 else if (cinfo->in_color_space == JCS_RGB) {
435 cconvert->pub.start_pass = rgb_ycc_start;
436 cconvert->pub.color_convert = rgb_gray_convert;
437 } else
438 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
439 break;
440
441 case JCS_RGB:
442 if (cinfo->num_components != 3)
443 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
444 if (cinfo->in_color_space == JCS_RGB)
445 cconvert->pub.color_convert = rgb_convert;
446 else
447 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
448 break;
449
450 case JCS_YCbCr:
451 if (cinfo->num_components != 3)
452 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
453 if (cinfo->in_color_space == JCS_RGB) {
454 cconvert->pub.start_pass = rgb_ycc_start;
455 cconvert->pub.color_convert = rgb_ycc_convert;
456 } else if (cinfo->in_color_space == JCS_YCbCr)
457 cconvert->pub.color_convert = null_convert;
458 else
459 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
460 break;
461
462 case JCS_CMYK:
463 if (cinfo->num_components != 4)
464 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
465 if (cinfo->in_color_space == JCS_CMYK)
466 cconvert->pub.color_convert = null_convert;
467 else
468 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
469 break;
470
471 case JCS_YCCK:
472 if (cinfo->num_components != 4)
473 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
474 if (cinfo->in_color_space == JCS_CMYK) {
475 cconvert->pub.start_pass = rgb_ycc_start;
476 cconvert->pub.color_convert = cmyk_ycck_convert;
477 } else if (cinfo->in_color_space == JCS_YCCK)
478 cconvert->pub.color_convert = null_convert;
479 else
480 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
481 break;
482
483 default: /* allow null conversion of JCS_UNKNOWN */
484 if (cinfo->jpeg_color_space != cinfo->in_color_space ||
485 cinfo->num_components != cinfo->input_components)
486 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
487 cconvert->pub.color_convert = null_convert;
488 break;
489 }
490}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcdctmgr.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcdctmgr.c
new file mode 100644
index 0000000..550b1a6
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcdctmgr.c
@@ -0,0 +1,482 @@
1/*
2 * jcdctmgr.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains the forward-DCT management logic.
9 * This code selects a particular DCT implementation to be used,
10 * and it performs related housekeeping chores including coefficient
11 * quantization.
12 */
13
14#define JPEG_INTERNALS
15#include "jinclude.h"
16#include "jpeglib.h"
17#include "jdct.h" /* Private declarations for DCT subsystem */
18
19
20/* Private subobject for this module */
21
22typedef struct {
23 struct jpeg_forward_dct pub; /* public fields */
24
25 /* Pointer to the DCT routine actually in use */
26 forward_DCT_method_ptr do_dct[MAX_COMPONENTS];
27
28 /* The actual post-DCT divisors --- not identical to the quant table
29 * entries, because of scaling (especially for an unnormalized DCT).
30 * Each table is given in normal array order.
31 */
32 DCTELEM * divisors[NUM_QUANT_TBLS];
33
34#ifdef DCT_FLOAT_SUPPORTED
35 /* Same as above for the floating-point case. */
36 float_DCT_method_ptr do_float_dct[MAX_COMPONENTS];
37 FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
38#endif
39} my_fdct_controller;
40
41typedef my_fdct_controller * my_fdct_ptr;
42
43
44/* The current scaled-DCT routines require ISLOW-style divisor tables,
45 * so be sure to compile that code if either ISLOW or SCALING is requested.
46 */
47#ifdef DCT_ISLOW_SUPPORTED
48#define PROVIDE_ISLOW_TABLES
49#else
50#ifdef DCT_SCALING_SUPPORTED
51#define PROVIDE_ISLOW_TABLES
52#endif
53#endif
54
55
56/*
57 * Perform forward DCT on one or more blocks of a component.
58 *
59 * The input samples are taken from the sample_data[] array starting at
60 * position start_row/start_col, and moving to the right for any additional
61 * blocks. The quantized coefficients are returned in coef_blocks[].
62 */
63
64METHODDEF(void)
65forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
66 JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
67 JDIMENSION start_row, JDIMENSION start_col,
68 JDIMENSION num_blocks)
69/* This version is used for integer DCT implementations. */
70{
71 /* This routine is heavily used, so it's worth coding it tightly. */
72 my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
73 forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index];
74 DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
75 DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
76 JDIMENSION bi;
77
78 sample_data += start_row; /* fold in the vertical offset once */
79
80 for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
81 /* Perform the DCT */
82 (*do_dct) (workspace, sample_data, start_col);
83
84 /* Quantize/descale the coefficients, and store into coef_blocks[] */
85 { register DCTELEM temp, qval;
86 register int i;
87 register JCOEFPTR output_ptr = coef_blocks[bi];
88
89 for (i = 0; i < DCTSIZE2; i++) {
90 qval = divisors[i];
91 temp = workspace[i];
92 /* Divide the coefficient value by qval, ensuring proper rounding.
93 * Since C does not specify the direction of rounding for negative
94 * quotients, we have to force the dividend positive for portability.
95 *
96 * In most files, at least half of the output values will be zero
97 * (at default quantization settings, more like three-quarters...)
98 * so we should ensure that this case is fast. On many machines,
99 * a comparison is enough cheaper than a divide to make a special test
100 * a win. Since both inputs will be nonnegative, we need only test
101 * for a < b to discover whether a/b is 0.
102 * If your machine's division is fast enough, define FAST_DIVIDE.
103 */
104#ifdef FAST_DIVIDE
105#define DIVIDE_BY(a,b) a /= b
106#else
107#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
108#endif
109 if (temp < 0) {
110 temp = -temp;
111 temp += qval>>1; /* for rounding */
112 DIVIDE_BY(temp, qval);
113 temp = -temp;
114 } else {
115 temp += qval>>1; /* for rounding */
116 DIVIDE_BY(temp, qval);
117 }
118 output_ptr[i] = (JCOEF) temp;
119 }
120 }
121 }
122}
123
124
125#ifdef DCT_FLOAT_SUPPORTED
126
127METHODDEF(void)
128forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
129 JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
130 JDIMENSION start_row, JDIMENSION start_col,
131 JDIMENSION num_blocks)
132/* This version is used for floating-point DCT implementations. */
133{
134 /* This routine is heavily used, so it's worth coding it tightly. */
135 my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
136 float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index];
137 FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
138 FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
139 JDIMENSION bi;
140
141 sample_data += start_row; /* fold in the vertical offset once */
142
143 for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
144 /* Perform the DCT */
145 (*do_dct) (workspace, sample_data, start_col);
146
147 /* Quantize/descale the coefficients, and store into coef_blocks[] */
148 { register FAST_FLOAT temp;
149 register int i;
150 register JCOEFPTR output_ptr = coef_blocks[bi];
151
152 for (i = 0; i < DCTSIZE2; i++) {
153 /* Apply the quantization and scaling factor */
154 temp = workspace[i] * divisors[i];
155 /* Round to nearest integer.
156 * Since C does not specify the direction of rounding for negative
157 * quotients, we have to force the dividend positive for portability.
158 * The maximum coefficient size is +-16K (for 12-bit data), so this
159 * code should work for either 16-bit or 32-bit ints.
160 */
161 output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
162 }
163 }
164 }
165}
166
167#endif /* DCT_FLOAT_SUPPORTED */
168
169
170/*
171 * Initialize for a processing pass.
172 * Verify that all referenced Q-tables are present, and set up
173 * the divisor table for each one.
174 * In the current implementation, DCT of all components is done during
175 * the first pass, even if only some components will be output in the
176 * first scan. Hence all components should be examined here.
177 */
178
179METHODDEF(void)
180start_pass_fdctmgr (j_compress_ptr cinfo)
181{
182 my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
183 int ci, qtblno, i;
184 jpeg_component_info *compptr;
185 int method = 0;
186 JQUANT_TBL * qtbl;
187 DCTELEM * dtbl;
188
189 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
190 ci++, compptr++) {
191 /* Select the proper DCT routine for this component's scaling */
192 switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {
193#ifdef DCT_SCALING_SUPPORTED
194 case ((1 << 8) + 1):
195 fdct->do_dct[ci] = jpeg_fdct_1x1;
196 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
197 break;
198 case ((2 << 8) + 2):
199 fdct->do_dct[ci] = jpeg_fdct_2x2;
200 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
201 break;
202 case ((3 << 8) + 3):
203 fdct->do_dct[ci] = jpeg_fdct_3x3;
204 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
205 break;
206 case ((4 << 8) + 4):
207 fdct->do_dct[ci] = jpeg_fdct_4x4;
208 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
209 break;
210 case ((5 << 8) + 5):
211 fdct->do_dct[ci] = jpeg_fdct_5x5;
212 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
213 break;
214 case ((6 << 8) + 6):
215 fdct->do_dct[ci] = jpeg_fdct_6x6;
216 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
217 break;
218 case ((7 << 8) + 7):
219 fdct->do_dct[ci] = jpeg_fdct_7x7;
220 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
221 break;
222 case ((9 << 8) + 9):
223 fdct->do_dct[ci] = jpeg_fdct_9x9;
224 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
225 break;
226 case ((10 << 8) + 10):
227 fdct->do_dct[ci] = jpeg_fdct_10x10;
228 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
229 break;
230 case ((11 << 8) + 11):
231 fdct->do_dct[ci] = jpeg_fdct_11x11;
232 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
233 break;
234 case ((12 << 8) + 12):
235 fdct->do_dct[ci] = jpeg_fdct_12x12;
236 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
237 break;
238 case ((13 << 8) + 13):
239 fdct->do_dct[ci] = jpeg_fdct_13x13;
240 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
241 break;
242 case ((14 << 8) + 14):
243 fdct->do_dct[ci] = jpeg_fdct_14x14;
244 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
245 break;
246 case ((15 << 8) + 15):
247 fdct->do_dct[ci] = jpeg_fdct_15x15;
248 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
249 break;
250 case ((16 << 8) + 16):
251 fdct->do_dct[ci] = jpeg_fdct_16x16;
252 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
253 break;
254 case ((16 << 8) + 8):
255 fdct->do_dct[ci] = jpeg_fdct_16x8;
256 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
257 break;
258 case ((14 << 8) + 7):
259 fdct->do_dct[ci] = jpeg_fdct_14x7;
260 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
261 break;
262 case ((12 << 8) + 6):
263 fdct->do_dct[ci] = jpeg_fdct_12x6;
264 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
265 break;
266 case ((10 << 8) + 5):
267 fdct->do_dct[ci] = jpeg_fdct_10x5;
268 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
269 break;
270 case ((8 << 8) + 4):
271 fdct->do_dct[ci] = jpeg_fdct_8x4;
272 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
273 break;
274 case ((6 << 8) + 3):
275 fdct->do_dct[ci] = jpeg_fdct_6x3;
276 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
277 break;
278 case ((4 << 8) + 2):
279 fdct->do_dct[ci] = jpeg_fdct_4x2;
280 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
281 break;
282 case ((2 << 8) + 1):
283 fdct->do_dct[ci] = jpeg_fdct_2x1;
284 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
285 break;
286 case ((8 << 8) + 16):
287 fdct->do_dct[ci] = jpeg_fdct_8x16;
288 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
289 break;
290 case ((7 << 8) + 14):
291 fdct->do_dct[ci] = jpeg_fdct_7x14;
292 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
293 break;
294 case ((6 << 8) + 12):
295 fdct->do_dct[ci] = jpeg_fdct_6x12;
296 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
297 break;
298 case ((5 << 8) + 10):
299 fdct->do_dct[ci] = jpeg_fdct_5x10;
300 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
301 break;
302 case ((4 << 8) + 8):
303 fdct->do_dct[ci] = jpeg_fdct_4x8;
304 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
305 break;
306 case ((3 << 8) + 6):
307 fdct->do_dct[ci] = jpeg_fdct_3x6;
308 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
309 break;
310 case ((2 << 8) + 4):
311 fdct->do_dct[ci] = jpeg_fdct_2x4;
312 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
313 break;
314 case ((1 << 8) + 2):
315 fdct->do_dct[ci] = jpeg_fdct_1x2;
316 method = JDCT_ISLOW; /* jfdctint uses islow-style table */
317 break;
318#endif
319 case ((DCTSIZE << 8) + DCTSIZE):
320 switch (cinfo->dct_method) {
321#ifdef DCT_ISLOW_SUPPORTED
322 case JDCT_ISLOW:
323 fdct->do_dct[ci] = jpeg_fdct_islow;
324 method = JDCT_ISLOW;
325 break;
326#endif
327#ifdef DCT_IFAST_SUPPORTED
328 case JDCT_IFAST:
329 fdct->do_dct[ci] = jpeg_fdct_ifast;
330 method = JDCT_IFAST;
331 break;
332#endif
333#ifdef DCT_FLOAT_SUPPORTED
334 case JDCT_FLOAT:
335 fdct->do_float_dct[ci] = jpeg_fdct_float;
336 method = JDCT_FLOAT;
337 break;
338#endif
339 default:
340 ERREXIT(cinfo, JERR_NOT_COMPILED);
341 break;
342 }
343 break;
344 default:
345 ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
346 compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);
347 break;
348 }
349 qtblno = compptr->quant_tbl_no;
350 /* Make sure specified quantization table is present */
351 if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
352 cinfo->quant_tbl_ptrs[qtblno] == NULL)
353 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
354 qtbl = cinfo->quant_tbl_ptrs[qtblno];
355 /* Compute divisors for this quant table */
356 /* We may do this more than once for same table, but it's not a big deal */
357 switch (method) {
358#ifdef PROVIDE_ISLOW_TABLES
359 case JDCT_ISLOW:
360 /* For LL&M IDCT method, divisors are equal to raw quantization
361 * coefficients multiplied by 8 (to counteract scaling).
362 */
363 if (fdct->divisors[qtblno] == NULL) {
364 fdct->divisors[qtblno] = (DCTELEM *)
365 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
366 DCTSIZE2 * SIZEOF(DCTELEM));
367 }
368 dtbl = fdct->divisors[qtblno];
369 for (i = 0; i < DCTSIZE2; i++) {
370 dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
371 }
372 fdct->pub.forward_DCT[ci] = forward_DCT;
373 break;
374#endif
375#ifdef DCT_IFAST_SUPPORTED
376 case JDCT_IFAST:
377 {
378 /* For AA&N IDCT method, divisors are equal to quantization
379 * coefficients scaled by scalefactor[row]*scalefactor[col], where
380 * scalefactor[0] = 1
381 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
382 * We apply a further scale factor of 8.
383 */
384#define CONST_BITS 14
385 static const INT16 aanscales[DCTSIZE2] = {
386 /* precomputed values scaled up by 14 bits */
387 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
388 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
389 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
390 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
391 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
392 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
393 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
394 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
395 };
396 SHIFT_TEMPS
397
398 if (fdct->divisors[qtblno] == NULL) {
399 fdct->divisors[qtblno] = (DCTELEM *)
400 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
401 DCTSIZE2 * SIZEOF(DCTELEM));
402 }
403 dtbl = fdct->divisors[qtblno];
404 for (i = 0; i < DCTSIZE2; i++) {
405 dtbl[i] = (DCTELEM)
406 DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
407 (INT32) aanscales[i]),
408 CONST_BITS-3);
409 }
410 }
411 fdct->pub.forward_DCT[ci] = forward_DCT;
412 break;
413#endif
414#ifdef DCT_FLOAT_SUPPORTED
415 case JDCT_FLOAT:
416 {
417 /* For float AA&N IDCT method, divisors are equal to quantization
418 * coefficients scaled by scalefactor[row]*scalefactor[col], where
419 * scalefactor[0] = 1
420 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
421 * We apply a further scale factor of 8.
422 * What's actually stored is 1/divisor so that the inner loop can
423 * use a multiplication rather than a division.
424 */
425 FAST_FLOAT * fdtbl;
426 int row, col;
427 static const double aanscalefactor[DCTSIZE] = {
428 1.0, 1.387039845, 1.306562965, 1.175875602,
429 1.0, 0.785694958, 0.541196100, 0.275899379
430 };
431
432 if (fdct->float_divisors[qtblno] == NULL) {
433 fdct->float_divisors[qtblno] = (FAST_FLOAT *)
434 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
435 DCTSIZE2 * SIZEOF(FAST_FLOAT));
436 }
437 fdtbl = fdct->float_divisors[qtblno];
438 i = 0;
439 for (row = 0; row < DCTSIZE; row++) {
440 for (col = 0; col < DCTSIZE; col++) {
441 fdtbl[i] = (FAST_FLOAT)
442 (1.0 / (((double) qtbl->quantval[i] *
443 aanscalefactor[row] * aanscalefactor[col] * 8.0)));
444 i++;
445 }
446 }
447 }
448 fdct->pub.forward_DCT[ci] = forward_DCT_float;
449 break;
450#endif
451 default:
452 ERREXIT(cinfo, JERR_NOT_COMPILED);
453 break;
454 }
455 }
456}
457
458
459/*
460 * Initialize FDCT manager.
461 */
462
463GLOBAL(void)
464jinit_forward_dct (j_compress_ptr cinfo)
465{
466 my_fdct_ptr fdct;
467 int i;
468
469 fdct = (my_fdct_ptr)
470 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
471 SIZEOF(my_fdct_controller));
472 cinfo->fdct = (struct jpeg_forward_dct *) fdct;
473 fdct->pub.start_pass = start_pass_fdctmgr;
474
475 /* Mark divisor tables unallocated */
476 for (i = 0; i < NUM_QUANT_TBLS; i++) {
477 fdct->divisors[i] = NULL;
478#ifdef DCT_FLOAT_SUPPORTED
479 fdct->float_divisors[i] = NULL;
480#endif
481 }
482}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jchuff.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jchuff.c
new file mode 100644
index 0000000..4cbab43
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jchuff.c
@@ -0,0 +1,1576 @@
1/*
2 * jchuff.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2006-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains Huffman entropy encoding routines.
10 * Both sequential and progressive modes are supported in this single module.
11 *
12 * Much of the complexity here has to do with supporting output suspension.
13 * If the data destination module demands suspension, we want to be able to
14 * back up to the start of the current MCU. To do this, we copy state
15 * variables into local working storage, and update them back to the
16 * permanent JPEG objects only upon successful completion of an MCU.
17 *
18 * We do not support output suspension for the progressive JPEG mode, since
19 * the library currently does not allow multiple-scan files to be written
20 * with output suspension.
21 */
22
23#define JPEG_INTERNALS
24#include "jinclude.h"
25#include "jpeglib.h"
26
27
28/* The legal range of a DCT coefficient is
29 * -1024 .. +1023 for 8-bit data;
30 * -16384 .. +16383 for 12-bit data.
31 * Hence the magnitude should always fit in 10 or 14 bits respectively.
32 */
33
34#if BITS_IN_JSAMPLE == 8
35#define MAX_COEF_BITS 10
36#else
37#define MAX_COEF_BITS 14
38#endif
39
40/* Derived data constructed for each Huffman table */
41
42typedef struct {
43 unsigned int ehufco[256]; /* code for each symbol */
44 char ehufsi[256]; /* length of code for each symbol */
45 /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
46} c_derived_tbl;
47
48
49/* Expanded entropy encoder object for Huffman encoding.
50 *
51 * The savable_state subrecord contains fields that change within an MCU,
52 * but must not be updated permanently until we complete the MCU.
53 */
54
55typedef struct {
56 INT32 put_buffer; /* current bit-accumulation buffer */
57 int put_bits; /* # of bits now in it */
58 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
59} savable_state;
60
61/* This macro is to work around compilers with missing or broken
62 * structure assignment. You'll need to fix this code if you have
63 * such a compiler and you change MAX_COMPS_IN_SCAN.
64 */
65
66#ifndef NO_STRUCT_ASSIGN
67#define ASSIGN_STATE(dest,src) ((dest) = (src))
68#else
69#if MAX_COMPS_IN_SCAN == 4
70#define ASSIGN_STATE(dest,src) \
71 ((dest).put_buffer = (src).put_buffer, \
72 (dest).put_bits = (src).put_bits, \
73 (dest).last_dc_val[0] = (src).last_dc_val[0], \
74 (dest).last_dc_val[1] = (src).last_dc_val[1], \
75 (dest).last_dc_val[2] = (src).last_dc_val[2], \
76 (dest).last_dc_val[3] = (src).last_dc_val[3])
77#endif
78#endif
79
80
81typedef struct {
82 struct jpeg_entropy_encoder pub; /* public fields */
83
84 savable_state saved; /* Bit buffer & DC state at start of MCU */
85
86 /* These fields are NOT loaded into local working state. */
87 unsigned int restarts_to_go; /* MCUs left in this restart interval */
88 int next_restart_num; /* next restart number to write (0-7) */
89
90 /* Pointers to derived tables (these workspaces have image lifespan) */
91 c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
92 c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
93
94 /* Statistics tables for optimization */
95 long * dc_count_ptrs[NUM_HUFF_TBLS];
96 long * ac_count_ptrs[NUM_HUFF_TBLS];
97
98 /* Following fields used only in progressive mode */
99
100 /* Mode flag: TRUE for optimization, FALSE for actual data output */
101 boolean gather_statistics;
102
103 /* next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
104 */
105 JOCTET * next_output_byte; /* => next byte to write in buffer */
106 size_t free_in_buffer; /* # of byte spaces remaining in buffer */
107 j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */
108
109 /* Coding status for AC components */
110 int ac_tbl_no; /* the table number of the single component */
111 unsigned int EOBRUN; /* run length of EOBs */
112 unsigned int BE; /* # of buffered correction bits before MCU */
113 char * bit_buffer; /* buffer for correction bits (1 per char) */
114 /* packing correction bits tightly would save some space but cost time... */
115} huff_entropy_encoder;
116
117typedef huff_entropy_encoder * huff_entropy_ptr;
118
119/* Working state while writing an MCU (sequential mode).
120 * This struct contains all the fields that are needed by subroutines.
121 */
122
123typedef struct {
124 JOCTET * next_output_byte; /* => next byte to write in buffer */
125 size_t free_in_buffer; /* # of byte spaces remaining in buffer */
126 savable_state cur; /* Current bit buffer & DC state */
127 j_compress_ptr cinfo; /* dump_buffer needs access to this */
128} working_state;
129
130/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
131 * buffer can hold. Larger sizes may slightly improve compression, but
132 * 1000 is already well into the realm of overkill.
133 * The minimum safe size is 64 bits.
134 */
135
136#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */
137
138/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
139 * We assume that int right shift is unsigned if INT32 right shift is,
140 * which should be safe.
141 */
142
143#ifdef RIGHT_SHIFT_IS_UNSIGNED
144#define ISHIFT_TEMPS int ishift_temp;
145#define IRIGHT_SHIFT(x,shft) \
146 ((ishift_temp = (x)) < 0 ? \
147 (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
148 (ishift_temp >> (shft)))
149#else
150#define ISHIFT_TEMPS
151#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
152#endif
153
154
155/*
156 * Compute the derived values for a Huffman table.
157 * This routine also performs some validation checks on the table.
158 */
159
160LOCAL(void)
161jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
162 c_derived_tbl ** pdtbl)
163{
164 JHUFF_TBL *htbl;
165 c_derived_tbl *dtbl;
166 int p, i, l, lastp, si, maxsymbol;
167 char huffsize[257];
168 unsigned int huffcode[257];
169 unsigned int code;
170
171 /* Note that huffsize[] and huffcode[] are filled in code-length order,
172 * paralleling the order of the symbols themselves in htbl->huffval[].
173 */
174
175 /* Find the input Huffman table */
176 if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
177 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
178 htbl =
179 isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
180 if (htbl == NULL)
181 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
182
183 /* Allocate a workspace if we haven't already done so. */
184 if (*pdtbl == NULL)
185 *pdtbl = (c_derived_tbl *)
186 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
187 SIZEOF(c_derived_tbl));
188 dtbl = *pdtbl;
189
190 /* Figure C.1: make table of Huffman code length for each symbol */
191
192 p = 0;
193 for (l = 1; l <= 16; l++) {
194 i = (int) htbl->bits[l];
195 if (i < 0 || p + i > 256) /* protect against table overrun */
196 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
197 while (i--)
198 huffsize[p++] = (char) l;
199 }
200 huffsize[p] = 0;
201 lastp = p;
202
203 /* Figure C.2: generate the codes themselves */
204 /* We also validate that the counts represent a legal Huffman code tree. */
205
206 code = 0;
207 si = huffsize[0];
208 p = 0;
209 while (huffsize[p]) {
210 while (((int) huffsize[p]) == si) {
211 huffcode[p++] = code;
212 code++;
213 }
214 /* code is now 1 more than the last code used for codelength si; but
215 * it must still fit in si bits, since no code is allowed to be all ones.
216 */
217 if (((INT32) code) >= (((INT32) 1) << si))
218 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
219 code <<= 1;
220 si++;
221 }
222
223 /* Figure C.3: generate encoding tables */
224 /* These are code and size indexed by symbol value */
225
226 /* Set all codeless symbols to have code length 0;
227 * this lets us detect duplicate VAL entries here, and later
228 * allows emit_bits to detect any attempt to emit such symbols.
229 */
230 MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
231
232 /* This is also a convenient place to check for out-of-range
233 * and duplicated VAL entries. We allow 0..255 for AC symbols
234 * but only 0..15 for DC. (We could constrain them further
235 * based on data depth and mode, but this seems enough.)
236 */
237 maxsymbol = isDC ? 15 : 255;
238
239 for (p = 0; p < lastp; p++) {
240 i = htbl->huffval[p];
241 if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])
242 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
243 dtbl->ehufco[i] = huffcode[p];
244 dtbl->ehufsi[i] = huffsize[p];
245 }
246}
247
248
249/* Outputting bytes to the file.
250 * NB: these must be called only when actually outputting,
251 * that is, entropy->gather_statistics == FALSE.
252 */
253
254/* Emit a byte, taking 'action' if must suspend. */
255#define emit_byte_s(state,val,action) \
256 { *(state)->next_output_byte++ = (JOCTET) (val); \
257 if (--(state)->free_in_buffer == 0) \
258 if (! dump_buffer_s(state)) \
259 { action; } }
260
261/* Emit a byte */
262#define emit_byte_e(entropy,val) \
263 { *(entropy)->next_output_byte++ = (JOCTET) (val); \
264 if (--(entropy)->free_in_buffer == 0) \
265 dump_buffer_e(entropy); }
266
267
268LOCAL(boolean)
269dump_buffer_s (working_state * state)
270/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
271{
272 struct jpeg_destination_mgr * dest = state->cinfo->dest;
273
274 if (! (*dest->empty_output_buffer) (state->cinfo))
275 return FALSE;
276 /* After a successful buffer dump, must reset buffer pointers */
277 state->next_output_byte = dest->next_output_byte;
278 state->free_in_buffer = dest->free_in_buffer;
279 return TRUE;
280}
281
282
283LOCAL(void)
284dump_buffer_e (huff_entropy_ptr entropy)
285/* Empty the output buffer; we do not support suspension in this case. */
286{
287 struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
288
289 if (! (*dest->empty_output_buffer) (entropy->cinfo))
290 ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
291 /* After a successful buffer dump, must reset buffer pointers */
292 entropy->next_output_byte = dest->next_output_byte;
293 entropy->free_in_buffer = dest->free_in_buffer;
294}
295
296
297/* Outputting bits to the file */
298
299/* Only the right 24 bits of put_buffer are used; the valid bits are
300 * left-justified in this part. At most 16 bits can be passed to emit_bits
301 * in one call, and we never retain more than 7 bits in put_buffer
302 * between calls, so 24 bits are sufficient.
303 */
304
305INLINE
306LOCAL(boolean)
307emit_bits_s (working_state * state, unsigned int code, int size)
308/* Emit some bits; return TRUE if successful, FALSE if must suspend */
309{
310 /* This routine is heavily used, so it's worth coding tightly. */
311 register INT32 put_buffer = (INT32) code;
312 register int put_bits = state->cur.put_bits;
313
314 /* if size is 0, caller used an invalid Huffman table entry */
315 if (size == 0)
316 ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
317
318 put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
319
320 put_bits += size; /* new number of bits in buffer */
321
322 put_buffer <<= 24 - put_bits; /* align incoming bits */
323
324 put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
325
326 while (put_bits >= 8) {
327 int c = (int) ((put_buffer >> 16) & 0xFF);
328
329 emit_byte_s(state, c, return FALSE);
330 if (c == 0xFF) { /* need to stuff a zero byte? */
331 emit_byte_s(state, 0, return FALSE);
332 }
333 put_buffer <<= 8;
334 put_bits -= 8;
335 }
336
337 state->cur.put_buffer = put_buffer; /* update state variables */
338 state->cur.put_bits = put_bits;
339
340 return TRUE;
341}
342
343
344INLINE
345LOCAL(void)
346emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size)
347/* Emit some bits, unless we are in gather mode */
348{
349 /* This routine is heavily used, so it's worth coding tightly. */
350 register INT32 put_buffer = (INT32) code;
351 register int put_bits = entropy->saved.put_bits;
352
353 /* if size is 0, caller used an invalid Huffman table entry */
354 if (size == 0)
355 ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
356
357 if (entropy->gather_statistics)
358 return; /* do nothing if we're only getting stats */
359
360 put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
361
362 put_bits += size; /* new number of bits in buffer */
363
364 put_buffer <<= 24 - put_bits; /* align incoming bits */
365
366 /* and merge with old buffer contents */
367 put_buffer |= entropy->saved.put_buffer;
368
369 while (put_bits >= 8) {
370 int c = (int) ((put_buffer >> 16) & 0xFF);
371
372 emit_byte_e(entropy, c);
373 if (c == 0xFF) { /* need to stuff a zero byte? */
374 emit_byte_e(entropy, 0);
375 }
376 put_buffer <<= 8;
377 put_bits -= 8;
378 }
379
380 entropy->saved.put_buffer = put_buffer; /* update variables */
381 entropy->saved.put_bits = put_bits;
382}
383
384
385LOCAL(boolean)
386flush_bits_s (working_state * state)
387{
388 if (! emit_bits_s(state, 0x7F, 7)) /* fill any partial byte with ones */
389 return FALSE;
390 state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
391 state->cur.put_bits = 0;
392 return TRUE;
393}
394
395
396LOCAL(void)
397flush_bits_e (huff_entropy_ptr entropy)
398{
399 emit_bits_e(entropy, 0x7F, 7); /* fill any partial byte with ones */
400 entropy->saved.put_buffer = 0; /* and reset bit-buffer to empty */
401 entropy->saved.put_bits = 0;
402}
403
404
405/*
406 * Emit (or just count) a Huffman symbol.
407 */
408
409INLINE
410LOCAL(void)
411emit_dc_symbol (huff_entropy_ptr entropy, int tbl_no, int symbol)
412{
413 if (entropy->gather_statistics)
414 entropy->dc_count_ptrs[tbl_no][symbol]++;
415 else {
416 c_derived_tbl * tbl = entropy->dc_derived_tbls[tbl_no];
417 emit_bits_e(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
418 }
419}
420
421
422INLINE
423LOCAL(void)
424emit_ac_symbol (huff_entropy_ptr entropy, int tbl_no, int symbol)
425{
426 if (entropy->gather_statistics)
427 entropy->ac_count_ptrs[tbl_no][symbol]++;
428 else {
429 c_derived_tbl * tbl = entropy->ac_derived_tbls[tbl_no];
430 emit_bits_e(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
431 }
432}
433
434
435/*
436 * Emit bits from a correction bit buffer.
437 */
438
439LOCAL(void)
440emit_buffered_bits (huff_entropy_ptr entropy, char * bufstart,
441 unsigned int nbits)
442{
443 if (entropy->gather_statistics)
444 return; /* no real work */
445
446 while (nbits > 0) {
447 emit_bits_e(entropy, (unsigned int) (*bufstart), 1);
448 bufstart++;
449 nbits--;
450 }
451}
452
453
454/*
455 * Emit any pending EOBRUN symbol.
456 */
457
458LOCAL(void)
459emit_eobrun (huff_entropy_ptr entropy)
460{
461 register int temp, nbits;
462
463 if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */
464 temp = entropy->EOBRUN;
465 nbits = 0;
466 while ((temp >>= 1))
467 nbits++;
468 /* safety check: shouldn't happen given limited correction-bit buffer */
469 if (nbits > 14)
470 ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
471
472 emit_ac_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
473 if (nbits)
474 emit_bits_e(entropy, entropy->EOBRUN, nbits);
475
476 entropy->EOBRUN = 0;
477
478 /* Emit any buffered correction bits */
479 emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
480 entropy->BE = 0;
481 }
482}
483
484
485/*
486 * Emit a restart marker & resynchronize predictions.
487 */
488
489LOCAL(boolean)
490emit_restart_s (working_state * state, int restart_num)
491{
492 int ci;
493
494 if (! flush_bits_s(state))
495 return FALSE;
496
497 emit_byte_s(state, 0xFF, return FALSE);
498 emit_byte_s(state, JPEG_RST0 + restart_num, return FALSE);
499
500 /* Re-initialize DC predictions to 0 */
501 for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
502 state->cur.last_dc_val[ci] = 0;
503
504 /* The restart counter is not updated until we successfully write the MCU. */
505
506 return TRUE;
507}
508
509
510LOCAL(void)
511emit_restart_e (huff_entropy_ptr entropy, int restart_num)
512{
513 int ci;
514
515 emit_eobrun(entropy);
516
517 if (! entropy->gather_statistics) {
518 flush_bits_e(entropy);
519 emit_byte_e(entropy, 0xFF);
520 emit_byte_e(entropy, JPEG_RST0 + restart_num);
521 }
522
523 if (entropy->cinfo->Ss == 0) {
524 /* Re-initialize DC predictions to 0 */
525 for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
526 entropy->saved.last_dc_val[ci] = 0;
527 } else {
528 /* Re-initialize all AC-related fields to 0 */
529 entropy->EOBRUN = 0;
530 entropy->BE = 0;
531 }
532}
533
534
535/*
536 * MCU encoding for DC initial scan (either spectral selection,
537 * or first pass of successive approximation).
538 */
539
540METHODDEF(boolean)
541encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
542{
543 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
544 register int temp, temp2;
545 register int nbits;
546 int blkn, ci;
547 int Al = cinfo->Al;
548 JBLOCKROW block;
549 jpeg_component_info * compptr;
550 ISHIFT_TEMPS
551
552 entropy->next_output_byte = cinfo->dest->next_output_byte;
553 entropy->free_in_buffer = cinfo->dest->free_in_buffer;
554
555 /* Emit restart marker if needed */
556 if (cinfo->restart_interval)
557 if (entropy->restarts_to_go == 0)
558 emit_restart_e(entropy, entropy->next_restart_num);
559
560 /* Encode the MCU data blocks */
561 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
562 block = MCU_data[blkn];
563 ci = cinfo->MCU_membership[blkn];
564 compptr = cinfo->cur_comp_info[ci];
565
566 /* Compute the DC value after the required point transform by Al.
567 * This is simply an arithmetic right shift.
568 */
569 temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
570
571 /* DC differences are figured on the point-transformed values. */
572 temp = temp2 - entropy->saved.last_dc_val[ci];
573 entropy->saved.last_dc_val[ci] = temp2;
574
575 /* Encode the DC coefficient difference per section G.1.2.1 */
576 temp2 = temp;
577 if (temp < 0) {
578 temp = -temp; /* temp is abs value of input */
579 /* For a negative input, want temp2 = bitwise complement of abs(input) */
580 /* This code assumes we are on a two's complement machine */
581 temp2--;
582 }
583
584 /* Find the number of bits needed for the magnitude of the coefficient */
585 nbits = 0;
586 while (temp) {
587 nbits++;
588 temp >>= 1;
589 }
590 /* Check for out-of-range coefficient values.
591 * Since we're encoding a difference, the range limit is twice as much.
592 */
593 if (nbits > MAX_COEF_BITS+1)
594 ERREXIT(cinfo, JERR_BAD_DCT_COEF);
595
596 /* Count/emit the Huffman-coded symbol for the number of bits */
597 emit_dc_symbol(entropy, compptr->dc_tbl_no, nbits);
598
599 /* Emit that number of bits of the value, if positive, */
600 /* or the complement of its magnitude, if negative. */
601 if (nbits) /* emit_bits rejects calls with size 0 */
602 emit_bits_e(entropy, (unsigned int) temp2, nbits);
603 }
604
605 cinfo->dest->next_output_byte = entropy->next_output_byte;
606 cinfo->dest->free_in_buffer = entropy->free_in_buffer;
607
608 /* Update restart-interval state too */
609 if (cinfo->restart_interval) {
610 if (entropy->restarts_to_go == 0) {
611 entropy->restarts_to_go = cinfo->restart_interval;
612 entropy->next_restart_num++;
613 entropy->next_restart_num &= 7;
614 }
615 entropy->restarts_to_go--;
616 }
617
618 return TRUE;
619}
620
621
622/*
623 * MCU encoding for AC initial scan (either spectral selection,
624 * or first pass of successive approximation).
625 */
626
627METHODDEF(boolean)
628encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
629{
630 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
631 register int temp, temp2;
632 register int nbits;
633 register int r, k;
634 int Se, Al;
635 const int * natural_order;
636 JBLOCKROW block;
637
638 entropy->next_output_byte = cinfo->dest->next_output_byte;
639 entropy->free_in_buffer = cinfo->dest->free_in_buffer;
640
641 /* Emit restart marker if needed */
642 if (cinfo->restart_interval)
643 if (entropy->restarts_to_go == 0)
644 emit_restart_e(entropy, entropy->next_restart_num);
645
646 Se = cinfo->Se;
647 Al = cinfo->Al;
648 natural_order = cinfo->natural_order;
649
650 /* Encode the MCU data block */
651 block = MCU_data[0];
652
653 /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
654
655 r = 0; /* r = run length of zeros */
656
657 for (k = cinfo->Ss; k <= Se; k++) {
658 if ((temp = (*block)[natural_order[k]]) == 0) {
659 r++;
660 continue;
661 }
662 /* We must apply the point transform by Al. For AC coefficients this
663 * is an integer division with rounding towards 0. To do this portably
664 * in C, we shift after obtaining the absolute value; so the code is
665 * interwoven with finding the abs value (temp) and output bits (temp2).
666 */
667 if (temp < 0) {
668 temp = -temp; /* temp is abs value of input */
669 temp >>= Al; /* apply the point transform */
670 /* For a negative coef, want temp2 = bitwise complement of abs(coef) */
671 temp2 = ~temp;
672 } else {
673 temp >>= Al; /* apply the point transform */
674 temp2 = temp;
675 }
676 /* Watch out for case that nonzero coef is zero after point transform */
677 if (temp == 0) {
678 r++;
679 continue;
680 }
681
682 /* Emit any pending EOBRUN */
683 if (entropy->EOBRUN > 0)
684 emit_eobrun(entropy);
685 /* if run length > 15, must emit special run-length-16 codes (0xF0) */
686 while (r > 15) {
687 emit_ac_symbol(entropy, entropy->ac_tbl_no, 0xF0);
688 r -= 16;
689 }
690
691 /* Find the number of bits needed for the magnitude of the coefficient */
692 nbits = 1; /* there must be at least one 1 bit */
693 while ((temp >>= 1))
694 nbits++;
695 /* Check for out-of-range coefficient values */
696 if (nbits > MAX_COEF_BITS)
697 ERREXIT(cinfo, JERR_BAD_DCT_COEF);
698
699 /* Count/emit Huffman symbol for run length / number of bits */
700 emit_ac_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
701
702 /* Emit that number of bits of the value, if positive, */
703 /* or the complement of its magnitude, if negative. */
704 emit_bits_e(entropy, (unsigned int) temp2, nbits);
705
706 r = 0; /* reset zero run length */
707 }
708
709 if (r > 0) { /* If there are trailing zeroes, */
710 entropy->EOBRUN++; /* count an EOB */
711 if (entropy->EOBRUN == 0x7FFF)
712 emit_eobrun(entropy); /* force it out to avoid overflow */
713 }
714
715 cinfo->dest->next_output_byte = entropy->next_output_byte;
716 cinfo->dest->free_in_buffer = entropy->free_in_buffer;
717
718 /* Update restart-interval state too */
719 if (cinfo->restart_interval) {
720 if (entropy->restarts_to_go == 0) {
721 entropy->restarts_to_go = cinfo->restart_interval;
722 entropy->next_restart_num++;
723 entropy->next_restart_num &= 7;
724 }
725 entropy->restarts_to_go--;
726 }
727
728 return TRUE;
729}
730
731
732/*
733 * MCU encoding for DC successive approximation refinement scan.
734 * Note: we assume such scans can be multi-component, although the spec
735 * is not very clear on the point.
736 */
737
738METHODDEF(boolean)
739encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
740{
741 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
742 register int temp;
743 int blkn;
744 int Al = cinfo->Al;
745 JBLOCKROW block;
746
747 entropy->next_output_byte = cinfo->dest->next_output_byte;
748 entropy->free_in_buffer = cinfo->dest->free_in_buffer;
749
750 /* Emit restart marker if needed */
751 if (cinfo->restart_interval)
752 if (entropy->restarts_to_go == 0)
753 emit_restart_e(entropy, entropy->next_restart_num);
754
755 /* Encode the MCU data blocks */
756 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
757 block = MCU_data[blkn];
758
759 /* We simply emit the Al'th bit of the DC coefficient value. */
760 temp = (*block)[0];
761 emit_bits_e(entropy, (unsigned int) (temp >> Al), 1);
762 }
763
764 cinfo->dest->next_output_byte = entropy->next_output_byte;
765 cinfo->dest->free_in_buffer = entropy->free_in_buffer;
766
767 /* Update restart-interval state too */
768 if (cinfo->restart_interval) {
769 if (entropy->restarts_to_go == 0) {
770 entropy->restarts_to_go = cinfo->restart_interval;
771 entropy->next_restart_num++;
772 entropy->next_restart_num &= 7;
773 }
774 entropy->restarts_to_go--;
775 }
776
777 return TRUE;
778}
779
780
781/*
782 * MCU encoding for AC successive approximation refinement scan.
783 */
784
785METHODDEF(boolean)
786encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
787{
788 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
789 register int temp;
790 register int r, k;
791 int EOB;
792 char *BR_buffer;
793 unsigned int BR;
794 int Se, Al;
795 const int * natural_order;
796 JBLOCKROW block;
797 int absvalues[DCTSIZE2];
798
799 entropy->next_output_byte = cinfo->dest->next_output_byte;
800 entropy->free_in_buffer = cinfo->dest->free_in_buffer;
801
802 /* Emit restart marker if needed */
803 if (cinfo->restart_interval)
804 if (entropy->restarts_to_go == 0)
805 emit_restart_e(entropy, entropy->next_restart_num);
806
807 Se = cinfo->Se;
808 Al = cinfo->Al;
809 natural_order = cinfo->natural_order;
810
811 /* Encode the MCU data block */
812 block = MCU_data[0];
813
814 /* It is convenient to make a pre-pass to determine the transformed
815 * coefficients' absolute values and the EOB position.
816 */
817 EOB = 0;
818 for (k = cinfo->Ss; k <= Se; k++) {
819 temp = (*block)[natural_order[k]];
820 /* We must apply the point transform by Al. For AC coefficients this
821 * is an integer division with rounding towards 0. To do this portably
822 * in C, we shift after obtaining the absolute value.
823 */
824 if (temp < 0)
825 temp = -temp; /* temp is abs value of input */
826 temp >>= Al; /* apply the point transform */
827 absvalues[k] = temp; /* save abs value for main pass */
828 if (temp == 1)
829 EOB = k; /* EOB = index of last newly-nonzero coef */
830 }
831
832 /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
833
834 r = 0; /* r = run length of zeros */
835 BR = 0; /* BR = count of buffered bits added now */
836 BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
837
838 for (k = cinfo->Ss; k <= Se; k++) {
839 if ((temp = absvalues[k]) == 0) {
840 r++;
841 continue;
842 }
843
844 /* Emit any required ZRLs, but not if they can be folded into EOB */
845 while (r > 15 && k <= EOB) {
846 /* emit any pending EOBRUN and the BE correction bits */
847 emit_eobrun(entropy);
848 /* Emit ZRL */
849 emit_ac_symbol(entropy, entropy->ac_tbl_no, 0xF0);
850 r -= 16;
851 /* Emit buffered correction bits that must be associated with ZRL */
852 emit_buffered_bits(entropy, BR_buffer, BR);
853 BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
854 BR = 0;
855 }
856
857 /* If the coef was previously nonzero, it only needs a correction bit.
858 * NOTE: a straight translation of the spec's figure G.7 would suggest
859 * that we also need to test r > 15. But if r > 15, we can only get here
860 * if k > EOB, which implies that this coefficient is not 1.
861 */
862 if (temp > 1) {
863 /* The correction bit is the next bit of the absolute value. */
864 BR_buffer[BR++] = (char) (temp & 1);
865 continue;
866 }
867
868 /* Emit any pending EOBRUN and the BE correction bits */
869 emit_eobrun(entropy);
870
871 /* Count/emit Huffman symbol for run length / number of bits */
872 emit_ac_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
873
874 /* Emit output bit for newly-nonzero coef */
875 temp = ((*block)[natural_order[k]] < 0) ? 0 : 1;
876 emit_bits_e(entropy, (unsigned int) temp, 1);
877
878 /* Emit buffered correction bits that must be associated with this code */
879 emit_buffered_bits(entropy, BR_buffer, BR);
880 BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
881 BR = 0;
882 r = 0; /* reset zero run length */
883 }
884
885 if (r > 0 || BR > 0) { /* If there are trailing zeroes, */
886 entropy->EOBRUN++; /* count an EOB */
887 entropy->BE += BR; /* concat my correction bits to older ones */
888 /* We force out the EOB if we risk either:
889 * 1. overflow of the EOB counter;
890 * 2. overflow of the correction bit buffer during the next MCU.
891 */
892 if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
893 emit_eobrun(entropy);
894 }
895
896 cinfo->dest->next_output_byte = entropy->next_output_byte;
897 cinfo->dest->free_in_buffer = entropy->free_in_buffer;
898
899 /* Update restart-interval state too */
900 if (cinfo->restart_interval) {
901 if (entropy->restarts_to_go == 0) {
902 entropy->restarts_to_go = cinfo->restart_interval;
903 entropy->next_restart_num++;
904 entropy->next_restart_num &= 7;
905 }
906 entropy->restarts_to_go--;
907 }
908
909 return TRUE;
910}
911
912
913/* Encode a single block's worth of coefficients */
914
915LOCAL(boolean)
916encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
917 c_derived_tbl *dctbl, c_derived_tbl *actbl)
918{
919 register int temp, temp2;
920 register int nbits;
921 register int k, r, i;
922 int Se = state->cinfo->lim_Se;
923 const int * natural_order = state->cinfo->natural_order;
924
925 /* Encode the DC coefficient difference per section F.1.2.1 */
926
927 temp = temp2 = block[0] - last_dc_val;
928
929 if (temp < 0) {
930 temp = -temp; /* temp is abs value of input */
931 /* For a negative input, want temp2 = bitwise complement of abs(input) */
932 /* This code assumes we are on a two's complement machine */
933 temp2--;
934 }
935
936 /* Find the number of bits needed for the magnitude of the coefficient */
937 nbits = 0;
938 while (temp) {
939 nbits++;
940 temp >>= 1;
941 }
942 /* Check for out-of-range coefficient values.
943 * Since we're encoding a difference, the range limit is twice as much.
944 */
945 if (nbits > MAX_COEF_BITS+1)
946 ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
947
948 /* Emit the Huffman-coded symbol for the number of bits */
949 if (! emit_bits_s(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
950 return FALSE;
951
952 /* Emit that number of bits of the value, if positive, */
953 /* or the complement of its magnitude, if negative. */
954 if (nbits) /* emit_bits rejects calls with size 0 */
955 if (! emit_bits_s(state, (unsigned int) temp2, nbits))
956 return FALSE;
957
958 /* Encode the AC coefficients per section F.1.2.2 */
959
960 r = 0; /* r = run length of zeros */
961
962 for (k = 1; k <= Se; k++) {
963 if ((temp = block[natural_order[k]]) == 0) {
964 r++;
965 } else {
966 /* if run length > 15, must emit special run-length-16 codes (0xF0) */
967 while (r > 15) {
968 if (! emit_bits_s(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
969 return FALSE;
970 r -= 16;
971 }
972
973 temp2 = temp;
974 if (temp < 0) {
975 temp = -temp; /* temp is abs value of input */
976 /* This code assumes we are on a two's complement machine */
977 temp2--;
978 }
979
980 /* Find the number of bits needed for the magnitude of the coefficient */
981 nbits = 1; /* there must be at least one 1 bit */
982 while ((temp >>= 1))
983 nbits++;
984 /* Check for out-of-range coefficient values */
985 if (nbits > MAX_COEF_BITS)
986 ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
987
988 /* Emit Huffman symbol for run length / number of bits */
989 i = (r << 4) + nbits;
990 if (! emit_bits_s(state, actbl->ehufco[i], actbl->ehufsi[i]))
991 return FALSE;
992
993 /* Emit that number of bits of the value, if positive, */
994 /* or the complement of its magnitude, if negative. */
995 if (! emit_bits_s(state, (unsigned int) temp2, nbits))
996 return FALSE;
997
998 r = 0;
999 }
1000 }
1001
1002 /* If the last coef(s) were zero, emit an end-of-block code */
1003 if (r > 0)
1004 if (! emit_bits_s(state, actbl->ehufco[0], actbl->ehufsi[0]))
1005 return FALSE;
1006
1007 return TRUE;
1008}
1009
1010
1011/*
1012 * Encode and output one MCU's worth of Huffman-compressed coefficients.
1013 */
1014
1015METHODDEF(boolean)
1016encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
1017{
1018 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1019 working_state state;
1020 int blkn, ci;
1021 jpeg_component_info * compptr;
1022
1023 /* Load up working state */
1024 state.next_output_byte = cinfo->dest->next_output_byte;
1025 state.free_in_buffer = cinfo->dest->free_in_buffer;
1026 ASSIGN_STATE(state.cur, entropy->saved);
1027 state.cinfo = cinfo;
1028
1029 /* Emit restart marker if needed */
1030 if (cinfo->restart_interval) {
1031 if (entropy->restarts_to_go == 0)
1032 if (! emit_restart_s(&state, entropy->next_restart_num))
1033 return FALSE;
1034 }
1035
1036 /* Encode the MCU data blocks */
1037 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
1038 ci = cinfo->MCU_membership[blkn];
1039 compptr = cinfo->cur_comp_info[ci];
1040 if (! encode_one_block(&state,
1041 MCU_data[blkn][0], state.cur.last_dc_val[ci],
1042 entropy->dc_derived_tbls[compptr->dc_tbl_no],
1043 entropy->ac_derived_tbls[compptr->ac_tbl_no]))
1044 return FALSE;
1045 /* Update last_dc_val */
1046 state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
1047 }
1048
1049 /* Completed MCU, so update state */
1050 cinfo->dest->next_output_byte = state.next_output_byte;
1051 cinfo->dest->free_in_buffer = state.free_in_buffer;
1052 ASSIGN_STATE(entropy->saved, state.cur);
1053
1054 /* Update restart-interval state too */
1055 if (cinfo->restart_interval) {
1056 if (entropy->restarts_to_go == 0) {
1057 entropy->restarts_to_go = cinfo->restart_interval;
1058 entropy->next_restart_num++;
1059 entropy->next_restart_num &= 7;
1060 }
1061 entropy->restarts_to_go--;
1062 }
1063
1064 return TRUE;
1065}
1066
1067
1068/*
1069 * Finish up at the end of a Huffman-compressed scan.
1070 */
1071
1072METHODDEF(void)
1073finish_pass_huff (j_compress_ptr cinfo)
1074{
1075 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1076 working_state state;
1077
1078 if (cinfo->progressive_mode) {
1079 entropy->next_output_byte = cinfo->dest->next_output_byte;
1080 entropy->free_in_buffer = cinfo->dest->free_in_buffer;
1081
1082 /* Flush out any buffered data */
1083 emit_eobrun(entropy);
1084 flush_bits_e(entropy);
1085
1086 cinfo->dest->next_output_byte = entropy->next_output_byte;
1087 cinfo->dest->free_in_buffer = entropy->free_in_buffer;
1088 } else {
1089 /* Load up working state ... flush_bits needs it */
1090 state.next_output_byte = cinfo->dest->next_output_byte;
1091 state.free_in_buffer = cinfo->dest->free_in_buffer;
1092 ASSIGN_STATE(state.cur, entropy->saved);
1093 state.cinfo = cinfo;
1094
1095 /* Flush out the last data */
1096 if (! flush_bits_s(&state))
1097 ERREXIT(cinfo, JERR_CANT_SUSPEND);
1098
1099 /* Update state */
1100 cinfo->dest->next_output_byte = state.next_output_byte;
1101 cinfo->dest->free_in_buffer = state.free_in_buffer;
1102 ASSIGN_STATE(entropy->saved, state.cur);
1103 }
1104}
1105
1106
1107/*
1108 * Huffman coding optimization.
1109 *
1110 * We first scan the supplied data and count the number of uses of each symbol
1111 * that is to be Huffman-coded. (This process MUST agree with the code above.)
1112 * Then we build a Huffman coding tree for the observed counts.
1113 * Symbols which are not needed at all for the particular image are not
1114 * assigned any code, which saves space in the DHT marker as well as in
1115 * the compressed data.
1116 */
1117
1118
1119/* Process a single block's worth of coefficients */
1120
1121LOCAL(void)
1122htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
1123 long dc_counts[], long ac_counts[])
1124{
1125 register int temp;
1126 register int nbits;
1127 register int k, r;
1128 int Se = cinfo->lim_Se;
1129 const int * natural_order = cinfo->natural_order;
1130
1131 /* Encode the DC coefficient difference per section F.1.2.1 */
1132
1133 temp = block[0] - last_dc_val;
1134 if (temp < 0)
1135 temp = -temp;
1136
1137 /* Find the number of bits needed for the magnitude of the coefficient */
1138 nbits = 0;
1139 while (temp) {
1140 nbits++;
1141 temp >>= 1;
1142 }
1143 /* Check for out-of-range coefficient values.
1144 * Since we're encoding a difference, the range limit is twice as much.
1145 */
1146 if (nbits > MAX_COEF_BITS+1)
1147 ERREXIT(cinfo, JERR_BAD_DCT_COEF);
1148
1149 /* Count the Huffman symbol for the number of bits */
1150 dc_counts[nbits]++;
1151
1152 /* Encode the AC coefficients per section F.1.2.2 */
1153
1154 r = 0; /* r = run length of zeros */
1155
1156 for (k = 1; k <= Se; k++) {
1157 if ((temp = block[natural_order[k]]) == 0) {
1158 r++;
1159 } else {
1160 /* if run length > 15, must emit special run-length-16 codes (0xF0) */
1161 while (r > 15) {
1162 ac_counts[0xF0]++;
1163 r -= 16;
1164 }
1165
1166 /* Find the number of bits needed for the magnitude of the coefficient */
1167 if (temp < 0)
1168 temp = -temp;
1169
1170 /* Find the number of bits needed for the magnitude of the coefficient */
1171 nbits = 1; /* there must be at least one 1 bit */
1172 while ((temp >>= 1))
1173 nbits++;
1174 /* Check for out-of-range coefficient values */
1175 if (nbits > MAX_COEF_BITS)
1176 ERREXIT(cinfo, JERR_BAD_DCT_COEF);
1177
1178 /* Count Huffman symbol for run length / number of bits */
1179 ac_counts[(r << 4) + nbits]++;
1180
1181 r = 0;
1182 }
1183 }
1184
1185 /* If the last coef(s) were zero, emit an end-of-block code */
1186 if (r > 0)
1187 ac_counts[0]++;
1188}
1189
1190
1191/*
1192 * Trial-encode one MCU's worth of Huffman-compressed coefficients.
1193 * No data is actually output, so no suspension return is possible.
1194 */
1195
1196METHODDEF(boolean)
1197encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
1198{
1199 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1200 int blkn, ci;
1201 jpeg_component_info * compptr;
1202
1203 /* Take care of restart intervals if needed */
1204 if (cinfo->restart_interval) {
1205 if (entropy->restarts_to_go == 0) {
1206 /* Re-initialize DC predictions to 0 */
1207 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
1208 entropy->saved.last_dc_val[ci] = 0;
1209 /* Update restart state */
1210 entropy->restarts_to_go = cinfo->restart_interval;
1211 }
1212 entropy->restarts_to_go--;
1213 }
1214
1215 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
1216 ci = cinfo->MCU_membership[blkn];
1217 compptr = cinfo->cur_comp_info[ci];
1218 htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
1219 entropy->dc_count_ptrs[compptr->dc_tbl_no],
1220 entropy->ac_count_ptrs[compptr->ac_tbl_no]);
1221 entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
1222 }
1223
1224 return TRUE;
1225}
1226
1227
1228/*
1229 * Generate the best Huffman code table for the given counts, fill htbl.
1230 *
1231 * The JPEG standard requires that no symbol be assigned a codeword of all
1232 * one bits (so that padding bits added at the end of a compressed segment
1233 * can't look like a valid code). Because of the canonical ordering of
1234 * codewords, this just means that there must be an unused slot in the
1235 * longest codeword length category. Section K.2 of the JPEG spec suggests
1236 * reserving such a slot by pretending that symbol 256 is a valid symbol
1237 * with count 1. In theory that's not optimal; giving it count zero but
1238 * including it in the symbol set anyway should give a better Huffman code.
1239 * But the theoretically better code actually seems to come out worse in
1240 * practice, because it produces more all-ones bytes (which incur stuffed
1241 * zero bytes in the final file). In any case the difference is tiny.
1242 *
1243 * The JPEG standard requires Huffman codes to be no more than 16 bits long.
1244 * If some symbols have a very small but nonzero probability, the Huffman tree
1245 * must be adjusted to meet the code length restriction. We currently use
1246 * the adjustment method suggested in JPEG section K.2. This method is *not*
1247 * optimal; it may not choose the best possible limited-length code. But
1248 * typically only very-low-frequency symbols will be given less-than-optimal
1249 * lengths, so the code is almost optimal. Experimental comparisons against
1250 * an optimal limited-length-code algorithm indicate that the difference is
1251 * microscopic --- usually less than a hundredth of a percent of total size.
1252 * So the extra complexity of an optimal algorithm doesn't seem worthwhile.
1253 */
1254
1255LOCAL(void)
1256jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
1257{
1258#define MAX_CLEN 32 /* assumed maximum initial code length */
1259 UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
1260 int codesize[257]; /* codesize[k] = code length of symbol k */
1261 int others[257]; /* next symbol in current branch of tree */
1262 int c1, c2;
1263 int p, i, j;
1264 long v;
1265
1266 /* This algorithm is explained in section K.2 of the JPEG standard */
1267
1268 MEMZERO(bits, SIZEOF(bits));
1269 MEMZERO(codesize, SIZEOF(codesize));
1270 for (i = 0; i < 257; i++)
1271 others[i] = -1; /* init links to empty */
1272
1273 freq[256] = 1; /* make sure 256 has a nonzero count */
1274 /* Including the pseudo-symbol 256 in the Huffman procedure guarantees
1275 * that no real symbol is given code-value of all ones, because 256
1276 * will be placed last in the largest codeword category.
1277 */
1278
1279 /* Huffman's basic algorithm to assign optimal code lengths to symbols */
1280
1281 for (;;) {
1282 /* Find the smallest nonzero frequency, set c1 = its symbol */
1283 /* In case of ties, take the larger symbol number */
1284 c1 = -1;
1285 v = 1000000000L;
1286 for (i = 0; i <= 256; i++) {
1287 if (freq[i] && freq[i] <= v) {
1288 v = freq[i];
1289 c1 = i;
1290 }
1291 }
1292
1293 /* Find the next smallest nonzero frequency, set c2 = its symbol */
1294 /* In case of ties, take the larger symbol number */
1295 c2 = -1;
1296 v = 1000000000L;
1297 for (i = 0; i <= 256; i++) {
1298 if (freq[i] && freq[i] <= v && i != c1) {
1299 v = freq[i];
1300 c2 = i;
1301 }
1302 }
1303
1304 /* Done if we've merged everything into one frequency */
1305 if (c2 < 0)
1306 break;
1307
1308 /* Else merge the two counts/trees */
1309 freq[c1] += freq[c2];
1310 freq[c2] = 0;
1311
1312 /* Increment the codesize of everything in c1's tree branch */
1313 codesize[c1]++;
1314 while (others[c1] >= 0) {
1315 c1 = others[c1];
1316 codesize[c1]++;
1317 }
1318
1319 others[c1] = c2; /* chain c2 onto c1's tree branch */
1320
1321 /* Increment the codesize of everything in c2's tree branch */
1322 codesize[c2]++;
1323 while (others[c2] >= 0) {
1324 c2 = others[c2];
1325 codesize[c2]++;
1326 }
1327 }
1328
1329 /* Now count the number of symbols of each code length */
1330 for (i = 0; i <= 256; i++) {
1331 if (codesize[i]) {
1332 /* The JPEG standard seems to think that this can't happen, */
1333 /* but I'm paranoid... */
1334 if (codesize[i] > MAX_CLEN)
1335 ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
1336
1337 bits[codesize[i]]++;
1338 }
1339 }
1340
1341 /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
1342 * Huffman procedure assigned any such lengths, we must adjust the coding.
1343 * Here is what the JPEG spec says about how this next bit works:
1344 * Since symbols are paired for the longest Huffman code, the symbols are
1345 * removed from this length category two at a time. The prefix for the pair
1346 * (which is one bit shorter) is allocated to one of the pair; then,
1347 * skipping the BITS entry for that prefix length, a code word from the next
1348 * shortest nonzero BITS entry is converted into a prefix for two code words
1349 * one bit longer.
1350 */
1351
1352 for (i = MAX_CLEN; i > 16; i--) {
1353 while (bits[i] > 0) {
1354 j = i - 2; /* find length of new prefix to be used */
1355 while (bits[j] == 0)
1356 j--;
1357
1358 bits[i] -= 2; /* remove two symbols */
1359 bits[i-1]++; /* one goes in this length */
1360 bits[j+1] += 2; /* two new symbols in this length */
1361 bits[j]--; /* symbol of this length is now a prefix */
1362 }
1363 }
1364
1365 /* Remove the count for the pseudo-symbol 256 from the largest codelength */
1366 while (bits[i] == 0) /* find largest codelength still in use */
1367 i--;
1368 bits[i]--;
1369
1370 /* Return final symbol counts (only for lengths 0..16) */
1371 MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
1372
1373 /* Return a list of the symbols sorted by code length */
1374 /* It's not real clear to me why we don't need to consider the codelength
1375 * changes made above, but the JPEG spec seems to think this works.
1376 */
1377 p = 0;
1378 for (i = 1; i <= MAX_CLEN; i++) {
1379 for (j = 0; j <= 255; j++) {
1380 if (codesize[j] == i) {
1381 htbl->huffval[p] = (UINT8) j;
1382 p++;
1383 }
1384 }
1385 }
1386
1387 /* Set sent_table FALSE so updated table will be written to JPEG file. */
1388 htbl->sent_table = FALSE;
1389}
1390
1391
1392/*
1393 * Finish up a statistics-gathering pass and create the new Huffman tables.
1394 */
1395
1396METHODDEF(void)
1397finish_pass_gather (j_compress_ptr cinfo)
1398{
1399 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1400 int ci, tbl;
1401 jpeg_component_info * compptr;
1402 JHUFF_TBL **htblptr;
1403 boolean did_dc[NUM_HUFF_TBLS];
1404 boolean did_ac[NUM_HUFF_TBLS];
1405
1406 /* It's important not to apply jpeg_gen_optimal_table more than once
1407 * per table, because it clobbers the input frequency counts!
1408 */
1409 if (cinfo->progressive_mode)
1410 /* Flush out buffered data (all we care about is counting the EOB symbol) */
1411 emit_eobrun(entropy);
1412
1413 MEMZERO(did_dc, SIZEOF(did_dc));
1414 MEMZERO(did_ac, SIZEOF(did_ac));
1415
1416 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
1417 compptr = cinfo->cur_comp_info[ci];
1418 /* DC needs no table for refinement scan */
1419 if (cinfo->Ss == 0 && cinfo->Ah == 0) {
1420 tbl = compptr->dc_tbl_no;
1421 if (! did_dc[tbl]) {
1422 htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
1423 if (*htblptr == NULL)
1424 *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
1425 jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[tbl]);
1426 did_dc[tbl] = TRUE;
1427 }
1428 }
1429 /* AC needs no table when not present */
1430 if (cinfo->Se) {
1431 tbl = compptr->ac_tbl_no;
1432 if (! did_ac[tbl]) {
1433 htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
1434 if (*htblptr == NULL)
1435 *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
1436 jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[tbl]);
1437 did_ac[tbl] = TRUE;
1438 }
1439 }
1440 }
1441}
1442
1443
1444/*
1445 * Initialize for a Huffman-compressed scan.
1446 * If gather_statistics is TRUE, we do not output anything during the scan,
1447 * just count the Huffman symbols used and generate Huffman code tables.
1448 */
1449
1450METHODDEF(void)
1451start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
1452{
1453 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1454 int ci, tbl;
1455 jpeg_component_info * compptr;
1456
1457 if (gather_statistics)
1458 entropy->pub.finish_pass = finish_pass_gather;
1459 else
1460 entropy->pub.finish_pass = finish_pass_huff;
1461
1462 if (cinfo->progressive_mode) {
1463 entropy->cinfo = cinfo;
1464 entropy->gather_statistics = gather_statistics;
1465
1466 /* We assume jcmaster.c already validated the scan parameters. */
1467
1468 /* Select execution routine */
1469 if (cinfo->Ah == 0) {
1470 if (cinfo->Ss == 0)
1471 entropy->pub.encode_mcu = encode_mcu_DC_first;
1472 else
1473 entropy->pub.encode_mcu = encode_mcu_AC_first;
1474 } else {
1475 if (cinfo->Ss == 0)
1476 entropy->pub.encode_mcu = encode_mcu_DC_refine;
1477 else {
1478 entropy->pub.encode_mcu = encode_mcu_AC_refine;
1479 /* AC refinement needs a correction bit buffer */
1480 if (entropy->bit_buffer == NULL)
1481 entropy->bit_buffer = (char *)
1482 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1483 MAX_CORR_BITS * SIZEOF(char));
1484 }
1485 }
1486
1487 /* Initialize AC stuff */
1488 entropy->ac_tbl_no = cinfo->cur_comp_info[0]->ac_tbl_no;
1489 entropy->EOBRUN = 0;
1490 entropy->BE = 0;
1491 } else {
1492 if (gather_statistics)
1493 entropy->pub.encode_mcu = encode_mcu_gather;
1494 else
1495 entropy->pub.encode_mcu = encode_mcu_huff;
1496 }
1497
1498 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
1499 compptr = cinfo->cur_comp_info[ci];
1500 /* DC needs no table for refinement scan */
1501 if (cinfo->Ss == 0 && cinfo->Ah == 0) {
1502 tbl = compptr->dc_tbl_no;
1503 if (gather_statistics) {
1504 /* Check for invalid table index */
1505 /* (make_c_derived_tbl does this in the other path) */
1506 if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
1507 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
1508 /* Allocate and zero the statistics tables */
1509 /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
1510 if (entropy->dc_count_ptrs[tbl] == NULL)
1511 entropy->dc_count_ptrs[tbl] = (long *)
1512 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1513 257 * SIZEOF(long));
1514 MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long));
1515 } else {
1516 /* Compute derived values for Huffman tables */
1517 /* We may do this more than once for a table, but it's not expensive */
1518 jpeg_make_c_derived_tbl(cinfo, TRUE, tbl,
1519 & entropy->dc_derived_tbls[tbl]);
1520 }
1521 /* Initialize DC predictions to 0 */
1522 entropy->saved.last_dc_val[ci] = 0;
1523 }
1524 /* AC needs no table when not present */
1525 if (cinfo->Se) {
1526 tbl = compptr->ac_tbl_no;
1527 if (gather_statistics) {
1528 if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
1529 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
1530 if (entropy->ac_count_ptrs[tbl] == NULL)
1531 entropy->ac_count_ptrs[tbl] = (long *)
1532 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1533 257 * SIZEOF(long));
1534 MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long));
1535 } else {
1536 jpeg_make_c_derived_tbl(cinfo, FALSE, tbl,
1537 & entropy->ac_derived_tbls[tbl]);
1538 }
1539 }
1540 }
1541
1542 /* Initialize bit buffer to empty */
1543 entropy->saved.put_buffer = 0;
1544 entropy->saved.put_bits = 0;
1545
1546 /* Initialize restart stuff */
1547 entropy->restarts_to_go = cinfo->restart_interval;
1548 entropy->next_restart_num = 0;
1549}
1550
1551
1552/*
1553 * Module initialization routine for Huffman entropy encoding.
1554 */
1555
1556GLOBAL(void)
1557jinit_huff_encoder (j_compress_ptr cinfo)
1558{
1559 huff_entropy_ptr entropy;
1560 int i;
1561
1562 entropy = (huff_entropy_ptr)
1563 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1564 SIZEOF(huff_entropy_encoder));
1565 cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
1566 entropy->pub.start_pass = start_pass_huff;
1567
1568 /* Mark tables unallocated */
1569 for (i = 0; i < NUM_HUFF_TBLS; i++) {
1570 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
1571 entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
1572 }
1573
1574 if (cinfo->progressive_mode)
1575 entropy->bit_buffer = NULL; /* needed only in AC refinement scan */
1576}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcinit.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcinit.c
new file mode 100644
index 0000000..f7aa89f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcinit.c
@@ -0,0 +1,65 @@
1/*
2 * jcinit.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains initialization logic for the JPEG compressor.
9 * This routine is in charge of selecting the modules to be executed and
10 * making an initialization call to each one.
11 *
12 * Logically, this code belongs in jcmaster.c. It's split out because
13 * linking this routine implies linking the entire compression library.
14 * For a transcoding-only application, we want to be able to use jcmaster.c
15 * without linking in the whole library.
16 */
17
18#define JPEG_INTERNALS
19#include "jinclude.h"
20#include "jpeglib.h"
21
22
23/*
24 * Master selection of compression modules.
25 * This is done once at the start of processing an image. We determine
26 * which modules will be used and give them appropriate initialization calls.
27 */
28
29GLOBAL(void)
30jinit_compress_master (j_compress_ptr cinfo)
31{
32 /* Initialize master control (includes parameter checking/processing) */
33 jinit_c_master_control(cinfo, FALSE /* full compression */);
34
35 /* Preprocessing */
36 if (! cinfo->raw_data_in) {
37 jinit_color_converter(cinfo);
38 jinit_downsampler(cinfo);
39 jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
40 }
41 /* Forward DCT */
42 jinit_forward_dct(cinfo);
43 /* Entropy encoding: either Huffman or arithmetic coding. */
44 if (cinfo->arith_code)
45 jinit_arith_encoder(cinfo);
46 else {
47 jinit_huff_encoder(cinfo);
48 }
49
50 /* Need a full-image coefficient buffer in any multi-pass mode. */
51 jinit_c_coef_controller(cinfo,
52 (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
53 jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
54
55 jinit_marker_writer(cinfo);
56
57 /* We can now tell the memory manager to allocate virtual arrays. */
58 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
59
60 /* Write the datastream header (SOI) immediately.
61 * Frame and scan headers are postponed till later.
62 * This lets application insert special markers after the SOI.
63 */
64 (*cinfo->marker->write_file_header) (cinfo);
65}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmainct.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmainct.c
new file mode 100644
index 0000000..669b7bb
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmainct.c
@@ -0,0 +1,293 @@
1/*
2 * jcmainct.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains the main buffer controller for compression.
9 * The main buffer lies between the pre-processor and the JPEG
10 * compressor proper; it holds downsampled data in the JPEG colorspace.
11 */
12
13#define JPEG_INTERNALS
14#include "jinclude.h"
15#include "jpeglib.h"
16
17
18/* Note: currently, there is no operating mode in which a full-image buffer
19 * is needed at this step. If there were, that mode could not be used with
20 * "raw data" input, since this module is bypassed in that case. However,
21 * we've left the code here for possible use in special applications.
22 */
23#undef FULL_MAIN_BUFFER_SUPPORTED
24
25
26/* Private buffer controller object */
27
28typedef struct {
29 struct jpeg_c_main_controller pub; /* public fields */
30
31 JDIMENSION cur_iMCU_row; /* number of current iMCU row */
32 JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
33 boolean suspended; /* remember if we suspended output */
34 J_BUF_MODE pass_mode; /* current operating mode */
35
36 /* If using just a strip buffer, this points to the entire set of buffers
37 * (we allocate one for each component). In the full-image case, this
38 * points to the currently accessible strips of the virtual arrays.
39 */
40 JSAMPARRAY buffer[MAX_COMPONENTS];
41
42#ifdef FULL_MAIN_BUFFER_SUPPORTED
43 /* If using full-image storage, this array holds pointers to virtual-array
44 * control blocks for each component. Unused if not full-image storage.
45 */
46 jvirt_sarray_ptr whole_image[MAX_COMPONENTS];
47#endif
48} my_main_controller;
49
50typedef my_main_controller * my_main_ptr;
51
52
53/* Forward declarations */
54METHODDEF(void) process_data_simple_main
55 JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
56 JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
57#ifdef FULL_MAIN_BUFFER_SUPPORTED
58METHODDEF(void) process_data_buffer_main
59 JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
60 JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
61#endif
62
63
64/*
65 * Initialize for a processing pass.
66 */
67
68METHODDEF(void)
69start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
70{
71 my_main_ptr main = (my_main_ptr) cinfo->main;
72
73 /* Do nothing in raw-data mode. */
74 if (cinfo->raw_data_in)
75 return;
76
77 main->cur_iMCU_row = 0; /* initialize counters */
78 main->rowgroup_ctr = 0;
79 main->suspended = FALSE;
80 main->pass_mode = pass_mode; /* save mode for use by process_data */
81
82 switch (pass_mode) {
83 case JBUF_PASS_THRU:
84#ifdef FULL_MAIN_BUFFER_SUPPORTED
85 if (main->whole_image[0] != NULL)
86 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
87#endif
88 main->pub.process_data = process_data_simple_main;
89 break;
90#ifdef FULL_MAIN_BUFFER_SUPPORTED
91 case JBUF_SAVE_SOURCE:
92 case JBUF_CRANK_DEST:
93 case JBUF_SAVE_AND_PASS:
94 if (main->whole_image[0] == NULL)
95 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
96 main->pub.process_data = process_data_buffer_main;
97 break;
98#endif
99 default:
100 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
101 break;
102 }
103}
104
105
106/*
107 * Process some data.
108 * This routine handles the simple pass-through mode,
109 * where we have only a strip buffer.
110 */
111
112METHODDEF(void)
113process_data_simple_main (j_compress_ptr cinfo,
114 JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
115 JDIMENSION in_rows_avail)
116{
117 my_main_ptr main = (my_main_ptr) cinfo->main;
118
119 while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
120 /* Read input data if we haven't filled the main buffer yet */
121 if (main->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)
122 (*cinfo->prep->pre_process_data) (cinfo,
123 input_buf, in_row_ctr, in_rows_avail,
124 main->buffer, &main->rowgroup_ctr,
125 (JDIMENSION) cinfo->min_DCT_v_scaled_size);
126
127 /* If we don't have a full iMCU row buffered, return to application for
128 * more data. Note that preprocessor will always pad to fill the iMCU row
129 * at the bottom of the image.
130 */
131 if (main->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size)
132 return;
133
134 /* Send the completed row to the compressor */
135 if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
136 /* If compressor did not consume the whole row, then we must need to
137 * suspend processing and return to the application. In this situation
138 * we pretend we didn't yet consume the last input row; otherwise, if
139 * it happened to be the last row of the image, the application would
140 * think we were done.
141 */
142 if (! main->suspended) {
143 (*in_row_ctr)--;
144 main->suspended = TRUE;
145 }
146 return;
147 }
148 /* We did finish the row. Undo our little suspension hack if a previous
149 * call suspended; then mark the main buffer empty.
150 */
151 if (main->suspended) {
152 (*in_row_ctr)++;
153 main->suspended = FALSE;
154 }
155 main->rowgroup_ctr = 0;
156 main->cur_iMCU_row++;
157 }
158}
159
160
161#ifdef FULL_MAIN_BUFFER_SUPPORTED
162
163/*
164 * Process some data.
165 * This routine handles all of the modes that use a full-size buffer.
166 */
167
168METHODDEF(void)
169process_data_buffer_main (j_compress_ptr cinfo,
170 JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
171 JDIMENSION in_rows_avail)
172{
173 my_main_ptr main = (my_main_ptr) cinfo->main;
174 int ci;
175 jpeg_component_info *compptr;
176 boolean writing = (main->pass_mode != JBUF_CRANK_DEST);
177
178 while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
179 /* Realign the virtual buffers if at the start of an iMCU row. */
180 if (main->rowgroup_ctr == 0) {
181 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
182 ci++, compptr++) {
183 main->buffer[ci] = (*cinfo->mem->access_virt_sarray)
184 ((j_common_ptr) cinfo, main->whole_image[ci],
185 main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
186 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
187 }
188 /* In a read pass, pretend we just read some source data. */
189 if (! writing) {
190 *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
191 main->rowgroup_ctr = DCTSIZE;
192 }
193 }
194
195 /* If a write pass, read input data until the current iMCU row is full. */
196 /* Note: preprocessor will pad if necessary to fill the last iMCU row. */
197 if (writing) {
198 (*cinfo->prep->pre_process_data) (cinfo,
199 input_buf, in_row_ctr, in_rows_avail,
200 main->buffer, &main->rowgroup_ctr,
201 (JDIMENSION) DCTSIZE);
202 /* Return to application if we need more data to fill the iMCU row. */
203 if (main->rowgroup_ctr < DCTSIZE)
204 return;
205 }
206
207 /* Emit data, unless this is a sink-only pass. */
208 if (main->pass_mode != JBUF_SAVE_SOURCE) {
209 if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
210 /* If compressor did not consume the whole row, then we must need to
211 * suspend processing and return to the application. In this situation
212 * we pretend we didn't yet consume the last input row; otherwise, if
213 * it happened to be the last row of the image, the application would
214 * think we were done.
215 */
216 if (! main->suspended) {
217 (*in_row_ctr)--;
218 main->suspended = TRUE;
219 }
220 return;
221 }
222 /* We did finish the row. Undo our little suspension hack if a previous
223 * call suspended; then mark the main buffer empty.
224 */
225 if (main->suspended) {
226 (*in_row_ctr)++;
227 main->suspended = FALSE;
228 }
229 }
230
231 /* If get here, we are done with this iMCU row. Mark buffer empty. */
232 main->rowgroup_ctr = 0;
233 main->cur_iMCU_row++;
234 }
235}
236
237#endif /* FULL_MAIN_BUFFER_SUPPORTED */
238
239
240/*
241 * Initialize main buffer controller.
242 */
243
244GLOBAL(void)
245jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
246{
247 my_main_ptr main;
248 int ci;
249 jpeg_component_info *compptr;
250
251 main = (my_main_ptr)
252 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
253 SIZEOF(my_main_controller));
254 cinfo->main = (struct jpeg_c_main_controller *) main;
255 main->pub.start_pass = start_pass_main;
256
257 /* We don't need to create a buffer in raw-data mode. */
258 if (cinfo->raw_data_in)
259 return;
260
261 /* Create the buffer. It holds downsampled data, so each component
262 * may be of a different size.
263 */
264 if (need_full_buffer) {
265#ifdef FULL_MAIN_BUFFER_SUPPORTED
266 /* Allocate a full-image virtual array for each component */
267 /* Note we pad the bottom to a multiple of the iMCU height */
268 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
269 ci++, compptr++) {
270 main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
271 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
272 compptr->width_in_blocks * compptr->DCT_h_scaled_size,
273 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
274 (long) compptr->v_samp_factor) * DCTSIZE,
275 (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));
276 }
277#else
278 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
279#endif
280 } else {
281#ifdef FULL_MAIN_BUFFER_SUPPORTED
282 main->whole_image[0] = NULL; /* flag for no virtual arrays */
283#endif
284 /* Allocate a strip buffer for each component */
285 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
286 ci++, compptr++) {
287 main->buffer[ci] = (*cinfo->mem->alloc_sarray)
288 ((j_common_ptr) cinfo, JPOOL_IMAGE,
289 compptr->width_in_blocks * compptr->DCT_h_scaled_size,
290 (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));
291 }
292 }
293}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmarker.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmarker.c
new file mode 100644
index 0000000..3b91e95
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmarker.c
@@ -0,0 +1,682 @@
1/*
2 * jcmarker.c
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * Modified 2003-2010 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains routines to write JPEG datastream markers.
10 */
11
12#define JPEG_INTERNALS
13#include "jinclude.h"
14#include "jpeglib.h"
15
16
17typedef enum { /* JPEG marker codes */
18 M_SOF0 = 0xc0,
19 M_SOF1 = 0xc1,
20 M_SOF2 = 0xc2,
21 M_SOF3 = 0xc3,
22
23 M_SOF5 = 0xc5,
24 M_SOF6 = 0xc6,
25 M_SOF7 = 0xc7,
26
27 M_JPG = 0xc8,
28 M_SOF9 = 0xc9,
29 M_SOF10 = 0xca,
30 M_SOF11 = 0xcb,
31
32 M_SOF13 = 0xcd,
33 M_SOF14 = 0xce,
34 M_SOF15 = 0xcf,
35
36 M_DHT = 0xc4,
37
38 M_DAC = 0xcc,
39
40 M_RST0 = 0xd0,
41 M_RST1 = 0xd1,
42 M_RST2 = 0xd2,
43 M_RST3 = 0xd3,
44 M_RST4 = 0xd4,
45 M_RST5 = 0xd5,
46 M_RST6 = 0xd6,
47 M_RST7 = 0xd7,
48
49 M_SOI = 0xd8,
50 M_EOI = 0xd9,
51 M_SOS = 0xda,
52 M_DQT = 0xdb,
53 M_DNL = 0xdc,
54 M_DRI = 0xdd,
55 M_DHP = 0xde,
56 M_EXP = 0xdf,
57
58 M_APP0 = 0xe0,
59 M_APP1 = 0xe1,
60 M_APP2 = 0xe2,
61 M_APP3 = 0xe3,
62 M_APP4 = 0xe4,
63 M_APP5 = 0xe5,
64 M_APP6 = 0xe6,
65 M_APP7 = 0xe7,
66 M_APP8 = 0xe8,
67 M_APP9 = 0xe9,
68 M_APP10 = 0xea,
69 M_APP11 = 0xeb,
70 M_APP12 = 0xec,
71 M_APP13 = 0xed,
72 M_APP14 = 0xee,
73 M_APP15 = 0xef,
74
75 M_JPG0 = 0xf0,
76 M_JPG13 = 0xfd,
77 M_COM = 0xfe,
78
79 M_TEM = 0x01,
80
81 M_ERROR = 0x100
82} JPEG_MARKER;
83
84
85/* Private state */
86
87typedef struct {
88 struct jpeg_marker_writer pub; /* public fields */
89
90 unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
91} my_marker_writer;
92
93typedef my_marker_writer * my_marker_ptr;
94
95
96/*
97 * Basic output routines.
98 *
99 * Note that we do not support suspension while writing a marker.
100 * Therefore, an application using suspension must ensure that there is
101 * enough buffer space for the initial markers (typ. 600-700 bytes) before
102 * calling jpeg_start_compress, and enough space to write the trailing EOI
103 * (a few bytes) before calling jpeg_finish_compress. Multipass compression
104 * modes are not supported at all with suspension, so those two are the only
105 * points where markers will be written.
106 */
107
108LOCAL(void)
109emit_byte (j_compress_ptr cinfo, int val)
110/* Emit a byte */
111{
112 struct jpeg_destination_mgr * dest = cinfo->dest;
113
114 *(dest->next_output_byte)++ = (JOCTET) val;
115 if (--dest->free_in_buffer == 0) {
116 if (! (*dest->empty_output_buffer) (cinfo))
117 ERREXIT(cinfo, JERR_CANT_SUSPEND);
118 }
119}
120
121
122LOCAL(void)
123emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
124/* Emit a marker code */
125{
126 emit_byte(cinfo, 0xFF);
127 emit_byte(cinfo, (int) mark);
128}
129
130
131LOCAL(void)
132emit_2bytes (j_compress_ptr cinfo, int value)
133/* Emit a 2-byte integer; these are always MSB first in JPEG files */
134{
135 emit_byte(cinfo, (value >> 8) & 0xFF);
136 emit_byte(cinfo, value & 0xFF);
137}
138
139
140/*
141 * Routines to write specific marker types.
142 */
143
144LOCAL(int)
145emit_dqt (j_compress_ptr cinfo, int index)
146/* Emit a DQT marker */
147/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
148{
149 JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
150 int prec;
151 int i;
152
153 if (qtbl == NULL)
154 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
155
156 prec = 0;
157 for (i = 0; i <= cinfo->lim_Se; i++) {
158 if (qtbl->quantval[cinfo->natural_order[i]] > 255)
159 prec = 1;
160 }
161
162 if (! qtbl->sent_table) {
163 emit_marker(cinfo, M_DQT);
164
165 emit_2bytes(cinfo,
166 prec ? cinfo->lim_Se * 2 + 2 + 1 + 2 : cinfo->lim_Se + 1 + 1 + 2);
167
168 emit_byte(cinfo, index + (prec<<4));
169
170 for (i = 0; i <= cinfo->lim_Se; i++) {
171 /* The table entries must be emitted in zigzag order. */
172 unsigned int qval = qtbl->quantval[cinfo->natural_order[i]];
173 if (prec)
174 emit_byte(cinfo, (int) (qval >> 8));
175 emit_byte(cinfo, (int) (qval & 0xFF));
176 }
177
178 qtbl->sent_table = TRUE;
179 }
180
181 return prec;
182}
183
184
185LOCAL(void)
186emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
187/* Emit a DHT marker */
188{
189 JHUFF_TBL * htbl;
190 int length, i;
191
192 if (is_ac) {
193 htbl = cinfo->ac_huff_tbl_ptrs[index];
194 index += 0x10; /* output index has AC bit set */
195 } else {
196 htbl = cinfo->dc_huff_tbl_ptrs[index];
197 }
198
199 if (htbl == NULL)
200 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
201
202 if (! htbl->sent_table) {
203 emit_marker(cinfo, M_DHT);
204
205 length = 0;
206 for (i = 1; i <= 16; i++)
207 length += htbl->bits[i];
208
209 emit_2bytes(cinfo, length + 2 + 1 + 16);
210 emit_byte(cinfo, index);
211
212 for (i = 1; i <= 16; i++)
213 emit_byte(cinfo, htbl->bits[i]);
214
215 for (i = 0; i < length; i++)
216 emit_byte(cinfo, htbl->huffval[i]);
217
218 htbl->sent_table = TRUE;
219 }
220}
221
222
223LOCAL(void)
224emit_dac (j_compress_ptr cinfo)
225/* Emit a DAC marker */
226/* Since the useful info is so small, we want to emit all the tables in */
227/* one DAC marker. Therefore this routine does its own scan of the table. */
228{
229#ifdef C_ARITH_CODING_SUPPORTED
230 char dc_in_use[NUM_ARITH_TBLS];
231 char ac_in_use[NUM_ARITH_TBLS];
232 int length, i;
233 jpeg_component_info *compptr;
234
235 for (i = 0; i < NUM_ARITH_TBLS; i++)
236 dc_in_use[i] = ac_in_use[i] = 0;
237
238 for (i = 0; i < cinfo->comps_in_scan; i++) {
239 compptr = cinfo->cur_comp_info[i];
240 /* DC needs no table for refinement scan */
241 if (cinfo->Ss == 0 && cinfo->Ah == 0)
242 dc_in_use[compptr->dc_tbl_no] = 1;
243 /* AC needs no table when not present */
244 if (cinfo->Se)
245 ac_in_use[compptr->ac_tbl_no] = 1;
246 }
247
248 length = 0;
249 for (i = 0; i < NUM_ARITH_TBLS; i++)
250 length += dc_in_use[i] + ac_in_use[i];
251
252 if (length) {
253 emit_marker(cinfo, M_DAC);
254
255 emit_2bytes(cinfo, length*2 + 2);
256
257 for (i = 0; i < NUM_ARITH_TBLS; i++) {
258 if (dc_in_use[i]) {
259 emit_byte(cinfo, i);
260 emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
261 }
262 if (ac_in_use[i]) {
263 emit_byte(cinfo, i + 0x10);
264 emit_byte(cinfo, cinfo->arith_ac_K[i]);
265 }
266 }
267 }
268#endif /* C_ARITH_CODING_SUPPORTED */
269}
270
271
272LOCAL(void)
273emit_dri (j_compress_ptr cinfo)
274/* Emit a DRI marker */
275{
276 emit_marker(cinfo, M_DRI);
277
278 emit_2bytes(cinfo, 4); /* fixed length */
279
280 emit_2bytes(cinfo, (int) cinfo->restart_interval);
281}
282
283
284LOCAL(void)
285emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
286/* Emit a SOF marker */
287{
288 int ci;
289 jpeg_component_info *compptr;
290
291 emit_marker(cinfo, code);
292
293 emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
294
295 /* Make sure image isn't bigger than SOF field can handle */
296 if ((long) cinfo->jpeg_height > 65535L ||
297 (long) cinfo->jpeg_width > 65535L)
298 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);
299
300 emit_byte(cinfo, cinfo->data_precision);
301 emit_2bytes(cinfo, (int) cinfo->jpeg_height);
302 emit_2bytes(cinfo, (int) cinfo->jpeg_width);
303
304 emit_byte(cinfo, cinfo->num_components);
305
306 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
307 ci++, compptr++) {
308 emit_byte(cinfo, compptr->component_id);
309 emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
310 emit_byte(cinfo, compptr->quant_tbl_no);
311 }
312}
313
314
315LOCAL(void)
316emit_sos (j_compress_ptr cinfo)
317/* Emit a SOS marker */
318{
319 int i, td, ta;
320 jpeg_component_info *compptr;
321
322 emit_marker(cinfo, M_SOS);
323
324 emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
325
326 emit_byte(cinfo, cinfo->comps_in_scan);
327
328 for (i = 0; i < cinfo->comps_in_scan; i++) {
329 compptr = cinfo->cur_comp_info[i];
330 emit_byte(cinfo, compptr->component_id);
331
332 /* We emit 0 for unused field(s); this is recommended by the P&M text
333 * but does not seem to be specified in the standard.
334 */
335
336 /* DC needs no table for refinement scan */
337 td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;
338 /* AC needs no table when not present */
339 ta = cinfo->Se ? compptr->ac_tbl_no : 0;
340
341 emit_byte(cinfo, (td << 4) + ta);
342 }
343
344 emit_byte(cinfo, cinfo->Ss);
345 emit_byte(cinfo, cinfo->Se);
346 emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
347}
348
349
350LOCAL(void)
351emit_pseudo_sos (j_compress_ptr cinfo)
352/* Emit a pseudo SOS marker */
353{
354 emit_marker(cinfo, M_SOS);
355
356 emit_2bytes(cinfo, 2 + 1 + 3); /* length */
357
358 emit_byte(cinfo, 0); /* Ns */
359
360 emit_byte(cinfo, 0); /* Ss */
361 emit_byte(cinfo, cinfo->block_size * cinfo->block_size - 1); /* Se */
362 emit_byte(cinfo, 0); /* Ah/Al */
363}
364
365
366LOCAL(void)
367emit_jfif_app0 (j_compress_ptr cinfo)
368/* Emit a JFIF-compliant APP0 marker */
369{
370 /*
371 * Length of APP0 block (2 bytes)
372 * Block ID (4 bytes - ASCII "JFIF")
373 * Zero byte (1 byte to terminate the ID string)
374 * Version Major, Minor (2 bytes - major first)
375 * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
376 * Xdpu (2 bytes - dots per unit horizontal)
377 * Ydpu (2 bytes - dots per unit vertical)
378 * Thumbnail X size (1 byte)
379 * Thumbnail Y size (1 byte)
380 */
381
382 emit_marker(cinfo, M_APP0);
383
384 emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
385
386 emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
387 emit_byte(cinfo, 0x46);
388 emit_byte(cinfo, 0x49);
389 emit_byte(cinfo, 0x46);
390 emit_byte(cinfo, 0);
391 emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
392 emit_byte(cinfo, cinfo->JFIF_minor_version);
393 emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
394 emit_2bytes(cinfo, (int) cinfo->X_density);
395 emit_2bytes(cinfo, (int) cinfo->Y_density);
396 emit_byte(cinfo, 0); /* No thumbnail image */
397 emit_byte(cinfo, 0);
398}
399
400
401LOCAL(void)
402emit_adobe_app14 (j_compress_ptr cinfo)
403/* Emit an Adobe APP14 marker */
404{
405 /*
406 * Length of APP14 block (2 bytes)
407 * Block ID (5 bytes - ASCII "Adobe")
408 * Version Number (2 bytes - currently 100)
409 * Flags0 (2 bytes - currently 0)
410 * Flags1 (2 bytes - currently 0)
411 * Color transform (1 byte)
412 *
413 * Although Adobe TN 5116 mentions Version = 101, all the Adobe files
414 * now in circulation seem to use Version = 100, so that's what we write.
415 *
416 * We write the color transform byte as 1 if the JPEG color space is
417 * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with
418 * whether the encoder performed a transformation, which is pretty useless.
419 */
420
421 emit_marker(cinfo, M_APP14);
422
423 emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
424
425 emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
426 emit_byte(cinfo, 0x64);
427 emit_byte(cinfo, 0x6F);
428 emit_byte(cinfo, 0x62);
429 emit_byte(cinfo, 0x65);
430 emit_2bytes(cinfo, 100); /* Version */
431 emit_2bytes(cinfo, 0); /* Flags0 */
432 emit_2bytes(cinfo, 0); /* Flags1 */
433 switch (cinfo->jpeg_color_space) {
434 case JCS_YCbCr:
435 emit_byte(cinfo, 1); /* Color transform = 1 */
436 break;
437 case JCS_YCCK:
438 emit_byte(cinfo, 2); /* Color transform = 2 */
439 break;
440 default:
441 emit_byte(cinfo, 0); /* Color transform = 0 */
442 break;
443 }
444}
445
446
447/*
448 * These routines allow writing an arbitrary marker with parameters.
449 * The only intended use is to emit COM or APPn markers after calling
450 * write_file_header and before calling write_frame_header.
451 * Other uses are not guaranteed to produce desirable results.
452 * Counting the parameter bytes properly is the caller's responsibility.
453 */
454
455METHODDEF(void)
456write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
457/* Emit an arbitrary marker header */
458{
459 if (datalen > (unsigned int) 65533) /* safety check */
460 ERREXIT(cinfo, JERR_BAD_LENGTH);
461
462 emit_marker(cinfo, (JPEG_MARKER) marker);
463
464 emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */
465}
466
467METHODDEF(void)
468write_marker_byte (j_compress_ptr cinfo, int val)
469/* Emit one byte of marker parameters following write_marker_header */
470{
471 emit_byte(cinfo, val);
472}
473
474
475/*
476 * Write datastream header.
477 * This consists of an SOI and optional APPn markers.
478 * We recommend use of the JFIF marker, but not the Adobe marker,
479 * when using YCbCr or grayscale data. The JFIF marker should NOT
480 * be used for any other JPEG colorspace. The Adobe marker is helpful
481 * to distinguish RGB, CMYK, and YCCK colorspaces.
482 * Note that an application can write additional header markers after
483 * jpeg_start_compress returns.
484 */
485
486METHODDEF(void)
487write_file_header (j_compress_ptr cinfo)
488{
489 my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
490
491 emit_marker(cinfo, M_SOI); /* first the SOI */
492
493 /* SOI is defined to reset restart interval to 0 */
494 marker->last_restart_interval = 0;
495
496 if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
497 emit_jfif_app0(cinfo);
498 if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
499 emit_adobe_app14(cinfo);
500}
501
502
503/*
504 * Write frame header.
505 * This consists of DQT and SOFn markers, and a conditional pseudo SOS marker.
506 * Note that we do not emit the SOF until we have emitted the DQT(s).
507 * This avoids compatibility problems with incorrect implementations that
508 * try to error-check the quant table numbers as soon as they see the SOF.
509 */
510
511METHODDEF(void)
512write_frame_header (j_compress_ptr cinfo)
513{
514 int ci, prec;
515 boolean is_baseline;
516 jpeg_component_info *compptr;
517
518 /* Emit DQT for each quantization table.
519 * Note that emit_dqt() suppresses any duplicate tables.
520 */
521 prec = 0;
522 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
523 ci++, compptr++) {
524 prec += emit_dqt(cinfo, compptr->quant_tbl_no);
525 }
526 /* now prec is nonzero iff there are any 16-bit quant tables. */
527
528 /* Check for a non-baseline specification.
529 * Note we assume that Huffman table numbers won't be changed later.
530 */
531 if (cinfo->arith_code || cinfo->progressive_mode ||
532 cinfo->data_precision != 8 || cinfo->block_size != DCTSIZE) {
533 is_baseline = FALSE;
534 } else {
535 is_baseline = TRUE;
536 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
537 ci++, compptr++) {
538 if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
539 is_baseline = FALSE;
540 }
541 if (prec && is_baseline) {
542 is_baseline = FALSE;
543 /* If it's baseline except for quantizer size, warn the user */
544 TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
545 }
546 }
547
548 /* Emit the proper SOF marker */
549 if (cinfo->arith_code) {
550 if (cinfo->progressive_mode)
551 emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */
552 else
553 emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */
554 } else {
555 if (cinfo->progressive_mode)
556 emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
557 else if (is_baseline)
558 emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
559 else
560 emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
561 }
562
563 /* Check to emit pseudo SOS marker */
564 if (cinfo->progressive_mode && cinfo->block_size != DCTSIZE)
565 emit_pseudo_sos(cinfo);
566}
567
568
569/*
570 * Write scan header.
571 * This consists of DHT or DAC markers, optional DRI, and SOS.
572 * Compressed data will be written following the SOS.
573 */
574
575METHODDEF(void)
576write_scan_header (j_compress_ptr cinfo)
577{
578 my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
579 int i;
580 jpeg_component_info *compptr;
581
582 if (cinfo->arith_code) {
583 /* Emit arith conditioning info. We may have some duplication
584 * if the file has multiple scans, but it's so small it's hardly
585 * worth worrying about.
586 */
587 emit_dac(cinfo);
588 } else {
589 /* Emit Huffman tables.
590 * Note that emit_dht() suppresses any duplicate tables.
591 */
592 for (i = 0; i < cinfo->comps_in_scan; i++) {
593 compptr = cinfo->cur_comp_info[i];
594 /* DC needs no table for refinement scan */
595 if (cinfo->Ss == 0 && cinfo->Ah == 0)
596 emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
597 /* AC needs no table when not present */
598 if (cinfo->Se)
599 emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
600 }
601 }
602
603 /* Emit DRI if required --- note that DRI value could change for each scan.
604 * We avoid wasting space with unnecessary DRIs, however.
605 */
606 if (cinfo->restart_interval != marker->last_restart_interval) {
607 emit_dri(cinfo);
608 marker->last_restart_interval = cinfo->restart_interval;
609 }
610
611 emit_sos(cinfo);
612}
613
614
615/*
616 * Write datastream trailer.
617 */
618
619METHODDEF(void)
620write_file_trailer (j_compress_ptr cinfo)
621{
622 emit_marker(cinfo, M_EOI);
623}
624
625
626/*
627 * Write an abbreviated table-specification datastream.
628 * This consists of SOI, DQT and DHT tables, and EOI.
629 * Any table that is defined and not marked sent_table = TRUE will be
630 * emitted. Note that all tables will be marked sent_table = TRUE at exit.
631 */
632
633METHODDEF(void)
634write_tables_only (j_compress_ptr cinfo)
635{
636 int i;
637
638 emit_marker(cinfo, M_SOI);
639
640 for (i = 0; i < NUM_QUANT_TBLS; i++) {
641 if (cinfo->quant_tbl_ptrs[i] != NULL)
642 (void) emit_dqt(cinfo, i);
643 }
644
645 if (! cinfo->arith_code) {
646 for (i = 0; i < NUM_HUFF_TBLS; i++) {
647 if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
648 emit_dht(cinfo, i, FALSE);
649 if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
650 emit_dht(cinfo, i, TRUE);
651 }
652 }
653
654 emit_marker(cinfo, M_EOI);
655}
656
657
658/*
659 * Initialize the marker writer module.
660 */
661
662GLOBAL(void)
663jinit_marker_writer (j_compress_ptr cinfo)
664{
665 my_marker_ptr marker;
666
667 /* Create the subobject */
668 marker = (my_marker_ptr)
669 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
670 SIZEOF(my_marker_writer));
671 cinfo->marker = (struct jpeg_marker_writer *) marker;
672 /* Initialize method pointers */
673 marker->pub.write_file_header = write_file_header;
674 marker->pub.write_frame_header = write_frame_header;
675 marker->pub.write_scan_header = write_scan_header;
676 marker->pub.write_file_trailer = write_file_trailer;
677 marker->pub.write_tables_only = write_tables_only;
678 marker->pub.write_marker_header = write_marker_header;
679 marker->pub.write_marker_byte = write_marker_byte;
680 /* Initialize private state */
681 marker->last_restart_interval = 0;
682}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmaster.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmaster.c
new file mode 100644
index 0000000..ef73194
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcmaster.c
@@ -0,0 +1,858 @@
1/*
2 * jcmaster.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2003-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains master control logic for the JPEG compressor.
10 * These routines are concerned with parameter validation, initial setup,
11 * and inter-pass control (determining the number of passes and the work
12 * to be done in each pass).
13 */
14
15#define JPEG_INTERNALS
16#include "jinclude.h"
17#include "jpeglib.h"
18
19
20/* Private state */
21
22typedef enum {
23 main_pass, /* input data, also do first output step */
24 huff_opt_pass, /* Huffman code optimization pass */
25 output_pass /* data output pass */
26} c_pass_type;
27
28typedef struct {
29 struct jpeg_comp_master pub; /* public fields */
30
31 c_pass_type pass_type; /* the type of the current pass */
32
33 int pass_number; /* # of passes completed */
34 int total_passes; /* total # of passes needed */
35
36 int scan_number; /* current index in scan_info[] */
37} my_comp_master;
38
39typedef my_comp_master * my_master_ptr;
40
41
42/*
43 * Support routines that do various essential calculations.
44 */
45
46/*
47 * Compute JPEG image dimensions and related values.
48 * NOTE: this is exported for possible use by application.
49 * Hence it mustn't do anything that can't be done twice.
50 */
51
52GLOBAL(void)
53jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
54/* Do computations that are needed before master selection phase */
55{
56#ifdef DCT_SCALING_SUPPORTED
57
58 /* Sanity check on input image dimensions to prevent overflow in
59 * following calculation.
60 * We do check jpeg_width and jpeg_height in initial_setup below,
61 * but image_width and image_height can come from arbitrary data,
62 * and we need some space for multiplication by block_size.
63 */
64 if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
65 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
66
67 /* Compute actual JPEG image dimensions and DCT scaling choices. */
68 if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
69 /* Provide block_size/1 scaling */
70 cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
71 cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
72 cinfo->min_DCT_h_scaled_size = 1;
73 cinfo->min_DCT_v_scaled_size = 1;
74 } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
75 /* Provide block_size/2 scaling */
76 cinfo->jpeg_width = (JDIMENSION)
77 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
78 cinfo->jpeg_height = (JDIMENSION)
79 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
80 cinfo->min_DCT_h_scaled_size = 2;
81 cinfo->min_DCT_v_scaled_size = 2;
82 } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
83 /* Provide block_size/3 scaling */
84 cinfo->jpeg_width = (JDIMENSION)
85 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
86 cinfo->jpeg_height = (JDIMENSION)
87 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
88 cinfo->min_DCT_h_scaled_size = 3;
89 cinfo->min_DCT_v_scaled_size = 3;
90 } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
91 /* Provide block_size/4 scaling */
92 cinfo->jpeg_width = (JDIMENSION)
93 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
94 cinfo->jpeg_height = (JDIMENSION)
95 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
96 cinfo->min_DCT_h_scaled_size = 4;
97 cinfo->min_DCT_v_scaled_size = 4;
98 } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
99 /* Provide block_size/5 scaling */
100 cinfo->jpeg_width = (JDIMENSION)
101 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
102 cinfo->jpeg_height = (JDIMENSION)
103 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
104 cinfo->min_DCT_h_scaled_size = 5;
105 cinfo->min_DCT_v_scaled_size = 5;
106 } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
107 /* Provide block_size/6 scaling */
108 cinfo->jpeg_width = (JDIMENSION)
109 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
110 cinfo->jpeg_height = (JDIMENSION)
111 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
112 cinfo->min_DCT_h_scaled_size = 6;
113 cinfo->min_DCT_v_scaled_size = 6;
114 } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
115 /* Provide block_size/7 scaling */
116 cinfo->jpeg_width = (JDIMENSION)
117 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
118 cinfo->jpeg_height = (JDIMENSION)
119 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
120 cinfo->min_DCT_h_scaled_size = 7;
121 cinfo->min_DCT_v_scaled_size = 7;
122 } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
123 /* Provide block_size/8 scaling */
124 cinfo->jpeg_width = (JDIMENSION)
125 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
126 cinfo->jpeg_height = (JDIMENSION)
127 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
128 cinfo->min_DCT_h_scaled_size = 8;
129 cinfo->min_DCT_v_scaled_size = 8;
130 } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
131 /* Provide block_size/9 scaling */
132 cinfo->jpeg_width = (JDIMENSION)
133 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
134 cinfo->jpeg_height = (JDIMENSION)
135 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
136 cinfo->min_DCT_h_scaled_size = 9;
137 cinfo->min_DCT_v_scaled_size = 9;
138 } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
139 /* Provide block_size/10 scaling */
140 cinfo->jpeg_width = (JDIMENSION)
141 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
142 cinfo->jpeg_height = (JDIMENSION)
143 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
144 cinfo->min_DCT_h_scaled_size = 10;
145 cinfo->min_DCT_v_scaled_size = 10;
146 } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
147 /* Provide block_size/11 scaling */
148 cinfo->jpeg_width = (JDIMENSION)
149 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
150 cinfo->jpeg_height = (JDIMENSION)
151 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
152 cinfo->min_DCT_h_scaled_size = 11;
153 cinfo->min_DCT_v_scaled_size = 11;
154 } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
155 /* Provide block_size/12 scaling */
156 cinfo->jpeg_width = (JDIMENSION)
157 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
158 cinfo->jpeg_height = (JDIMENSION)
159 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
160 cinfo->min_DCT_h_scaled_size = 12;
161 cinfo->min_DCT_v_scaled_size = 12;
162 } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
163 /* Provide block_size/13 scaling */
164 cinfo->jpeg_width = (JDIMENSION)
165 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
166 cinfo->jpeg_height = (JDIMENSION)
167 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
168 cinfo->min_DCT_h_scaled_size = 13;
169 cinfo->min_DCT_v_scaled_size = 13;
170 } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
171 /* Provide block_size/14 scaling */
172 cinfo->jpeg_width = (JDIMENSION)
173 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
174 cinfo->jpeg_height = (JDIMENSION)
175 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
176 cinfo->min_DCT_h_scaled_size = 14;
177 cinfo->min_DCT_v_scaled_size = 14;
178 } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
179 /* Provide block_size/15 scaling */
180 cinfo->jpeg_width = (JDIMENSION)
181 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
182 cinfo->jpeg_height = (JDIMENSION)
183 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
184 cinfo->min_DCT_h_scaled_size = 15;
185 cinfo->min_DCT_v_scaled_size = 15;
186 } else {
187 /* Provide block_size/16 scaling */
188 cinfo->jpeg_width = (JDIMENSION)
189 jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
190 cinfo->jpeg_height = (JDIMENSION)
191 jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
192 cinfo->min_DCT_h_scaled_size = 16;
193 cinfo->min_DCT_v_scaled_size = 16;
194 }
195
196#else /* !DCT_SCALING_SUPPORTED */
197
198 /* Hardwire it to "no scaling" */
199 cinfo->jpeg_width = cinfo->image_width;
200 cinfo->jpeg_height = cinfo->image_height;
201 cinfo->min_DCT_h_scaled_size = DCTSIZE;
202 cinfo->min_DCT_v_scaled_size = DCTSIZE;
203
204#endif /* DCT_SCALING_SUPPORTED */
205}
206
207
208LOCAL(void)
209jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
210{
211 if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
212 ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
213 cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
214
215 cinfo->block_size = cinfo->min_DCT_h_scaled_size;
216}
217
218
219LOCAL(void)
220initial_setup (j_compress_ptr cinfo, boolean transcode_only)
221/* Do computations that are needed before master selection phase */
222{
223 int ci, ssize;
224 jpeg_component_info *compptr;
225 long samplesperrow;
226 JDIMENSION jd_samplesperrow;
227
228 if (transcode_only)
229 jpeg_calc_trans_dimensions(cinfo);
230 else
231 jpeg_calc_jpeg_dimensions(cinfo);
232
233 /* Sanity check on block_size */
234 if (cinfo->block_size < 1 || cinfo->block_size > 16)
235 ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
236
237 /* Derive natural_order from block_size */
238 switch (cinfo->block_size) {
239 case 2: cinfo->natural_order = jpeg_natural_order2; break;
240 case 3: cinfo->natural_order = jpeg_natural_order3; break;
241 case 4: cinfo->natural_order = jpeg_natural_order4; break;
242 case 5: cinfo->natural_order = jpeg_natural_order5; break;
243 case 6: cinfo->natural_order = jpeg_natural_order6; break;
244 case 7: cinfo->natural_order = jpeg_natural_order7; break;
245 default: cinfo->natural_order = jpeg_natural_order; break;
246 }
247
248 /* Derive lim_Se from block_size */
249 cinfo->lim_Se = cinfo->block_size < DCTSIZE ?
250 cinfo->block_size * cinfo->block_size - 1 : DCTSIZE2-1;
251
252 /* Sanity check on image dimensions */
253 if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 ||
254 cinfo->num_components <= 0 || cinfo->input_components <= 0)
255 ERREXIT(cinfo, JERR_EMPTY_IMAGE);
256
257 /* Make sure image isn't bigger than I can handle */
258 if ((long) cinfo->jpeg_height > (long) JPEG_MAX_DIMENSION ||
259 (long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION)
260 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
261
262 /* Width of an input scanline must be representable as JDIMENSION. */
263 samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
264 jd_samplesperrow = (JDIMENSION) samplesperrow;
265 if ((long) jd_samplesperrow != samplesperrow)
266 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
267
268 /* For now, precision must match compiled-in value... */
269 if (cinfo->data_precision != BITS_IN_JSAMPLE)
270 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
271
272 /* Check that number of components won't exceed internal array sizes */
273 if (cinfo->num_components > MAX_COMPONENTS)
274 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
275 MAX_COMPONENTS);
276
277 /* Compute maximum sampling factors; check factor validity */
278 cinfo->max_h_samp_factor = 1;
279 cinfo->max_v_samp_factor = 1;
280 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
281 ci++, compptr++) {
282 if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
283 compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
284 ERREXIT(cinfo, JERR_BAD_SAMPLING);
285 cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
286 compptr->h_samp_factor);
287 cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
288 compptr->v_samp_factor);
289 }
290
291 /* Compute dimensions of components */
292 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
293 ci++, compptr++) {
294 /* Fill in the correct component_index value; don't rely on application */
295 compptr->component_index = ci;
296 /* In selecting the actual DCT scaling for each component, we try to
297 * scale down the chroma components via DCT scaling rather than downsampling.
298 * This saves time if the downsampler gets to use 1:1 scaling.
299 * Note this code adapts subsampling ratios which are powers of 2.
300 */
301 ssize = 1;
302#ifdef DCT_SCALING_SUPPORTED
303 while (cinfo->min_DCT_h_scaled_size * ssize <=
304 (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
305 (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
306 ssize = ssize * 2;
307 }
308#endif
309 compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
310 ssize = 1;
311#ifdef DCT_SCALING_SUPPORTED
312 while (cinfo->min_DCT_v_scaled_size * ssize <=
313 (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
314 (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
315 ssize = ssize * 2;
316 }
317#endif
318 compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
319
320 /* We don't support DCT ratios larger than 2. */
321 if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2)
322 compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
323 else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
324 compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
325
326 /* Size in DCT blocks */
327 compptr->width_in_blocks = (JDIMENSION)
328 jdiv_round_up((long) cinfo->jpeg_width * (long) compptr->h_samp_factor,
329 (long) (cinfo->max_h_samp_factor * cinfo->block_size));
330 compptr->height_in_blocks = (JDIMENSION)
331 jdiv_round_up((long) cinfo->jpeg_height * (long) compptr->v_samp_factor,
332 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
333 /* Size in samples */
334 compptr->downsampled_width = (JDIMENSION)
335 jdiv_round_up((long) cinfo->jpeg_width *
336 (long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size),
337 (long) (cinfo->max_h_samp_factor * cinfo->block_size));
338 compptr->downsampled_height = (JDIMENSION)
339 jdiv_round_up((long) cinfo->jpeg_height *
340 (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),
341 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
342 /* Mark component needed (this flag isn't actually used for compression) */
343 compptr->component_needed = TRUE;
344 }
345
346 /* Compute number of fully interleaved MCU rows (number of times that
347 * main controller will call coefficient controller).
348 */
349 cinfo->total_iMCU_rows = (JDIMENSION)
350 jdiv_round_up((long) cinfo->jpeg_height,
351 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
352}
353
354
355#ifdef C_MULTISCAN_FILES_SUPPORTED
356
357LOCAL(void)
358validate_script (j_compress_ptr cinfo)
359/* Verify that the scan script in cinfo->scan_info[] is valid; also
360 * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
361 */
362{
363 const jpeg_scan_info * scanptr;
364 int scanno, ncomps, ci, coefi, thisi;
365 int Ss, Se, Ah, Al;
366 boolean component_sent[MAX_COMPONENTS];
367#ifdef C_PROGRESSIVE_SUPPORTED
368 int * last_bitpos_ptr;
369 int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
370 /* -1 until that coefficient has been seen; then last Al for it */
371#endif
372
373 if (cinfo->num_scans <= 0)
374 ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
375
376 /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
377 * for progressive JPEG, no scan can have this.
378 */
379 scanptr = cinfo->scan_info;
380 if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {
381#ifdef C_PROGRESSIVE_SUPPORTED
382 cinfo->progressive_mode = TRUE;
383 last_bitpos_ptr = & last_bitpos[0][0];
384 for (ci = 0; ci < cinfo->num_components; ci++)
385 for (coefi = 0; coefi < DCTSIZE2; coefi++)
386 *last_bitpos_ptr++ = -1;
387#else
388 ERREXIT(cinfo, JERR_NOT_COMPILED);
389#endif
390 } else {
391 cinfo->progressive_mode = FALSE;
392 for (ci = 0; ci < cinfo->num_components; ci++)
393 component_sent[ci] = FALSE;
394 }
395
396 for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
397 /* Validate component indexes */
398 ncomps = scanptr->comps_in_scan;
399 if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
400 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
401 for (ci = 0; ci < ncomps; ci++) {
402 thisi = scanptr->component_index[ci];
403 if (thisi < 0 || thisi >= cinfo->num_components)
404 ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
405 /* Components must appear in SOF order within each scan */
406 if (ci > 0 && thisi <= scanptr->component_index[ci-1])
407 ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
408 }
409 /* Validate progression parameters */
410 Ss = scanptr->Ss;
411 Se = scanptr->Se;
412 Ah = scanptr->Ah;
413 Al = scanptr->Al;
414 if (cinfo->progressive_mode) {
415#ifdef C_PROGRESSIVE_SUPPORTED
416 /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that
417 * seems wrong: the upper bound ought to depend on data precision.
418 * Perhaps they really meant 0..N+1 for N-bit precision.
419 * Here we allow 0..10 for 8-bit data; Al larger than 10 results in
420 * out-of-range reconstructed DC values during the first DC scan,
421 * which might cause problems for some decoders.
422 */
423#if BITS_IN_JSAMPLE == 8
424#define MAX_AH_AL 10
425#else
426#define MAX_AH_AL 13
427#endif
428 if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
429 Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
430 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
431 if (Ss == 0) {
432 if (Se != 0) /* DC and AC together not OK */
433 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
434 } else {
435 if (ncomps != 1) /* AC scans must be for only one component */
436 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
437 }
438 for (ci = 0; ci < ncomps; ci++) {
439 last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
440 if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
441 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
442 for (coefi = Ss; coefi <= Se; coefi++) {
443 if (last_bitpos_ptr[coefi] < 0) {
444 /* first scan of this coefficient */
445 if (Ah != 0)
446 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
447 } else {
448 /* not first scan */
449 if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
450 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
451 }
452 last_bitpos_ptr[coefi] = Al;
453 }
454 }
455#endif
456 } else {
457 /* For sequential JPEG, all progression parameters must be these: */
458 if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
459 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
460 /* Make sure components are not sent twice */
461 for (ci = 0; ci < ncomps; ci++) {
462 thisi = scanptr->component_index[ci];
463 if (component_sent[thisi])
464 ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
465 component_sent[thisi] = TRUE;
466 }
467 }
468 }
469
470 /* Now verify that everything got sent. */
471 if (cinfo->progressive_mode) {
472#ifdef C_PROGRESSIVE_SUPPORTED
473 /* For progressive mode, we only check that at least some DC data
474 * got sent for each component; the spec does not require that all bits
475 * of all coefficients be transmitted. Would it be wiser to enforce
476 * transmission of all coefficient bits??
477 */
478 for (ci = 0; ci < cinfo->num_components; ci++) {
479 if (last_bitpos[ci][0] < 0)
480 ERREXIT(cinfo, JERR_MISSING_DATA);
481 }
482#endif
483 } else {
484 for (ci = 0; ci < cinfo->num_components; ci++) {
485 if (! component_sent[ci])
486 ERREXIT(cinfo, JERR_MISSING_DATA);
487 }
488 }
489}
490
491
492LOCAL(void)
493reduce_script (j_compress_ptr cinfo)
494/* Adapt scan script for use with reduced block size;
495 * assume that script has been validated before.
496 */
497{
498 jpeg_scan_info * scanptr;
499 int idxout, idxin;
500
501 /* Circumvent const declaration for this function */
502 scanptr = (jpeg_scan_info *) cinfo->scan_info;
503 idxout = 0;
504
505 for (idxin = 0; idxin < cinfo->num_scans; idxin++) {
506 /* After skipping, idxout becomes smaller than idxin */
507 if (idxin != idxout)
508 /* Copy rest of data;
509 * note we stay in given chunk of allocated memory.
510 */
511 scanptr[idxout] = scanptr[idxin];
512 if (scanptr[idxout].Ss > cinfo->lim_Se)
513 /* Entire scan out of range - skip this entry */
514 continue;
515 if (scanptr[idxout].Se > cinfo->lim_Se)
516 /* Limit scan to end of block */
517 scanptr[idxout].Se = cinfo->lim_Se;
518 idxout++;
519 }
520
521 cinfo->num_scans = idxout;
522}
523
524#endif /* C_MULTISCAN_FILES_SUPPORTED */
525
526
527LOCAL(void)
528select_scan_parameters (j_compress_ptr cinfo)
529/* Set up the scan parameters for the current scan */
530{
531 int ci;
532
533#ifdef C_MULTISCAN_FILES_SUPPORTED
534 if (cinfo->scan_info != NULL) {
535 /* Prepare for current scan --- the script is already validated */
536 my_master_ptr master = (my_master_ptr) cinfo->master;
537 const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;
538
539 cinfo->comps_in_scan = scanptr->comps_in_scan;
540 for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
541 cinfo->cur_comp_info[ci] =
542 &cinfo->comp_info[scanptr->component_index[ci]];
543 }
544 if (cinfo->progressive_mode) {
545 cinfo->Ss = scanptr->Ss;
546 cinfo->Se = scanptr->Se;
547 cinfo->Ah = scanptr->Ah;
548 cinfo->Al = scanptr->Al;
549 return;
550 }
551 }
552 else
553#endif
554 {
555 /* Prepare for single sequential-JPEG scan containing all components */
556 if (cinfo->num_components > MAX_COMPS_IN_SCAN)
557 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
558 MAX_COMPS_IN_SCAN);
559 cinfo->comps_in_scan = cinfo->num_components;
560 for (ci = 0; ci < cinfo->num_components; ci++) {
561 cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
562 }
563 }
564 cinfo->Ss = 0;
565 cinfo->Se = cinfo->block_size * cinfo->block_size - 1;
566 cinfo->Ah = 0;
567 cinfo->Al = 0;
568}
569
570
571LOCAL(void)
572per_scan_setup (j_compress_ptr cinfo)
573/* Do computations that are needed before processing a JPEG scan */
574/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
575{
576 int ci, mcublks, tmp;
577 jpeg_component_info *compptr;
578
579 if (cinfo->comps_in_scan == 1) {
580
581 /* Noninterleaved (single-component) scan */
582 compptr = cinfo->cur_comp_info[0];
583
584 /* Overall image size in MCUs */
585 cinfo->MCUs_per_row = compptr->width_in_blocks;
586 cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
587
588 /* For noninterleaved scan, always one block per MCU */
589 compptr->MCU_width = 1;
590 compptr->MCU_height = 1;
591 compptr->MCU_blocks = 1;
592 compptr->MCU_sample_width = compptr->DCT_h_scaled_size;
593 compptr->last_col_width = 1;
594 /* For noninterleaved scans, it is convenient to define last_row_height
595 * as the number of block rows present in the last iMCU row.
596 */
597 tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
598 if (tmp == 0) tmp = compptr->v_samp_factor;
599 compptr->last_row_height = tmp;
600
601 /* Prepare array describing MCU composition */
602 cinfo->blocks_in_MCU = 1;
603 cinfo->MCU_membership[0] = 0;
604
605 } else {
606
607 /* Interleaved (multi-component) scan */
608 if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
609 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
610 MAX_COMPS_IN_SCAN);
611
612 /* Overall image size in MCUs */
613 cinfo->MCUs_per_row = (JDIMENSION)
614 jdiv_round_up((long) cinfo->jpeg_width,
615 (long) (cinfo->max_h_samp_factor * cinfo->block_size));
616 cinfo->MCU_rows_in_scan = (JDIMENSION)
617 jdiv_round_up((long) cinfo->jpeg_height,
618 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
619
620 cinfo->blocks_in_MCU = 0;
621
622 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
623 compptr = cinfo->cur_comp_info[ci];
624 /* Sampling factors give # of blocks of component in each MCU */
625 compptr->MCU_width = compptr->h_samp_factor;
626 compptr->MCU_height = compptr->v_samp_factor;
627 compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
628 compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size;
629 /* Figure number of non-dummy blocks in last MCU column & row */
630 tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
631 if (tmp == 0) tmp = compptr->MCU_width;
632 compptr->last_col_width = tmp;
633 tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
634 if (tmp == 0) tmp = compptr->MCU_height;
635 compptr->last_row_height = tmp;
636 /* Prepare array describing MCU composition */
637 mcublks = compptr->MCU_blocks;
638 if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
639 ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
640 while (mcublks-- > 0) {
641 cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
642 }
643 }
644
645 }
646
647 /* Convert restart specified in rows to actual MCU count. */
648 /* Note that count must fit in 16 bits, so we provide limiting. */
649 if (cinfo->restart_in_rows > 0) {
650 long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;
651 cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);
652 }
653}
654
655
656/*
657 * Per-pass setup.
658 * This is called at the beginning of each pass. We determine which modules
659 * will be active during this pass and give them appropriate start_pass calls.
660 * We also set is_last_pass to indicate whether any more passes will be
661 * required.
662 */
663
664METHODDEF(void)
665prepare_for_pass (j_compress_ptr cinfo)
666{
667 my_master_ptr master = (my_master_ptr) cinfo->master;
668
669 switch (master->pass_type) {
670 case main_pass:
671 /* Initial pass: will collect input data, and do either Huffman
672 * optimization or data output for the first scan.
673 */
674 select_scan_parameters(cinfo);
675 per_scan_setup(cinfo);
676 if (! cinfo->raw_data_in) {
677 (*cinfo->cconvert->start_pass) (cinfo);
678 (*cinfo->downsample->start_pass) (cinfo);
679 (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
680 }
681 (*cinfo->fdct->start_pass) (cinfo);
682 (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
683 (*cinfo->coef->start_pass) (cinfo,
684 (master->total_passes > 1 ?
685 JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
686 (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
687 if (cinfo->optimize_coding) {
688 /* No immediate data output; postpone writing frame/scan headers */
689 master->pub.call_pass_startup = FALSE;
690 } else {
691 /* Will write frame/scan headers at first jpeg_write_scanlines call */
692 master->pub.call_pass_startup = TRUE;
693 }
694 break;
695#ifdef ENTROPY_OPT_SUPPORTED
696 case huff_opt_pass:
697 /* Do Huffman optimization for a scan after the first one. */
698 select_scan_parameters(cinfo);
699 per_scan_setup(cinfo);
700 if (cinfo->Ss != 0 || cinfo->Ah == 0) {
701 (*cinfo->entropy->start_pass) (cinfo, TRUE);
702 (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
703 master->pub.call_pass_startup = FALSE;
704 break;
705 }
706 /* Special case: Huffman DC refinement scans need no Huffman table
707 * and therefore we can skip the optimization pass for them.
708 */
709 master->pass_type = output_pass;
710 master->pass_number++;
711 /*FALLTHROUGH*/
712#endif
713 case output_pass:
714 /* Do a data-output pass. */
715 /* We need not repeat per-scan setup if prior optimization pass did it. */
716 if (! cinfo->optimize_coding) {
717 select_scan_parameters(cinfo);
718 per_scan_setup(cinfo);
719 }
720 (*cinfo->entropy->start_pass) (cinfo, FALSE);
721 (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
722 /* We emit frame/scan headers now */
723 if (master->scan_number == 0)
724 (*cinfo->marker->write_frame_header) (cinfo);
725 (*cinfo->marker->write_scan_header) (cinfo);
726 master->pub.call_pass_startup = FALSE;
727 break;
728 default:
729 ERREXIT(cinfo, JERR_NOT_COMPILED);
730 }
731
732 master->pub.is_last_pass = (master->pass_number == master->total_passes-1);
733
734 /* Set up progress monitor's pass info if present */
735 if (cinfo->progress != NULL) {
736 cinfo->progress->completed_passes = master->pass_number;
737 cinfo->progress->total_passes = master->total_passes;
738 }
739}
740
741
742/*
743 * Special start-of-pass hook.
744 * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
745 * In single-pass processing, we need this hook because we don't want to
746 * write frame/scan headers during jpeg_start_compress; we want to let the
747 * application write COM markers etc. between jpeg_start_compress and the
748 * jpeg_write_scanlines loop.
749 * In multi-pass processing, this routine is not used.
750 */
751
752METHODDEF(void)
753pass_startup (j_compress_ptr cinfo)
754{
755 cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
756
757 (*cinfo->marker->write_frame_header) (cinfo);
758 (*cinfo->marker->write_scan_header) (cinfo);
759}
760
761
762/*
763 * Finish up at end of pass.
764 */
765
766METHODDEF(void)
767finish_pass_master (j_compress_ptr cinfo)
768{
769 my_master_ptr master = (my_master_ptr) cinfo->master;
770
771 /* The entropy coder always needs an end-of-pass call,
772 * either to analyze statistics or to flush its output buffer.
773 */
774 (*cinfo->entropy->finish_pass) (cinfo);
775
776 /* Update state for next pass */
777 switch (master->pass_type) {
778 case main_pass:
779 /* next pass is either output of scan 0 (after optimization)
780 * or output of scan 1 (if no optimization).
781 */
782 master->pass_type = output_pass;
783 if (! cinfo->optimize_coding)
784 master->scan_number++;
785 break;
786 case huff_opt_pass:
787 /* next pass is always output of current scan */
788 master->pass_type = output_pass;
789 break;
790 case output_pass:
791 /* next pass is either optimization or output of next scan */
792 if (cinfo->optimize_coding)
793 master->pass_type = huff_opt_pass;
794 master->scan_number++;
795 break;
796 }
797
798 master->pass_number++;
799}
800
801
802/*
803 * Initialize master compression control.
804 */
805
806GLOBAL(void)
807jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
808{
809 my_master_ptr master;
810
811 master = (my_master_ptr)
812 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
813 SIZEOF(my_comp_master));
814 cinfo->master = (struct jpeg_comp_master *) master;
815 master->pub.prepare_for_pass = prepare_for_pass;
816 master->pub.pass_startup = pass_startup;
817 master->pub.finish_pass = finish_pass_master;
818 master->pub.is_last_pass = FALSE;
819
820 /* Validate parameters, determine derived values */
821 initial_setup(cinfo, transcode_only);
822
823 if (cinfo->scan_info != NULL) {
824#ifdef C_MULTISCAN_FILES_SUPPORTED
825 validate_script(cinfo);
826 if (cinfo->block_size < DCTSIZE)
827 reduce_script(cinfo);
828#else
829 ERREXIT(cinfo, JERR_NOT_COMPILED);
830#endif
831 } else {
832 cinfo->progressive_mode = FALSE;
833 cinfo->num_scans = 1;
834 }
835
836 if ((cinfo->progressive_mode || cinfo->block_size < DCTSIZE) &&
837 !cinfo->arith_code) /* TEMPORARY HACK ??? */
838 /* assume default tables no good for progressive or downscale mode */
839 cinfo->optimize_coding = TRUE;
840
841 /* Initialize my private state */
842 if (transcode_only) {
843 /* no main pass in transcoding */
844 if (cinfo->optimize_coding)
845 master->pass_type = huff_opt_pass;
846 else
847 master->pass_type = output_pass;
848 } else {
849 /* for normal compression, first pass is always this type: */
850 master->pass_type = main_pass;
851 }
852 master->scan_number = 0;
853 master->pass_number = 0;
854 if (cinfo->optimize_coding)
855 master->total_passes = cinfo->num_scans * 2;
856 else
857 master->total_passes = cinfo->num_scans;
858}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcomapi.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcomapi.c
new file mode 100644
index 0000000..1b1a340
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcomapi.c
@@ -0,0 +1,106 @@
1/*
2 * jcomapi.c
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains application interface routines that are used for both
9 * compression and decompression.
10 */
11
12#define JPEG_INTERNALS
13#include "jinclude.h"
14#include "jpeglib.h"
15
16
17/*
18 * Abort processing of a JPEG compression or decompression operation,
19 * but don't destroy the object itself.
20 *
21 * For this, we merely clean up all the nonpermanent memory pools.
22 * Note that temp files (virtual arrays) are not allowed to belong to
23 * the permanent pool, so we will be able to close all temp files here.
24 * Closing a data source or destination, if necessary, is the application's
25 * responsibility.
26 */
27
28GLOBAL(void)
29jpeg_abort (j_common_ptr cinfo)
30{
31 int pool;
32
33 /* Do nothing if called on a not-initialized or destroyed JPEG object. */
34 if (cinfo->mem == NULL)
35 return;
36
37 /* Releasing pools in reverse order might help avoid fragmentation
38 * with some (brain-damaged) malloc libraries.
39 */
40 for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
41 (*cinfo->mem->free_pool) (cinfo, pool);
42 }
43
44 /* Reset overall state for possible reuse of object */
45 if (cinfo->is_decompressor) {
46 cinfo->global_state = DSTATE_START;
47 /* Try to keep application from accessing now-deleted marker list.
48 * A bit kludgy to do it here, but this is the most central place.
49 */
50 ((j_decompress_ptr) cinfo)->marker_list = NULL;
51 } else {
52 cinfo->global_state = CSTATE_START;
53 }
54}
55
56
57/*
58 * Destruction of a JPEG object.
59 *
60 * Everything gets deallocated except the master jpeg_compress_struct itself
61 * and the error manager struct. Both of these are supplied by the application
62 * and must be freed, if necessary, by the application. (Often they are on
63 * the stack and so don't need to be freed anyway.)
64 * Closing a data source or destination, if necessary, is the application's
65 * responsibility.
66 */
67
68GLOBAL(void)
69jpeg_destroy (j_common_ptr cinfo)
70{
71 /* We need only tell the memory manager to release everything. */
72 /* NB: mem pointer is NULL if memory mgr failed to initialize. */
73 if (cinfo->mem != NULL)
74 (*cinfo->mem->self_destruct) (cinfo);
75 cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
76 cinfo->global_state = 0; /* mark it destroyed */
77}
78
79
80/*
81 * Convenience routines for allocating quantization and Huffman tables.
82 * (Would jutils.c be a more reasonable place to put these?)
83 */
84
85GLOBAL(JQUANT_TBL *)
86jpeg_alloc_quant_table (j_common_ptr cinfo)
87{
88 JQUANT_TBL *tbl;
89
90 tbl = (JQUANT_TBL *)
91 (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
92 tbl->sent_table = FALSE; /* make sure this is false in any new table */
93 return tbl;
94}
95
96
97GLOBAL(JHUFF_TBL *)
98jpeg_alloc_huff_table (j_common_ptr cinfo)
99{
100 JHUFF_TBL *tbl;
101
102 tbl = (JHUFF_TBL *)
103 (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
104 tbl->sent_table = FALSE; /* make sure this is false in any new table */
105 return tbl;
106}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.bcc b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.bcc
new file mode 100644
index 0000000..ae2e97e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.bcc
@@ -0,0 +1,48 @@
1/* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#ifdef __MSDOS__
15#define NEED_FAR_POINTERS /* for small or medium memory model */
16#endif
17#undef NEED_SHORT_EXTERNAL_NAMES
18#undef INCOMPLETE_TYPES_BROKEN /* this assumes you have -w-stu in CFLAGS */
19
20#ifdef JPEG_INTERNALS
21
22#undef RIGHT_SHIFT_IS_UNSIGNED
23
24#ifdef __MSDOS__
25#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */
26#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */
27#define USE_FMEM /* Borland has _fmemcpy() and _fmemset() */
28#endif
29
30#endif /* JPEG_INTERNALS */
31
32#ifdef JPEG_CJPEG_DJPEG
33
34#define BMP_SUPPORTED /* BMP image file format */
35#define GIF_SUPPORTED /* GIF image file format */
36#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
37#undef RLE_SUPPORTED /* Utah RLE image file format */
38#define TARGA_SUPPORTED /* Targa image file format */
39
40#define TWO_FILE_COMMANDLINE
41#define USE_SETMODE /* Borland has setmode() */
42#ifdef __MSDOS__
43#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */
44#endif
45#undef DONT_USE_B_MODE
46#undef PROGRESS_REPORT /* optional */
47
48#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.cfg b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.cfg
new file mode 100644
index 0000000..5f57e8e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.cfg
@@ -0,0 +1,53 @@
1/* jconfig.cfg --- source file edited by configure script */
2/* see jconfig.txt for explanations */
3
4#undef HAVE_PROTOTYPES
5#undef HAVE_UNSIGNED_CHAR
6#undef HAVE_UNSIGNED_SHORT
7#undef void
8#undef const
9#undef CHAR_IS_UNSIGNED
10#undef HAVE_STDDEF_H
11#undef HAVE_STDLIB_H
12#undef HAVE_LOCALE_H
13#undef NEED_BSD_STRINGS
14#undef NEED_SYS_TYPES_H
15#undef NEED_FAR_POINTERS
16#undef NEED_SHORT_EXTERNAL_NAMES
17/* Define this if you get warnings about undefined structures. */
18#undef INCOMPLETE_TYPES_BROKEN
19
20/* Define "boolean" as unsigned char, not int, on Windows systems. */
21#ifdef _WIN32
22#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
23typedef unsigned char boolean;
24#endif
25#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
26#endif
27
28#ifdef JPEG_INTERNALS
29
30#undef RIGHT_SHIFT_IS_UNSIGNED
31#undef INLINE
32/* These are for configuring the JPEG memory manager. */
33#undef DEFAULT_MAX_MEM
34#undef NO_MKTEMP
35
36#endif /* JPEG_INTERNALS */
37
38#ifdef JPEG_CJPEG_DJPEG
39
40#define BMP_SUPPORTED /* BMP image file format */
41#define GIF_SUPPORTED /* GIF image file format */
42#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
43#undef RLE_SUPPORTED /* Utah RLE image file format */
44#define TARGA_SUPPORTED /* Targa image file format */
45
46#undef TWO_FILE_COMMANDLINE
47#undef NEED_SIGNAL_CATCHER
48#undef DONT_USE_B_MODE
49
50/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
51#undef PROGRESS_REPORT
52
53#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.dj b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.dj
new file mode 100644
index 0000000..9c0f2ce
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.dj
@@ -0,0 +1,38 @@
1/* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#endif /* JPEG_INTERNALS */
23
24#ifdef JPEG_CJPEG_DJPEG
25
26#define BMP_SUPPORTED /* BMP image file format */
27#define GIF_SUPPORTED /* GIF image file format */
28#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
29#undef RLE_SUPPORTED /* Utah RLE image file format */
30#define TARGA_SUPPORTED /* Targa image file format */
31
32#undef TWO_FILE_COMMANDLINE /* optional */
33#define USE_SETMODE /* Needed to make one-file style work in DJGPP */
34#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */
35#undef DONT_USE_B_MODE
36#undef PROGRESS_REPORT /* optional */
37
38#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.h
new file mode 100644
index 0000000..709c4de
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.h
@@ -0,0 +1,45 @@
1/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18/* Define "boolean" as unsigned char, not int, per Windows custom */
19#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
20typedef unsigned char boolean;
21#endif
22#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
23
24
25#ifdef JPEG_INTERNALS
26
27#undef RIGHT_SHIFT_IS_UNSIGNED
28
29#endif /* JPEG_INTERNALS */
30
31#ifdef JPEG_CJPEG_DJPEG
32
33#define BMP_SUPPORTED /* BMP image file format */
34#define GIF_SUPPORTED /* GIF image file format */
35#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
36#undef RLE_SUPPORTED /* Utah RLE image file format */
37#define TARGA_SUPPORTED /* Targa image file format */
38
39#define TWO_FILE_COMMANDLINE /* optional */
40#define USE_SETMODE /* Microsoft has setmode() */
41#undef NEED_SIGNAL_CATCHER
42#undef DONT_USE_B_MODE
43#undef PROGRESS_REPORT /* optional */
44
45#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mac b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mac
new file mode 100644
index 0000000..a5e5519
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mac
@@ -0,0 +1,43 @@
1/* jconfig.mac --- jconfig.h for CodeWarrior on Apple Macintosh */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#define USE_MAC_MEMMGR /* Define this if you use jmemmac.c */
23
24#define ALIGN_TYPE long /* Needed for 680x0 Macs */
25
26#endif /* JPEG_INTERNALS */
27
28#ifdef JPEG_CJPEG_DJPEG
29
30#define BMP_SUPPORTED /* BMP image file format */
31#define GIF_SUPPORTED /* GIF image file format */
32#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
33#undef RLE_SUPPORTED /* Utah RLE image file format */
34#define TARGA_SUPPORTED /* Targa image file format */
35
36#define USE_CCOMMAND /* Command line reader for Macintosh */
37#define TWO_FILE_COMMANDLINE /* Binary I/O thru stdin/stdout doesn't work */
38
39#undef NEED_SIGNAL_CATCHER
40#undef DONT_USE_B_MODE
41#undef PROGRESS_REPORT /* optional */
42
43#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.manx b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.manx
new file mode 100644
index 0000000..46ce226
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.manx
@@ -0,0 +1,43 @@
1/* jconfig.manx --- jconfig.h for Amiga systems using Manx Aztec C ver 5.x. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */
23
24#define SHORTxSHORT_32 /* produces better DCT code with Aztec C */
25
26#endif /* JPEG_INTERNALS */
27
28#ifdef JPEG_CJPEG_DJPEG
29
30#define BMP_SUPPORTED /* BMP image file format */
31#define GIF_SUPPORTED /* GIF image file format */
32#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
33#undef RLE_SUPPORTED /* Utah RLE image file format */
34#define TARGA_SUPPORTED /* Targa image file format */
35
36#define TWO_FILE_COMMANDLINE
37#define NEED_SIGNAL_CATCHER
38#undef DONT_USE_B_MODE
39#undef PROGRESS_REPORT /* optional */
40
41#define signal_catcher _abort /* hack for Aztec C naming requirements */
42
43#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mc6
new file mode 100644
index 0000000..4dae6d0
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.mc6
@@ -0,0 +1,52 @@
1/* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#define NEED_FAR_POINTERS /* for small or medium memory model */
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */
23
24#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */
25
26#define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */
27
28#define NEED_FHEAPMIN /* far heap management routines are broken */
29
30#define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */
31/* Note: the above define is known to improve the code with Microsoft C 6.00A.
32 * I do not know whether it is good for later compiler versions.
33 * Please report any info on this point to jpeg-info@jpegclub.org.
34 */
35
36#endif /* JPEG_INTERNALS */
37
38#ifdef JPEG_CJPEG_DJPEG
39
40#define BMP_SUPPORTED /* BMP image file format */
41#define GIF_SUPPORTED /* GIF image file format */
42#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
43#undef RLE_SUPPORTED /* Utah RLE image file format */
44#define TARGA_SUPPORTED /* Targa image file format */
45
46#define TWO_FILE_COMMANDLINE
47#define USE_SETMODE /* Microsoft has setmode() */
48#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */
49#undef DONT_USE_B_MODE
50#undef PROGRESS_REPORT /* optional */
51
52#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.sas b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.sas
new file mode 100644
index 0000000..8dc8cc1
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.sas
@@ -0,0 +1,43 @@
1/* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */
23
24#define NO_MKTEMP /* SAS C doesn't have mktemp() */
25
26#define SHORTxSHORT_32 /* produces better DCT code with SAS C */
27
28#endif /* JPEG_INTERNALS */
29
30#ifdef JPEG_CJPEG_DJPEG
31
32#define BMP_SUPPORTED /* BMP image file format */
33#define GIF_SUPPORTED /* GIF image file format */
34#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
35#undef RLE_SUPPORTED /* Utah RLE image file format */
36#define TARGA_SUPPORTED /* Targa image file format */
37
38#define TWO_FILE_COMMANDLINE
39#define NEED_SIGNAL_CATCHER
40#undef DONT_USE_B_MODE
41#undef PROGRESS_REPORT /* optional */
42
43#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.st b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.st
new file mode 100644
index 0000000..e0af8e1
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.st
@@ -0,0 +1,42 @@
1/* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS
15#undef NEED_SHORT_EXTERNAL_NAMES
16#define INCOMPLETE_TYPES_BROKEN /* suppress undefined-structure warnings */
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#define ALIGN_TYPE long /* apparently double is a weird size? */
23
24#endif /* JPEG_INTERNALS */
25
26#ifdef JPEG_CJPEG_DJPEG
27
28#define BMP_SUPPORTED /* BMP image file format */
29#define GIF_SUPPORTED /* GIF image file format */
30#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
31#undef RLE_SUPPORTED /* Utah RLE image file format */
32#define TARGA_SUPPORTED /* Targa image file format */
33
34#define TWO_FILE_COMMANDLINE /* optional -- undef if you like Unix style */
35/* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define
36 * USE_SETMODE. Some Atari compilers require it, some do not.
37 */
38#define NEED_SIGNAL_CATCHER /* needed if you use jmemname.c */
39#undef DONT_USE_B_MODE
40#undef PROGRESS_REPORT /* optional */
41
42#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.txt
new file mode 100644
index 0000000..27086a3
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.txt
@@ -0,0 +1,164 @@
1/*
2 * jconfig.txt
3 *
4 * Copyright (C) 1991-1994, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file documents the configuration options that are required to
9 * customize the JPEG software for a particular system.
10 *
11 * The actual configuration options for a particular installation are stored
12 * in jconfig.h. On many machines, jconfig.h can be generated automatically
13 * or copied from one of the "canned" jconfig files that we supply. But if
14 * you need to generate a jconfig.h file by hand, this file tells you how.
15 *
16 * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING.
17 * EDIT A COPY NAMED JCONFIG.H.
18 */
19
20
21/*
22 * These symbols indicate the properties of your machine or compiler.
23 * #define the symbol if yes, #undef it if no.
24 */
25
26/* Does your compiler support function prototypes?
27 * (If not, you also need to use ansi2knr, see install.txt)
28 */
29#define HAVE_PROTOTYPES
30
31/* Does your compiler support the declaration "unsigned char" ?
32 * How about "unsigned short" ?
33 */
34#define HAVE_UNSIGNED_CHAR
35#define HAVE_UNSIGNED_SHORT
36
37/* Define "void" as "char" if your compiler doesn't know about type void.
38 * NOTE: be sure to define void such that "void *" represents the most general
39 * pointer type, e.g., that returned by malloc().
40 */
41/* #define void char */
42
43/* Define "const" as empty if your compiler doesn't know the "const" keyword.
44 */
45/* #define const */
46
47/* Define this if an ordinary "char" type is unsigned.
48 * If you're not sure, leaving it undefined will work at some cost in speed.
49 * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
50 */
51#undef CHAR_IS_UNSIGNED
52
53/* Define this if your system has an ANSI-conforming <stddef.h> file.
54 */
55#define HAVE_STDDEF_H
56
57/* Define this if your system has an ANSI-conforming <stdlib.h> file.
58 */
59#define HAVE_STDLIB_H
60
61/* Define this if your system does not have an ANSI/SysV <string.h>,
62 * but does have a BSD-style <strings.h>.
63 */
64#undef NEED_BSD_STRINGS
65
66/* Define this if your system does not provide typedef size_t in any of the
67 * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in
68 * <sys/types.h> instead.
69 */
70#undef NEED_SYS_TYPES_H
71
72/* For 80x86 machines, you need to define NEED_FAR_POINTERS,
73 * unless you are using a large-data memory model or 80386 flat-memory mode.
74 * On less brain-damaged CPUs this symbol must not be defined.
75 * (Defining this symbol causes large data structures to be referenced through
76 * "far" pointers and to be allocated with a special version of malloc.)
77 */
78#undef NEED_FAR_POINTERS
79
80/* Define this if your linker needs global names to be unique in less
81 * than the first 15 characters.
82 */
83#undef NEED_SHORT_EXTERNAL_NAMES
84
85/* Although a real ANSI C compiler can deal perfectly well with pointers to
86 * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
87 * and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
88 * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you
89 * actually get "missing structure definition" warnings or errors while
90 * compiling the JPEG code.
91 */
92#undef INCOMPLETE_TYPES_BROKEN
93
94/* Define "boolean" as unsigned char, not int, on Windows systems.
95 */
96#ifdef _WIN32
97#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
98typedef unsigned char boolean;
99#endif
100#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
101#endif
102
103
104/*
105 * The following options affect code selection within the JPEG library,
106 * but they don't need to be visible to applications using the library.
107 * To minimize application namespace pollution, the symbols won't be
108 * defined unless JPEG_INTERNALS has been defined.
109 */
110
111#ifdef JPEG_INTERNALS
112
113/* Define this if your compiler implements ">>" on signed values as a logical
114 * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift,
115 * which is the normal and rational definition.
116 */
117#undef RIGHT_SHIFT_IS_UNSIGNED
118
119
120#endif /* JPEG_INTERNALS */
121
122
123/*
124 * The remaining options do not affect the JPEG library proper,
125 * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).
126 * Other applications can ignore these.
127 */
128
129#ifdef JPEG_CJPEG_DJPEG
130
131/* These defines indicate which image (non-JPEG) file formats are allowed. */
132
133#define BMP_SUPPORTED /* BMP image file format */
134#define GIF_SUPPORTED /* GIF image file format */
135#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
136#undef RLE_SUPPORTED /* Utah RLE image file format */
137#define TARGA_SUPPORTED /* Targa image file format */
138
139/* Define this if you want to name both input and output files on the command
140 * line, rather than using stdout and optionally stdin. You MUST do this if
141 * your system can't cope with binary I/O to stdin/stdout. See comments at
142 * head of cjpeg.c or djpeg.c.
143 */
144#undef TWO_FILE_COMMANDLINE
145
146/* Define this if your system needs explicit cleanup of temporary files.
147 * This is crucial under MS-DOS, where the temporary "files" may be areas
148 * of extended memory; on most other systems it's not as important.
149 */
150#undef NEED_SIGNAL_CATCHER
151
152/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb").
153 * This is necessary on systems that distinguish text files from binary files,
154 * and is harmless on most systems that don't. If you have one of the rare
155 * systems that complains about the "b" spec, define this symbol.
156 */
157#undef DONT_USE_B_MODE
158
159/* Define this if you want percent-done progress reports from cjpeg/djpeg.
160 */
161#undef PROGRESS_REPORT
162
163
164#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vc b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vc
new file mode 100644
index 0000000..709c4de
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vc
@@ -0,0 +1,45 @@
1/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18/* Define "boolean" as unsigned char, not int, per Windows custom */
19#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
20typedef unsigned char boolean;
21#endif
22#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
23
24
25#ifdef JPEG_INTERNALS
26
27#undef RIGHT_SHIFT_IS_UNSIGNED
28
29#endif /* JPEG_INTERNALS */
30
31#ifdef JPEG_CJPEG_DJPEG
32
33#define BMP_SUPPORTED /* BMP image file format */
34#define GIF_SUPPORTED /* GIF image file format */
35#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
36#undef RLE_SUPPORTED /* Utah RLE image file format */
37#define TARGA_SUPPORTED /* Targa image file format */
38
39#define TWO_FILE_COMMANDLINE /* optional */
40#define USE_SETMODE /* Microsoft has setmode() */
41#undef NEED_SIGNAL_CATCHER
42#undef DONT_USE_B_MODE
43#undef PROGRESS_REPORT /* optional */
44
45#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vms b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vms
new file mode 100644
index 0000000..bdaa027
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.vms
@@ -0,0 +1,37 @@
1/* jconfig.vms --- jconfig.h for use on Digital VMS. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#undef CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#endif /* JPEG_INTERNALS */
23
24#ifdef JPEG_CJPEG_DJPEG
25
26#define BMP_SUPPORTED /* BMP image file format */
27#define GIF_SUPPORTED /* GIF image file format */
28#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
29#undef RLE_SUPPORTED /* Utah RLE image file format */
30#define TARGA_SUPPORTED /* Targa image file format */
31
32#define TWO_FILE_COMMANDLINE /* Needed on VMS */
33#undef NEED_SIGNAL_CATCHER
34#undef DONT_USE_B_MODE
35#undef PROGRESS_REPORT /* optional */
36
37#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.wat b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.wat
new file mode 100644
index 0000000..f1e0c02
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jconfig.wat
@@ -0,0 +1,38 @@
1/* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */
2/* see jconfig.txt for explanations */
3
4#define HAVE_PROTOTYPES
5#define HAVE_UNSIGNED_CHAR
6#define HAVE_UNSIGNED_SHORT
7/* #define void char */
8/* #define const */
9#define CHAR_IS_UNSIGNED
10#define HAVE_STDDEF_H
11#define HAVE_STDLIB_H
12#undef NEED_BSD_STRINGS
13#undef NEED_SYS_TYPES_H
14#undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */
15#undef NEED_SHORT_EXTERNAL_NAMES
16#undef INCOMPLETE_TYPES_BROKEN
17
18#ifdef JPEG_INTERNALS
19
20#undef RIGHT_SHIFT_IS_UNSIGNED
21
22#endif /* JPEG_INTERNALS */
23
24#ifdef JPEG_CJPEG_DJPEG
25
26#define BMP_SUPPORTED /* BMP image file format */
27#define GIF_SUPPORTED /* GIF image file format */
28#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
29#undef RLE_SUPPORTED /* Utah RLE image file format */
30#define TARGA_SUPPORTED /* Targa image file format */
31
32#undef TWO_FILE_COMMANDLINE /* optional */
33#define USE_SETMODE /* Needed to make one-file style work in Watcom */
34#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */
35#undef DONT_USE_B_MODE
36#undef PROGRESS_REPORT /* optional */
37
38#endif /* JPEG_CJPEG_DJPEG */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcparam.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcparam.c
new file mode 100644
index 0000000..10c5c87
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcparam.c
@@ -0,0 +1,632 @@
1/*
2 * jcparam.c
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * Modified 2003-2008 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains optional default-setting code for the JPEG compressor.
10 * Applications do not have to use this file, but those that don't use it
11 * must know a lot more about the innards of the JPEG code.
12 */
13
14#define JPEG_INTERNALS
15#include "jinclude.h"
16#include "jpeglib.h"
17
18
19/*
20 * Quantization table setup routines
21 */
22
23GLOBAL(void)
24jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
25 const unsigned int *basic_table,
26 int scale_factor, boolean force_baseline)
27/* Define a quantization table equal to the basic_table times
28 * a scale factor (given as a percentage).
29 * If force_baseline is TRUE, the computed quantization table entries
30 * are limited to 1..255 for JPEG baseline compatibility.
31 */
32{
33 JQUANT_TBL ** qtblptr;
34 int i;
35 long temp;
36
37 /* Safety check to ensure start_compress not called yet. */
38 if (cinfo->global_state != CSTATE_START)
39 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
40
41 if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
42 ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
43
44 qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
45
46 if (*qtblptr == NULL)
47 *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
48
49 for (i = 0; i < DCTSIZE2; i++) {
50 temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
51 /* limit the values to the valid range */
52 if (temp <= 0L) temp = 1L;
53 if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
54 if (force_baseline && temp > 255L)
55 temp = 255L; /* limit to baseline range if requested */
56 (*qtblptr)->quantval[i] = (UINT16) temp;
57 }
58
59 /* Initialize sent_table FALSE so table will be written to JPEG file. */
60 (*qtblptr)->sent_table = FALSE;
61}
62
63
64/* These are the sample quantization tables given in JPEG spec section K.1.
65 * The spec says that the values given produce "good" quality, and
66 * when divided by 2, "very good" quality.
67 */
68static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
69 16, 11, 10, 16, 24, 40, 51, 61,
70 12, 12, 14, 19, 26, 58, 60, 55,
71 14, 13, 16, 24, 40, 57, 69, 56,
72 14, 17, 22, 29, 51, 87, 80, 62,
73 18, 22, 37, 56, 68, 109, 103, 77,
74 24, 35, 55, 64, 81, 104, 113, 92,
75 49, 64, 78, 87, 103, 121, 120, 101,
76 72, 92, 95, 98, 112, 100, 103, 99
77};
78static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
79 17, 18, 24, 47, 99, 99, 99, 99,
80 18, 21, 26, 66, 99, 99, 99, 99,
81 24, 26, 56, 99, 99, 99, 99, 99,
82 47, 66, 99, 99, 99, 99, 99, 99,
83 99, 99, 99, 99, 99, 99, 99, 99,
84 99, 99, 99, 99, 99, 99, 99, 99,
85 99, 99, 99, 99, 99, 99, 99, 99,
86 99, 99, 99, 99, 99, 99, 99, 99
87};
88
89
90GLOBAL(void)
91jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
92/* Set or change the 'quality' (quantization) setting, using default tables
93 * and straight percentage-scaling quality scales.
94 * This entry point allows different scalings for luminance and chrominance.
95 */
96{
97 /* Set up two quantization tables using the specified scaling */
98 jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
99 cinfo->q_scale_factor[0], force_baseline);
100 jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
101 cinfo->q_scale_factor[1], force_baseline);
102}
103
104
105GLOBAL(void)
106jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
107 boolean force_baseline)
108/* Set or change the 'quality' (quantization) setting, using default tables
109 * and a straight percentage-scaling quality scale. In most cases it's better
110 * to use jpeg_set_quality (below); this entry point is provided for
111 * applications that insist on a linear percentage scaling.
112 */
113{
114 /* Set up two quantization tables using the specified scaling */
115 jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
116 scale_factor, force_baseline);
117 jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
118 scale_factor, force_baseline);
119}
120
121
122GLOBAL(int)
123jpeg_quality_scaling (int quality)
124/* Convert a user-specified quality rating to a percentage scaling factor
125 * for an underlying quantization table, using our recommended scaling curve.
126 * The input 'quality' factor should be 0 (terrible) to 100 (very good).
127 */
128{
129 /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
130 if (quality <= 0) quality = 1;
131 if (quality > 100) quality = 100;
132
133 /* The basic table is used as-is (scaling 100) for a quality of 50.
134 * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
135 * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
136 * to make all the table entries 1 (hence, minimum quantization loss).
137 * Qualities 1..50 are converted to scaling percentage 5000/Q.
138 */
139 if (quality < 50)
140 quality = 5000 / quality;
141 else
142 quality = 200 - quality*2;
143
144 return quality;
145}
146
147
148GLOBAL(void)
149jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
150/* Set or change the 'quality' (quantization) setting, using default tables.
151 * This is the standard quality-adjusting entry point for typical user
152 * interfaces; only those who want detailed control over quantization tables
153 * would use the preceding three routines directly.
154 */
155{
156 /* Convert user 0-100 rating to percentage scaling */
157 quality = jpeg_quality_scaling(quality);
158
159 /* Set up standard quality tables */
160 jpeg_set_linear_quality(cinfo, quality, force_baseline);
161}
162
163
164/*
165 * Huffman table setup routines
166 */
167
168LOCAL(void)
169add_huff_table (j_compress_ptr cinfo,
170 JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
171/* Define a Huffman table */
172{
173 int nsymbols, len;
174
175 if (*htblptr == NULL)
176 *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
177
178 /* Copy the number-of-symbols-of-each-code-length counts */
179 MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
180
181 /* Validate the counts. We do this here mainly so we can copy the right
182 * number of symbols from the val[] array, without risking marching off
183 * the end of memory. jchuff.c will do a more thorough test later.
184 */
185 nsymbols = 0;
186 for (len = 1; len <= 16; len++)
187 nsymbols += bits[len];
188 if (nsymbols < 1 || nsymbols > 256)
189 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
190
191 MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
192
193 /* Initialize sent_table FALSE so table will be written to JPEG file. */
194 (*htblptr)->sent_table = FALSE;
195}
196
197
198LOCAL(void)
199std_huff_tables (j_compress_ptr cinfo)
200/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
201/* IMPORTANT: these are only valid for 8-bit data precision! */
202{
203 static const UINT8 bits_dc_luminance[17] =
204 { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
205 static const UINT8 val_dc_luminance[] =
206 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
207
208 static const UINT8 bits_dc_chrominance[17] =
209 { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
210 static const UINT8 val_dc_chrominance[] =
211 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
212
213 static const UINT8 bits_ac_luminance[17] =
214 { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
215 static const UINT8 val_ac_luminance[] =
216 { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
217 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
218 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
219 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
220 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
221 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
222 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
223 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
224 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
225 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
226 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
227 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
228 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
229 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
230 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
231 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
232 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
233 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
234 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
235 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
236 0xf9, 0xfa };
237
238 static const UINT8 bits_ac_chrominance[17] =
239 { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
240 static const UINT8 val_ac_chrominance[] =
241 { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
242 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
243 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
244 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
245 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
246 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
247 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
248 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
249 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
250 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
251 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
252 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
253 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
254 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
255 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
256 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
257 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
258 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
259 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
260 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
261 0xf9, 0xfa };
262
263 add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
264 bits_dc_luminance, val_dc_luminance);
265 add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
266 bits_ac_luminance, val_ac_luminance);
267 add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
268 bits_dc_chrominance, val_dc_chrominance);
269 add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
270 bits_ac_chrominance, val_ac_chrominance);
271}
272
273
274/*
275 * Default parameter setup for compression.
276 *
277 * Applications that don't choose to use this routine must do their
278 * own setup of all these parameters. Alternately, you can call this
279 * to establish defaults and then alter parameters selectively. This
280 * is the recommended approach since, if we add any new parameters,
281 * your code will still work (they'll be set to reasonable defaults).
282 */
283
284GLOBAL(void)
285jpeg_set_defaults (j_compress_ptr cinfo)
286{
287 int i;
288
289 /* Safety check to ensure start_compress not called yet. */
290 if (cinfo->global_state != CSTATE_START)
291 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
292
293 /* Allocate comp_info array large enough for maximum component count.
294 * Array is made permanent in case application wants to compress
295 * multiple images at same param settings.
296 */
297 if (cinfo->comp_info == NULL)
298 cinfo->comp_info = (jpeg_component_info *)
299 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
300 MAX_COMPONENTS * SIZEOF(jpeg_component_info));
301
302 /* Initialize everything not dependent on the color space */
303
304 cinfo->scale_num = 1; /* 1:1 scaling */
305 cinfo->scale_denom = 1;
306 cinfo->data_precision = BITS_IN_JSAMPLE;
307 /* Set up two quantization tables using default quality of 75 */
308 jpeg_set_quality(cinfo, 75, TRUE);
309 /* Set up two Huffman tables */
310 std_huff_tables(cinfo);
311
312 /* Initialize default arithmetic coding conditioning */
313 for (i = 0; i < NUM_ARITH_TBLS; i++) {
314 cinfo->arith_dc_L[i] = 0;
315 cinfo->arith_dc_U[i] = 1;
316 cinfo->arith_ac_K[i] = 5;
317 }
318
319 /* Default is no multiple-scan output */
320 cinfo->scan_info = NULL;
321 cinfo->num_scans = 0;
322
323 /* Expect normal source image, not raw downsampled data */
324 cinfo->raw_data_in = FALSE;
325
326 /* Use Huffman coding, not arithmetic coding, by default */
327 cinfo->arith_code = FALSE;
328
329 /* By default, don't do extra passes to optimize entropy coding */
330 cinfo->optimize_coding = FALSE;
331 /* The standard Huffman tables are only valid for 8-bit data precision.
332 * If the precision is higher, force optimization on so that usable
333 * tables will be computed. This test can be removed if default tables
334 * are supplied that are valid for the desired precision.
335 */
336 if (cinfo->data_precision > 8)
337 cinfo->optimize_coding = TRUE;
338
339 /* By default, use the simpler non-cosited sampling alignment */
340 cinfo->CCIR601_sampling = FALSE;
341
342 /* By default, apply fancy downsampling */
343 cinfo->do_fancy_downsampling = TRUE;
344
345 /* No input smoothing */
346 cinfo->smoothing_factor = 0;
347
348 /* DCT algorithm preference */
349 cinfo->dct_method = JDCT_DEFAULT;
350
351 /* No restart markers */
352 cinfo->restart_interval = 0;
353 cinfo->restart_in_rows = 0;
354
355 /* Fill in default JFIF marker parameters. Note that whether the marker
356 * will actually be written is determined by jpeg_set_colorspace.
357 *
358 * By default, the library emits JFIF version code 1.01.
359 * An application that wants to emit JFIF 1.02 extension markers should set
360 * JFIF_minor_version to 2. We could probably get away with just defaulting
361 * to 1.02, but there may still be some decoders in use that will complain
362 * about that; saying 1.01 should minimize compatibility problems.
363 */
364 cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
365 cinfo->JFIF_minor_version = 1;
366 cinfo->density_unit = 0; /* Pixel size is unknown by default */
367 cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
368 cinfo->Y_density = 1;
369
370 /* Choose JPEG colorspace based on input space, set defaults accordingly */
371
372 jpeg_default_colorspace(cinfo);
373}
374
375
376/*
377 * Select an appropriate JPEG colorspace for in_color_space.
378 */
379
380GLOBAL(void)
381jpeg_default_colorspace (j_compress_ptr cinfo)
382{
383 switch (cinfo->in_color_space) {
384 case JCS_GRAYSCALE:
385 jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
386 break;
387 case JCS_RGB:
388 jpeg_set_colorspace(cinfo, JCS_YCbCr);
389 break;
390 case JCS_YCbCr:
391 jpeg_set_colorspace(cinfo, JCS_YCbCr);
392 break;
393 case JCS_CMYK:
394 jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
395 break;
396 case JCS_YCCK:
397 jpeg_set_colorspace(cinfo, JCS_YCCK);
398 break;
399 case JCS_UNKNOWN:
400 jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
401 break;
402 default:
403 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
404 }
405}
406
407
408/*
409 * Set the JPEG colorspace, and choose colorspace-dependent default values.
410 */
411
412GLOBAL(void)
413jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
414{
415 jpeg_component_info * compptr;
416 int ci;
417
418#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \
419 (compptr = &cinfo->comp_info[index], \
420 compptr->component_id = (id), \
421 compptr->h_samp_factor = (hsamp), \
422 compptr->v_samp_factor = (vsamp), \
423 compptr->quant_tbl_no = (quant), \
424 compptr->dc_tbl_no = (dctbl), \
425 compptr->ac_tbl_no = (actbl) )
426
427 /* Safety check to ensure start_compress not called yet. */
428 if (cinfo->global_state != CSTATE_START)
429 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
430
431 /* For all colorspaces, we use Q and Huff tables 0 for luminance components,
432 * tables 1 for chrominance components.
433 */
434
435 cinfo->jpeg_color_space = colorspace;
436
437 cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
438 cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
439
440 switch (colorspace) {
441 case JCS_GRAYSCALE:
442 cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
443 cinfo->num_components = 1;
444 /* JFIF specifies component ID 1 */
445 SET_COMP(0, 1, 1,1, 0, 0,0);
446 break;
447 case JCS_RGB:
448 cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
449 cinfo->num_components = 3;
450 SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
451 SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
452 SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
453 break;
454 case JCS_YCbCr:
455 cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
456 cinfo->num_components = 3;
457 /* JFIF specifies component IDs 1,2,3 */
458 /* We default to 2x2 subsamples of chrominance */
459 SET_COMP(0, 1, 2,2, 0, 0,0);
460 SET_COMP(1, 2, 1,1, 1, 1,1);
461 SET_COMP(2, 3, 1,1, 1, 1,1);
462 break;
463 case JCS_CMYK:
464 cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
465 cinfo->num_components = 4;
466 SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);
467 SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);
468 SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);
469 SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);
470 break;
471 case JCS_YCCK:
472 cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
473 cinfo->num_components = 4;
474 SET_COMP(0, 1, 2,2, 0, 0,0);
475 SET_COMP(1, 2, 1,1, 1, 1,1);
476 SET_COMP(2, 3, 1,1, 1, 1,1);
477 SET_COMP(3, 4, 2,2, 0, 0,0);
478 break;
479 case JCS_UNKNOWN:
480 cinfo->num_components = cinfo->input_components;
481 if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
482 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
483 MAX_COMPONENTS);
484 for (ci = 0; ci < cinfo->num_components; ci++) {
485 SET_COMP(ci, ci, 1,1, 0, 0,0);
486 }
487 break;
488 default:
489 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
490 }
491}
492
493
494#ifdef C_PROGRESSIVE_SUPPORTED
495
496LOCAL(jpeg_scan_info *)
497fill_a_scan (jpeg_scan_info * scanptr, int ci,
498 int Ss, int Se, int Ah, int Al)
499/* Support routine: generate one scan for specified component */
500{
501 scanptr->comps_in_scan = 1;
502 scanptr->component_index[0] = ci;
503 scanptr->Ss = Ss;
504 scanptr->Se = Se;
505 scanptr->Ah = Ah;
506 scanptr->Al = Al;
507 scanptr++;
508 return scanptr;
509}
510
511LOCAL(jpeg_scan_info *)
512fill_scans (jpeg_scan_info * scanptr, int ncomps,
513 int Ss, int Se, int Ah, int Al)
514/* Support routine: generate one scan for each component */
515{
516 int ci;
517
518 for (ci = 0; ci < ncomps; ci++) {
519 scanptr->comps_in_scan = 1;
520 scanptr->component_index[0] = ci;
521 scanptr->Ss = Ss;
522 scanptr->Se = Se;
523 scanptr->Ah = Ah;
524 scanptr->Al = Al;
525 scanptr++;
526 }
527 return scanptr;
528}
529
530LOCAL(jpeg_scan_info *)
531fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
532/* Support routine: generate interleaved DC scan if possible, else N scans */
533{
534 int ci;
535
536 if (ncomps <= MAX_COMPS_IN_SCAN) {
537 /* Single interleaved DC scan */
538 scanptr->comps_in_scan = ncomps;
539 for (ci = 0; ci < ncomps; ci++)
540 scanptr->component_index[ci] = ci;
541 scanptr->Ss = scanptr->Se = 0;
542 scanptr->Ah = Ah;
543 scanptr->Al = Al;
544 scanptr++;
545 } else {
546 /* Noninterleaved DC scan for each component */
547 scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
548 }
549 return scanptr;
550}
551
552
553/*
554 * Create a recommended progressive-JPEG script.
555 * cinfo->num_components and cinfo->jpeg_color_space must be correct.
556 */
557
558GLOBAL(void)
559jpeg_simple_progression (j_compress_ptr cinfo)
560{
561 int ncomps = cinfo->num_components;
562 int nscans;
563 jpeg_scan_info * scanptr;
564
565 /* Safety check to ensure start_compress not called yet. */
566 if (cinfo->global_state != CSTATE_START)
567 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
568
569 /* Figure space needed for script. Calculation must match code below! */
570 if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
571 /* Custom script for YCbCr color images. */
572 nscans = 10;
573 } else {
574 /* All-purpose script for other color spaces. */
575 if (ncomps > MAX_COMPS_IN_SCAN)
576 nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
577 else
578 nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
579 }
580
581 /* Allocate space for script.
582 * We need to put it in the permanent pool in case the application performs
583 * multiple compressions without changing the settings. To avoid a memory
584 * leak if jpeg_simple_progression is called repeatedly for the same JPEG
585 * object, we try to re-use previously allocated space, and we allocate
586 * enough space to handle YCbCr even if initially asked for grayscale.
587 */
588 if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
589 cinfo->script_space_size = MAX(nscans, 10);
590 cinfo->script_space = (jpeg_scan_info *)
591 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
592 cinfo->script_space_size * SIZEOF(jpeg_scan_info));
593 }
594 scanptr = cinfo->script_space;
595 cinfo->scan_info = scanptr;
596 cinfo->num_scans = nscans;
597
598 if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
599 /* Custom script for YCbCr color images. */
600 /* Initial DC scan */
601 scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
602 /* Initial AC scan: get some luma data out in a hurry */
603 scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
604 /* Chroma data is too small to be worth expending many scans on */
605 scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
606 scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
607 /* Complete spectral selection for luma AC */
608 scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
609 /* Refine next bit of luma AC */
610 scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
611 /* Finish DC successive approximation */
612 scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
613 /* Finish AC successive approximation */
614 scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
615 scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
616 /* Luma bottom bit comes last since it's usually largest scan */
617 scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
618 } else {
619 /* All-purpose script for other color spaces. */
620 /* Successive approximation first pass */
621 scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
622 scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
623 scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
624 /* Successive approximation second pass */
625 scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
626 /* Successive approximation final pass */
627 scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
628 scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
629 }
630}
631
632#endif /* C_PROGRESSIVE_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcprepct.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcprepct.c
new file mode 100644
index 0000000..00101e0
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcprepct.c
@@ -0,0 +1,358 @@
1/*
2 * jcprepct.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains the compression preprocessing controller.
9 * This controller manages the color conversion, downsampling,
10 * and edge expansion steps.
11 *
12 * Most of the complexity here is associated with buffering input rows
13 * as required by the downsampler. See the comments at the head of
14 * jcsample.c for the downsampler's needs.
15 */
16
17#define JPEG_INTERNALS
18#include "jinclude.h"
19#include "jpeglib.h"
20
21
22/* At present, jcsample.c can request context rows only for smoothing.
23 * In the future, we might also need context rows for CCIR601 sampling
24 * or other more-complex downsampling procedures. The code to support
25 * context rows should be compiled only if needed.
26 */
27#ifdef INPUT_SMOOTHING_SUPPORTED
28#define CONTEXT_ROWS_SUPPORTED
29#endif
30
31
32/*
33 * For the simple (no-context-row) case, we just need to buffer one
34 * row group's worth of pixels for the downsampling step. At the bottom of
35 * the image, we pad to a full row group by replicating the last pixel row.
36 * The downsampler's last output row is then replicated if needed to pad
37 * out to a full iMCU row.
38 *
39 * When providing context rows, we must buffer three row groups' worth of
40 * pixels. Three row groups are physically allocated, but the row pointer
41 * arrays are made five row groups high, with the extra pointers above and
42 * below "wrapping around" to point to the last and first real row groups.
43 * This allows the downsampler to access the proper context rows.
44 * At the top and bottom of the image, we create dummy context rows by
45 * copying the first or last real pixel row. This copying could be avoided
46 * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
47 * trouble on the compression side.
48 */
49
50
51/* Private buffer controller object */
52
53typedef struct {
54 struct jpeg_c_prep_controller pub; /* public fields */
55
56 /* Downsampling input buffer. This buffer holds color-converted data
57 * until we have enough to do a downsample step.
58 */
59 JSAMPARRAY color_buf[MAX_COMPONENTS];
60
61 JDIMENSION rows_to_go; /* counts rows remaining in source image */
62 int next_buf_row; /* index of next row to store in color_buf */
63
64#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */
65 int this_row_group; /* starting row index of group to process */
66 int next_buf_stop; /* downsample when we reach this index */
67#endif
68} my_prep_controller;
69
70typedef my_prep_controller * my_prep_ptr;
71
72
73/*
74 * Initialize for a processing pass.
75 */
76
77METHODDEF(void)
78start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
79{
80 my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
81
82 if (pass_mode != JBUF_PASS_THRU)
83 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
84
85 /* Initialize total-height counter for detecting bottom of image */
86 prep->rows_to_go = cinfo->image_height;
87 /* Mark the conversion buffer empty */
88 prep->next_buf_row = 0;
89#ifdef CONTEXT_ROWS_SUPPORTED
90 /* Preset additional state variables for context mode.
91 * These aren't used in non-context mode, so we needn't test which mode.
92 */
93 prep->this_row_group = 0;
94 /* Set next_buf_stop to stop after two row groups have been read in. */
95 prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
96#endif
97}
98
99
100/*
101 * Expand an image vertically from height input_rows to height output_rows,
102 * by duplicating the bottom row.
103 */
104
105LOCAL(void)
106expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
107 int input_rows, int output_rows)
108{
109 register int row;
110
111 for (row = input_rows; row < output_rows; row++) {
112 jcopy_sample_rows(image_data, input_rows-1, image_data, row,
113 1, num_cols);
114 }
115}
116
117
118/*
119 * Process some data in the simple no-context case.
120 *
121 * Preprocessor output data is counted in "row groups". A row group
122 * is defined to be v_samp_factor sample rows of each component.
123 * Downsampling will produce this much data from each max_v_samp_factor
124 * input rows.
125 */
126
127METHODDEF(void)
128pre_process_data (j_compress_ptr cinfo,
129 JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
130 JDIMENSION in_rows_avail,
131 JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
132 JDIMENSION out_row_groups_avail)
133{
134 my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
135 int numrows, ci;
136 JDIMENSION inrows;
137 jpeg_component_info * compptr;
138
139 while (*in_row_ctr < in_rows_avail &&
140 *out_row_group_ctr < out_row_groups_avail) {
141 /* Do color conversion to fill the conversion buffer. */
142 inrows = in_rows_avail - *in_row_ctr;
143 numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
144 numrows = (int) MIN((JDIMENSION) numrows, inrows);
145 (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
146 prep->color_buf,
147 (JDIMENSION) prep->next_buf_row,
148 numrows);
149 *in_row_ctr += numrows;
150 prep->next_buf_row += numrows;
151 prep->rows_to_go -= numrows;
152 /* If at bottom of image, pad to fill the conversion buffer. */
153 if (prep->rows_to_go == 0 &&
154 prep->next_buf_row < cinfo->max_v_samp_factor) {
155 for (ci = 0; ci < cinfo->num_components; ci++) {
156 expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
157 prep->next_buf_row, cinfo->max_v_samp_factor);
158 }
159 prep->next_buf_row = cinfo->max_v_samp_factor;
160 }
161 /* If we've filled the conversion buffer, empty it. */
162 if (prep->next_buf_row == cinfo->max_v_samp_factor) {
163 (*cinfo->downsample->downsample) (cinfo,
164 prep->color_buf, (JDIMENSION) 0,
165 output_buf, *out_row_group_ctr);
166 prep->next_buf_row = 0;
167 (*out_row_group_ctr)++;
168 }
169 /* If at bottom of image, pad the output to a full iMCU height.
170 * Note we assume the caller is providing a one-iMCU-height output buffer!
171 */
172 if (prep->rows_to_go == 0 &&
173 *out_row_group_ctr < out_row_groups_avail) {
174 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
175 ci++, compptr++) {
176 numrows = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
177 cinfo->min_DCT_v_scaled_size;
178 expand_bottom_edge(output_buf[ci],
179 compptr->width_in_blocks * compptr->DCT_h_scaled_size,
180 (int) (*out_row_group_ctr * numrows),
181 (int) (out_row_groups_avail * numrows));
182 }
183 *out_row_group_ctr = out_row_groups_avail;
184 break; /* can exit outer loop without test */
185 }
186 }
187}
188
189
190#ifdef CONTEXT_ROWS_SUPPORTED
191
192/*
193 * Process some data in the context case.
194 */
195
196METHODDEF(void)
197pre_process_context (j_compress_ptr cinfo,
198 JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
199 JDIMENSION in_rows_avail,
200 JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
201 JDIMENSION out_row_groups_avail)
202{
203 my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
204 int numrows, ci;
205 int buf_height = cinfo->max_v_samp_factor * 3;
206 JDIMENSION inrows;
207
208 while (*out_row_group_ctr < out_row_groups_avail) {
209 if (*in_row_ctr < in_rows_avail) {
210 /* Do color conversion to fill the conversion buffer. */
211 inrows = in_rows_avail - *in_row_ctr;
212 numrows = prep->next_buf_stop - prep->next_buf_row;
213 numrows = (int) MIN((JDIMENSION) numrows, inrows);
214 (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
215 prep->color_buf,
216 (JDIMENSION) prep->next_buf_row,
217 numrows);
218 /* Pad at top of image, if first time through */
219 if (prep->rows_to_go == cinfo->image_height) {
220 for (ci = 0; ci < cinfo->num_components; ci++) {
221 int row;
222 for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
223 jcopy_sample_rows(prep->color_buf[ci], 0,
224 prep->color_buf[ci], -row,
225 1, cinfo->image_width);
226 }
227 }
228 }
229 *in_row_ctr += numrows;
230 prep->next_buf_row += numrows;
231 prep->rows_to_go -= numrows;
232 } else {
233 /* Return for more data, unless we are at the bottom of the image. */
234 if (prep->rows_to_go != 0)
235 break;
236 /* When at bottom of image, pad to fill the conversion buffer. */
237 if (prep->next_buf_row < prep->next_buf_stop) {
238 for (ci = 0; ci < cinfo->num_components; ci++) {
239 expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
240 prep->next_buf_row, prep->next_buf_stop);
241 }
242 prep->next_buf_row = prep->next_buf_stop;
243 }
244 }
245 /* If we've gotten enough data, downsample a row group. */
246 if (prep->next_buf_row == prep->next_buf_stop) {
247 (*cinfo->downsample->downsample) (cinfo,
248 prep->color_buf,
249 (JDIMENSION) prep->this_row_group,
250 output_buf, *out_row_group_ctr);
251 (*out_row_group_ctr)++;
252 /* Advance pointers with wraparound as necessary. */
253 prep->this_row_group += cinfo->max_v_samp_factor;
254 if (prep->this_row_group >= buf_height)
255 prep->this_row_group = 0;
256 if (prep->next_buf_row >= buf_height)
257 prep->next_buf_row = 0;
258 prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
259 }
260 }
261}
262
263
264/*
265 * Create the wrapped-around downsampling input buffer needed for context mode.
266 */
267
268LOCAL(void)
269create_context_buffer (j_compress_ptr cinfo)
270{
271 my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
272 int rgroup_height = cinfo->max_v_samp_factor;
273 int ci, i;
274 jpeg_component_info * compptr;
275 JSAMPARRAY true_buffer, fake_buffer;
276
277 /* Grab enough space for fake row pointers for all the components;
278 * we need five row groups' worth of pointers for each component.
279 */
280 fake_buffer = (JSAMPARRAY)
281 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
282 (cinfo->num_components * 5 * rgroup_height) *
283 SIZEOF(JSAMPROW));
284
285 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
286 ci++, compptr++) {
287 /* Allocate the actual buffer space (3 row groups) for this component.
288 * We make the buffer wide enough to allow the downsampler to edge-expand
289 * horizontally within the buffer, if it so chooses.
290 */
291 true_buffer = (*cinfo->mem->alloc_sarray)
292 ((j_common_ptr) cinfo, JPOOL_IMAGE,
293 (JDIMENSION) (((long) compptr->width_in_blocks *
294 cinfo->min_DCT_h_scaled_size *
295 cinfo->max_h_samp_factor) / compptr->h_samp_factor),
296 (JDIMENSION) (3 * rgroup_height));
297 /* Copy true buffer row pointers into the middle of the fake row array */
298 MEMCOPY(fake_buffer + rgroup_height, true_buffer,
299 3 * rgroup_height * SIZEOF(JSAMPROW));
300 /* Fill in the above and below wraparound pointers */
301 for (i = 0; i < rgroup_height; i++) {
302 fake_buffer[i] = true_buffer[2 * rgroup_height + i];
303 fake_buffer[4 * rgroup_height + i] = true_buffer[i];
304 }
305 prep->color_buf[ci] = fake_buffer + rgroup_height;
306 fake_buffer += 5 * rgroup_height; /* point to space for next component */
307 }
308}
309
310#endif /* CONTEXT_ROWS_SUPPORTED */
311
312
313/*
314 * Initialize preprocessing controller.
315 */
316
317GLOBAL(void)
318jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
319{
320 my_prep_ptr prep;
321 int ci;
322 jpeg_component_info * compptr;
323
324 if (need_full_buffer) /* safety check */
325 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
326
327 prep = (my_prep_ptr)
328 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
329 SIZEOF(my_prep_controller));
330 cinfo->prep = (struct jpeg_c_prep_controller *) prep;
331 prep->pub.start_pass = start_pass_prep;
332
333 /* Allocate the color conversion buffer.
334 * We make the buffer wide enough to allow the downsampler to edge-expand
335 * horizontally within the buffer, if it so chooses.
336 */
337 if (cinfo->downsample->need_context_rows) {
338 /* Set up to provide context rows */
339#ifdef CONTEXT_ROWS_SUPPORTED
340 prep->pub.pre_process_data = pre_process_context;
341 create_context_buffer(cinfo);
342#else
343 ERREXIT(cinfo, JERR_NOT_COMPILED);
344#endif
345 } else {
346 /* No context, just make it tall enough for one row group */
347 prep->pub.pre_process_data = pre_process_data;
348 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
349 ci++, compptr++) {
350 prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
351 ((j_common_ptr) cinfo, JPOOL_IMAGE,
352 (JDIMENSION) (((long) compptr->width_in_blocks *
353 cinfo->min_DCT_h_scaled_size *
354 cinfo->max_h_samp_factor) / compptr->h_samp_factor),
355 (JDIMENSION) cinfo->max_v_samp_factor);
356 }
357 }
358}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcsample.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcsample.c
new file mode 100644
index 0000000..1aef8a6
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jcsample.c
@@ -0,0 +1,545 @@
1/*
2 * jcsample.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains downsampling routines.
9 *
10 * Downsampling input data is counted in "row groups". A row group
11 * is defined to be max_v_samp_factor pixel rows of each component,
12 * from which the downsampler produces v_samp_factor sample rows.
13 * A single row group is processed in each call to the downsampler module.
14 *
15 * The downsampler is responsible for edge-expansion of its output data
16 * to fill an integral number of DCT blocks horizontally. The source buffer
17 * may be modified if it is helpful for this purpose (the source buffer is
18 * allocated wide enough to correspond to the desired output width).
19 * The caller (the prep controller) is responsible for vertical padding.
20 *
21 * The downsampler may request "context rows" by setting need_context_rows
22 * during startup. In this case, the input arrays will contain at least
23 * one row group's worth of pixels above and below the passed-in data;
24 * the caller will create dummy rows at image top and bottom by replicating
25 * the first or last real pixel row.
26 *
27 * An excellent reference for image resampling is
28 * Digital Image Warping, George Wolberg, 1990.
29 * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
30 *
31 * The downsampling algorithm used here is a simple average of the source
32 * pixels covered by the output pixel. The hi-falutin sampling literature
33 * refers to this as a "box filter". In general the characteristics of a box
34 * filter are not very good, but for the specific cases we normally use (1:1
35 * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
36 * nearly so bad. If you intend to use other sampling ratios, you'd be well
37 * advised to improve this code.
38 *
39 * A simple input-smoothing capability is provided. This is mainly intended
40 * for cleaning up color-dithered GIF input files (if you find it inadequate,
41 * we suggest using an external filtering program such as pnmconvol). When
42 * enabled, each input pixel P is replaced by a weighted sum of itself and its
43 * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF,
44 * where SF = (smoothing_factor / 1024).
45 * Currently, smoothing is only supported for 2h2v sampling factors.
46 */
47
48#define JPEG_INTERNALS
49#include "jinclude.h"
50#include "jpeglib.h"
51
52
53/* Pointer to routine to downsample a single component */
54typedef JMETHOD(void, downsample1_ptr,
55 (j_compress_ptr cinfo, jpeg_component_info * compptr,
56 JSAMPARRAY input_data, JSAMPARRAY output_data));
57
58/* Private subobject */
59
60typedef struct {
61 struct jpeg_downsampler pub; /* public fields */
62
63 /* Downsampling method pointers, one per component */
64 downsample1_ptr methods[MAX_COMPONENTS];
65
66 /* Height of an output row group for each component. */
67 int rowgroup_height[MAX_COMPONENTS];
68
69 /* These arrays save pixel expansion factors so that int_downsample need not
70 * recompute them each time. They are unused for other downsampling methods.
71 */
72 UINT8 h_expand[MAX_COMPONENTS];
73 UINT8 v_expand[MAX_COMPONENTS];
74} my_downsampler;
75
76typedef my_downsampler * my_downsample_ptr;
77
78
79/*
80 * Initialize for a downsampling pass.
81 */
82
83METHODDEF(void)
84start_pass_downsample (j_compress_ptr cinfo)
85{
86 /* no work for now */
87}
88
89
90/*
91 * Expand a component horizontally from width input_cols to width output_cols,
92 * by duplicating the rightmost samples.
93 */
94
95LOCAL(void)
96expand_right_edge (JSAMPARRAY image_data, int num_rows,
97 JDIMENSION input_cols, JDIMENSION output_cols)
98{
99 register JSAMPROW ptr;
100 register JSAMPLE pixval;
101 register int count;
102 int row;
103 int numcols = (int) (output_cols - input_cols);
104
105 if (numcols > 0) {
106 for (row = 0; row < num_rows; row++) {
107 ptr = image_data[row] + input_cols;
108 pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
109 for (count = numcols; count > 0; count--)
110 *ptr++ = pixval;
111 }
112 }
113}
114
115
116/*
117 * Do downsampling for a whole row group (all components).
118 *
119 * In this version we simply downsample each component independently.
120 */
121
122METHODDEF(void)
123sep_downsample (j_compress_ptr cinfo,
124 JSAMPIMAGE input_buf, JDIMENSION in_row_index,
125 JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
126{
127 my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
128 int ci;
129 jpeg_component_info * compptr;
130 JSAMPARRAY in_ptr, out_ptr;
131
132 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
133 ci++, compptr++) {
134 in_ptr = input_buf[ci] + in_row_index;
135 out_ptr = output_buf[ci] +
136 (out_row_group_index * downsample->rowgroup_height[ci]);
137 (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
138 }
139}
140
141
142/*
143 * Downsample pixel values of a single component.
144 * One row group is processed per call.
145 * This version handles arbitrary integral sampling ratios, without smoothing.
146 * Note that this version is not actually used for customary sampling ratios.
147 */
148
149METHODDEF(void)
150int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
151 JSAMPARRAY input_data, JSAMPARRAY output_data)
152{
153 my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
154 int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
155 JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
156 JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
157 JSAMPROW inptr, outptr;
158 INT32 outvalue;
159
160 h_expand = downsample->h_expand[compptr->component_index];
161 v_expand = downsample->v_expand[compptr->component_index];
162 numpix = h_expand * v_expand;
163 numpix2 = numpix/2;
164
165 /* Expand input data enough to let all the output samples be generated
166 * by the standard loop. Special-casing padded output would be more
167 * efficient.
168 */
169 expand_right_edge(input_data, cinfo->max_v_samp_factor,
170 cinfo->image_width, output_cols * h_expand);
171
172 inrow = outrow = 0;
173 while (inrow < cinfo->max_v_samp_factor) {
174 outptr = output_data[outrow];
175 for (outcol = 0, outcol_h = 0; outcol < output_cols;
176 outcol++, outcol_h += h_expand) {
177 outvalue = 0;
178 for (v = 0; v < v_expand; v++) {
179 inptr = input_data[inrow+v] + outcol_h;
180 for (h = 0; h < h_expand; h++) {
181 outvalue += (INT32) GETJSAMPLE(*inptr++);
182 }
183 }
184 *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
185 }
186 inrow += v_expand;
187 outrow++;
188 }
189}
190
191
192/*
193 * Downsample pixel values of a single component.
194 * This version handles the special case of a full-size component,
195 * without smoothing.
196 */
197
198METHODDEF(void)
199fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
200 JSAMPARRAY input_data, JSAMPARRAY output_data)
201{
202 /* Copy the data */
203 jcopy_sample_rows(input_data, 0, output_data, 0,
204 cinfo->max_v_samp_factor, cinfo->image_width);
205 /* Edge-expand */
206 expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,
207 compptr->width_in_blocks * compptr->DCT_h_scaled_size);
208}
209
210
211/*
212 * Downsample pixel values of a single component.
213 * This version handles the common case of 2:1 horizontal and 1:1 vertical,
214 * without smoothing.
215 *
216 * A note about the "bias" calculations: when rounding fractional values to
217 * integer, we do not want to always round 0.5 up to the next integer.
218 * If we did that, we'd introduce a noticeable bias towards larger values.
219 * Instead, this code is arranged so that 0.5 will be rounded up or down at
220 * alternate pixel locations (a simple ordered dither pattern).
221 */
222
223METHODDEF(void)
224h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
225 JSAMPARRAY input_data, JSAMPARRAY output_data)
226{
227 int inrow;
228 JDIMENSION outcol;
229 JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
230 register JSAMPROW inptr, outptr;
231 register int bias;
232
233 /* Expand input data enough to let all the output samples be generated
234 * by the standard loop. Special-casing padded output would be more
235 * efficient.
236 */
237 expand_right_edge(input_data, cinfo->max_v_samp_factor,
238 cinfo->image_width, output_cols * 2);
239
240 for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
241 outptr = output_data[inrow];
242 inptr = input_data[inrow];
243 bias = 0; /* bias = 0,1,0,1,... for successive samples */
244 for (outcol = 0; outcol < output_cols; outcol++) {
245 *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
246 + bias) >> 1);
247 bias ^= 1; /* 0=>1, 1=>0 */
248 inptr += 2;
249 }
250 }
251}
252
253
254/*
255 * Downsample pixel values of a single component.
256 * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
257 * without smoothing.
258 */
259
260METHODDEF(void)
261h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
262 JSAMPARRAY input_data, JSAMPARRAY output_data)
263{
264 int inrow, outrow;
265 JDIMENSION outcol;
266 JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
267 register JSAMPROW inptr0, inptr1, outptr;
268 register int bias;
269
270 /* Expand input data enough to let all the output samples be generated
271 * by the standard loop. Special-casing padded output would be more
272 * efficient.
273 */
274 expand_right_edge(input_data, cinfo->max_v_samp_factor,
275 cinfo->image_width, output_cols * 2);
276
277 inrow = outrow = 0;
278 while (inrow < cinfo->max_v_samp_factor) {
279 outptr = output_data[outrow];
280 inptr0 = input_data[inrow];
281 inptr1 = input_data[inrow+1];
282 bias = 1; /* bias = 1,2,1,2,... for successive samples */
283 for (outcol = 0; outcol < output_cols; outcol++) {
284 *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
285 GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
286 + bias) >> 2);
287 bias ^= 3; /* 1=>2, 2=>1 */
288 inptr0 += 2; inptr1 += 2;
289 }
290 inrow += 2;
291 outrow++;
292 }
293}
294
295
296#ifdef INPUT_SMOOTHING_SUPPORTED
297
298/*
299 * Downsample pixel values of a single component.
300 * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
301 * with smoothing. One row of context is required.
302 */
303
304METHODDEF(void)
305h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
306 JSAMPARRAY input_data, JSAMPARRAY output_data)
307{
308 int inrow, outrow;
309 JDIMENSION colctr;
310 JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
311 register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
312 INT32 membersum, neighsum, memberscale, neighscale;
313
314 /* Expand input data enough to let all the output samples be generated
315 * by the standard loop. Special-casing padded output would be more
316 * efficient.
317 */
318 expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
319 cinfo->image_width, output_cols * 2);
320
321 /* We don't bother to form the individual "smoothed" input pixel values;
322 * we can directly compute the output which is the average of the four
323 * smoothed values. Each of the four member pixels contributes a fraction
324 * (1-8*SF) to its own smoothed image and a fraction SF to each of the three
325 * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
326 * output. The four corner-adjacent neighbor pixels contribute a fraction
327 * SF to just one smoothed pixel, or SF/4 to the final output; while the
328 * eight edge-adjacent neighbors contribute SF to each of two smoothed
329 * pixels, or SF/2 overall. In order to use integer arithmetic, these
330 * factors are scaled by 2^16 = 65536.
331 * Also recall that SF = smoothing_factor / 1024.
332 */
333
334 memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
335 neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
336
337 inrow = outrow = 0;
338 while (inrow < cinfo->max_v_samp_factor) {
339 outptr = output_data[outrow];
340 inptr0 = input_data[inrow];
341 inptr1 = input_data[inrow+1];
342 above_ptr = input_data[inrow-1];
343 below_ptr = input_data[inrow+2];
344
345 /* Special case for first column: pretend column -1 is same as column 0 */
346 membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
347 GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
348 neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
349 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
350 GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
351 GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
352 neighsum += neighsum;
353 neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
354 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
355 membersum = membersum * memberscale + neighsum * neighscale;
356 *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
357 inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
358
359 for (colctr = output_cols - 2; colctr > 0; colctr--) {
360 /* sum of pixels directly mapped to this output element */
361 membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
362 GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
363 /* sum of edge-neighbor pixels */
364 neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
365 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
366 GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
367 GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
368 /* The edge-neighbors count twice as much as corner-neighbors */
369 neighsum += neighsum;
370 /* Add in the corner-neighbors */
371 neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
372 GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
373 /* form final output scaled up by 2^16 */
374 membersum = membersum * memberscale + neighsum * neighscale;
375 /* round, descale and output it */
376 *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
377 inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
378 }
379
380 /* Special case for last column */
381 membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
382 GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
383 neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
384 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
385 GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
386 GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
387 neighsum += neighsum;
388 neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
389 GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
390 membersum = membersum * memberscale + neighsum * neighscale;
391 *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
392
393 inrow += 2;
394 outrow++;
395 }
396}
397
398
399/*
400 * Downsample pixel values of a single component.
401 * This version handles the special case of a full-size component,
402 * with smoothing. One row of context is required.
403 */
404
405METHODDEF(void)
406fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
407 JSAMPARRAY input_data, JSAMPARRAY output_data)
408{
409 int inrow;
410 JDIMENSION colctr;
411 JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
412 register JSAMPROW inptr, above_ptr, below_ptr, outptr;
413 INT32 membersum, neighsum, memberscale, neighscale;
414 int colsum, lastcolsum, nextcolsum;
415
416 /* Expand input data enough to let all the output samples be generated
417 * by the standard loop. Special-casing padded output would be more
418 * efficient.
419 */
420 expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
421 cinfo->image_width, output_cols);
422
423 /* Each of the eight neighbor pixels contributes a fraction SF to the
424 * smoothed pixel, while the main pixel contributes (1-8*SF). In order
425 * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
426 * Also recall that SF = smoothing_factor / 1024.
427 */
428
429 memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
430 neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
431
432 for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
433 outptr = output_data[inrow];
434 inptr = input_data[inrow];
435 above_ptr = input_data[inrow-1];
436 below_ptr = input_data[inrow+1];
437
438 /* Special case for first column */
439 colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
440 GETJSAMPLE(*inptr);
441 membersum = GETJSAMPLE(*inptr++);
442 nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
443 GETJSAMPLE(*inptr);
444 neighsum = colsum + (colsum - membersum) + nextcolsum;
445 membersum = membersum * memberscale + neighsum * neighscale;
446 *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
447 lastcolsum = colsum; colsum = nextcolsum;
448
449 for (colctr = output_cols - 2; colctr > 0; colctr--) {
450 membersum = GETJSAMPLE(*inptr++);
451 above_ptr++; below_ptr++;
452 nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
453 GETJSAMPLE(*inptr);
454 neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
455 membersum = membersum * memberscale + neighsum * neighscale;
456 *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
457 lastcolsum = colsum; colsum = nextcolsum;
458 }
459
460 /* Special case for last column */
461 membersum = GETJSAMPLE(*inptr);
462 neighsum = lastcolsum + (colsum - membersum) + colsum;
463 membersum = membersum * memberscale + neighsum * neighscale;
464 *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
465
466 }
467}
468
469#endif /* INPUT_SMOOTHING_SUPPORTED */
470
471
472/*
473 * Module initialization routine for downsampling.
474 * Note that we must select a routine for each component.
475 */
476
477GLOBAL(void)
478jinit_downsampler (j_compress_ptr cinfo)
479{
480 my_downsample_ptr downsample;
481 int ci;
482 jpeg_component_info * compptr;
483 boolean smoothok = TRUE;
484 int h_in_group, v_in_group, h_out_group, v_out_group;
485
486 downsample = (my_downsample_ptr)
487 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
488 SIZEOF(my_downsampler));
489 cinfo->downsample = (struct jpeg_downsampler *) downsample;
490 downsample->pub.start_pass = start_pass_downsample;
491 downsample->pub.downsample = sep_downsample;
492 downsample->pub.need_context_rows = FALSE;
493
494 if (cinfo->CCIR601_sampling)
495 ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
496
497 /* Verify we can handle the sampling factors, and set up method pointers */
498 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
499 ci++, compptr++) {
500 /* Compute size of an "output group" for DCT scaling. This many samples
501 * are to be converted from max_h_samp_factor * max_v_samp_factor pixels.
502 */
503 h_out_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) /
504 cinfo->min_DCT_h_scaled_size;
505 v_out_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
506 cinfo->min_DCT_v_scaled_size;
507 h_in_group = cinfo->max_h_samp_factor;
508 v_in_group = cinfo->max_v_samp_factor;
509 downsample->rowgroup_height[ci] = v_out_group; /* save for use later */
510 if (h_in_group == h_out_group && v_in_group == v_out_group) {
511#ifdef INPUT_SMOOTHING_SUPPORTED
512 if (cinfo->smoothing_factor) {
513 downsample->methods[ci] = fullsize_smooth_downsample;
514 downsample->pub.need_context_rows = TRUE;
515 } else
516#endif
517 downsample->methods[ci] = fullsize_downsample;
518 } else if (h_in_group == h_out_group * 2 &&
519 v_in_group == v_out_group) {
520 smoothok = FALSE;
521 downsample->methods[ci] = h2v1_downsample;
522 } else if (h_in_group == h_out_group * 2 &&
523 v_in_group == v_out_group * 2) {
524#ifdef INPUT_SMOOTHING_SUPPORTED
525 if (cinfo->smoothing_factor) {
526 downsample->methods[ci] = h2v2_smooth_downsample;
527 downsample->pub.need_context_rows = TRUE;
528 } else
529#endif
530 downsample->methods[ci] = h2v2_downsample;
531 } else if ((h_in_group % h_out_group) == 0 &&
532 (v_in_group % v_out_group) == 0) {
533 smoothok = FALSE;
534 downsample->methods[ci] = int_downsample;
535 downsample->h_expand[ci] = (UINT8) (h_in_group / h_out_group);
536 downsample->v_expand[ci] = (UINT8) (v_in_group / v_out_group);
537 } else
538 ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
539 }
540
541#ifdef INPUT_SMOOTHING_SUPPORTED
542 if (cinfo->smoothing_factor && !smoothok)
543 TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
544#endif
545}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jctrans.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jctrans.c
new file mode 100644
index 0000000..dc84214
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jctrans.c
@@ -0,0 +1,382 @@
1/*
2 * jctrans.c
3 *
4 * Copyright (C) 1995-1998, Thomas G. Lane.
5 * Modified 2000-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains library routines for transcoding compression,
10 * that is, writing raw DCT coefficient arrays to an output JPEG file.
11 * The routines in jcapimin.c will also be needed by a transcoder.
12 */
13
14#define JPEG_INTERNALS
15#include "jinclude.h"
16#include "jpeglib.h"
17
18
19/* Forward declarations */
20LOCAL(void) transencode_master_selection
21 JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
22LOCAL(void) transencode_coef_controller
23 JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
24
25
26/*
27 * Compression initialization for writing raw-coefficient data.
28 * Before calling this, all parameters and a data destination must be set up.
29 * Call jpeg_finish_compress() to actually write the data.
30 *
31 * The number of passed virtual arrays must match cinfo->num_components.
32 * Note that the virtual arrays need not be filled or even realized at
33 * the time write_coefficients is called; indeed, if the virtual arrays
34 * were requested from this compression object's memory manager, they
35 * typically will be realized during this routine and filled afterwards.
36 */
37
38GLOBAL(void)
39jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
40{
41 if (cinfo->global_state != CSTATE_START)
42 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
43 /* Mark all tables to be written */
44 jpeg_suppress_tables(cinfo, FALSE);
45 /* (Re)initialize error mgr and destination modules */
46 (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
47 (*cinfo->dest->init_destination) (cinfo);
48 /* Perform master selection of active modules */
49 transencode_master_selection(cinfo, coef_arrays);
50 /* Wait for jpeg_finish_compress() call */
51 cinfo->next_scanline = 0; /* so jpeg_write_marker works */
52 cinfo->global_state = CSTATE_WRCOEFS;
53}
54
55
56/*
57 * Initialize the compression object with default parameters,
58 * then copy from the source object all parameters needed for lossless
59 * transcoding. Parameters that can be varied without loss (such as
60 * scan script and Huffman optimization) are left in their default states.
61 */
62
63GLOBAL(void)
64jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
65 j_compress_ptr dstinfo)
66{
67 JQUANT_TBL ** qtblptr;
68 jpeg_component_info *incomp, *outcomp;
69 JQUANT_TBL *c_quant, *slot_quant;
70 int tblno, ci, coefi;
71
72 /* Safety check to ensure start_compress not called yet. */
73 if (dstinfo->global_state != CSTATE_START)
74 ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
75 /* Copy fundamental image dimensions */
76 dstinfo->image_width = srcinfo->image_width;
77 dstinfo->image_height = srcinfo->image_height;
78 dstinfo->input_components = srcinfo->num_components;
79 dstinfo->in_color_space = srcinfo->jpeg_color_space;
80 dstinfo->jpeg_width = srcinfo->output_width;
81 dstinfo->jpeg_height = srcinfo->output_height;
82 dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;
83 dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;
84 /* Initialize all parameters to default values */
85 jpeg_set_defaults(dstinfo);
86 /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
87 * Fix it to get the right header markers for the image colorspace.
88 */
89 jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
90 dstinfo->data_precision = srcinfo->data_precision;
91 dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
92 /* Copy the source's quantization tables. */
93 for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
94 if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
95 qtblptr = & dstinfo->quant_tbl_ptrs[tblno];
96 if (*qtblptr == NULL)
97 *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
98 MEMCOPY((*qtblptr)->quantval,
99 srcinfo->quant_tbl_ptrs[tblno]->quantval,
100 SIZEOF((*qtblptr)->quantval));
101 (*qtblptr)->sent_table = FALSE;
102 }
103 }
104 /* Copy the source's per-component info.
105 * Note we assume jpeg_set_defaults has allocated the dest comp_info array.
106 */
107 dstinfo->num_components = srcinfo->num_components;
108 if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
109 ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
110 MAX_COMPONENTS);
111 for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
112 ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
113 outcomp->component_id = incomp->component_id;
114 outcomp->h_samp_factor = incomp->h_samp_factor;
115 outcomp->v_samp_factor = incomp->v_samp_factor;
116 outcomp->quant_tbl_no = incomp->quant_tbl_no;
117 /* Make sure saved quantization table for component matches the qtable
118 * slot. If not, the input file re-used this qtable slot.
119 * IJG encoder currently cannot duplicate this.
120 */
121 tblno = outcomp->quant_tbl_no;
122 if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
123 srcinfo->quant_tbl_ptrs[tblno] == NULL)
124 ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
125 slot_quant = srcinfo->quant_tbl_ptrs[tblno];
126 c_quant = incomp->quant_table;
127 if (c_quant != NULL) {
128 for (coefi = 0; coefi < DCTSIZE2; coefi++) {
129 if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
130 ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
131 }
132 }
133 /* Note: we do not copy the source's Huffman table assignments;
134 * instead we rely on jpeg_set_colorspace to have made a suitable choice.
135 */
136 }
137 /* Also copy JFIF version and resolution information, if available.
138 * Strictly speaking this isn't "critical" info, but it's nearly
139 * always appropriate to copy it if available. In particular,
140 * if the application chooses to copy JFIF 1.02 extension markers from
141 * the source file, we need to copy the version to make sure we don't
142 * emit a file that has 1.02 extensions but a claimed version of 1.01.
143 * We will *not*, however, copy version info from mislabeled "2.01" files.
144 */
145 if (srcinfo->saw_JFIF_marker) {
146 if (srcinfo->JFIF_major_version == 1) {
147 dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
148 dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
149 }
150 dstinfo->density_unit = srcinfo->density_unit;
151 dstinfo->X_density = srcinfo->X_density;
152 dstinfo->Y_density = srcinfo->Y_density;
153 }
154}
155
156
157/*
158 * Master selection of compression modules for transcoding.
159 * This substitutes for jcinit.c's initialization of the full compressor.
160 */
161
162LOCAL(void)
163transencode_master_selection (j_compress_ptr cinfo,
164 jvirt_barray_ptr * coef_arrays)
165{
166 /* Initialize master control (includes parameter checking/processing) */
167 jinit_c_master_control(cinfo, TRUE /* transcode only */);
168
169 /* Entropy encoding: either Huffman or arithmetic coding. */
170 if (cinfo->arith_code)
171 jinit_arith_encoder(cinfo);
172 else {
173 jinit_huff_encoder(cinfo);
174 }
175
176 /* We need a special coefficient buffer controller. */
177 transencode_coef_controller(cinfo, coef_arrays);
178
179 jinit_marker_writer(cinfo);
180
181 /* We can now tell the memory manager to allocate virtual arrays. */
182 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
183
184 /* Write the datastream header (SOI, JFIF) immediately.
185 * Frame and scan headers are postponed till later.
186 * This lets application insert special markers after the SOI.
187 */
188 (*cinfo->marker->write_file_header) (cinfo);
189}
190
191
192/*
193 * The rest of this file is a special implementation of the coefficient
194 * buffer controller. This is similar to jccoefct.c, but it handles only
195 * output from presupplied virtual arrays. Furthermore, we generate any
196 * dummy padding blocks on-the-fly rather than expecting them to be present
197 * in the arrays.
198 */
199
200/* Private buffer controller object */
201
202typedef struct {
203 struct jpeg_c_coef_controller pub; /* public fields */
204
205 JDIMENSION iMCU_row_num; /* iMCU row # within image */
206 JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
207 int MCU_vert_offset; /* counts MCU rows within iMCU row */
208 int MCU_rows_per_iMCU_row; /* number of such rows needed */
209
210 /* Virtual block array for each component. */
211 jvirt_barray_ptr * whole_image;
212
213 /* Workspace for constructing dummy blocks at right/bottom edges. */
214 JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
215} my_coef_controller;
216
217typedef my_coef_controller * my_coef_ptr;
218
219
220LOCAL(void)
221start_iMCU_row (j_compress_ptr cinfo)
222/* Reset within-iMCU-row counters for a new row */
223{
224 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
225
226 /* In an interleaved scan, an MCU row is the same as an iMCU row.
227 * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
228 * But at the bottom of the image, process only what's left.
229 */
230 if (cinfo->comps_in_scan > 1) {
231 coef->MCU_rows_per_iMCU_row = 1;
232 } else {
233 if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
234 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
235 else
236 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
237 }
238
239 coef->mcu_ctr = 0;
240 coef->MCU_vert_offset = 0;
241}
242
243
244/*
245 * Initialize for a processing pass.
246 */
247
248METHODDEF(void)
249start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
250{
251 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
252
253 if (pass_mode != JBUF_CRANK_DEST)
254 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
255
256 coef->iMCU_row_num = 0;
257 start_iMCU_row(cinfo);
258}
259
260
261/*
262 * Process some data.
263 * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
264 * per call, ie, v_samp_factor block rows for each component in the scan.
265 * The data is obtained from the virtual arrays and fed to the entropy coder.
266 * Returns TRUE if the iMCU row is completed, FALSE if suspended.
267 *
268 * NB: input_buf is ignored; it is likely to be a NULL pointer.
269 */
270
271METHODDEF(boolean)
272compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
273{
274 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
275 JDIMENSION MCU_col_num; /* index of current MCU within row */
276 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
277 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
278 int blkn, ci, xindex, yindex, yoffset, blockcnt;
279 JDIMENSION start_col;
280 JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
281 JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
282 JBLOCKROW buffer_ptr;
283 jpeg_component_info *compptr;
284
285 /* Align the virtual buffers for the components used in this scan. */
286 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
287 compptr = cinfo->cur_comp_info[ci];
288 buffer[ci] = (*cinfo->mem->access_virt_barray)
289 ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
290 coef->iMCU_row_num * compptr->v_samp_factor,
291 (JDIMENSION) compptr->v_samp_factor, FALSE);
292 }
293
294 /* Loop to process one whole iMCU row */
295 for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
296 yoffset++) {
297 for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
298 MCU_col_num++) {
299 /* Construct list of pointers to DCT blocks belonging to this MCU */
300 blkn = 0; /* index of current DCT block within MCU */
301 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
302 compptr = cinfo->cur_comp_info[ci];
303 start_col = MCU_col_num * compptr->MCU_width;
304 blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
305 : compptr->last_col_width;
306 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
307 if (coef->iMCU_row_num < last_iMCU_row ||
308 yindex+yoffset < compptr->last_row_height) {
309 /* Fill in pointers to real blocks in this row */
310 buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
311 for (xindex = 0; xindex < blockcnt; xindex++)
312 MCU_buffer[blkn++] = buffer_ptr++;
313 } else {
314 /* At bottom of image, need a whole row of dummy blocks */
315 xindex = 0;
316 }
317 /* Fill in any dummy blocks needed in this row.
318 * Dummy blocks are filled in the same way as in jccoefct.c:
319 * all zeroes in the AC entries, DC entries equal to previous
320 * block's DC value. The init routine has already zeroed the
321 * AC entries, so we need only set the DC entries correctly.
322 */
323 for (; xindex < compptr->MCU_width; xindex++) {
324 MCU_buffer[blkn] = coef->dummy_buffer[blkn];
325 MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
326 blkn++;
327 }
328 }
329 }
330 /* Try to write the MCU. */
331 if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
332 /* Suspension forced; update state counters and exit */
333 coef->MCU_vert_offset = yoffset;
334 coef->mcu_ctr = MCU_col_num;
335 return FALSE;
336 }
337 }
338 /* Completed an MCU row, but perhaps not an iMCU row */
339 coef->mcu_ctr = 0;
340 }
341 /* Completed the iMCU row, advance counters for next one */
342 coef->iMCU_row_num++;
343 start_iMCU_row(cinfo);
344 return TRUE;
345}
346
347
348/*
349 * Initialize coefficient buffer controller.
350 *
351 * Each passed coefficient array must be the right size for that
352 * coefficient: width_in_blocks wide and height_in_blocks high,
353 * with unitheight at least v_samp_factor.
354 */
355
356LOCAL(void)
357transencode_coef_controller (j_compress_ptr cinfo,
358 jvirt_barray_ptr * coef_arrays)
359{
360 my_coef_ptr coef;
361 JBLOCKROW buffer;
362 int i;
363
364 coef = (my_coef_ptr)
365 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
366 SIZEOF(my_coef_controller));
367 cinfo->coef = (struct jpeg_c_coef_controller *) coef;
368 coef->pub.start_pass = start_pass_coef;
369 coef->pub.compress_data = compress_output;
370
371 /* Save pointer to virtual arrays */
372 coef->whole_image = coef_arrays;
373
374 /* Allocate and pre-zero space for dummy DCT blocks. */
375 buffer = (JBLOCKROW)
376 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
377 C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
378 FMEMZERO((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
379 for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
380 coef->dummy_buffer[i] = buffer + i;
381 }
382}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapimin.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapimin.c
new file mode 100644
index 0000000..65f8a49
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapimin.c
@@ -0,0 +1,396 @@
1/*
2 * jdapimin.c
3 *
4 * Copyright (C) 1994-1998, Thomas G. Lane.
5 * Modified 2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains application interface code for the decompression half
10 * of the JPEG library. These are the "minimum" API routines that may be
11 * needed in either the normal full-decompression case or the
12 * transcoding-only case.
13 *
14 * Most of the routines intended to be called directly by an application
15 * are in this file or in jdapistd.c. But also see jcomapi.c for routines
16 * shared by compression and decompression, and jdtrans.c for the transcoding
17 * case.
18 */
19
20#define JPEG_INTERNALS
21#include "jinclude.h"
22#include "jpeglib.h"
23
24
25/*
26 * Initialization of a JPEG decompression object.
27 * The error manager must already be set up (in case memory manager fails).
28 */
29
30GLOBAL(void)
31jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
32{
33 int i;
34
35 /* Guard against version mismatches between library and caller. */
36 cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
37 if (version != JPEG_LIB_VERSION)
38 ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
39 if (structsize != SIZEOF(struct jpeg_decompress_struct))
40 ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
41 (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
42
43 /* For debugging purposes, we zero the whole master structure.
44 * But the application has already set the err pointer, and may have set
45 * client_data, so we have to save and restore those fields.
46 * Note: if application hasn't set client_data, tools like Purify may
47 * complain here.
48 */
49 {
50 struct jpeg_error_mgr * err = cinfo->err;
51 void * client_data = cinfo->client_data; /* ignore Purify complaint here */
52 MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
53 cinfo->err = err;
54 cinfo->client_data = client_data;
55 }
56 cinfo->is_decompressor = TRUE;
57
58 /* Initialize a memory manager instance for this object */
59 jinit_memory_mgr((j_common_ptr) cinfo);
60
61 /* Zero out pointers to permanent structures. */
62 cinfo->progress = NULL;
63 cinfo->src = NULL;
64
65 for (i = 0; i < NUM_QUANT_TBLS; i++)
66 cinfo->quant_tbl_ptrs[i] = NULL;
67
68 for (i = 0; i < NUM_HUFF_TBLS; i++) {
69 cinfo->dc_huff_tbl_ptrs[i] = NULL;
70 cinfo->ac_huff_tbl_ptrs[i] = NULL;
71 }
72
73 /* Initialize marker processor so application can override methods
74 * for COM, APPn markers before calling jpeg_read_header.
75 */
76 cinfo->marker_list = NULL;
77 jinit_marker_reader(cinfo);
78
79 /* And initialize the overall input controller. */
80 jinit_input_controller(cinfo);
81
82 /* OK, I'm ready */
83 cinfo->global_state = DSTATE_START;
84}
85
86
87/*
88 * Destruction of a JPEG decompression object
89 */
90
91GLOBAL(void)
92jpeg_destroy_decompress (j_decompress_ptr cinfo)
93{
94 jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
95}
96
97
98/*
99 * Abort processing of a JPEG decompression operation,
100 * but don't destroy the object itself.
101 */
102
103GLOBAL(void)
104jpeg_abort_decompress (j_decompress_ptr cinfo)
105{
106 jpeg_abort((j_common_ptr) cinfo); /* use common routine */
107}
108
109
110/*
111 * Set default decompression parameters.
112 */
113
114LOCAL(void)
115default_decompress_parms (j_decompress_ptr cinfo)
116{
117 /* Guess the input colorspace, and set output colorspace accordingly. */
118 /* (Wish JPEG committee had provided a real way to specify this...) */
119 /* Note application may override our guesses. */
120 switch (cinfo->num_components) {
121 case 1:
122 cinfo->jpeg_color_space = JCS_GRAYSCALE;
123 cinfo->out_color_space = JCS_GRAYSCALE;
124 break;
125
126 case 3:
127 if (cinfo->saw_JFIF_marker) {
128 cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
129 } else if (cinfo->saw_Adobe_marker) {
130 switch (cinfo->Adobe_transform) {
131 case 0:
132 cinfo->jpeg_color_space = JCS_RGB;
133 break;
134 case 1:
135 cinfo->jpeg_color_space = JCS_YCbCr;
136 break;
137 default:
138 WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
139 cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
140 break;
141 }
142 } else {
143 /* Saw no special markers, try to guess from the component IDs */
144 int cid0 = cinfo->comp_info[0].component_id;
145 int cid1 = cinfo->comp_info[1].component_id;
146 int cid2 = cinfo->comp_info[2].component_id;
147
148 if (cid0 == 1 && cid1 == 2 && cid2 == 3)
149 cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
150 else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
151 cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
152 else {
153 TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
154 cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
155 }
156 }
157 /* Always guess RGB is proper output colorspace. */
158 cinfo->out_color_space = JCS_RGB;
159 break;
160
161 case 4:
162 if (cinfo->saw_Adobe_marker) {
163 switch (cinfo->Adobe_transform) {
164 case 0:
165 cinfo->jpeg_color_space = JCS_CMYK;
166 break;
167 case 2:
168 cinfo->jpeg_color_space = JCS_YCCK;
169 break;
170 default:
171 WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
172 cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
173 break;
174 }
175 } else {
176 /* No special markers, assume straight CMYK. */
177 cinfo->jpeg_color_space = JCS_CMYK;
178 }
179 cinfo->out_color_space = JCS_CMYK;
180 break;
181
182 default:
183 cinfo->jpeg_color_space = JCS_UNKNOWN;
184 cinfo->out_color_space = JCS_UNKNOWN;
185 break;
186 }
187
188 /* Set defaults for other decompression parameters. */
189 cinfo->scale_num = cinfo->block_size; /* 1:1 scaling */
190 cinfo->scale_denom = cinfo->block_size;
191 cinfo->output_gamma = 1.0;
192 cinfo->buffered_image = FALSE;
193 cinfo->raw_data_out = FALSE;
194 cinfo->dct_method = JDCT_DEFAULT;
195 cinfo->do_fancy_upsampling = TRUE;
196 cinfo->do_block_smoothing = TRUE;
197 cinfo->quantize_colors = FALSE;
198 /* We set these in case application only sets quantize_colors. */
199 cinfo->dither_mode = JDITHER_FS;
200#ifdef QUANT_2PASS_SUPPORTED
201 cinfo->two_pass_quantize = TRUE;
202#else
203 cinfo->two_pass_quantize = FALSE;
204#endif
205 cinfo->desired_number_of_colors = 256;
206 cinfo->colormap = NULL;
207 /* Initialize for no mode change in buffered-image mode. */
208 cinfo->enable_1pass_quant = FALSE;
209 cinfo->enable_external_quant = FALSE;
210 cinfo->enable_2pass_quant = FALSE;
211}
212
213
214/*
215 * Decompression startup: read start of JPEG datastream to see what's there.
216 * Need only initialize JPEG object and supply a data source before calling.
217 *
218 * This routine will read as far as the first SOS marker (ie, actual start of
219 * compressed data), and will save all tables and parameters in the JPEG
220 * object. It will also initialize the decompression parameters to default
221 * values, and finally return JPEG_HEADER_OK. On return, the application may
222 * adjust the decompression parameters and then call jpeg_start_decompress.
223 * (Or, if the application only wanted to determine the image parameters,
224 * the data need not be decompressed. In that case, call jpeg_abort or
225 * jpeg_destroy to release any temporary space.)
226 * If an abbreviated (tables only) datastream is presented, the routine will
227 * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then
228 * re-use the JPEG object to read the abbreviated image datastream(s).
229 * It is unnecessary (but OK) to call jpeg_abort in this case.
230 * The JPEG_SUSPENDED return code only occurs if the data source module
231 * requests suspension of the decompressor. In this case the application
232 * should load more source data and then re-call jpeg_read_header to resume
233 * processing.
234 * If a non-suspending data source is used and require_image is TRUE, then the
235 * return code need not be inspected since only JPEG_HEADER_OK is possible.
236 *
237 * This routine is now just a front end to jpeg_consume_input, with some
238 * extra error checking.
239 */
240
241GLOBAL(int)
242jpeg_read_header (j_decompress_ptr cinfo, boolean require_image)
243{
244 int retcode;
245
246 if (cinfo->global_state != DSTATE_START &&
247 cinfo->global_state != DSTATE_INHEADER)
248 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
249
250 retcode = jpeg_consume_input(cinfo);
251
252 switch (retcode) {
253 case JPEG_REACHED_SOS:
254 retcode = JPEG_HEADER_OK;
255 break;
256 case JPEG_REACHED_EOI:
257 if (require_image) /* Complain if application wanted an image */
258 ERREXIT(cinfo, JERR_NO_IMAGE);
259 /* Reset to start state; it would be safer to require the application to
260 * call jpeg_abort, but we can't change it now for compatibility reasons.
261 * A side effect is to free any temporary memory (there shouldn't be any).
262 */
263 jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
264 retcode = JPEG_HEADER_TABLES_ONLY;
265 break;
266 case JPEG_SUSPENDED:
267 /* no work */
268 break;
269 }
270
271 return retcode;
272}
273
274
275/*
276 * Consume data in advance of what the decompressor requires.
277 * This can be called at any time once the decompressor object has
278 * been created and a data source has been set up.
279 *
280 * This routine is essentially a state machine that handles a couple
281 * of critical state-transition actions, namely initial setup and
282 * transition from header scanning to ready-for-start_decompress.
283 * All the actual input is done via the input controller's consume_input
284 * method.
285 */
286
287GLOBAL(int)
288jpeg_consume_input (j_decompress_ptr cinfo)
289{
290 int retcode = JPEG_SUSPENDED;
291
292 /* NB: every possible DSTATE value should be listed in this switch */
293 switch (cinfo->global_state) {
294 case DSTATE_START:
295 /* Start-of-datastream actions: reset appropriate modules */
296 (*cinfo->inputctl->reset_input_controller) (cinfo);
297 /* Initialize application's data source module */
298 (*cinfo->src->init_source) (cinfo);
299 cinfo->global_state = DSTATE_INHEADER;
300 /*FALLTHROUGH*/
301 case DSTATE_INHEADER:
302 retcode = (*cinfo->inputctl->consume_input) (cinfo);
303 if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
304 /* Set up default parameters based on header data */
305 default_decompress_parms(cinfo);
306 /* Set global state: ready for start_decompress */
307 cinfo->global_state = DSTATE_READY;
308 }
309 break;
310 case DSTATE_READY:
311 /* Can't advance past first SOS until start_decompress is called */
312 retcode = JPEG_REACHED_SOS;
313 break;
314 case DSTATE_PRELOAD:
315 case DSTATE_PRESCAN:
316 case DSTATE_SCANNING:
317 case DSTATE_RAW_OK:
318 case DSTATE_BUFIMAGE:
319 case DSTATE_BUFPOST:
320 case DSTATE_STOPPING:
321 retcode = (*cinfo->inputctl->consume_input) (cinfo);
322 break;
323 default:
324 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
325 }
326 return retcode;
327}
328
329
330/*
331 * Have we finished reading the input file?
332 */
333
334GLOBAL(boolean)
335jpeg_input_complete (j_decompress_ptr cinfo)
336{
337 /* Check for valid jpeg object */
338 if (cinfo->global_state < DSTATE_START ||
339 cinfo->global_state > DSTATE_STOPPING)
340 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
341 return cinfo->inputctl->eoi_reached;
342}
343
344
345/*
346 * Is there more than one scan?
347 */
348
349GLOBAL(boolean)
350jpeg_has_multiple_scans (j_decompress_ptr cinfo)
351{
352 /* Only valid after jpeg_read_header completes */
353 if (cinfo->global_state < DSTATE_READY ||
354 cinfo->global_state > DSTATE_STOPPING)
355 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
356 return cinfo->inputctl->has_multiple_scans;
357}
358
359
360/*
361 * Finish JPEG decompression.
362 *
363 * This will normally just verify the file trailer and release temp storage.
364 *
365 * Returns FALSE if suspended. The return value need be inspected only if
366 * a suspending data source is used.
367 */
368
369GLOBAL(boolean)
370jpeg_finish_decompress (j_decompress_ptr cinfo)
371{
372 if ((cinfo->global_state == DSTATE_SCANNING ||
373 cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
374 /* Terminate final pass of non-buffered mode */
375 if (cinfo->output_scanline < cinfo->output_height)
376 ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
377 (*cinfo->master->finish_output_pass) (cinfo);
378 cinfo->global_state = DSTATE_STOPPING;
379 } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
380 /* Finishing after a buffered-image operation */
381 cinfo->global_state = DSTATE_STOPPING;
382 } else if (cinfo->global_state != DSTATE_STOPPING) {
383 /* STOPPING = repeat call after a suspension, anything else is error */
384 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
385 }
386 /* Read until EOI */
387 while (! cinfo->inputctl->eoi_reached) {
388 if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
389 return FALSE; /* Suspend, come back later */
390 }
391 /* Do final cleanup */
392 (*cinfo->src->term_source) (cinfo);
393 /* We can use jpeg_abort to release memory and reset global_state */
394 jpeg_abort((j_common_ptr) cinfo);
395 return TRUE;
396}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapistd.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapistd.c
new file mode 100644
index 0000000..e81bd67
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdapistd.c
@@ -0,0 +1,275 @@
1/*
2 * jdapistd.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains application interface code for the decompression half
9 * of the JPEG library. These are the "standard" API routines that are
10 * used in the normal full-decompression case. They are not used by a
11 * transcoding-only application. Note that if an application links in
12 * jpeg_start_decompress, it will end up linking in the entire decompressor.
13 * We thus must separate this file from jdapimin.c to avoid linking the
14 * whole decompression library into a transcoder.
15 */
16
17#define JPEG_INTERNALS
18#include "jinclude.h"
19#include "jpeglib.h"
20
21
22/* Forward declarations */
23LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
24
25
26/*
27 * Decompression initialization.
28 * jpeg_read_header must be completed before calling this.
29 *
30 * If a multipass operating mode was selected, this will do all but the
31 * last pass, and thus may take a great deal of time.
32 *
33 * Returns FALSE if suspended. The return value need be inspected only if
34 * a suspending data source is used.
35 */
36
37GLOBAL(boolean)
38jpeg_start_decompress (j_decompress_ptr cinfo)
39{
40 if (cinfo->global_state == DSTATE_READY) {
41 /* First call: initialize master control, select active modules */
42 jinit_master_decompress(cinfo);
43 if (cinfo->buffered_image) {
44 /* No more work here; expecting jpeg_start_output next */
45 cinfo->global_state = DSTATE_BUFIMAGE;
46 return TRUE;
47 }
48 cinfo->global_state = DSTATE_PRELOAD;
49 }
50 if (cinfo->global_state == DSTATE_PRELOAD) {
51 /* If file has multiple scans, absorb them all into the coef buffer */
52 if (cinfo->inputctl->has_multiple_scans) {
53#ifdef D_MULTISCAN_FILES_SUPPORTED
54 for (;;) {
55 int retcode;
56 /* Call progress monitor hook if present */
57 if (cinfo->progress != NULL)
58 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
59 /* Absorb some more input */
60 retcode = (*cinfo->inputctl->consume_input) (cinfo);
61 if (retcode == JPEG_SUSPENDED)
62 return FALSE;
63 if (retcode == JPEG_REACHED_EOI)
64 break;
65 /* Advance progress counter if appropriate */
66 if (cinfo->progress != NULL &&
67 (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
68 if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
69 /* jdmaster underestimated number of scans; ratchet up one scan */
70 cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
71 }
72 }
73 }
74#else
75 ERREXIT(cinfo, JERR_NOT_COMPILED);
76#endif /* D_MULTISCAN_FILES_SUPPORTED */
77 }
78 cinfo->output_scan_number = cinfo->input_scan_number;
79 } else if (cinfo->global_state != DSTATE_PRESCAN)
80 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
81 /* Perform any dummy output passes, and set up for the final pass */
82 return output_pass_setup(cinfo);
83}
84
85
86/*
87 * Set up for an output pass, and perform any dummy pass(es) needed.
88 * Common subroutine for jpeg_start_decompress and jpeg_start_output.
89 * Entry: global_state = DSTATE_PRESCAN only if previously suspended.
90 * Exit: If done, returns TRUE and sets global_state for proper output mode.
91 * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
92 */
93
94LOCAL(boolean)
95output_pass_setup (j_decompress_ptr cinfo)
96{
97 if (cinfo->global_state != DSTATE_PRESCAN) {
98 /* First call: do pass setup */
99 (*cinfo->master->prepare_for_output_pass) (cinfo);
100 cinfo->output_scanline = 0;
101 cinfo->global_state = DSTATE_PRESCAN;
102 }
103 /* Loop over any required dummy passes */
104 while (cinfo->master->is_dummy_pass) {
105#ifdef QUANT_2PASS_SUPPORTED
106 /* Crank through the dummy pass */
107 while (cinfo->output_scanline < cinfo->output_height) {
108 JDIMENSION last_scanline;
109 /* Call progress monitor hook if present */
110 if (cinfo->progress != NULL) {
111 cinfo->progress->pass_counter = (long) cinfo->output_scanline;
112 cinfo->progress->pass_limit = (long) cinfo->output_height;
113 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
114 }
115 /* Process some data */
116 last_scanline = cinfo->output_scanline;
117 (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
118 &cinfo->output_scanline, (JDIMENSION) 0);
119 if (cinfo->output_scanline == last_scanline)
120 return FALSE; /* No progress made, must suspend */
121 }
122 /* Finish up dummy pass, and set up for another one */
123 (*cinfo->master->finish_output_pass) (cinfo);
124 (*cinfo->master->prepare_for_output_pass) (cinfo);
125 cinfo->output_scanline = 0;
126#else
127 ERREXIT(cinfo, JERR_NOT_COMPILED);
128#endif /* QUANT_2PASS_SUPPORTED */
129 }
130 /* Ready for application to drive output pass through
131 * jpeg_read_scanlines or jpeg_read_raw_data.
132 */
133 cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
134 return TRUE;
135}
136
137
138/*
139 * Read some scanlines of data from the JPEG decompressor.
140 *
141 * The return value will be the number of lines actually read.
142 * This may be less than the number requested in several cases,
143 * including bottom of image, data source suspension, and operating
144 * modes that emit multiple scanlines at a time.
145 *
146 * Note: we warn about excess calls to jpeg_read_scanlines() since
147 * this likely signals an application programmer error. However,
148 * an oversize buffer (max_lines > scanlines remaining) is not an error.
149 */
150
151GLOBAL(JDIMENSION)
152jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
153 JDIMENSION max_lines)
154{
155 JDIMENSION row_ctr;
156
157 if (cinfo->global_state != DSTATE_SCANNING)
158 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
159 if (cinfo->output_scanline >= cinfo->output_height) {
160 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
161 return 0;
162 }
163
164 /* Call progress monitor hook if present */
165 if (cinfo->progress != NULL) {
166 cinfo->progress->pass_counter = (long) cinfo->output_scanline;
167 cinfo->progress->pass_limit = (long) cinfo->output_height;
168 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
169 }
170
171 /* Process some data */
172 row_ctr = 0;
173 (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
174 cinfo->output_scanline += row_ctr;
175 return row_ctr;
176}
177
178
179/*
180 * Alternate entry point to read raw data.
181 * Processes exactly one iMCU row per call, unless suspended.
182 */
183
184GLOBAL(JDIMENSION)
185jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
186 JDIMENSION max_lines)
187{
188 JDIMENSION lines_per_iMCU_row;
189
190 if (cinfo->global_state != DSTATE_RAW_OK)
191 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
192 if (cinfo->output_scanline >= cinfo->output_height) {
193 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
194 return 0;
195 }
196
197 /* Call progress monitor hook if present */
198 if (cinfo->progress != NULL) {
199 cinfo->progress->pass_counter = (long) cinfo->output_scanline;
200 cinfo->progress->pass_limit = (long) cinfo->output_height;
201 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
202 }
203
204 /* Verify that at least one iMCU row can be returned. */
205 lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size;
206 if (max_lines < lines_per_iMCU_row)
207 ERREXIT(cinfo, JERR_BUFFER_SIZE);
208
209 /* Decompress directly into user's buffer. */
210 if (! (*cinfo->coef->decompress_data) (cinfo, data))
211 return 0; /* suspension forced, can do nothing more */
212
213 /* OK, we processed one iMCU row. */
214 cinfo->output_scanline += lines_per_iMCU_row;
215 return lines_per_iMCU_row;
216}
217
218
219/* Additional entry points for buffered-image mode. */
220
221#ifdef D_MULTISCAN_FILES_SUPPORTED
222
223/*
224 * Initialize for an output pass in buffered-image mode.
225 */
226
227GLOBAL(boolean)
228jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
229{
230 if (cinfo->global_state != DSTATE_BUFIMAGE &&
231 cinfo->global_state != DSTATE_PRESCAN)
232 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
233 /* Limit scan number to valid range */
234 if (scan_number <= 0)
235 scan_number = 1;
236 if (cinfo->inputctl->eoi_reached &&
237 scan_number > cinfo->input_scan_number)
238 scan_number = cinfo->input_scan_number;
239 cinfo->output_scan_number = scan_number;
240 /* Perform any dummy output passes, and set up for the real pass */
241 return output_pass_setup(cinfo);
242}
243
244
245/*
246 * Finish up after an output pass in buffered-image mode.
247 *
248 * Returns FALSE if suspended. The return value need be inspected only if
249 * a suspending data source is used.
250 */
251
252GLOBAL(boolean)
253jpeg_finish_output (j_decompress_ptr cinfo)
254{
255 if ((cinfo->global_state == DSTATE_SCANNING ||
256 cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
257 /* Terminate this pass. */
258 /* We do not require the whole pass to have been completed. */
259 (*cinfo->master->finish_output_pass) (cinfo);
260 cinfo->global_state = DSTATE_BUFPOST;
261 } else if (cinfo->global_state != DSTATE_BUFPOST) {
262 /* BUFPOST = repeat call after a suspension, anything else is error */
263 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
264 }
265 /* Read markers looking for SOS or EOI */
266 while (cinfo->input_scan_number <= cinfo->output_scan_number &&
267 ! cinfo->inputctl->eoi_reached) {
268 if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
269 return FALSE; /* Suspend, come back later */
270 }
271 cinfo->global_state = DSTATE_BUFIMAGE;
272 return TRUE;
273}
274
275#endif /* D_MULTISCAN_FILES_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdarith.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdarith.c
new file mode 100644
index 0000000..86a4ac7
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdarith.c
@@ -0,0 +1,776 @@
1/*
2 * jdarith.c
3 *
4 * Developed 1997-2011 by Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains portable arithmetic entropy decoding routines for JPEG
9 * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
10 *
11 * Both sequential and progressive modes are supported in this single module.
12 *
13 * Suspension is not currently supported in this module.
14 */
15
16#define JPEG_INTERNALS
17#include "jinclude.h"
18#include "jpeglib.h"
19
20
21/* Expanded entropy decoder object for arithmetic decoding. */
22
23typedef struct {
24 struct jpeg_entropy_decoder pub; /* public fields */
25
26 INT32 c; /* C register, base of coding interval + input bit buffer */
27 INT32 a; /* A register, normalized size of coding interval */
28 int ct; /* bit shift counter, # of bits left in bit buffer part of C */
29 /* init: ct = -16 */
30 /* run: ct = 0..7 */
31 /* error: ct = -1 */
32 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
33 int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
34
35 unsigned int restarts_to_go; /* MCUs left in this restart interval */
36
37 /* Pointers to statistics areas (these workspaces have image lifespan) */
38 unsigned char * dc_stats[NUM_ARITH_TBLS];
39 unsigned char * ac_stats[NUM_ARITH_TBLS];
40
41 /* Statistics bin for coding with fixed probability 0.5 */
42 unsigned char fixed_bin[4];
43} arith_entropy_decoder;
44
45typedef arith_entropy_decoder * arith_entropy_ptr;
46
47/* The following two definitions specify the allocation chunk size
48 * for the statistics area.
49 * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
50 * 49 statistics bins for DC, and 245 statistics bins for AC coding.
51 *
52 * We use a compact representation with 1 byte per statistics bin,
53 * thus the numbers directly represent byte sizes.
54 * This 1 byte per statistics bin contains the meaning of the MPS
55 * (more probable symbol) in the highest bit (mask 0x80), and the
56 * index into the probability estimation state machine table
57 * in the lower bits (mask 0x7F).
58 */
59
60#define DC_STAT_BINS 64
61#define AC_STAT_BINS 256
62
63
64LOCAL(int)
65get_byte (j_decompress_ptr cinfo)
66/* Read next input byte; we do not support suspension in this module. */
67{
68 struct jpeg_source_mgr * src = cinfo->src;
69
70 if (src->bytes_in_buffer == 0)
71 if (! (*src->fill_input_buffer) (cinfo))
72 ERREXIT(cinfo, JERR_CANT_SUSPEND);
73 src->bytes_in_buffer--;
74 return GETJOCTET(*src->next_input_byte++);
75}
76
77
78/*
79 * The core arithmetic decoding routine (common in JPEG and JBIG).
80 * This needs to go as fast as possible.
81 * Machine-dependent optimization facilities
82 * are not utilized in this portable implementation.
83 * However, this code should be fairly efficient and
84 * may be a good base for further optimizations anyway.
85 *
86 * Return value is 0 or 1 (binary decision).
87 *
88 * Note: I've changed the handling of the code base & bit
89 * buffer register C compared to other implementations
90 * based on the standards layout & procedures.
91 * While it also contains both the actual base of the
92 * coding interval (16 bits) and the next-bits buffer,
93 * the cut-point between these two parts is floating
94 * (instead of fixed) with the bit shift counter CT.
95 * Thus, we also need only one (variable instead of
96 * fixed size) shift for the LPS/MPS decision, and
97 * we can get away with any renormalization update
98 * of C (except for new data insertion, of course).
99 *
100 * I've also introduced a new scheme for accessing
101 * the probability estimation state machine table,
102 * derived from Markus Kuhn's JBIG implementation.
103 */
104
105LOCAL(int)
106arith_decode (j_decompress_ptr cinfo, unsigned char *st)
107{
108 register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
109 register unsigned char nl, nm;
110 register INT32 qe, temp;
111 register int sv, data;
112
113 /* Renormalization & data input per section D.2.6 */
114 while (e->a < 0x8000L) {
115 if (--e->ct < 0) {
116 /* Need to fetch next data byte */
117 if (cinfo->unread_marker)
118 data = 0; /* stuff zero data */
119 else {
120 data = get_byte(cinfo); /* read next input byte */
121 if (data == 0xFF) { /* zero stuff or marker code */
122 do data = get_byte(cinfo);
123 while (data == 0xFF); /* swallow extra 0xFF bytes */
124 if (data == 0)
125 data = 0xFF; /* discard stuffed zero byte */
126 else {
127 /* Note: Different from the Huffman decoder, hitting
128 * a marker while processing the compressed data
129 * segment is legal in arithmetic coding.
130 * The convention is to supply zero data
131 * then until decoding is complete.
132 */
133 cinfo->unread_marker = data;
134 data = 0;
135 }
136 }
137 }
138 e->c = (e->c << 8) | data; /* insert data into C register */
139 if ((e->ct += 8) < 0) /* update bit shift counter */
140 /* Need more initial bytes */
141 if (++e->ct == 0)
142 /* Got 2 initial bytes -> re-init A and exit loop */
143 e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */
144 }
145 e->a <<= 1;
146 }
147
148 /* Fetch values from our compact representation of Table D.3(D.2):
149 * Qe values and probability estimation state machine
150 */
151 sv = *st;
152 qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
153 nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
154 nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
155
156 /* Decode & estimation procedures per sections D.2.4 & D.2.5 */
157 temp = e->a - qe;
158 e->a = temp;
159 temp <<= e->ct;
160 if (e->c >= temp) {
161 e->c -= temp;
162 /* Conditional LPS (less probable symbol) exchange */
163 if (e->a < qe) {
164 e->a = qe;
165 *st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
166 } else {
167 e->a = qe;
168 *st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
169 sv ^= 0x80; /* Exchange LPS/MPS */
170 }
171 } else if (e->a < 0x8000L) {
172 /* Conditional MPS (more probable symbol) exchange */
173 if (e->a < qe) {
174 *st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
175 sv ^= 0x80; /* Exchange LPS/MPS */
176 } else {
177 *st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
178 }
179 }
180
181 return sv >> 7;
182}
183
184
185/*
186 * Check for a restart marker & resynchronize decoder.
187 */
188
189LOCAL(void)
190process_restart (j_decompress_ptr cinfo)
191{
192 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
193 int ci;
194 jpeg_component_info * compptr;
195
196 /* Advance past the RSTn marker */
197 if (! (*cinfo->marker->read_restart_marker) (cinfo))
198 ERREXIT(cinfo, JERR_CANT_SUSPEND);
199
200 /* Re-initialize statistics areas */
201 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
202 compptr = cinfo->cur_comp_info[ci];
203 if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
204 MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
205 /* Reset DC predictions to 0 */
206 entropy->last_dc_val[ci] = 0;
207 entropy->dc_context[ci] = 0;
208 }
209 if ((! cinfo->progressive_mode && cinfo->lim_Se) ||
210 (cinfo->progressive_mode && cinfo->Ss)) {
211 MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
212 }
213 }
214
215 /* Reset arithmetic decoding variables */
216 entropy->c = 0;
217 entropy->a = 0;
218 entropy->ct = -16; /* force reading 2 initial bytes to fill C */
219
220 /* Reset restart counter */
221 entropy->restarts_to_go = cinfo->restart_interval;
222}
223
224
225/*
226 * Arithmetic MCU decoding.
227 * Each of these routines decodes and returns one MCU's worth of
228 * arithmetic-compressed coefficients.
229 * The coefficients are reordered from zigzag order into natural array order,
230 * but are not dequantized.
231 *
232 * The i'th block of the MCU is stored into the block pointed to by
233 * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
234 */
235
236/*
237 * MCU decoding for DC initial scan (either spectral selection,
238 * or first pass of successive approximation).
239 */
240
241METHODDEF(boolean)
242decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
243{
244 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
245 JBLOCKROW block;
246 unsigned char *st;
247 int blkn, ci, tbl, sign;
248 int v, m;
249
250 /* Process restart marker if needed */
251 if (cinfo->restart_interval) {
252 if (entropy->restarts_to_go == 0)
253 process_restart(cinfo);
254 entropy->restarts_to_go--;
255 }
256
257 if (entropy->ct == -1) return TRUE; /* if error do nothing */
258
259 /* Outer loop handles each block in the MCU */
260
261 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
262 block = MCU_data[blkn];
263 ci = cinfo->MCU_membership[blkn];
264 tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
265
266 /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
267
268 /* Table F.4: Point to statistics bin S0 for DC coefficient coding */
269 st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
270
271 /* Figure F.19: Decode_DC_DIFF */
272 if (arith_decode(cinfo, st) == 0)
273 entropy->dc_context[ci] = 0;
274 else {
275 /* Figure F.21: Decoding nonzero value v */
276 /* Figure F.22: Decoding the sign of v */
277 sign = arith_decode(cinfo, st + 1);
278 st += 2; st += sign;
279 /* Figure F.23: Decoding the magnitude category of v */
280 if ((m = arith_decode(cinfo, st)) != 0) {
281 st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
282 while (arith_decode(cinfo, st)) {
283 if ((m <<= 1) == 0x8000) {
284 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
285 entropy->ct = -1; /* magnitude overflow */
286 return TRUE;
287 }
288 st += 1;
289 }
290 }
291 /* Section F.1.4.4.1.2: Establish dc_context conditioning category */
292 if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
293 entropy->dc_context[ci] = 0; /* zero diff category */
294 else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
295 entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
296 else
297 entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
298 v = m;
299 /* Figure F.24: Decoding the magnitude bit pattern of v */
300 st += 14;
301 while (m >>= 1)
302 if (arith_decode(cinfo, st)) v |= m;
303 v += 1; if (sign) v = -v;
304 entropy->last_dc_val[ci] += v;
305 }
306
307 /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
308 (*block)[0] = (JCOEF) (entropy->last_dc_val[ci] << cinfo->Al);
309 }
310
311 return TRUE;
312}
313
314
315/*
316 * MCU decoding for AC initial scan (either spectral selection,
317 * or first pass of successive approximation).
318 */
319
320METHODDEF(boolean)
321decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
322{
323 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
324 JBLOCKROW block;
325 unsigned char *st;
326 int tbl, sign, k;
327 int v, m;
328 const int * natural_order;
329
330 /* Process restart marker if needed */
331 if (cinfo->restart_interval) {
332 if (entropy->restarts_to_go == 0)
333 process_restart(cinfo);
334 entropy->restarts_to_go--;
335 }
336
337 if (entropy->ct == -1) return TRUE; /* if error do nothing */
338
339 natural_order = cinfo->natural_order;
340
341 /* There is always only one block per MCU */
342 block = MCU_data[0];
343 tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
344
345 /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
346
347 /* Figure F.20: Decode_AC_coefficients */
348 for (k = cinfo->Ss; k <= cinfo->Se; k++) {
349 st = entropy->ac_stats[tbl] + 3 * (k - 1);
350 if (arith_decode(cinfo, st)) break; /* EOB flag */
351 while (arith_decode(cinfo, st + 1) == 0) {
352 st += 3; k++;
353 if (k > cinfo->Se) {
354 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
355 entropy->ct = -1; /* spectral overflow */
356 return TRUE;
357 }
358 }
359 /* Figure F.21: Decoding nonzero value v */
360 /* Figure F.22: Decoding the sign of v */
361 sign = arith_decode(cinfo, entropy->fixed_bin);
362 st += 2;
363 /* Figure F.23: Decoding the magnitude category of v */
364 if ((m = arith_decode(cinfo, st)) != 0) {
365 if (arith_decode(cinfo, st)) {
366 m <<= 1;
367 st = entropy->ac_stats[tbl] +
368 (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
369 while (arith_decode(cinfo, st)) {
370 if ((m <<= 1) == 0x8000) {
371 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
372 entropy->ct = -1; /* magnitude overflow */
373 return TRUE;
374 }
375 st += 1;
376 }
377 }
378 }
379 v = m;
380 /* Figure F.24: Decoding the magnitude bit pattern of v */
381 st += 14;
382 while (m >>= 1)
383 if (arith_decode(cinfo, st)) v |= m;
384 v += 1; if (sign) v = -v;
385 /* Scale and output coefficient in natural (dezigzagged) order */
386 (*block)[natural_order[k]] = (JCOEF) (v << cinfo->Al);
387 }
388
389 return TRUE;
390}
391
392
393/*
394 * MCU decoding for DC successive approximation refinement scan.
395 */
396
397METHODDEF(boolean)
398decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
399{
400 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
401 unsigned char *st;
402 int p1, blkn;
403
404 /* Process restart marker if needed */
405 if (cinfo->restart_interval) {
406 if (entropy->restarts_to_go == 0)
407 process_restart(cinfo);
408 entropy->restarts_to_go--;
409 }
410
411 st = entropy->fixed_bin; /* use fixed probability estimation */
412 p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
413
414 /* Outer loop handles each block in the MCU */
415
416 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
417 /* Encoded data is simply the next bit of the two's-complement DC value */
418 if (arith_decode(cinfo, st))
419 MCU_data[blkn][0][0] |= p1;
420 }
421
422 return TRUE;
423}
424
425
426/*
427 * MCU decoding for AC successive approximation refinement scan.
428 */
429
430METHODDEF(boolean)
431decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
432{
433 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
434 JBLOCKROW block;
435 JCOEFPTR thiscoef;
436 unsigned char *st;
437 int tbl, k, kex;
438 int p1, m1;
439 const int * natural_order;
440
441 /* Process restart marker if needed */
442 if (cinfo->restart_interval) {
443 if (entropy->restarts_to_go == 0)
444 process_restart(cinfo);
445 entropy->restarts_to_go--;
446 }
447
448 if (entropy->ct == -1) return TRUE; /* if error do nothing */
449
450 natural_order = cinfo->natural_order;
451
452 /* There is always only one block per MCU */
453 block = MCU_data[0];
454 tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
455
456 p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
457 m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
458
459 /* Establish EOBx (previous stage end-of-block) index */
460 for (kex = cinfo->Se; kex > 0; kex--)
461 if ((*block)[natural_order[kex]]) break;
462
463 for (k = cinfo->Ss; k <= cinfo->Se; k++) {
464 st = entropy->ac_stats[tbl] + 3 * (k - 1);
465 if (k > kex)
466 if (arith_decode(cinfo, st)) break; /* EOB flag */
467 for (;;) {
468 thiscoef = *block + natural_order[k];
469 if (*thiscoef) { /* previously nonzero coef */
470 if (arith_decode(cinfo, st + 2)) {
471 if (*thiscoef < 0)
472 *thiscoef += m1;
473 else
474 *thiscoef += p1;
475 }
476 break;
477 }
478 if (arith_decode(cinfo, st + 1)) { /* newly nonzero coef */
479 if (arith_decode(cinfo, entropy->fixed_bin))
480 *thiscoef = m1;
481 else
482 *thiscoef = p1;
483 break;
484 }
485 st += 3; k++;
486 if (k > cinfo->Se) {
487 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
488 entropy->ct = -1; /* spectral overflow */
489 return TRUE;
490 }
491 }
492 }
493
494 return TRUE;
495}
496
497
498/*
499 * Decode one MCU's worth of arithmetic-compressed coefficients.
500 */
501
502METHODDEF(boolean)
503decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
504{
505 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
506 jpeg_component_info * compptr;
507 JBLOCKROW block;
508 unsigned char *st;
509 int blkn, ci, tbl, sign, k;
510 int v, m;
511 const int * natural_order;
512
513 /* Process restart marker if needed */
514 if (cinfo->restart_interval) {
515 if (entropy->restarts_to_go == 0)
516 process_restart(cinfo);
517 entropy->restarts_to_go--;
518 }
519
520 if (entropy->ct == -1) return TRUE; /* if error do nothing */
521
522 natural_order = cinfo->natural_order;
523
524 /* Outer loop handles each block in the MCU */
525
526 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
527 block = MCU_data[blkn];
528 ci = cinfo->MCU_membership[blkn];
529 compptr = cinfo->cur_comp_info[ci];
530
531 /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
532
533 tbl = compptr->dc_tbl_no;
534
535 /* Table F.4: Point to statistics bin S0 for DC coefficient coding */
536 st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
537
538 /* Figure F.19: Decode_DC_DIFF */
539 if (arith_decode(cinfo, st) == 0)
540 entropy->dc_context[ci] = 0;
541 else {
542 /* Figure F.21: Decoding nonzero value v */
543 /* Figure F.22: Decoding the sign of v */
544 sign = arith_decode(cinfo, st + 1);
545 st += 2; st += sign;
546 /* Figure F.23: Decoding the magnitude category of v */
547 if ((m = arith_decode(cinfo, st)) != 0) {
548 st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
549 while (arith_decode(cinfo, st)) {
550 if ((m <<= 1) == 0x8000) {
551 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
552 entropy->ct = -1; /* magnitude overflow */
553 return TRUE;
554 }
555 st += 1;
556 }
557 }
558 /* Section F.1.4.4.1.2: Establish dc_context conditioning category */
559 if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
560 entropy->dc_context[ci] = 0; /* zero diff category */
561 else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
562 entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
563 else
564 entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
565 v = m;
566 /* Figure F.24: Decoding the magnitude bit pattern of v */
567 st += 14;
568 while (m >>= 1)
569 if (arith_decode(cinfo, st)) v |= m;
570 v += 1; if (sign) v = -v;
571 entropy->last_dc_val[ci] += v;
572 }
573
574 (*block)[0] = (JCOEF) entropy->last_dc_val[ci];
575
576 /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
577
578 if (cinfo->lim_Se == 0) continue;
579 tbl = compptr->ac_tbl_no;
580 k = 0;
581
582 /* Figure F.20: Decode_AC_coefficients */
583 do {
584 st = entropy->ac_stats[tbl] + 3 * k;
585 if (arith_decode(cinfo, st)) break; /* EOB flag */
586 for (;;) {
587 k++;
588 if (arith_decode(cinfo, st + 1)) break;
589 st += 3;
590 if (k >= cinfo->lim_Se) {
591 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
592 entropy->ct = -1; /* spectral overflow */
593 return TRUE;
594 }
595 }
596 /* Figure F.21: Decoding nonzero value v */
597 /* Figure F.22: Decoding the sign of v */
598 sign = arith_decode(cinfo, entropy->fixed_bin);
599 st += 2;
600 /* Figure F.23: Decoding the magnitude category of v */
601 if ((m = arith_decode(cinfo, st)) != 0) {
602 if (arith_decode(cinfo, st)) {
603 m <<= 1;
604 st = entropy->ac_stats[tbl] +
605 (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
606 while (arith_decode(cinfo, st)) {
607 if ((m <<= 1) == 0x8000) {
608 WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
609 entropy->ct = -1; /* magnitude overflow */
610 return TRUE;
611 }
612 st += 1;
613 }
614 }
615 }
616 v = m;
617 /* Figure F.24: Decoding the magnitude bit pattern of v */
618 st += 14;
619 while (m >>= 1)
620 if (arith_decode(cinfo, st)) v |= m;
621 v += 1; if (sign) v = -v;
622 (*block)[natural_order[k]] = (JCOEF) v;
623 } while (k < cinfo->lim_Se);
624 }
625
626 return TRUE;
627}
628
629
630/*
631 * Initialize for an arithmetic-compressed scan.
632 */
633
634METHODDEF(void)
635start_pass (j_decompress_ptr cinfo)
636{
637 arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
638 int ci, tbl;
639 jpeg_component_info * compptr;
640
641 if (cinfo->progressive_mode) {
642 /* Validate progressive scan parameters */
643 if (cinfo->Ss == 0) {
644 if (cinfo->Se != 0)
645 goto bad;
646 } else {
647 /* need not check Ss/Se < 0 since they came from unsigned bytes */
648 if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se)
649 goto bad;
650 /* AC scans may have only one component */
651 if (cinfo->comps_in_scan != 1)
652 goto bad;
653 }
654 if (cinfo->Ah != 0) {
655 /* Successive approximation refinement scan: must have Al = Ah-1. */
656 if (cinfo->Ah-1 != cinfo->Al)
657 goto bad;
658 }
659 if (cinfo->Al > 13) { /* need not check for < 0 */
660 bad:
661 ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
662 cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
663 }
664 /* Update progression status, and verify that scan order is legal.
665 * Note that inter-scan inconsistencies are treated as warnings
666 * not fatal errors ... not clear if this is right way to behave.
667 */
668 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
669 int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
670 int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];
671 if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
672 WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
673 for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
674 int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
675 if (cinfo->Ah != expected)
676 WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
677 coef_bit_ptr[coefi] = cinfo->Al;
678 }
679 }
680 /* Select MCU decoding routine */
681 if (cinfo->Ah == 0) {
682 if (cinfo->Ss == 0)
683 entropy->pub.decode_mcu = decode_mcu_DC_first;
684 else
685 entropy->pub.decode_mcu = decode_mcu_AC_first;
686 } else {
687 if (cinfo->Ss == 0)
688 entropy->pub.decode_mcu = decode_mcu_DC_refine;
689 else
690 entropy->pub.decode_mcu = decode_mcu_AC_refine;
691 }
692 } else {
693 /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
694 * This ought to be an error condition, but we make it a warning.
695 */
696 if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||
697 (cinfo->Se < DCTSIZE2 && cinfo->Se != cinfo->lim_Se))
698 WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
699 /* Select MCU decoding routine */
700 entropy->pub.decode_mcu = decode_mcu;
701 }
702
703 /* Allocate & initialize requested statistics areas */
704 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
705 compptr = cinfo->cur_comp_info[ci];
706 if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
707 tbl = compptr->dc_tbl_no;
708 if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
709 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
710 if (entropy->dc_stats[tbl] == NULL)
711 entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
712 ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);
713 MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
714 /* Initialize DC predictions to 0 */
715 entropy->last_dc_val[ci] = 0;
716 entropy->dc_context[ci] = 0;
717 }
718 if ((! cinfo->progressive_mode && cinfo->lim_Se) ||
719 (cinfo->progressive_mode && cinfo->Ss)) {
720 tbl = compptr->ac_tbl_no;
721 if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
722 ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
723 if (entropy->ac_stats[tbl] == NULL)
724 entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
725 ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);
726 MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
727 }
728 }
729
730 /* Initialize arithmetic decoding variables */
731 entropy->c = 0;
732 entropy->a = 0;
733 entropy->ct = -16; /* force reading 2 initial bytes to fill C */
734
735 /* Initialize restart counter */
736 entropy->restarts_to_go = cinfo->restart_interval;
737}
738
739
740/*
741 * Module initialization routine for arithmetic entropy decoding.
742 */
743
744GLOBAL(void)
745jinit_arith_decoder (j_decompress_ptr cinfo)
746{
747 arith_entropy_ptr entropy;
748 int i;
749
750 entropy = (arith_entropy_ptr)
751 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
752 SIZEOF(arith_entropy_decoder));
753 cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
754 entropy->pub.start_pass = start_pass;
755
756 /* Mark tables unallocated */
757 for (i = 0; i < NUM_ARITH_TBLS; i++) {
758 entropy->dc_stats[i] = NULL;
759 entropy->ac_stats[i] = NULL;
760 }
761
762 /* Initialize index for fixed probability estimation */
763 entropy->fixed_bin[0] = 113;
764
765 if (cinfo->progressive_mode) {
766 /* Create progression status table */
767 int *coef_bit_ptr, ci;
768 cinfo->coef_bits = (int (*)[DCTSIZE2])
769 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
770 cinfo->num_components*DCTSIZE2*SIZEOF(int));
771 coef_bit_ptr = & cinfo->coef_bits[0][0];
772 for (ci = 0; ci < cinfo->num_components; ci++)
773 for (i = 0; i < DCTSIZE2; i++)
774 *coef_bit_ptr++ = -1;
775 }
776}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatadst.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatadst.c
new file mode 100644
index 0000000..d22feb0
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatadst.c
@@ -0,0 +1,267 @@
1/*
2 * jdatadst.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * Modified 2009-2012 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains compression data destination routines for the case of
10 * emitting JPEG data to memory or to a file (or any stdio stream).
11 * While these routines are sufficient for most applications,
12 * some will want to use a different destination manager.
13 * IMPORTANT: we assume that fwrite() will correctly transcribe an array of
14 * JOCTETs into 8-bit-wide elements on external storage. If char is wider
15 * than 8 bits on your machine, you may need to do some tweaking.
16 */
17
18/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
19#include "jinclude.h"
20#include "jpeglib.h"
21#include "jerror.h"
22
23#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
24extern void * malloc JPP((size_t size));
25extern void free JPP((void *ptr));
26#endif
27
28
29/* Expanded data destination object for stdio output */
30
31typedef struct {
32 struct jpeg_destination_mgr pub; /* public fields */
33
34 FILE * outfile; /* target stream */
35 JOCTET * buffer; /* start of buffer */
36} my_destination_mgr;
37
38typedef my_destination_mgr * my_dest_ptr;
39
40#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
41
42
43/* Expanded data destination object for memory output */
44
45typedef struct {
46 struct jpeg_destination_mgr pub; /* public fields */
47
48 unsigned char ** outbuffer; /* target buffer */
49 unsigned long * outsize;
50 unsigned char * newbuffer; /* newly allocated buffer */
51 JOCTET * buffer; /* start of buffer */
52 size_t bufsize;
53} my_mem_destination_mgr;
54
55typedef my_mem_destination_mgr * my_mem_dest_ptr;
56
57
58/*
59 * Initialize destination --- called by jpeg_start_compress
60 * before any data is actually written.
61 */
62
63METHODDEF(void)
64init_destination (j_compress_ptr cinfo)
65{
66 my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
67
68 /* Allocate the output buffer --- it will be released when done with image */
69 dest->buffer = (JOCTET *)
70 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
71 OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
72
73 dest->pub.next_output_byte = dest->buffer;
74 dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
75}
76
77METHODDEF(void)
78init_mem_destination (j_compress_ptr cinfo)
79{
80 /* no work necessary here */
81}
82
83
84/*
85 * Empty the output buffer --- called whenever buffer fills up.
86 *
87 * In typical applications, this should write the entire output buffer
88 * (ignoring the current state of next_output_byte & free_in_buffer),
89 * reset the pointer & count to the start of the buffer, and return TRUE
90 * indicating that the buffer has been dumped.
91 *
92 * In applications that need to be able to suspend compression due to output
93 * overrun, a FALSE return indicates that the buffer cannot be emptied now.
94 * In this situation, the compressor will return to its caller (possibly with
95 * an indication that it has not accepted all the supplied scanlines). The
96 * application should resume compression after it has made more room in the
97 * output buffer. Note that there are substantial restrictions on the use of
98 * suspension --- see the documentation.
99 *
100 * When suspending, the compressor will back up to a convenient restart point
101 * (typically the start of the current MCU). next_output_byte & free_in_buffer
102 * indicate where the restart point will be if the current call returns FALSE.
103 * Data beyond this point will be regenerated after resumption, so do not
104 * write it out when emptying the buffer externally.
105 */
106
107METHODDEF(boolean)
108empty_output_buffer (j_compress_ptr cinfo)
109{
110 my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
111
112 if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
113 (size_t) OUTPUT_BUF_SIZE)
114 ERREXIT(cinfo, JERR_FILE_WRITE);
115
116 dest->pub.next_output_byte = dest->buffer;
117 dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
118
119 return TRUE;
120}
121
122METHODDEF(boolean)
123empty_mem_output_buffer (j_compress_ptr cinfo)
124{
125 size_t nextsize;
126 JOCTET * nextbuffer;
127 my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;
128
129 /* Try to allocate new buffer with double size */
130 nextsize = dest->bufsize * 2;
131 nextbuffer = (JOCTET *) malloc(nextsize);
132
133 if (nextbuffer == NULL)
134 ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
135
136 MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
137
138 if (dest->newbuffer != NULL)
139 free(dest->newbuffer);
140
141 dest->newbuffer = nextbuffer;
142
143 dest->pub.next_output_byte = nextbuffer + dest->bufsize;
144 dest->pub.free_in_buffer = dest->bufsize;
145
146 dest->buffer = nextbuffer;
147 dest->bufsize = nextsize;
148
149 return TRUE;
150}
151
152
153/*
154 * Terminate destination --- called by jpeg_finish_compress
155 * after all data has been written. Usually needs to flush buffer.
156 *
157 * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
158 * application must deal with any cleanup that should happen even
159 * for error exit.
160 */
161
162METHODDEF(void)
163term_destination (j_compress_ptr cinfo)
164{
165 my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
166 size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
167
168 /* Write any data remaining in the buffer */
169 if (datacount > 0) {
170 if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
171 ERREXIT(cinfo, JERR_FILE_WRITE);
172 }
173 fflush(dest->outfile);
174 /* Make sure we wrote the output file OK */
175 if (ferror(dest->outfile))
176 ERREXIT(cinfo, JERR_FILE_WRITE);
177}
178
179METHODDEF(void)
180term_mem_destination (j_compress_ptr cinfo)
181{
182 my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;
183
184 *dest->outbuffer = dest->buffer;
185 *dest->outsize = dest->bufsize - dest->pub.free_in_buffer;
186}
187
188
189/*
190 * Prepare for output to a stdio stream.
191 * The caller must have already opened the stream, and is responsible
192 * for closing it after finishing compression.
193 */
194
195GLOBAL(void)
196jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
197{
198 my_dest_ptr dest;
199
200 /* The destination object is made permanent so that multiple JPEG images
201 * can be written to the same file without re-executing jpeg_stdio_dest.
202 * This makes it dangerous to use this manager and a different destination
203 * manager serially with the same JPEG object, because their private object
204 * sizes may be different. Caveat programmer.
205 */
206 if (cinfo->dest == NULL) { /* first time for this JPEG object? */
207 cinfo->dest = (struct jpeg_destination_mgr *)
208 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
209 SIZEOF(my_destination_mgr));
210 }
211
212 dest = (my_dest_ptr) cinfo->dest;
213 dest->pub.init_destination = init_destination;
214 dest->pub.empty_output_buffer = empty_output_buffer;
215 dest->pub.term_destination = term_destination;
216 dest->outfile = outfile;
217}
218
219
220/*
221 * Prepare for output to a memory buffer.
222 * The caller may supply an own initial buffer with appropriate size.
223 * Otherwise, or when the actual data output exceeds the given size,
224 * the library adapts the buffer size as necessary.
225 * The standard library functions malloc/free are used for allocating
226 * larger memory, so the buffer is available to the application after
227 * finishing compression, and then the application is responsible for
228 * freeing the requested memory.
229 */
230
231GLOBAL(void)
232jpeg_mem_dest (j_compress_ptr cinfo,
233 unsigned char ** outbuffer, unsigned long * outsize)
234{
235 my_mem_dest_ptr dest;
236
237 if (outbuffer == NULL || outsize == NULL) /* sanity check */
238 ERREXIT(cinfo, JERR_BUFFER_SIZE);
239
240 /* The destination object is made permanent so that multiple JPEG images
241 * can be written to the same buffer without re-executing jpeg_mem_dest.
242 */
243 if (cinfo->dest == NULL) { /* first time for this JPEG object? */
244 cinfo->dest = (struct jpeg_destination_mgr *)
245 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
246 SIZEOF(my_mem_destination_mgr));
247 }
248
249 dest = (my_mem_dest_ptr) cinfo->dest;
250 dest->pub.init_destination = init_mem_destination;
251 dest->pub.empty_output_buffer = empty_mem_output_buffer;
252 dest->pub.term_destination = term_mem_destination;
253 dest->outbuffer = outbuffer;
254 dest->outsize = outsize;
255 dest->newbuffer = NULL;
256
257 if (*outbuffer == NULL || *outsize == 0) {
258 /* Allocate initial buffer */
259 dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);
260 if (dest->newbuffer == NULL)
261 ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
262 *outsize = OUTPUT_BUF_SIZE;
263 }
264
265 dest->pub.next_output_byte = dest->buffer = *outbuffer;
266 dest->pub.free_in_buffer = dest->bufsize = *outsize;
267}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatasrc.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatasrc.c
new file mode 100644
index 0000000..e8bca76
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdatasrc.c
@@ -0,0 +1,275 @@
1/*
2 * jdatasrc.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * Modified 2009-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains decompression data source routines for the case of
10 * reading JPEG data from memory or from a file (or any stdio stream).
11 * While these routines are sufficient for most applications,
12 * some will want to use a different source manager.
13 * IMPORTANT: we assume that fread() will correctly transcribe an array of
14 * JOCTETs from 8-bit-wide elements on external storage. If char is wider
15 * than 8 bits on your machine, you may need to do some tweaking.
16 */
17
18/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
19#include "jinclude.h"
20#include "jpeglib.h"
21#include "jerror.h"
22
23
24/* Expanded data source object for stdio input */
25
26typedef struct {
27 struct jpeg_source_mgr pub; /* public fields */
28
29 FILE * infile; /* source stream */
30 JOCTET * buffer; /* start of buffer */
31 boolean start_of_file; /* have we gotten any data yet? */
32} my_source_mgr;
33
34typedef my_source_mgr * my_src_ptr;
35
36#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */
37
38
39/*
40 * Initialize source --- called by jpeg_read_header
41 * before any data is actually read.
42 */
43
44METHODDEF(void)
45init_source (j_decompress_ptr cinfo)
46{
47 my_src_ptr src = (my_src_ptr) cinfo->src;
48
49 /* We reset the empty-input-file flag for each image,
50 * but we don't clear the input buffer.
51 * This is correct behavior for reading a series of images from one source.
52 */
53 src->start_of_file = TRUE;
54}
55
56METHODDEF(void)
57init_mem_source (j_decompress_ptr cinfo)
58{
59 /* no work necessary here */
60}
61
62
63/*
64 * Fill the input buffer --- called whenever buffer is emptied.
65 *
66 * In typical applications, this should read fresh data into the buffer
67 * (ignoring the current state of next_input_byte & bytes_in_buffer),
68 * reset the pointer & count to the start of the buffer, and return TRUE
69 * indicating that the buffer has been reloaded. It is not necessary to
70 * fill the buffer entirely, only to obtain at least one more byte.
71 *
72 * There is no such thing as an EOF return. If the end of the file has been
73 * reached, the routine has a choice of ERREXIT() or inserting fake data into
74 * the buffer. In most cases, generating a warning message and inserting a
75 * fake EOI marker is the best course of action --- this will allow the
76 * decompressor to output however much of the image is there. However,
77 * the resulting error message is misleading if the real problem is an empty
78 * input file, so we handle that case specially.
79 *
80 * In applications that need to be able to suspend compression due to input
81 * not being available yet, a FALSE return indicates that no more data can be
82 * obtained right now, but more may be forthcoming later. In this situation,
83 * the decompressor will return to its caller (with an indication of the
84 * number of scanlines it has read, if any). The application should resume
85 * decompression after it has loaded more data into the input buffer. Note
86 * that there are substantial restrictions on the use of suspension --- see
87 * the documentation.
88 *
89 * When suspending, the decompressor will back up to a convenient restart point
90 * (typically the start of the current MCU). next_input_byte & bytes_in_buffer
91 * indicate where the restart point will be if the current call returns FALSE.
92 * Data beyond this point must be rescanned after resumption, so move it to
93 * the front of the buffer rather than discarding it.
94 */
95
96METHODDEF(boolean)
97fill_input_buffer (j_decompress_ptr cinfo)
98{
99 my_src_ptr src = (my_src_ptr) cinfo->src;
100 size_t nbytes;
101
102 nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
103
104 if (nbytes <= 0) {
105 if (src->start_of_file) /* Treat empty input file as fatal error */
106 ERREXIT(cinfo, JERR_INPUT_EMPTY);
107 WARNMS(cinfo, JWRN_JPEG_EOF);
108 /* Insert a fake EOI marker */
109 src->buffer[0] = (JOCTET) 0xFF;
110 src->buffer[1] = (JOCTET) JPEG_EOI;
111 nbytes = 2;
112 }
113
114 src->pub.next_input_byte = src->buffer;
115 src->pub.bytes_in_buffer = nbytes;
116 src->start_of_file = FALSE;
117
118 return TRUE;
119}
120
121METHODDEF(boolean)
122fill_mem_input_buffer (j_decompress_ptr cinfo)
123{
124 static const JOCTET mybuffer[4] = {
125 (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0
126 };
127
128 /* The whole JPEG data is expected to reside in the supplied memory
129 * buffer, so any request for more data beyond the given buffer size
130 * is treated as an error.
131 */
132 WARNMS(cinfo, JWRN_JPEG_EOF);
133
134 /* Insert a fake EOI marker */
135
136 cinfo->src->next_input_byte = mybuffer;
137 cinfo->src->bytes_in_buffer = 2;
138
139 return TRUE;
140}
141
142
143/*
144 * Skip data --- used to skip over a potentially large amount of
145 * uninteresting data (such as an APPn marker).
146 *
147 * Writers of suspendable-input applications must note that skip_input_data
148 * is not granted the right to give a suspension return. If the skip extends
149 * beyond the data currently in the buffer, the buffer can be marked empty so
150 * that the next read will cause a fill_input_buffer call that can suspend.
151 * Arranging for additional bytes to be discarded before reloading the input
152 * buffer is the application writer's problem.
153 */
154
155METHODDEF(void)
156skip_input_data (j_decompress_ptr cinfo, long num_bytes)
157{
158 struct jpeg_source_mgr * src = cinfo->src;
159
160 /* Just a dumb implementation for now. Could use fseek() except
161 * it doesn't work on pipes. Not clear that being smart is worth
162 * any trouble anyway --- large skips are infrequent.
163 */
164 if (num_bytes > 0) {
165 while (num_bytes > (long) src->bytes_in_buffer) {
166 num_bytes -= (long) src->bytes_in_buffer;
167 (void) (*src->fill_input_buffer) (cinfo);
168 /* note we assume that fill_input_buffer will never return FALSE,
169 * so suspension need not be handled.
170 */
171 }
172 src->next_input_byte += (size_t) num_bytes;
173 src->bytes_in_buffer -= (size_t) num_bytes;
174 }
175}
176
177
178/*
179 * An additional method that can be provided by data source modules is the
180 * resync_to_restart method for error recovery in the presence of RST markers.
181 * For the moment, this source module just uses the default resync method
182 * provided by the JPEG library. That method assumes that no backtracking
183 * is possible.
184 */
185
186
187/*
188 * Terminate source --- called by jpeg_finish_decompress
189 * after all data has been read. Often a no-op.
190 *
191 * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
192 * application must deal with any cleanup that should happen even
193 * for error exit.
194 */
195
196METHODDEF(void)
197term_source (j_decompress_ptr cinfo)
198{
199 /* no work necessary here */
200}
201
202
203/*
204 * Prepare for input from a stdio stream.
205 * The caller must have already opened the stream, and is responsible
206 * for closing it after finishing decompression.
207 */
208
209GLOBAL(void)
210jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
211{
212 my_src_ptr src;
213
214 /* The source object and input buffer are made permanent so that a series
215 * of JPEG images can be read from the same file by calling jpeg_stdio_src
216 * only before the first one. (If we discarded the buffer at the end of
217 * one image, we'd likely lose the start of the next one.)
218 * This makes it unsafe to use this manager and a different source
219 * manager serially with the same JPEG object. Caveat programmer.
220 */
221 if (cinfo->src == NULL) { /* first time for this JPEG object? */
222 cinfo->src = (struct jpeg_source_mgr *)
223 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
224 SIZEOF(my_source_mgr));
225 src = (my_src_ptr) cinfo->src;
226 src->buffer = (JOCTET *)
227 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
228 INPUT_BUF_SIZE * SIZEOF(JOCTET));
229 }
230
231 src = (my_src_ptr) cinfo->src;
232 src->pub.init_source = init_source;
233 src->pub.fill_input_buffer = fill_input_buffer;
234 src->pub.skip_input_data = skip_input_data;
235 src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
236 src->pub.term_source = term_source;
237 src->infile = infile;
238 src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
239 src->pub.next_input_byte = NULL; /* until buffer loaded */
240}
241
242
243/*
244 * Prepare for input from a supplied memory buffer.
245 * The buffer must contain the whole JPEG data.
246 */
247
248GLOBAL(void)
249jpeg_mem_src (j_decompress_ptr cinfo,
250 unsigned char * inbuffer, unsigned long insize)
251{
252 struct jpeg_source_mgr * src;
253
254 if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */
255 ERREXIT(cinfo, JERR_INPUT_EMPTY);
256
257 /* The source object is made permanent so that a series of JPEG images
258 * can be read from the same buffer by calling jpeg_mem_src only before
259 * the first one.
260 */
261 if (cinfo->src == NULL) { /* first time for this JPEG object? */
262 cinfo->src = (struct jpeg_source_mgr *)
263 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
264 SIZEOF(struct jpeg_source_mgr));
265 }
266
267 src = cinfo->src;
268 src->init_source = init_mem_source;
269 src->fill_input_buffer = fill_mem_input_buffer;
270 src->skip_input_data = skip_input_data;
271 src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
272 src->term_source = term_source;
273 src->bytes_in_buffer = (size_t) insize;
274 src->next_input_byte = (JOCTET *) inbuffer;
275}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcoefct.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcoefct.c
new file mode 100644
index 0000000..75ee51f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcoefct.c
@@ -0,0 +1,741 @@
1/*
2 * jdcoefct.c
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * Modified 2002-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains the coefficient buffer controller for decompression.
10 * This controller is the top level of the JPEG decompressor proper.
11 * The coefficient buffer lies between entropy decoding and inverse-DCT steps.
12 *
13 * In buffered-image mode, this controller is the interface between
14 * input-oriented processing and output-oriented processing.
15 * Also, the input side (only) is used when reading a file for transcoding.
16 */
17
18#define JPEG_INTERNALS
19#include "jinclude.h"
20#include "jpeglib.h"
21
22/* Block smoothing is only applicable for progressive JPEG, so: */
23#ifndef D_PROGRESSIVE_SUPPORTED
24#undef BLOCK_SMOOTHING_SUPPORTED
25#endif
26
27/* Private buffer controller object */
28
29typedef struct {
30 struct jpeg_d_coef_controller pub; /* public fields */
31
32 /* These variables keep track of the current location of the input side. */
33 /* cinfo->input_iMCU_row is also used for this. */
34 JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
35 int MCU_vert_offset; /* counts MCU rows within iMCU row */
36 int MCU_rows_per_iMCU_row; /* number of such rows needed */
37
38 /* The output side's location is represented by cinfo->output_iMCU_row. */
39
40 /* In single-pass modes, it's sufficient to buffer just one MCU.
41 * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
42 * and let the entropy decoder write into that workspace each time.
43 * (On 80x86, the workspace is FAR even though it's not really very big;
44 * this is to keep the module interfaces unchanged when a large coefficient
45 * buffer is necessary.)
46 * In multi-pass modes, this array points to the current MCU's blocks
47 * within the virtual arrays; it is used only by the input side.
48 */
49 JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
50
51#ifdef D_MULTISCAN_FILES_SUPPORTED
52 /* In multi-pass modes, we need a virtual block array for each component. */
53 jvirt_barray_ptr whole_image[MAX_COMPONENTS];
54#endif
55
56#ifdef BLOCK_SMOOTHING_SUPPORTED
57 /* When doing block smoothing, we latch coefficient Al values here */
58 int * coef_bits_latch;
59#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
60#endif
61} my_coef_controller;
62
63typedef my_coef_controller * my_coef_ptr;
64
65/* Forward declarations */
66METHODDEF(int) decompress_onepass
67 JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
68#ifdef D_MULTISCAN_FILES_SUPPORTED
69METHODDEF(int) decompress_data
70 JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
71#endif
72#ifdef BLOCK_SMOOTHING_SUPPORTED
73LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
74METHODDEF(int) decompress_smooth_data
75 JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
76#endif
77
78
79LOCAL(void)
80start_iMCU_row (j_decompress_ptr cinfo)
81/* Reset within-iMCU-row counters for a new row (input side) */
82{
83 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
84
85 /* In an interleaved scan, an MCU row is the same as an iMCU row.
86 * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
87 * But at the bottom of the image, process only what's left.
88 */
89 if (cinfo->comps_in_scan > 1) {
90 coef->MCU_rows_per_iMCU_row = 1;
91 } else {
92 if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
93 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
94 else
95 coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
96 }
97
98 coef->MCU_ctr = 0;
99 coef->MCU_vert_offset = 0;
100}
101
102
103/*
104 * Initialize for an input processing pass.
105 */
106
107METHODDEF(void)
108start_input_pass (j_decompress_ptr cinfo)
109{
110 cinfo->input_iMCU_row = 0;
111 start_iMCU_row(cinfo);
112}
113
114
115/*
116 * Initialize for an output processing pass.
117 */
118
119METHODDEF(void)
120start_output_pass (j_decompress_ptr cinfo)
121{
122#ifdef BLOCK_SMOOTHING_SUPPORTED
123 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
124
125 /* If multipass, check to see whether to use block smoothing on this pass */
126 if (coef->pub.coef_arrays != NULL) {
127 if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
128 coef->pub.decompress_data = decompress_smooth_data;
129 else
130 coef->pub.decompress_data = decompress_data;
131 }
132#endif
133 cinfo->output_iMCU_row = 0;
134}
135
136
137/*
138 * Decompress and return some data in the single-pass case.
139 * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
140 * Input and output must run in lockstep since we have only a one-MCU buffer.
141 * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
142 *
143 * NB: output_buf contains a plane for each component in image,
144 * which we index according to the component's SOF position.
145 */
146
147METHODDEF(int)
148decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
149{
150 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
151 JDIMENSION MCU_col_num; /* index of current MCU within row */
152 JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
153 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
154 int blkn, ci, xindex, yindex, yoffset, useful_width;
155 JSAMPARRAY output_ptr;
156 JDIMENSION start_col, output_col;
157 jpeg_component_info *compptr;
158 inverse_DCT_method_ptr inverse_DCT;
159
160 /* Loop to process as much as one whole iMCU row */
161 for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
162 yoffset++) {
163 for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
164 MCU_col_num++) {
165 /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
166 if (cinfo->lim_Se) /* can bypass in DC only case */
167 FMEMZERO((void FAR *) coef->MCU_buffer[0],
168 (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
169 if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
170 /* Suspension forced; update state counters and exit */
171 coef->MCU_vert_offset = yoffset;
172 coef->MCU_ctr = MCU_col_num;
173 return JPEG_SUSPENDED;
174 }
175 /* Determine where data should go in output_buf and do the IDCT thing.
176 * We skip dummy blocks at the right and bottom edges (but blkn gets
177 * incremented past them!). Note the inner loop relies on having
178 * allocated the MCU_buffer[] blocks sequentially.
179 */
180 blkn = 0; /* index of current DCT block within MCU */
181 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
182 compptr = cinfo->cur_comp_info[ci];
183 /* Don't bother to IDCT an uninteresting component. */
184 if (! compptr->component_needed) {
185 blkn += compptr->MCU_blocks;
186 continue;
187 }
188 inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
189 useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
190 : compptr->last_col_width;
191 output_ptr = output_buf[compptr->component_index] +
192 yoffset * compptr->DCT_v_scaled_size;
193 start_col = MCU_col_num * compptr->MCU_sample_width;
194 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
195 if (cinfo->input_iMCU_row < last_iMCU_row ||
196 yoffset+yindex < compptr->last_row_height) {
197 output_col = start_col;
198 for (xindex = 0; xindex < useful_width; xindex++) {
199 (*inverse_DCT) (cinfo, compptr,
200 (JCOEFPTR) coef->MCU_buffer[blkn+xindex],
201 output_ptr, output_col);
202 output_col += compptr->DCT_h_scaled_size;
203 }
204 }
205 blkn += compptr->MCU_width;
206 output_ptr += compptr->DCT_v_scaled_size;
207 }
208 }
209 }
210 /* Completed an MCU row, but perhaps not an iMCU row */
211 coef->MCU_ctr = 0;
212 }
213 /* Completed the iMCU row, advance counters for next one */
214 cinfo->output_iMCU_row++;
215 if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
216 start_iMCU_row(cinfo);
217 return JPEG_ROW_COMPLETED;
218 }
219 /* Completed the scan */
220 (*cinfo->inputctl->finish_input_pass) (cinfo);
221 return JPEG_SCAN_COMPLETED;
222}
223
224
225/*
226 * Dummy consume-input routine for single-pass operation.
227 */
228
229METHODDEF(int)
230dummy_consume_data (j_decompress_ptr cinfo)
231{
232 return JPEG_SUSPENDED; /* Always indicate nothing was done */
233}
234
235
236#ifdef D_MULTISCAN_FILES_SUPPORTED
237
238/*
239 * Consume input data and store it in the full-image coefficient buffer.
240 * We read as much as one fully interleaved MCU row ("iMCU" row) per call,
241 * ie, v_samp_factor block rows for each component in the scan.
242 * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
243 */
244
245METHODDEF(int)
246consume_data (j_decompress_ptr cinfo)
247{
248 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
249 JDIMENSION MCU_col_num; /* index of current MCU within row */
250 int blkn, ci, xindex, yindex, yoffset;
251 JDIMENSION start_col;
252 JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
253 JBLOCKROW buffer_ptr;
254 jpeg_component_info *compptr;
255
256 /* Align the virtual buffers for the components used in this scan. */
257 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
258 compptr = cinfo->cur_comp_info[ci];
259 buffer[ci] = (*cinfo->mem->access_virt_barray)
260 ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
261 cinfo->input_iMCU_row * compptr->v_samp_factor,
262 (JDIMENSION) compptr->v_samp_factor, TRUE);
263 /* Note: entropy decoder expects buffer to be zeroed,
264 * but this is handled automatically by the memory manager
265 * because we requested a pre-zeroed array.
266 */
267 }
268
269 /* Loop to process one whole iMCU row */
270 for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
271 yoffset++) {
272 for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
273 MCU_col_num++) {
274 /* Construct list of pointers to DCT blocks belonging to this MCU */
275 blkn = 0; /* index of current DCT block within MCU */
276 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
277 compptr = cinfo->cur_comp_info[ci];
278 start_col = MCU_col_num * compptr->MCU_width;
279 for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
280 buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
281 for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
282 coef->MCU_buffer[blkn++] = buffer_ptr++;
283 }
284 }
285 }
286 /* Try to fetch the MCU. */
287 if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
288 /* Suspension forced; update state counters and exit */
289 coef->MCU_vert_offset = yoffset;
290 coef->MCU_ctr = MCU_col_num;
291 return JPEG_SUSPENDED;
292 }
293 }
294 /* Completed an MCU row, but perhaps not an iMCU row */
295 coef->MCU_ctr = 0;
296 }
297 /* Completed the iMCU row, advance counters for next one */
298 if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
299 start_iMCU_row(cinfo);
300 return JPEG_ROW_COMPLETED;
301 }
302 /* Completed the scan */
303 (*cinfo->inputctl->finish_input_pass) (cinfo);
304 return JPEG_SCAN_COMPLETED;
305}
306
307
308/*
309 * Decompress and return some data in the multi-pass case.
310 * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
311 * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
312 *
313 * NB: output_buf contains a plane for each component in image.
314 */
315
316METHODDEF(int)
317decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
318{
319 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
320 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
321 JDIMENSION block_num;
322 int ci, block_row, block_rows;
323 JBLOCKARRAY buffer;
324 JBLOCKROW buffer_ptr;
325 JSAMPARRAY output_ptr;
326 JDIMENSION output_col;
327 jpeg_component_info *compptr;
328 inverse_DCT_method_ptr inverse_DCT;
329
330 /* Force some input to be done if we are getting ahead of the input. */
331 while (cinfo->input_scan_number < cinfo->output_scan_number ||
332 (cinfo->input_scan_number == cinfo->output_scan_number &&
333 cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
334 if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
335 return JPEG_SUSPENDED;
336 }
337
338 /* OK, output from the virtual arrays. */
339 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
340 ci++, compptr++) {
341 /* Don't bother to IDCT an uninteresting component. */
342 if (! compptr->component_needed)
343 continue;
344 /* Align the virtual buffer for this component. */
345 buffer = (*cinfo->mem->access_virt_barray)
346 ((j_common_ptr) cinfo, coef->whole_image[ci],
347 cinfo->output_iMCU_row * compptr->v_samp_factor,
348 (JDIMENSION) compptr->v_samp_factor, FALSE);
349 /* Count non-dummy DCT block rows in this iMCU row. */
350 if (cinfo->output_iMCU_row < last_iMCU_row)
351 block_rows = compptr->v_samp_factor;
352 else {
353 /* NB: can't use last_row_height here; it is input-side-dependent! */
354 block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
355 if (block_rows == 0) block_rows = compptr->v_samp_factor;
356 }
357 inverse_DCT = cinfo->idct->inverse_DCT[ci];
358 output_ptr = output_buf[ci];
359 /* Loop over all DCT blocks to be processed. */
360 for (block_row = 0; block_row < block_rows; block_row++) {
361 buffer_ptr = buffer[block_row];
362 output_col = 0;
363 for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {
364 (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
365 output_ptr, output_col);
366 buffer_ptr++;
367 output_col += compptr->DCT_h_scaled_size;
368 }
369 output_ptr += compptr->DCT_v_scaled_size;
370 }
371 }
372
373 if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
374 return JPEG_ROW_COMPLETED;
375 return JPEG_SCAN_COMPLETED;
376}
377
378#endif /* D_MULTISCAN_FILES_SUPPORTED */
379
380
381#ifdef BLOCK_SMOOTHING_SUPPORTED
382
383/*
384 * This code applies interblock smoothing as described by section K.8
385 * of the JPEG standard: the first 5 AC coefficients are estimated from
386 * the DC values of a DCT block and its 8 neighboring blocks.
387 * We apply smoothing only for progressive JPEG decoding, and only if
388 * the coefficients it can estimate are not yet known to full precision.
389 */
390
391/* Natural-order array positions of the first 5 zigzag-order coefficients */
392#define Q01_POS 1
393#define Q10_POS 8
394#define Q20_POS 16
395#define Q11_POS 9
396#define Q02_POS 2
397
398/*
399 * Determine whether block smoothing is applicable and safe.
400 * We also latch the current states of the coef_bits[] entries for the
401 * AC coefficients; otherwise, if the input side of the decompressor
402 * advances into a new scan, we might think the coefficients are known
403 * more accurately than they really are.
404 */
405
406LOCAL(boolean)
407smoothing_ok (j_decompress_ptr cinfo)
408{
409 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
410 boolean smoothing_useful = FALSE;
411 int ci, coefi;
412 jpeg_component_info *compptr;
413 JQUANT_TBL * qtable;
414 int * coef_bits;
415 int * coef_bits_latch;
416
417 if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)
418 return FALSE;
419
420 /* Allocate latch area if not already done */
421 if (coef->coef_bits_latch == NULL)
422 coef->coef_bits_latch = (int *)
423 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
424 cinfo->num_components *
425 (SAVED_COEFS * SIZEOF(int)));
426 coef_bits_latch = coef->coef_bits_latch;
427
428 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
429 ci++, compptr++) {
430 /* All components' quantization values must already be latched. */
431 if ((qtable = compptr->quant_table) == NULL)
432 return FALSE;
433 /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
434 if (qtable->quantval[0] == 0 ||
435 qtable->quantval[Q01_POS] == 0 ||
436 qtable->quantval[Q10_POS] == 0 ||
437 qtable->quantval[Q20_POS] == 0 ||
438 qtable->quantval[Q11_POS] == 0 ||
439 qtable->quantval[Q02_POS] == 0)
440 return FALSE;
441 /* DC values must be at least partly known for all components. */
442 coef_bits = cinfo->coef_bits[ci];
443 if (coef_bits[0] < 0)
444 return FALSE;
445 /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
446 for (coefi = 1; coefi <= 5; coefi++) {
447 coef_bits_latch[coefi] = coef_bits[coefi];
448 if (coef_bits[coefi] != 0)
449 smoothing_useful = TRUE;
450 }
451 coef_bits_latch += SAVED_COEFS;
452 }
453
454 return smoothing_useful;
455}
456
457
458/*
459 * Variant of decompress_data for use when doing block smoothing.
460 */
461
462METHODDEF(int)
463decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
464{
465 my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
466 JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
467 JDIMENSION block_num, last_block_column;
468 int ci, block_row, block_rows, access_rows;
469 JBLOCKARRAY buffer;
470 JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
471 JSAMPARRAY output_ptr;
472 JDIMENSION output_col;
473 jpeg_component_info *compptr;
474 inverse_DCT_method_ptr inverse_DCT;
475 boolean first_row, last_row;
476 JBLOCK workspace;
477 int *coef_bits;
478 JQUANT_TBL *quanttbl;
479 INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
480 int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
481 int Al, pred;
482
483 /* Force some input to be done if we are getting ahead of the input. */
484 while (cinfo->input_scan_number <= cinfo->output_scan_number &&
485 ! cinfo->inputctl->eoi_reached) {
486 if (cinfo->input_scan_number == cinfo->output_scan_number) {
487 /* If input is working on current scan, we ordinarily want it to
488 * have completed the current row. But if input scan is DC,
489 * we want it to keep one row ahead so that next block row's DC
490 * values are up to date.
491 */
492 JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
493 if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)
494 break;
495 }
496 if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
497 return JPEG_SUSPENDED;
498 }
499
500 /* OK, output from the virtual arrays. */
501 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
502 ci++, compptr++) {
503 /* Don't bother to IDCT an uninteresting component. */
504 if (! compptr->component_needed)
505 continue;
506 /* Count non-dummy DCT block rows in this iMCU row. */
507 if (cinfo->output_iMCU_row < last_iMCU_row) {
508 block_rows = compptr->v_samp_factor;
509 access_rows = block_rows * 2; /* this and next iMCU row */
510 last_row = FALSE;
511 } else {
512 /* NB: can't use last_row_height here; it is input-side-dependent! */
513 block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
514 if (block_rows == 0) block_rows = compptr->v_samp_factor;
515 access_rows = block_rows; /* this iMCU row only */
516 last_row = TRUE;
517 }
518 /* Align the virtual buffer for this component. */
519 if (cinfo->output_iMCU_row > 0) {
520 access_rows += compptr->v_samp_factor; /* prior iMCU row too */
521 buffer = (*cinfo->mem->access_virt_barray)
522 ((j_common_ptr) cinfo, coef->whole_image[ci],
523 (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
524 (JDIMENSION) access_rows, FALSE);
525 buffer += compptr->v_samp_factor; /* point to current iMCU row */
526 first_row = FALSE;
527 } else {
528 buffer = (*cinfo->mem->access_virt_barray)
529 ((j_common_ptr) cinfo, coef->whole_image[ci],
530 (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
531 first_row = TRUE;
532 }
533 /* Fetch component-dependent info */
534 coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
535 quanttbl = compptr->quant_table;
536 Q00 = quanttbl->quantval[0];
537 Q01 = quanttbl->quantval[Q01_POS];
538 Q10 = quanttbl->quantval[Q10_POS];
539 Q20 = quanttbl->quantval[Q20_POS];
540 Q11 = quanttbl->quantval[Q11_POS];
541 Q02 = quanttbl->quantval[Q02_POS];
542 inverse_DCT = cinfo->idct->inverse_DCT[ci];
543 output_ptr = output_buf[ci];
544 /* Loop over all DCT blocks to be processed. */
545 for (block_row = 0; block_row < block_rows; block_row++) {
546 buffer_ptr = buffer[block_row];
547 if (first_row && block_row == 0)
548 prev_block_row = buffer_ptr;
549 else
550 prev_block_row = buffer[block_row-1];
551 if (last_row && block_row == block_rows-1)
552 next_block_row = buffer_ptr;
553 else
554 next_block_row = buffer[block_row+1];
555 /* We fetch the surrounding DC values using a sliding-register approach.
556 * Initialize all nine here so as to do the right thing on narrow pics.
557 */
558 DC1 = DC2 = DC3 = (int) prev_block_row[0][0];
559 DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];
560 DC7 = DC8 = DC9 = (int) next_block_row[0][0];
561 output_col = 0;
562 last_block_column = compptr->width_in_blocks - 1;
563 for (block_num = 0; block_num <= last_block_column; block_num++) {
564 /* Fetch current DCT block into workspace so we can modify it. */
565 jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
566 /* Update DC values */
567 if (block_num < last_block_column) {
568 DC3 = (int) prev_block_row[1][0];
569 DC6 = (int) buffer_ptr[1][0];
570 DC9 = (int) next_block_row[1][0];
571 }
572 /* Compute coefficient estimates per K.8.
573 * An estimate is applied only if coefficient is still zero,
574 * and is not known to be fully accurate.
575 */
576 /* AC01 */
577 if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
578 num = 36 * Q00 * (DC4 - DC6);
579 if (num >= 0) {
580 pred = (int) (((Q01<<7) + num) / (Q01<<8));
581 if (Al > 0 && pred >= (1<<Al))
582 pred = (1<<Al)-1;
583 } else {
584 pred = (int) (((Q01<<7) - num) / (Q01<<8));
585 if (Al > 0 && pred >= (1<<Al))
586 pred = (1<<Al)-1;
587 pred = -pred;
588 }
589 workspace[1] = (JCOEF) pred;
590 }
591 /* AC10 */
592 if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
593 num = 36 * Q00 * (DC2 - DC8);
594 if (num >= 0) {
595 pred = (int) (((Q10<<7) + num) / (Q10<<8));
596 if (Al > 0 && pred >= (1<<Al))
597 pred = (1<<Al)-1;
598 } else {
599 pred = (int) (((Q10<<7) - num) / (Q10<<8));
600 if (Al > 0 && pred >= (1<<Al))
601 pred = (1<<Al)-1;
602 pred = -pred;
603 }
604 workspace[8] = (JCOEF) pred;
605 }
606 /* AC20 */
607 if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
608 num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
609 if (num >= 0) {
610 pred = (int) (((Q20<<7) + num) / (Q20<<8));
611 if (Al > 0 && pred >= (1<<Al))
612 pred = (1<<Al)-1;
613 } else {
614 pred = (int) (((Q20<<7) - num) / (Q20<<8));
615 if (Al > 0 && pred >= (1<<Al))
616 pred = (1<<Al)-1;
617 pred = -pred;
618 }
619 workspace[16] = (JCOEF) pred;
620 }
621 /* AC11 */
622 if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
623 num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
624 if (num >= 0) {
625 pred = (int) (((Q11<<7) + num) / (Q11<<8));
626 if (Al > 0 && pred >= (1<<Al))
627 pred = (1<<Al)-1;
628 } else {
629 pred = (int) (((Q11<<7) - num) / (Q11<<8));
630 if (Al > 0 && pred >= (1<<Al))
631 pred = (1<<Al)-1;
632 pred = -pred;
633 }
634 workspace[9] = (JCOEF) pred;
635 }
636 /* AC02 */
637 if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
638 num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
639 if (num >= 0) {
640 pred = (int) (((Q02<<7) + num) / (Q02<<8));
641 if (Al > 0 && pred >= (1<<Al))
642 pred = (1<<Al)-1;
643 } else {
644 pred = (int) (((Q02<<7) - num) / (Q02<<8));
645 if (Al > 0 && pred >= (1<<Al))
646 pred = (1<<Al)-1;
647 pred = -pred;
648 }
649 workspace[2] = (JCOEF) pred;
650 }
651 /* OK, do the IDCT */
652 (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
653 output_ptr, output_col);
654 /* Advance for next column */
655 DC1 = DC2; DC2 = DC3;
656 DC4 = DC5; DC5 = DC6;
657 DC7 = DC8; DC8 = DC9;
658 buffer_ptr++, prev_block_row++, next_block_row++;
659 output_col += compptr->DCT_h_scaled_size;
660 }
661 output_ptr += compptr->DCT_v_scaled_size;
662 }
663 }
664
665 if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
666 return JPEG_ROW_COMPLETED;
667 return JPEG_SCAN_COMPLETED;
668}
669
670#endif /* BLOCK_SMOOTHING_SUPPORTED */
671
672
673/*
674 * Initialize coefficient buffer controller.
675 */
676
677GLOBAL(void)
678jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
679{
680 my_coef_ptr coef;
681
682 coef = (my_coef_ptr)
683 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
684 SIZEOF(my_coef_controller));
685 cinfo->coef = (struct jpeg_d_coef_controller *) coef;
686 coef->pub.start_input_pass = start_input_pass;
687 coef->pub.start_output_pass = start_output_pass;
688#ifdef BLOCK_SMOOTHING_SUPPORTED
689 coef->coef_bits_latch = NULL;
690#endif
691
692 /* Create the coefficient buffer. */
693 if (need_full_buffer) {
694#ifdef D_MULTISCAN_FILES_SUPPORTED
695 /* Allocate a full-image virtual array for each component, */
696 /* padded to a multiple of samp_factor DCT blocks in each direction. */
697 /* Note we ask for a pre-zeroed array. */
698 int ci, access_rows;
699 jpeg_component_info *compptr;
700
701 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
702 ci++, compptr++) {
703 access_rows = compptr->v_samp_factor;
704#ifdef BLOCK_SMOOTHING_SUPPORTED
705 /* If block smoothing could be used, need a bigger window */
706 if (cinfo->progressive_mode)
707 access_rows *= 3;
708#endif
709 coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
710 ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
711 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
712 (long) compptr->h_samp_factor),
713 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
714 (long) compptr->v_samp_factor),
715 (JDIMENSION) access_rows);
716 }
717 coef->pub.consume_data = consume_data;
718 coef->pub.decompress_data = decompress_data;
719 coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
720#else
721 ERREXIT(cinfo, JERR_NOT_COMPILED);
722#endif
723 } else {
724 /* We only need a single-MCU buffer. */
725 JBLOCKROW buffer;
726 int i;
727
728 buffer = (JBLOCKROW)
729 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
730 D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
731 for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
732 coef->MCU_buffer[i] = buffer + i;
733 }
734 if (cinfo->lim_Se == 0) /* DC only case: want to bypass later */
735 FMEMZERO((void FAR *) buffer,
736 (size_t) (D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)));
737 coef->pub.consume_data = dummy_consume_data;
738 coef->pub.decompress_data = decompress_onepass;
739 coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
740 }
741}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcolor.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcolor.c
new file mode 100644
index 0000000..c12d9c8
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdcolor.c
@@ -0,0 +1,512 @@
1/*
2 * jdcolor.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains output colorspace conversion routines.
10 */
11
12#define JPEG_INTERNALS
13#include "jinclude.h"
14#include "jpeglib.h"
15
16
17/* Private subobject */
18
19typedef struct {
20 struct jpeg_color_deconverter pub; /* public fields */
21
22 /* Private state for YCC->RGB conversion */
23 int * Cr_r_tab; /* => table for Cr to R conversion */
24 int * Cb_b_tab; /* => table for Cb to B conversion */
25 INT32 * Cr_g_tab; /* => table for Cr to G conversion */
26 INT32 * Cb_g_tab; /* => table for Cb to G conversion */
27
28 /* Private state for RGB->Y conversion */
29 INT32 * rgb_y_tab; /* => table for RGB to Y conversion */
30} my_color_deconverter;
31
32typedef my_color_deconverter * my_cconvert_ptr;
33
34
35/**************** YCbCr -> RGB conversion: most common case **************/
36/**************** RGB -> Y conversion: less common case **************/
37
38/*
39 * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
40 * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
41 * The conversion equations to be implemented are therefore
42 *
43 * R = Y + 1.40200 * Cr
44 * G = Y - 0.34414 * Cb - 0.71414 * Cr
45 * B = Y + 1.77200 * Cb
46 *
47 * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
48 *
49 * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
50 * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
51 *
52 * To avoid floating-point arithmetic, we represent the fractional constants
53 * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
54 * the products by 2^16, with appropriate rounding, to get the correct answer.
55 * Notice that Y, being an integral input, does not contribute any fraction
56 * so it need not participate in the rounding.
57 *
58 * For even more speed, we avoid doing any multiplications in the inner loop
59 * by precalculating the constants times Cb and Cr for all possible values.
60 * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
61 * for 12-bit samples it is still acceptable. It's not very reasonable for
62 * 16-bit samples, but if you want lossless storage you shouldn't be changing
63 * colorspace anyway.
64 * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
65 * values for the G calculation are left scaled up, since we must add them
66 * together before rounding.
67 */
68
69#define SCALEBITS 16 /* speediest right-shift on some machines */
70#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
71#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
72
73/* We allocate one big table for RGB->Y conversion and divide it up into
74 * three parts, instead of doing three alloc_small requests. This lets us
75 * use a single table base address, which can be held in a register in the
76 * inner loops on many machines (more than can hold all three addresses,
77 * anyway).
78 */
79
80#define R_Y_OFF 0 /* offset to R => Y section */
81#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
82#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
83#define TABLE_SIZE (3*(MAXJSAMPLE+1))
84
85
86/*
87 * Initialize tables for YCC->RGB colorspace conversion.
88 */
89
90LOCAL(void)
91build_ycc_rgb_table (j_decompress_ptr cinfo)
92{
93 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
94 int i;
95 INT32 x;
96 SHIFT_TEMPS
97
98 cconvert->Cr_r_tab = (int *)
99 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
100 (MAXJSAMPLE+1) * SIZEOF(int));
101 cconvert->Cb_b_tab = (int *)
102 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
103 (MAXJSAMPLE+1) * SIZEOF(int));
104 cconvert->Cr_g_tab = (INT32 *)
105 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
106 (MAXJSAMPLE+1) * SIZEOF(INT32));
107 cconvert->Cb_g_tab = (INT32 *)
108 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
109 (MAXJSAMPLE+1) * SIZEOF(INT32));
110
111 for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
112 /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
113 /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
114 /* Cr=>R value is nearest int to 1.40200 * x */
115 cconvert->Cr_r_tab[i] = (int)
116 RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
117 /* Cb=>B value is nearest int to 1.77200 * x */
118 cconvert->Cb_b_tab[i] = (int)
119 RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
120 /* Cr=>G value is scaled-up -0.71414 * x */
121 cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
122 /* Cb=>G value is scaled-up -0.34414 * x */
123 /* We also add in ONE_HALF so that need not do it in inner loop */
124 cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
125 }
126}
127
128
129/*
130 * Convert some rows of samples to the output colorspace.
131 *
132 * Note that we change from noninterleaved, one-plane-per-component format
133 * to interleaved-pixel format. The output buffer is therefore three times
134 * as wide as the input buffer.
135 * A starting row offset is provided only for the input buffer. The caller
136 * can easily adjust the passed output_buf value to accommodate any row
137 * offset required on that side.
138 */
139
140METHODDEF(void)
141ycc_rgb_convert (j_decompress_ptr cinfo,
142 JSAMPIMAGE input_buf, JDIMENSION input_row,
143 JSAMPARRAY output_buf, int num_rows)
144{
145 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
146 register int y, cb, cr;
147 register JSAMPROW outptr;
148 register JSAMPROW inptr0, inptr1, inptr2;
149 register JDIMENSION col;
150 JDIMENSION num_cols = cinfo->output_width;
151 /* copy these pointers into registers if possible */
152 register JSAMPLE * range_limit = cinfo->sample_range_limit;
153 register int * Crrtab = cconvert->Cr_r_tab;
154 register int * Cbbtab = cconvert->Cb_b_tab;
155 register INT32 * Crgtab = cconvert->Cr_g_tab;
156 register INT32 * Cbgtab = cconvert->Cb_g_tab;
157 SHIFT_TEMPS
158
159 while (--num_rows >= 0) {
160 inptr0 = input_buf[0][input_row];
161 inptr1 = input_buf[1][input_row];
162 inptr2 = input_buf[2][input_row];
163 input_row++;
164 outptr = *output_buf++;
165 for (col = 0; col < num_cols; col++) {
166 y = GETJSAMPLE(inptr0[col]);
167 cb = GETJSAMPLE(inptr1[col]);
168 cr = GETJSAMPLE(inptr2[col]);
169 /* Range-limiting is essential due to noise introduced by DCT losses. */
170 outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
171 outptr[RGB_GREEN] = range_limit[y +
172 ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
173 SCALEBITS))];
174 outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
175 outptr += RGB_PIXELSIZE;
176 }
177 }
178}
179
180
181/**************** Cases other than YCbCr -> RGB **************/
182
183
184/*
185 * Initialize for RGB->grayscale colorspace conversion.
186 */
187
188LOCAL(void)
189build_rgb_y_table (j_decompress_ptr cinfo)
190{
191 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
192 INT32 * rgb_y_tab;
193 INT32 i;
194
195 /* Allocate and fill in the conversion tables. */
196 cconvert->rgb_y_tab = rgb_y_tab = (INT32 *)
197 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
198 (TABLE_SIZE * SIZEOF(INT32)));
199
200 for (i = 0; i <= MAXJSAMPLE; i++) {
201 rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i;
202 rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i;
203 rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
204 }
205}
206
207
208/*
209 * Convert RGB to grayscale.
210 */
211
212METHODDEF(void)
213rgb_gray_convert (j_decompress_ptr cinfo,
214 JSAMPIMAGE input_buf, JDIMENSION input_row,
215 JSAMPARRAY output_buf, int num_rows)
216{
217 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
218 register int r, g, b;
219 register INT32 * ctab = cconvert->rgb_y_tab;
220 register JSAMPROW outptr;
221 register JSAMPROW inptr0, inptr1, inptr2;
222 register JDIMENSION col;
223 JDIMENSION num_cols = cinfo->output_width;
224
225 while (--num_rows >= 0) {
226 inptr0 = input_buf[0][input_row];
227 inptr1 = input_buf[1][input_row];
228 inptr2 = input_buf[2][input_row];
229 input_row++;
230 outptr = *output_buf++;
231 for (col = 0; col < num_cols; col++) {
232 r = GETJSAMPLE(inptr0[col]);
233 g = GETJSAMPLE(inptr1[col]);
234 b = GETJSAMPLE(inptr2[col]);
235 /* Y */
236 outptr[col] = (JSAMPLE)
237 ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
238 >> SCALEBITS);
239 }
240 }
241}
242
243
244/*
245 * No colorspace change, but conversion from separate-planes
246 * to interleaved representation.
247 */
248
249METHODDEF(void)
250rgb_convert (j_decompress_ptr cinfo,
251 JSAMPIMAGE input_buf, JDIMENSION input_row,
252 JSAMPARRAY output_buf, int num_rows)
253{
254 register JSAMPROW outptr;
255 register JSAMPROW inptr0, inptr1, inptr2;
256 register JDIMENSION col;
257 JDIMENSION num_cols = cinfo->output_width;
258
259 while (--num_rows >= 0) {
260 inptr0 = input_buf[0][input_row];
261 inptr1 = input_buf[1][input_row];
262 inptr2 = input_buf[2][input_row];
263 input_row++;
264 outptr = *output_buf++;
265 for (col = 0; col < num_cols; col++) {
266 /* We can dispense with GETJSAMPLE() here */
267 outptr[RGB_RED] = inptr0[col];
268 outptr[RGB_GREEN] = inptr1[col];
269 outptr[RGB_BLUE] = inptr2[col];
270 outptr += RGB_PIXELSIZE;
271 }
272 }
273}
274
275
276/*
277 * Color conversion for no colorspace change: just copy the data,
278 * converting from separate-planes to interleaved representation.
279 */
280
281METHODDEF(void)
282null_convert (j_decompress_ptr cinfo,
283 JSAMPIMAGE input_buf, JDIMENSION input_row,
284 JSAMPARRAY output_buf, int num_rows)
285{
286 register JSAMPROW inptr, outptr;
287 register JDIMENSION count;
288 register int num_components = cinfo->num_components;
289 JDIMENSION num_cols = cinfo->output_width;
290 int ci;
291
292 while (--num_rows >= 0) {
293 for (ci = 0; ci < num_components; ci++) {
294 inptr = input_buf[ci][input_row];
295 outptr = output_buf[0] + ci;
296 for (count = num_cols; count > 0; count--) {
297 *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
298 outptr += num_components;
299 }
300 }
301 input_row++;
302 output_buf++;
303 }
304}
305
306
307/*
308 * Color conversion for grayscale: just copy the data.
309 * This also works for YCbCr -> grayscale conversion, in which
310 * we just copy the Y (luminance) component and ignore chrominance.
311 */
312
313METHODDEF(void)
314grayscale_convert (j_decompress_ptr cinfo,
315 JSAMPIMAGE input_buf, JDIMENSION input_row,
316 JSAMPARRAY output_buf, int num_rows)
317{
318 jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
319 num_rows, cinfo->output_width);
320}
321
322
323/*
324 * Convert grayscale to RGB: just duplicate the graylevel three times.
325 * This is provided to support applications that don't want to cope
326 * with grayscale as a separate case.
327 */
328
329METHODDEF(void)
330gray_rgb_convert (j_decompress_ptr cinfo,
331 JSAMPIMAGE input_buf, JDIMENSION input_row,
332 JSAMPARRAY output_buf, int num_rows)
333{
334 register JSAMPROW inptr, outptr;
335 register JDIMENSION col;
336 JDIMENSION num_cols = cinfo->output_width;
337
338 while (--num_rows >= 0) {
339 inptr = input_buf[0][input_row++];
340 outptr = *output_buf++;
341 for (col = 0; col < num_cols; col++) {
342 /* We can dispense with GETJSAMPLE() here */
343 outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
344 outptr += RGB_PIXELSIZE;
345 }
346 }
347}
348
349
350/*
351 * Adobe-style YCCK->CMYK conversion.
352 * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
353 * conversion as above, while passing K (black) unchanged.
354 * We assume build_ycc_rgb_table has been called.
355 */
356
357METHODDEF(void)
358ycck_cmyk_convert (j_decompress_ptr cinfo,
359 JSAMPIMAGE input_buf, JDIMENSION input_row,
360 JSAMPARRAY output_buf, int num_rows)
361{
362 my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
363 register int y, cb, cr;
364 register JSAMPROW outptr;
365 register JSAMPROW inptr0, inptr1, inptr2, inptr3;
366 register JDIMENSION col;
367 JDIMENSION num_cols = cinfo->output_width;
368 /* copy these pointers into registers if possible */
369 register JSAMPLE * range_limit = cinfo->sample_range_limit;
370 register int * Crrtab = cconvert->Cr_r_tab;
371 register int * Cbbtab = cconvert->Cb_b_tab;
372 register INT32 * Crgtab = cconvert->Cr_g_tab;
373 register INT32 * Cbgtab = cconvert->Cb_g_tab;
374 SHIFT_TEMPS
375
376 while (--num_rows >= 0) {
377 inptr0 = input_buf[0][input_row];
378 inptr1 = input_buf[1][input_row];
379 inptr2 = input_buf[2][input_row];
380 inptr3 = input_buf[3][input_row];
381 input_row++;
382 outptr = *output_buf++;
383 for (col = 0; col < num_cols; col++) {
384 y = GETJSAMPLE(inptr0[col]);
385 cb = GETJSAMPLE(inptr1[col]);
386 cr = GETJSAMPLE(inptr2[col]);
387 /* Range-limiting is essential due to noise introduced by DCT losses. */
388 outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
389 outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
390 ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
391 SCALEBITS)))];
392 outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
393 /* K passes through unchanged */
394 outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
395 outptr += 4;
396 }
397 }
398}
399
400
401/*
402 * Empty method for start_pass.
403 */
404
405METHODDEF(void)
406start_pass_dcolor (j_decompress_ptr cinfo)
407{
408 /* no work needed */
409}
410
411
412/*
413 * Module initialization routine for output colorspace conversion.
414 */
415
416GLOBAL(void)
417jinit_color_deconverter (j_decompress_ptr cinfo)
418{
419 my_cconvert_ptr cconvert;
420 int ci;
421
422 cconvert = (my_cconvert_ptr)
423 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
424 SIZEOF(my_color_deconverter));
425 cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
426 cconvert->pub.start_pass = start_pass_dcolor;
427
428 /* Make sure num_components agrees with jpeg_color_space */
429 switch (cinfo->jpeg_color_space) {
430 case JCS_GRAYSCALE:
431 if (cinfo->num_components != 1)
432 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
433 break;
434
435 case JCS_RGB:
436 case JCS_YCbCr:
437 if (cinfo->num_components != 3)
438 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
439 break;
440
441 case JCS_CMYK:
442 case JCS_YCCK:
443 if (cinfo->num_components != 4)
444 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
445 break;
446
447 default: /* JCS_UNKNOWN can be anything */
448 if (cinfo->num_components < 1)
449 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
450 break;
451 }
452
453 /* Set out_color_components and conversion method based on requested space.
454 * Also clear the component_needed flags for any unused components,
455 * so that earlier pipeline stages can avoid useless computation.
456 */
457
458 switch (cinfo->out_color_space) {
459 case JCS_GRAYSCALE:
460 cinfo->out_color_components = 1;
461 if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
462 cinfo->jpeg_color_space == JCS_YCbCr) {
463 cconvert->pub.color_convert = grayscale_convert;
464 /* For color->grayscale conversion, only the Y (0) component is needed */
465 for (ci = 1; ci < cinfo->num_components; ci++)
466 cinfo->comp_info[ci].component_needed = FALSE;
467 } else if (cinfo->jpeg_color_space == JCS_RGB) {
468 cconvert->pub.color_convert = rgb_gray_convert;
469 build_rgb_y_table(cinfo);
470 } else
471 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
472 break;
473
474 case JCS_RGB:
475 cinfo->out_color_components = RGB_PIXELSIZE;
476 if (cinfo->jpeg_color_space == JCS_YCbCr) {
477 cconvert->pub.color_convert = ycc_rgb_convert;
478 build_ycc_rgb_table(cinfo);
479 } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
480 cconvert->pub.color_convert = gray_rgb_convert;
481 } else if (cinfo->jpeg_color_space == JCS_RGB) {
482 cconvert->pub.color_convert = rgb_convert;
483 } else
484 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
485 break;
486
487 case JCS_CMYK:
488 cinfo->out_color_components = 4;
489 if (cinfo->jpeg_color_space == JCS_YCCK) {
490 cconvert->pub.color_convert = ycck_cmyk_convert;
491 build_ycc_rgb_table(cinfo);
492 } else if (cinfo->jpeg_color_space == JCS_CMYK) {
493 cconvert->pub.color_convert = null_convert;
494 } else
495 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
496 break;
497
498 default:
499 /* Permit null conversion to same output space */
500 if (cinfo->out_color_space == cinfo->jpeg_color_space) {
501 cinfo->out_color_components = cinfo->num_components;
502 cconvert->pub.color_convert = null_convert;
503 } else /* unsupported non-null conversion */
504 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
505 break;
506 }
507
508 if (cinfo->quantize_colors)
509 cinfo->output_components = 1; /* single colormapped output component */
510 else
511 cinfo->output_components = cinfo->out_color_components;
512}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdct.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdct.h
new file mode 100644
index 0000000..b1ff912
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdct.h
@@ -0,0 +1,393 @@
1/*
2 * jdct.h
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This include file contains common declarations for the forward and
9 * inverse DCT modules. These declarations are private to the DCT managers
10 * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
11 * The individual DCT algorithms are kept in separate files to ease
12 * machine-dependent tuning (e.g., assembly coding).
13 */
14
15
16/*
17 * A forward DCT routine is given a pointer to an input sample array and
18 * a pointer to a work area of type DCTELEM[]; the DCT is to be performed
19 * in-place in that buffer. Type DCTELEM is int for 8-bit samples, INT32
20 * for 12-bit samples. (NOTE: Floating-point DCT implementations use an
21 * array of type FAST_FLOAT, instead.)
22 * The input data is to be fetched from the sample array starting at a
23 * specified column. (Any row offset needed will be applied to the array
24 * pointer before it is passed to the FDCT code.)
25 * Note that the number of samples fetched by the FDCT routine is
26 * DCT_h_scaled_size * DCT_v_scaled_size.
27 * The DCT outputs are returned scaled up by a factor of 8; they therefore
28 * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
29 * convention improves accuracy in integer implementations and saves some
30 * work in floating-point ones.
31 * Quantization of the output coefficients is done by jcdctmgr.c.
32 */
33
34#if BITS_IN_JSAMPLE == 8
35typedef int DCTELEM; /* 16 or 32 bits is fine */
36#else
37typedef INT32 DCTELEM; /* must have 32 bits */
38#endif
39
40typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data,
41 JSAMPARRAY sample_data,
42 JDIMENSION start_col));
43typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data,
44 JSAMPARRAY sample_data,
45 JDIMENSION start_col));
46
47
48/*
49 * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
50 * to an output sample array. The routine must dequantize the input data as
51 * well as perform the IDCT; for dequantization, it uses the multiplier table
52 * pointed to by compptr->dct_table. The output data is to be placed into the
53 * sample array starting at a specified column. (Any row offset needed will
54 * be applied to the array pointer before it is passed to the IDCT code.)
55 * Note that the number of samples emitted by the IDCT routine is
56 * DCT_h_scaled_size * DCT_v_scaled_size.
57 */
58
59/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
60
61/*
62 * Each IDCT routine has its own ideas about the best dct_table element type.
63 */
64
65typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
66#if BITS_IN_JSAMPLE == 8
67typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
68#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
69#else
70typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
71#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
72#endif
73typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
74
75
76/*
77 * Each IDCT routine is responsible for range-limiting its results and
78 * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
79 * be quite far out of range if the input data is corrupt, so a bulletproof
80 * range-limiting step is required. We use a mask-and-table-lookup method
81 * to do the combined operations quickly. See the comments with
82 * prepare_range_limit_table (in jdmaster.c) for more info.
83 */
84
85#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
86
87#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
88
89
90/* Short forms of external names for systems with brain-damaged linkers. */
91
92#ifdef NEED_SHORT_EXTERNAL_NAMES
93#define jpeg_fdct_islow jFDislow
94#define jpeg_fdct_ifast jFDifast
95#define jpeg_fdct_float jFDfloat
96#define jpeg_fdct_7x7 jFD7x7
97#define jpeg_fdct_6x6 jFD6x6
98#define jpeg_fdct_5x5 jFD5x5
99#define jpeg_fdct_4x4 jFD4x4
100#define jpeg_fdct_3x3 jFD3x3
101#define jpeg_fdct_2x2 jFD2x2
102#define jpeg_fdct_1x1 jFD1x1
103#define jpeg_fdct_9x9 jFD9x9
104#define jpeg_fdct_10x10 jFD10x10
105#define jpeg_fdct_11x11 jFD11x11
106#define jpeg_fdct_12x12 jFD12x12
107#define jpeg_fdct_13x13 jFD13x13
108#define jpeg_fdct_14x14 jFD14x14
109#define jpeg_fdct_15x15 jFD15x15
110#define jpeg_fdct_16x16 jFD16x16
111#define jpeg_fdct_16x8 jFD16x8
112#define jpeg_fdct_14x7 jFD14x7
113#define jpeg_fdct_12x6 jFD12x6
114#define jpeg_fdct_10x5 jFD10x5
115#define jpeg_fdct_8x4 jFD8x4
116#define jpeg_fdct_6x3 jFD6x3
117#define jpeg_fdct_4x2 jFD4x2
118#define jpeg_fdct_2x1 jFD2x1
119#define jpeg_fdct_8x16 jFD8x16
120#define jpeg_fdct_7x14 jFD7x14
121#define jpeg_fdct_6x12 jFD6x12
122#define jpeg_fdct_5x10 jFD5x10
123#define jpeg_fdct_4x8 jFD4x8
124#define jpeg_fdct_3x6 jFD3x6
125#define jpeg_fdct_2x4 jFD2x4
126#define jpeg_fdct_1x2 jFD1x2
127#define jpeg_idct_islow jRDislow
128#define jpeg_idct_ifast jRDifast
129#define jpeg_idct_float jRDfloat
130#define jpeg_idct_7x7 jRD7x7
131#define jpeg_idct_6x6 jRD6x6
132#define jpeg_idct_5x5 jRD5x5
133#define jpeg_idct_4x4 jRD4x4
134#define jpeg_idct_3x3 jRD3x3
135#define jpeg_idct_2x2 jRD2x2
136#define jpeg_idct_1x1 jRD1x1
137#define jpeg_idct_9x9 jRD9x9
138#define jpeg_idct_10x10 jRD10x10
139#define jpeg_idct_11x11 jRD11x11
140#define jpeg_idct_12x12 jRD12x12
141#define jpeg_idct_13x13 jRD13x13
142#define jpeg_idct_14x14 jRD14x14
143#define jpeg_idct_15x15 jRD15x15
144#define jpeg_idct_16x16 jRD16x16
145#define jpeg_idct_16x8 jRD16x8
146#define jpeg_idct_14x7 jRD14x7
147#define jpeg_idct_12x6 jRD12x6
148#define jpeg_idct_10x5 jRD10x5
149#define jpeg_idct_8x4 jRD8x4
150#define jpeg_idct_6x3 jRD6x3
151#define jpeg_idct_4x2 jRD4x2
152#define jpeg_idct_2x1 jRD2x1
153#define jpeg_idct_8x16 jRD8x16
154#define jpeg_idct_7x14 jRD7x14
155#define jpeg_idct_6x12 jRD6x12
156#define jpeg_idct_5x10 jRD5x10
157#define jpeg_idct_4x8 jRD4x8
158#define jpeg_idct_3x6 jRD3x8
159#define jpeg_idct_2x4 jRD2x4
160#define jpeg_idct_1x2 jRD1x2
161#endif /* NEED_SHORT_EXTERNAL_NAMES */
162
163/* Extern declarations for the forward and inverse DCT routines. */
164
165EXTERN(void) jpeg_fdct_islow
166 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
167EXTERN(void) jpeg_fdct_ifast
168 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
169EXTERN(void) jpeg_fdct_float
170 JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col));
171EXTERN(void) jpeg_fdct_7x7
172 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
173EXTERN(void) jpeg_fdct_6x6
174 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
175EXTERN(void) jpeg_fdct_5x5
176 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
177EXTERN(void) jpeg_fdct_4x4
178 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
179EXTERN(void) jpeg_fdct_3x3
180 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
181EXTERN(void) jpeg_fdct_2x2
182 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
183EXTERN(void) jpeg_fdct_1x1
184 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
185EXTERN(void) jpeg_fdct_9x9
186 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
187EXTERN(void) jpeg_fdct_10x10
188 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
189EXTERN(void) jpeg_fdct_11x11
190 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
191EXTERN(void) jpeg_fdct_12x12
192 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
193EXTERN(void) jpeg_fdct_13x13
194 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
195EXTERN(void) jpeg_fdct_14x14
196 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
197EXTERN(void) jpeg_fdct_15x15
198 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
199EXTERN(void) jpeg_fdct_16x16
200 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
201EXTERN(void) jpeg_fdct_16x8
202 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
203EXTERN(void) jpeg_fdct_14x7
204 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
205EXTERN(void) jpeg_fdct_12x6
206 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
207EXTERN(void) jpeg_fdct_10x5
208 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
209EXTERN(void) jpeg_fdct_8x4
210 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
211EXTERN(void) jpeg_fdct_6x3
212 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
213EXTERN(void) jpeg_fdct_4x2
214 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
215EXTERN(void) jpeg_fdct_2x1
216 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
217EXTERN(void) jpeg_fdct_8x16
218 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
219EXTERN(void) jpeg_fdct_7x14
220 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
221EXTERN(void) jpeg_fdct_6x12
222 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
223EXTERN(void) jpeg_fdct_5x10
224 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
225EXTERN(void) jpeg_fdct_4x8
226 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
227EXTERN(void) jpeg_fdct_3x6
228 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
229EXTERN(void) jpeg_fdct_2x4
230 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
231EXTERN(void) jpeg_fdct_1x2
232 JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
233
234EXTERN(void) jpeg_idct_islow
235 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
236 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
237EXTERN(void) jpeg_idct_ifast
238 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
239 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
240EXTERN(void) jpeg_idct_float
241 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
242 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
243EXTERN(void) jpeg_idct_7x7
244 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
245 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
246EXTERN(void) jpeg_idct_6x6
247 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
248 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
249EXTERN(void) jpeg_idct_5x5
250 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
251 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
252EXTERN(void) jpeg_idct_4x4
253 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
254 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
255EXTERN(void) jpeg_idct_3x3
256 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
257 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
258EXTERN(void) jpeg_idct_2x2
259 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
260 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
261EXTERN(void) jpeg_idct_1x1
262 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
263 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
264EXTERN(void) jpeg_idct_9x9
265 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
266 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
267EXTERN(void) jpeg_idct_10x10
268 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
269 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
270EXTERN(void) jpeg_idct_11x11
271 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
272 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
273EXTERN(void) jpeg_idct_12x12
274 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
275 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
276EXTERN(void) jpeg_idct_13x13
277 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
278 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
279EXTERN(void) jpeg_idct_14x14
280 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
281 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
282EXTERN(void) jpeg_idct_15x15
283 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
284 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
285EXTERN(void) jpeg_idct_16x16
286 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
287 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
288EXTERN(void) jpeg_idct_16x8
289 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
290 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
291EXTERN(void) jpeg_idct_14x7
292 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
293 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
294EXTERN(void) jpeg_idct_12x6
295 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
296 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
297EXTERN(void) jpeg_idct_10x5
298 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
299 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
300EXTERN(void) jpeg_idct_8x4
301 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
302 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
303EXTERN(void) jpeg_idct_6x3
304 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
305 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
306EXTERN(void) jpeg_idct_4x2
307 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
308 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
309EXTERN(void) jpeg_idct_2x1
310 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
311 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
312EXTERN(void) jpeg_idct_8x16
313 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
314 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
315EXTERN(void) jpeg_idct_7x14
316 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
317 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
318EXTERN(void) jpeg_idct_6x12
319 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
320 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
321EXTERN(void) jpeg_idct_5x10
322 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
323 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
324EXTERN(void) jpeg_idct_4x8
325 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
326 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
327EXTERN(void) jpeg_idct_3x6
328 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
329 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
330EXTERN(void) jpeg_idct_2x4
331 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
332 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
333EXTERN(void) jpeg_idct_1x2
334 JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
335 JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
336
337
338/*
339 * Macros for handling fixed-point arithmetic; these are used by many
340 * but not all of the DCT/IDCT modules.
341 *
342 * All values are expected to be of type INT32.
343 * Fractional constants are scaled left by CONST_BITS bits.
344 * CONST_BITS is defined within each module using these macros,
345 * and may differ from one module to the next.
346 */
347
348#define ONE ((INT32) 1)
349#define CONST_SCALE (ONE << CONST_BITS)
350
351/* Convert a positive real constant to an integer scaled by CONST_SCALE.
352 * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
353 * thus causing a lot of useless floating-point operations at run time.
354 */
355
356#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
357
358/* Descale and correctly round an INT32 value that's scaled by N bits.
359 * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
360 * the fudge factor is correct for either sign of X.
361 */
362
363#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
364
365/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
366 * This macro is used only when the two inputs will actually be no more than
367 * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
368 * full 32x32 multiply. This provides a useful speedup on many machines.
369 * Unfortunately there is no way to specify a 16x16->32 multiply portably
370 * in C, but some C compilers will do the right thing if you provide the
371 * correct combination of casts.
372 */
373
374#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
375#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const)))
376#endif
377#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
378#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const)))
379#endif
380
381#ifndef MULTIPLY16C16 /* default definition */
382#define MULTIPLY16C16(var,const) ((var) * (const))
383#endif
384
385/* Same except both inputs are variables. */
386
387#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
388#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2)))
389#endif
390
391#ifndef MULTIPLY16V16 /* default definition */
392#define MULTIPLY16V16(var1,var2) ((var1) * (var2))
393#endif
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jddctmgr.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jddctmgr.c
new file mode 100644
index 0000000..5e4f1dc
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jddctmgr.c
@@ -0,0 +1,384 @@
1/*
2 * jddctmgr.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * Modified 2002-2010 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains the inverse-DCT management logic.
10 * This code selects a particular IDCT implementation to be used,
11 * and it performs related housekeeping chores. No code in this file
12 * is executed per IDCT step, only during output pass setup.
13 *
14 * Note that the IDCT routines are responsible for performing coefficient
15 * dequantization as well as the IDCT proper. This module sets up the
16 * dequantization multiplier table needed by the IDCT routine.
17 */
18
19#define JPEG_INTERNALS
20#include "jinclude.h"
21#include "jpeglib.h"
22#include "jdct.h" /* Private declarations for DCT subsystem */
23
24
25/*
26 * The decompressor input side (jdinput.c) saves away the appropriate
27 * quantization table for each component at the start of the first scan
28 * involving that component. (This is necessary in order to correctly
29 * decode files that reuse Q-table slots.)
30 * When we are ready to make an output pass, the saved Q-table is converted
31 * to a multiplier table that will actually be used by the IDCT routine.
32 * The multiplier table contents are IDCT-method-dependent. To support
33 * application changes in IDCT method between scans, we can remake the
34 * multiplier tables if necessary.
35 * In buffered-image mode, the first output pass may occur before any data
36 * has been seen for some components, and thus before their Q-tables have
37 * been saved away. To handle this case, multiplier tables are preset
38 * to zeroes; the result of the IDCT will be a neutral gray level.
39 */
40
41
42/* Private subobject for this module */
43
44typedef struct {
45 struct jpeg_inverse_dct pub; /* public fields */
46
47 /* This array contains the IDCT method code that each multiplier table
48 * is currently set up for, or -1 if it's not yet set up.
49 * The actual multiplier tables are pointed to by dct_table in the
50 * per-component comp_info structures.
51 */
52 int cur_method[MAX_COMPONENTS];
53} my_idct_controller;
54
55typedef my_idct_controller * my_idct_ptr;
56
57
58/* Allocated multiplier tables: big enough for any supported variant */
59
60typedef union {
61 ISLOW_MULT_TYPE islow_array[DCTSIZE2];
62#ifdef DCT_IFAST_SUPPORTED
63 IFAST_MULT_TYPE ifast_array[DCTSIZE2];
64#endif
65#ifdef DCT_FLOAT_SUPPORTED
66 FLOAT_MULT_TYPE float_array[DCTSIZE2];
67#endif
68} multiplier_table;
69
70
71/* The current scaled-IDCT routines require ISLOW-style multiplier tables,
72 * so be sure to compile that code if either ISLOW or SCALING is requested.
73 */
74#ifdef DCT_ISLOW_SUPPORTED
75#define PROVIDE_ISLOW_TABLES
76#else
77#ifdef IDCT_SCALING_SUPPORTED
78#define PROVIDE_ISLOW_TABLES
79#endif
80#endif
81
82
83/*
84 * Prepare for an output pass.
85 * Here we select the proper IDCT routine for each component and build
86 * a matching multiplier table.
87 */
88
89METHODDEF(void)
90start_pass (j_decompress_ptr cinfo)
91{
92 my_idct_ptr idct = (my_idct_ptr) cinfo->idct;
93 int ci, i;
94 jpeg_component_info *compptr;
95 int method = 0;
96 inverse_DCT_method_ptr method_ptr = NULL;
97 JQUANT_TBL * qtbl;
98
99 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
100 ci++, compptr++) {
101 /* Select the proper IDCT routine for this component's scaling */
102 switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {
103#ifdef IDCT_SCALING_SUPPORTED
104 case ((1 << 8) + 1):
105 method_ptr = jpeg_idct_1x1;
106 method = JDCT_ISLOW; /* jidctint uses islow-style table */
107 break;
108 case ((2 << 8) + 2):
109 method_ptr = jpeg_idct_2x2;
110 method = JDCT_ISLOW; /* jidctint uses islow-style table */
111 break;
112 case ((3 << 8) + 3):
113 method_ptr = jpeg_idct_3x3;
114 method = JDCT_ISLOW; /* jidctint uses islow-style table */
115 break;
116 case ((4 << 8) + 4):
117 method_ptr = jpeg_idct_4x4;
118 method = JDCT_ISLOW; /* jidctint uses islow-style table */
119 break;
120 case ((5 << 8) + 5):
121 method_ptr = jpeg_idct_5x5;
122 method = JDCT_ISLOW; /* jidctint uses islow-style table */
123 break;
124 case ((6 << 8) + 6):
125 method_ptr = jpeg_idct_6x6;
126 method = JDCT_ISLOW; /* jidctint uses islow-style table */
127 break;
128 case ((7 << 8) + 7):
129 method_ptr = jpeg_idct_7x7;
130 method = JDCT_ISLOW; /* jidctint uses islow-style table */
131 break;
132 case ((9 << 8) + 9):
133 method_ptr = jpeg_idct_9x9;
134 method = JDCT_ISLOW; /* jidctint uses islow-style table */
135 break;
136 case ((10 << 8) + 10):
137 method_ptr = jpeg_idct_10x10;
138 method = JDCT_ISLOW; /* jidctint uses islow-style table */
139 break;
140 case ((11 << 8) + 11):
141 method_ptr = jpeg_idct_11x11;
142 method = JDCT_ISLOW; /* jidctint uses islow-style table */
143 break;
144 case ((12 << 8) + 12):
145 method_ptr = jpeg_idct_12x12;
146 method = JDCT_ISLOW; /* jidctint uses islow-style table */
147 break;
148 case ((13 << 8) + 13):
149 method_ptr = jpeg_idct_13x13;
150 method = JDCT_ISLOW; /* jidctint uses islow-style table */
151 break;
152 case ((14 << 8) + 14):
153 method_ptr = jpeg_idct_14x14;
154 method = JDCT_ISLOW; /* jidctint uses islow-style table */
155 break;
156 case ((15 << 8) + 15):
157 method_ptr = jpeg_idct_15x15;
158 method = JDCT_ISLOW; /* jidctint uses islow-style table */
159 break;
160 case ((16 << 8) + 16):
161 method_ptr = jpeg_idct_16x16;
162 method = JDCT_ISLOW; /* jidctint uses islow-style table */
163 break;
164 case ((16 << 8) + 8):
165 method_ptr = jpeg_idct_16x8;
166 method = JDCT_ISLOW; /* jidctint uses islow-style table */
167 break;
168 case ((14 << 8) + 7):
169 method_ptr = jpeg_idct_14x7;
170 method = JDCT_ISLOW; /* jidctint uses islow-style table */
171 break;
172 case ((12 << 8) + 6):
173 method_ptr = jpeg_idct_12x6;
174 method = JDCT_ISLOW; /* jidctint uses islow-style table */
175 break;
176 case ((10 << 8) + 5):
177 method_ptr = jpeg_idct_10x5;
178 method = JDCT_ISLOW; /* jidctint uses islow-style table */
179 break;
180 case ((8 << 8) + 4):
181 method_ptr = jpeg_idct_8x4;
182 method = JDCT_ISLOW; /* jidctint uses islow-style table */
183 break;
184 case ((6 << 8) + 3):
185 method_ptr = jpeg_idct_6x3;
186 method = JDCT_ISLOW; /* jidctint uses islow-style table */
187 break;
188 case ((4 << 8) + 2):
189 method_ptr = jpeg_idct_4x2;
190 method = JDCT_ISLOW; /* jidctint uses islow-style table */
191 break;
192 case ((2 << 8) + 1):
193 method_ptr = jpeg_idct_2x1;
194 method = JDCT_ISLOW; /* jidctint uses islow-style table */
195 break;
196 case ((8 << 8) + 16):
197 method_ptr = jpeg_idct_8x16;
198 method = JDCT_ISLOW; /* jidctint uses islow-style table */
199 break;
200 case ((7 << 8) + 14):
201 method_ptr = jpeg_idct_7x14;
202 method = JDCT_ISLOW; /* jidctint uses islow-style table */
203 break;
204 case ((6 << 8) + 12):
205 method_ptr = jpeg_idct_6x12;
206 method = JDCT_ISLOW; /* jidctint uses islow-style table */
207 break;
208 case ((5 << 8) + 10):
209 method_ptr = jpeg_idct_5x10;
210 method = JDCT_ISLOW; /* jidctint uses islow-style table */
211 break;
212 case ((4 << 8) + 8):
213 method_ptr = jpeg_idct_4x8;
214 method = JDCT_ISLOW; /* jidctint uses islow-style table */
215 break;
216 case ((3 << 8) + 6):
217 method_ptr = jpeg_idct_3x6;
218 method = JDCT_ISLOW; /* jidctint uses islow-style table */
219 break;
220 case ((2 << 8) + 4):
221 method_ptr = jpeg_idct_2x4;
222 method = JDCT_ISLOW; /* jidctint uses islow-style table */
223 break;
224 case ((1 << 8) + 2):
225 method_ptr = jpeg_idct_1x2;
226 method = JDCT_ISLOW; /* jidctint uses islow-style table */
227 break;
228#endif
229 case ((DCTSIZE << 8) + DCTSIZE):
230 switch (cinfo->dct_method) {
231#ifdef DCT_ISLOW_SUPPORTED
232 case JDCT_ISLOW:
233 method_ptr = jpeg_idct_islow;
234 method = JDCT_ISLOW;
235 break;
236#endif
237#ifdef DCT_IFAST_SUPPORTED
238 case JDCT_IFAST:
239 method_ptr = jpeg_idct_ifast;
240 method = JDCT_IFAST;
241 break;
242#endif
243#ifdef DCT_FLOAT_SUPPORTED
244 case JDCT_FLOAT:
245 method_ptr = jpeg_idct_float;
246 method = JDCT_FLOAT;
247 break;
248#endif
249 default:
250 ERREXIT(cinfo, JERR_NOT_COMPILED);
251 break;
252 }
253 break;
254 default:
255 ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
256 compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);
257 break;
258 }
259 idct->pub.inverse_DCT[ci] = method_ptr;
260 /* Create multiplier table from quant table.
261 * However, we can skip this if the component is uninteresting
262 * or if we already built the table. Also, if no quant table
263 * has yet been saved for the component, we leave the
264 * multiplier table all-zero; we'll be reading zeroes from the
265 * coefficient controller's buffer anyway.
266 */
267 if (! compptr->component_needed || idct->cur_method[ci] == method)
268 continue;
269 qtbl = compptr->quant_table;
270 if (qtbl == NULL) /* happens if no data yet for component */
271 continue;
272 idct->cur_method[ci] = method;
273 switch (method) {
274#ifdef PROVIDE_ISLOW_TABLES
275 case JDCT_ISLOW:
276 {
277 /* For LL&M IDCT method, multipliers are equal to raw quantization
278 * coefficients, but are stored as ints to ensure access efficiency.
279 */
280 ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
281 for (i = 0; i < DCTSIZE2; i++) {
282 ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
283 }
284 }
285 break;
286#endif
287#ifdef DCT_IFAST_SUPPORTED
288 case JDCT_IFAST:
289 {
290 /* For AA&N IDCT method, multipliers are equal to quantization
291 * coefficients scaled by scalefactor[row]*scalefactor[col], where
292 * scalefactor[0] = 1
293 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
294 * For integer operation, the multiplier table is to be scaled by
295 * IFAST_SCALE_BITS.
296 */
297 IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
298#define CONST_BITS 14
299 static const INT16 aanscales[DCTSIZE2] = {
300 /* precomputed values scaled up by 14 bits */
301 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
302 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
303 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
304 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
305 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
306 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
307 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
308 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
309 };
310 SHIFT_TEMPS
311
312 for (i = 0; i < DCTSIZE2; i++) {
313 ifmtbl[i] = (IFAST_MULT_TYPE)
314 DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
315 (INT32) aanscales[i]),
316 CONST_BITS-IFAST_SCALE_BITS);
317 }
318 }
319 break;
320#endif
321#ifdef DCT_FLOAT_SUPPORTED
322 case JDCT_FLOAT:
323 {
324 /* For float AA&N IDCT method, multipliers are equal to quantization
325 * coefficients scaled by scalefactor[row]*scalefactor[col], where
326 * scalefactor[0] = 1
327 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
328 * We apply a further scale factor of 1/8.
329 */
330 FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
331 int row, col;
332 static const double aanscalefactor[DCTSIZE] = {
333 1.0, 1.387039845, 1.306562965, 1.175875602,
334 1.0, 0.785694958, 0.541196100, 0.275899379
335 };
336
337 i = 0;
338 for (row = 0; row < DCTSIZE; row++) {
339 for (col = 0; col < DCTSIZE; col++) {
340 fmtbl[i] = (FLOAT_MULT_TYPE)
341 ((double) qtbl->quantval[i] *
342 aanscalefactor[row] * aanscalefactor[col] * 0.125);
343 i++;
344 }
345 }
346 }
347 break;
348#endif
349 default:
350 ERREXIT(cinfo, JERR_NOT_COMPILED);
351 break;
352 }
353 }
354}
355
356
357/*
358 * Initialize IDCT manager.
359 */
360
361GLOBAL(void)
362jinit_inverse_dct (j_decompress_ptr cinfo)
363{
364 my_idct_ptr idct;
365 int ci;
366 jpeg_component_info *compptr;
367
368 idct = (my_idct_ptr)
369 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
370 SIZEOF(my_idct_controller));
371 cinfo->idct = (struct jpeg_inverse_dct *) idct;
372 idct->pub.start_pass = start_pass;
373
374 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
375 ci++, compptr++) {
376 /* Allocate and pre-zero a multiplier table for each component */
377 compptr->dct_table =
378 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
379 SIZEOF(multiplier_table));
380 MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
381 /* Mark multiplier table not yet set up for any method */
382 idct->cur_method[ci] = -1;
383 }
384}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdhuff.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdhuff.c
new file mode 100644
index 0000000..9694117
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdhuff.c
@@ -0,0 +1,1541 @@
1/*
2 * jdhuff.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2006-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains Huffman entropy decoding routines.
10 * Both sequential and progressive modes are supported in this single module.
11 *
12 * Much of the complexity here has to do with supporting input suspension.
13 * If the data source module demands suspension, we want to be able to back
14 * up to the start of the current MCU. To do this, we copy state variables
15 * into local working storage, and update them back to the permanent
16 * storage only upon successful completion of an MCU.
17 */
18
19#define JPEG_INTERNALS
20#include "jinclude.h"
21#include "jpeglib.h"
22
23
24/* Derived data constructed for each Huffman table */
25
26#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */
27
28typedef struct {
29 /* Basic tables: (element [0] of each array is unused) */
30 INT32 maxcode[18]; /* largest code of length k (-1 if none) */
31 /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
32 INT32 valoffset[17]; /* huffval[] offset for codes of length k */
33 /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
34 * the smallest code of length k; so given a code of length k, the
35 * corresponding symbol is huffval[code + valoffset[k]]
36 */
37
38 /* Link to public Huffman table (needed only in jpeg_huff_decode) */
39 JHUFF_TBL *pub;
40
41 /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
42 * the input data stream. If the next Huffman code is no more
43 * than HUFF_LOOKAHEAD bits long, we can obtain its length and
44 * the corresponding symbol directly from these tables.
45 */
46 int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
47 UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
48} d_derived_tbl;
49
50
51/*
52 * Fetching the next N bits from the input stream is a time-critical operation
53 * for the Huffman decoders. We implement it with a combination of inline
54 * macros and out-of-line subroutines. Note that N (the number of bits
55 * demanded at one time) never exceeds 15 for JPEG use.
56 *
57 * We read source bytes into get_buffer and dole out bits as needed.
58 * If get_buffer already contains enough bits, they are fetched in-line
59 * by the macros CHECK_BIT_BUFFER and GET_BITS. When there aren't enough
60 * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer
61 * as full as possible (not just to the number of bits needed; this
62 * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).
63 * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.
64 * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains
65 * at least the requested number of bits --- dummy zeroes are inserted if
66 * necessary.
67 */
68
69typedef INT32 bit_buf_type; /* type of bit-extraction buffer */
70#define BIT_BUF_SIZE 32 /* size of buffer in bits */
71
72/* If long is > 32 bits on your machine, and shifting/masking longs is
73 * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
74 * appropriately should be a win. Unfortunately we can't define the size
75 * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)
76 * because not all machines measure sizeof in 8-bit bytes.
77 */
78
79typedef struct { /* Bitreading state saved across MCUs */
80 bit_buf_type get_buffer; /* current bit-extraction buffer */
81 int bits_left; /* # of unused bits in it */
82} bitread_perm_state;
83
84typedef struct { /* Bitreading working state within an MCU */
85 /* Current data source location */
86 /* We need a copy, rather than munging the original, in case of suspension */
87 const JOCTET * next_input_byte; /* => next byte to read from source */
88 size_t bytes_in_buffer; /* # of bytes remaining in source buffer */
89 /* Bit input buffer --- note these values are kept in register variables,
90 * not in this struct, inside the inner loops.
91 */
92 bit_buf_type get_buffer; /* current bit-extraction buffer */
93 int bits_left; /* # of unused bits in it */
94 /* Pointer needed by jpeg_fill_bit_buffer. */
95 j_decompress_ptr cinfo; /* back link to decompress master record */
96} bitread_working_state;
97
98/* Macros to declare and load/save bitread local variables. */
99#define BITREAD_STATE_VARS \
100 register bit_buf_type get_buffer; \
101 register int bits_left; \
102 bitread_working_state br_state
103
104#define BITREAD_LOAD_STATE(cinfop,permstate) \
105 br_state.cinfo = cinfop; \
106 br_state.next_input_byte = cinfop->src->next_input_byte; \
107 br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
108 get_buffer = permstate.get_buffer; \
109 bits_left = permstate.bits_left;
110
111#define BITREAD_SAVE_STATE(cinfop,permstate) \
112 cinfop->src->next_input_byte = br_state.next_input_byte; \
113 cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
114 permstate.get_buffer = get_buffer; \
115 permstate.bits_left = bits_left
116
117/*
118 * These macros provide the in-line portion of bit fetching.
119 * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer
120 * before using GET_BITS, PEEK_BITS, or DROP_BITS.
121 * The variables get_buffer and bits_left are assumed to be locals,
122 * but the state struct might not be (jpeg_huff_decode needs this).
123 * CHECK_BIT_BUFFER(state,n,action);
124 * Ensure there are N bits in get_buffer; if suspend, take action.
125 * val = GET_BITS(n);
126 * Fetch next N bits.
127 * val = PEEK_BITS(n);
128 * Fetch next N bits without removing them from the buffer.
129 * DROP_BITS(n);
130 * Discard next N bits.
131 * The value N should be a simple variable, not an expression, because it
132 * is evaluated multiple times.
133 */
134
135#define CHECK_BIT_BUFFER(state,nbits,action) \
136 { if (bits_left < (nbits)) { \
137 if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \
138 { action; } \
139 get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
140
141#define GET_BITS(nbits) \
142 (((int) (get_buffer >> (bits_left -= (nbits)))) & BIT_MASK(nbits))
143
144#define PEEK_BITS(nbits) \
145 (((int) (get_buffer >> (bits_left - (nbits)))) & BIT_MASK(nbits))
146
147#define DROP_BITS(nbits) \
148 (bits_left -= (nbits))
149
150
151/*
152 * Code for extracting next Huffman-coded symbol from input bit stream.
153 * Again, this is time-critical and we make the main paths be macros.
154 *
155 * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits
156 * without looping. Usually, more than 95% of the Huffman codes will be 8
157 * or fewer bits long. The few overlength codes are handled with a loop,
158 * which need not be inline code.
159 *
160 * Notes about the HUFF_DECODE macro:
161 * 1. Near the end of the data segment, we may fail to get enough bits
162 * for a lookahead. In that case, we do it the hard way.
163 * 2. If the lookahead table contains no entry, the next code must be
164 * more than HUFF_LOOKAHEAD bits long.
165 * 3. jpeg_huff_decode returns -1 if forced to suspend.
166 */
167
168#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
169{ register int nb, look; \
170 if (bits_left < HUFF_LOOKAHEAD) { \
171 if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
172 get_buffer = state.get_buffer; bits_left = state.bits_left; \
173 if (bits_left < HUFF_LOOKAHEAD) { \
174 nb = 1; goto slowlabel; \
175 } \
176 } \
177 look = PEEK_BITS(HUFF_LOOKAHEAD); \
178 if ((nb = htbl->look_nbits[look]) != 0) { \
179 DROP_BITS(nb); \
180 result = htbl->look_sym[look]; \
181 } else { \
182 nb = HUFF_LOOKAHEAD+1; \
183slowlabel: \
184 if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
185 { failaction; } \
186 get_buffer = state.get_buffer; bits_left = state.bits_left; \
187 } \
188}
189
190
191/*
192 * Expanded entropy decoder object for Huffman decoding.
193 *
194 * The savable_state subrecord contains fields that change within an MCU,
195 * but must not be updated permanently until we complete the MCU.
196 */
197
198typedef struct {
199 unsigned int EOBRUN; /* remaining EOBs in EOBRUN */
200 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
201} savable_state;
202
203/* This macro is to work around compilers with missing or broken
204 * structure assignment. You'll need to fix this code if you have
205 * such a compiler and you change MAX_COMPS_IN_SCAN.
206 */
207
208#ifndef NO_STRUCT_ASSIGN
209#define ASSIGN_STATE(dest,src) ((dest) = (src))
210#else
211#if MAX_COMPS_IN_SCAN == 4
212#define ASSIGN_STATE(dest,src) \
213 ((dest).EOBRUN = (src).EOBRUN, \
214 (dest).last_dc_val[0] = (src).last_dc_val[0], \
215 (dest).last_dc_val[1] = (src).last_dc_val[1], \
216 (dest).last_dc_val[2] = (src).last_dc_val[2], \
217 (dest).last_dc_val[3] = (src).last_dc_val[3])
218#endif
219#endif
220
221
222typedef struct {
223 struct jpeg_entropy_decoder pub; /* public fields */
224
225 /* These fields are loaded into local variables at start of each MCU.
226 * In case of suspension, we exit WITHOUT updating them.
227 */
228 bitread_perm_state bitstate; /* Bit buffer at start of MCU */
229 savable_state saved; /* Other state at start of MCU */
230
231 /* These fields are NOT loaded into local working state. */
232 boolean insufficient_data; /* set TRUE after emitting warning */
233 unsigned int restarts_to_go; /* MCUs left in this restart interval */
234
235 /* Following two fields used only in progressive mode */
236
237 /* Pointers to derived tables (these workspaces have image lifespan) */
238 d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
239
240 d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */
241
242 /* Following fields used only in sequential mode */
243
244 /* Pointers to derived tables (these workspaces have image lifespan) */
245 d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
246 d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
247
248 /* Precalculated info set up by start_pass for use in decode_mcu: */
249
250 /* Pointers to derived tables to be used for each block within an MCU */
251 d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
252 d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
253 /* Whether we care about the DC and AC coefficient values for each block */
254 int coef_limit[D_MAX_BLOCKS_IN_MCU];
255} huff_entropy_decoder;
256
257typedef huff_entropy_decoder * huff_entropy_ptr;
258
259
260static const int jpeg_zigzag_order[8][8] = {
261 { 0, 1, 5, 6, 14, 15, 27, 28 },
262 { 2, 4, 7, 13, 16, 26, 29, 42 },
263 { 3, 8, 12, 17, 25, 30, 41, 43 },
264 { 9, 11, 18, 24, 31, 40, 44, 53 },
265 { 10, 19, 23, 32, 39, 45, 52, 54 },
266 { 20, 22, 33, 38, 46, 51, 55, 60 },
267 { 21, 34, 37, 47, 50, 56, 59, 61 },
268 { 35, 36, 48, 49, 57, 58, 62, 63 }
269};
270
271static const int jpeg_zigzag_order7[7][7] = {
272 { 0, 1, 5, 6, 14, 15, 27 },
273 { 2, 4, 7, 13, 16, 26, 28 },
274 { 3, 8, 12, 17, 25, 29, 38 },
275 { 9, 11, 18, 24, 30, 37, 39 },
276 { 10, 19, 23, 31, 36, 40, 45 },
277 { 20, 22, 32, 35, 41, 44, 46 },
278 { 21, 33, 34, 42, 43, 47, 48 }
279};
280
281static const int jpeg_zigzag_order6[6][6] = {
282 { 0, 1, 5, 6, 14, 15 },
283 { 2, 4, 7, 13, 16, 25 },
284 { 3, 8, 12, 17, 24, 26 },
285 { 9, 11, 18, 23, 27, 32 },
286 { 10, 19, 22, 28, 31, 33 },
287 { 20, 21, 29, 30, 34, 35 }
288};
289
290static const int jpeg_zigzag_order5[5][5] = {
291 { 0, 1, 5, 6, 14 },
292 { 2, 4, 7, 13, 15 },
293 { 3, 8, 12, 16, 21 },
294 { 9, 11, 17, 20, 22 },
295 { 10, 18, 19, 23, 24 }
296};
297
298static const int jpeg_zigzag_order4[4][4] = {
299 { 0, 1, 5, 6 },
300 { 2, 4, 7, 12 },
301 { 3, 8, 11, 13 },
302 { 9, 10, 14, 15 }
303};
304
305static const int jpeg_zigzag_order3[3][3] = {
306 { 0, 1, 5 },
307 { 2, 4, 6 },
308 { 3, 7, 8 }
309};
310
311static const int jpeg_zigzag_order2[2][2] = {
312 { 0, 1 },
313 { 2, 3 }
314};
315
316
317/*
318 * Compute the derived values for a Huffman table.
319 * This routine also performs some validation checks on the table.
320 */
321
322LOCAL(void)
323jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
324 d_derived_tbl ** pdtbl)
325{
326 JHUFF_TBL *htbl;
327 d_derived_tbl *dtbl;
328 int p, i, l, si, numsymbols;
329 int lookbits, ctr;
330 char huffsize[257];
331 unsigned int huffcode[257];
332 unsigned int code;
333
334 /* Note that huffsize[] and huffcode[] are filled in code-length order,
335 * paralleling the order of the symbols themselves in htbl->huffval[].
336 */
337
338 /* Find the input Huffman table */
339 if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
340 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
341 htbl =
342 isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
343 if (htbl == NULL)
344 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
345
346 /* Allocate a workspace if we haven't already done so. */
347 if (*pdtbl == NULL)
348 *pdtbl = (d_derived_tbl *)
349 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
350 SIZEOF(d_derived_tbl));
351 dtbl = *pdtbl;
352 dtbl->pub = htbl; /* fill in back link */
353
354 /* Figure C.1: make table of Huffman code length for each symbol */
355
356 p = 0;
357 for (l = 1; l <= 16; l++) {
358 i = (int) htbl->bits[l];
359 if (i < 0 || p + i > 256) /* protect against table overrun */
360 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
361 while (i--)
362 huffsize[p++] = (char) l;
363 }
364 huffsize[p] = 0;
365 numsymbols = p;
366
367 /* Figure C.2: generate the codes themselves */
368 /* We also validate that the counts represent a legal Huffman code tree. */
369
370 code = 0;
371 si = huffsize[0];
372 p = 0;
373 while (huffsize[p]) {
374 while (((int) huffsize[p]) == si) {
375 huffcode[p++] = code;
376 code++;
377 }
378 /* code is now 1 more than the last code used for codelength si; but
379 * it must still fit in si bits, since no code is allowed to be all ones.
380 */
381 if (((INT32) code) >= (((INT32) 1) << si))
382 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
383 code <<= 1;
384 si++;
385 }
386
387 /* Figure F.15: generate decoding tables for bit-sequential decoding */
388
389 p = 0;
390 for (l = 1; l <= 16; l++) {
391 if (htbl->bits[l]) {
392 /* valoffset[l] = huffval[] index of 1st symbol of code length l,
393 * minus the minimum code of length l
394 */
395 dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
396 p += htbl->bits[l];
397 dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
398 } else {
399 dtbl->maxcode[l] = -1; /* -1 if no codes of this length */
400 }
401 }
402 dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
403
404 /* Compute lookahead tables to speed up decoding.
405 * First we set all the table entries to 0, indicating "too long";
406 * then we iterate through the Huffman codes that are short enough and
407 * fill in all the entries that correspond to bit sequences starting
408 * with that code.
409 */
410
411 MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
412
413 p = 0;
414 for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
415 for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
416 /* l = current code's length, p = its index in huffcode[] & huffval[]. */
417 /* Generate left-justified code followed by all possible bit sequences */
418 lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
419 for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
420 dtbl->look_nbits[lookbits] = l;
421 dtbl->look_sym[lookbits] = htbl->huffval[p];
422 lookbits++;
423 }
424 }
425 }
426
427 /* Validate symbols as being reasonable.
428 * For AC tables, we make no check, but accept all byte values 0..255.
429 * For DC tables, we require the symbols to be in range 0..15.
430 * (Tighter bounds could be applied depending on the data depth and mode,
431 * but this is sufficient to ensure safe decoding.)
432 */
433 if (isDC) {
434 for (i = 0; i < numsymbols; i++) {
435 int sym = htbl->huffval[i];
436 if (sym < 0 || sym > 15)
437 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
438 }
439 }
440}
441
442
443/*
444 * Out-of-line code for bit fetching.
445 * Note: current values of get_buffer and bits_left are passed as parameters,
446 * but are returned in the corresponding fields of the state struct.
447 *
448 * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
449 * of get_buffer to be used. (On machines with wider words, an even larger
450 * buffer could be used.) However, on some machines 32-bit shifts are
451 * quite slow and take time proportional to the number of places shifted.
452 * (This is true with most PC compilers, for instance.) In this case it may
453 * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the
454 * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
455 */
456
457#ifdef SLOW_SHIFT_32
458#define MIN_GET_BITS 15 /* minimum allowable value */
459#else
460#define MIN_GET_BITS (BIT_BUF_SIZE-7)
461#endif
462
463
464LOCAL(boolean)
465jpeg_fill_bit_buffer (bitread_working_state * state,
466 register bit_buf_type get_buffer, register int bits_left,
467 int nbits)
468/* Load up the bit buffer to a depth of at least nbits */
469{
470 /* Copy heavily used state fields into locals (hopefully registers) */
471 register const JOCTET * next_input_byte = state->next_input_byte;
472 register size_t bytes_in_buffer = state->bytes_in_buffer;
473 j_decompress_ptr cinfo = state->cinfo;
474
475 /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
476 /* (It is assumed that no request will be for more than that many bits.) */
477 /* We fail to do so only if we hit a marker or are forced to suspend. */
478
479 if (cinfo->unread_marker == 0) { /* cannot advance past a marker */
480 while (bits_left < MIN_GET_BITS) {
481 register int c;
482
483 /* Attempt to read a byte */
484 if (bytes_in_buffer == 0) {
485 if (! (*cinfo->src->fill_input_buffer) (cinfo))
486 return FALSE;
487 next_input_byte = cinfo->src->next_input_byte;
488 bytes_in_buffer = cinfo->src->bytes_in_buffer;
489 }
490 bytes_in_buffer--;
491 c = GETJOCTET(*next_input_byte++);
492
493 /* If it's 0xFF, check and discard stuffed zero byte */
494 if (c == 0xFF) {
495 /* Loop here to discard any padding FF's on terminating marker,
496 * so that we can save a valid unread_marker value. NOTE: we will
497 * accept multiple FF's followed by a 0 as meaning a single FF data
498 * byte. This data pattern is not valid according to the standard.
499 */
500 do {
501 if (bytes_in_buffer == 0) {
502 if (! (*cinfo->src->fill_input_buffer) (cinfo))
503 return FALSE;
504 next_input_byte = cinfo->src->next_input_byte;
505 bytes_in_buffer = cinfo->src->bytes_in_buffer;
506 }
507 bytes_in_buffer--;
508 c = GETJOCTET(*next_input_byte++);
509 } while (c == 0xFF);
510
511 if (c == 0) {
512 /* Found FF/00, which represents an FF data byte */
513 c = 0xFF;
514 } else {
515 /* Oops, it's actually a marker indicating end of compressed data.
516 * Save the marker code for later use.
517 * Fine point: it might appear that we should save the marker into
518 * bitread working state, not straight into permanent state. But
519 * once we have hit a marker, we cannot need to suspend within the
520 * current MCU, because we will read no more bytes from the data
521 * source. So it is OK to update permanent state right away.
522 */
523 cinfo->unread_marker = c;
524 /* See if we need to insert some fake zero bits. */
525 goto no_more_bytes;
526 }
527 }
528
529 /* OK, load c into get_buffer */
530 get_buffer = (get_buffer << 8) | c;
531 bits_left += 8;
532 } /* end while */
533 } else {
534 no_more_bytes:
535 /* We get here if we've read the marker that terminates the compressed
536 * data segment. There should be enough bits in the buffer register
537 * to satisfy the request; if so, no problem.
538 */
539 if (nbits > bits_left) {
540 /* Uh-oh. Report corrupted data to user and stuff zeroes into
541 * the data stream, so that we can produce some kind of image.
542 * We use a nonvolatile flag to ensure that only one warning message
543 * appears per data segment.
544 */
545 if (! ((huff_entropy_ptr) cinfo->entropy)->insufficient_data) {
546 WARNMS(cinfo, JWRN_HIT_MARKER);
547 ((huff_entropy_ptr) cinfo->entropy)->insufficient_data = TRUE;
548 }
549 /* Fill the buffer with zero bits */
550 get_buffer <<= MIN_GET_BITS - bits_left;
551 bits_left = MIN_GET_BITS;
552 }
553 }
554
555 /* Unload the local registers */
556 state->next_input_byte = next_input_byte;
557 state->bytes_in_buffer = bytes_in_buffer;
558 state->get_buffer = get_buffer;
559 state->bits_left = bits_left;
560
561 return TRUE;
562}
563
564
565/*
566 * Figure F.12: extend sign bit.
567 * On some machines, a shift and sub will be faster than a table lookup.
568 */
569
570#ifdef AVOID_TABLES
571
572#define BIT_MASK(nbits) ((1<<(nbits))-1)
573#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) - ((1<<(s))-1) : (x))
574
575#else
576
577#define BIT_MASK(nbits) bmask[nbits]
578#define HUFF_EXTEND(x,s) ((x) <= bmask[(s) - 1] ? (x) - bmask[s] : (x))
579
580static const int bmask[16] = /* bmask[n] is mask for n rightmost bits */
581 { 0, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF,
582 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF };
583
584#endif /* AVOID_TABLES */
585
586
587/*
588 * Out-of-line code for Huffman code decoding.
589 */
590
591LOCAL(int)
592jpeg_huff_decode (bitread_working_state * state,
593 register bit_buf_type get_buffer, register int bits_left,
594 d_derived_tbl * htbl, int min_bits)
595{
596 register int l = min_bits;
597 register INT32 code;
598
599 /* HUFF_DECODE has determined that the code is at least min_bits */
600 /* bits long, so fetch that many bits in one swoop. */
601
602 CHECK_BIT_BUFFER(*state, l, return -1);
603 code = GET_BITS(l);
604
605 /* Collect the rest of the Huffman code one bit at a time. */
606 /* This is per Figure F.16 in the JPEG spec. */
607
608 while (code > htbl->maxcode[l]) {
609 code <<= 1;
610 CHECK_BIT_BUFFER(*state, 1, return -1);
611 code |= GET_BITS(1);
612 l++;
613 }
614
615 /* Unload the local registers */
616 state->get_buffer = get_buffer;
617 state->bits_left = bits_left;
618
619 /* With garbage input we may reach the sentinel value l = 17. */
620
621 if (l > 16) {
622 WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
623 return 0; /* fake a zero as the safest result */
624 }
625
626 return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
627}
628
629
630/*
631 * Check for a restart marker & resynchronize decoder.
632 * Returns FALSE if must suspend.
633 */
634
635LOCAL(boolean)
636process_restart (j_decompress_ptr cinfo)
637{
638 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
639 int ci;
640
641 /* Throw away any unused bits remaining in bit buffer; */
642 /* include any full bytes in next_marker's count of discarded bytes */
643 cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
644 entropy->bitstate.bits_left = 0;
645
646 /* Advance past the RSTn marker */
647 if (! (*cinfo->marker->read_restart_marker) (cinfo))
648 return FALSE;
649
650 /* Re-initialize DC predictions to 0 */
651 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
652 entropy->saved.last_dc_val[ci] = 0;
653 /* Re-init EOB run count, too */
654 entropy->saved.EOBRUN = 0;
655
656 /* Reset restart counter */
657 entropy->restarts_to_go = cinfo->restart_interval;
658
659 /* Reset out-of-data flag, unless read_restart_marker left us smack up
660 * against a marker. In that case we will end up treating the next data
661 * segment as empty, and we can avoid producing bogus output pixels by
662 * leaving the flag set.
663 */
664 if (cinfo->unread_marker == 0)
665 entropy->insufficient_data = FALSE;
666
667 return TRUE;
668}
669
670
671/*
672 * Huffman MCU decoding.
673 * Each of these routines decodes and returns one MCU's worth of
674 * Huffman-compressed coefficients.
675 * The coefficients are reordered from zigzag order into natural array order,
676 * but are not dequantized.
677 *
678 * The i'th block of the MCU is stored into the block pointed to by
679 * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
680 * (Wholesale zeroing is usually a little faster than retail...)
681 *
682 * We return FALSE if data source requested suspension. In that case no
683 * changes have been made to permanent state. (Exception: some output
684 * coefficients may already have been assigned. This is harmless for
685 * spectral selection, since we'll just re-assign them on the next call.
686 * Successive approximation AC refinement has to be more careful, however.)
687 */
688
689/*
690 * MCU decoding for DC initial scan (either spectral selection,
691 * or first pass of successive approximation).
692 */
693
694METHODDEF(boolean)
695decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
696{
697 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
698 int Al = cinfo->Al;
699 register int s, r;
700 int blkn, ci;
701 JBLOCKROW block;
702 BITREAD_STATE_VARS;
703 savable_state state;
704 d_derived_tbl * tbl;
705 jpeg_component_info * compptr;
706
707 /* Process restart marker if needed; may have to suspend */
708 if (cinfo->restart_interval) {
709 if (entropy->restarts_to_go == 0)
710 if (! process_restart(cinfo))
711 return FALSE;
712 }
713
714 /* If we've run out of data, just leave the MCU set to zeroes.
715 * This way, we return uniform gray for the remainder of the segment.
716 */
717 if (! entropy->insufficient_data) {
718
719 /* Load up working state */
720 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
721 ASSIGN_STATE(state, entropy->saved);
722
723 /* Outer loop handles each block in the MCU */
724
725 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
726 block = MCU_data[blkn];
727 ci = cinfo->MCU_membership[blkn];
728 compptr = cinfo->cur_comp_info[ci];
729 tbl = entropy->derived_tbls[compptr->dc_tbl_no];
730
731 /* Decode a single block's worth of coefficients */
732
733 /* Section F.2.2.1: decode the DC coefficient difference */
734 HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
735 if (s) {
736 CHECK_BIT_BUFFER(br_state, s, return FALSE);
737 r = GET_BITS(s);
738 s = HUFF_EXTEND(r, s);
739 }
740
741 /* Convert DC difference to actual value, update last_dc_val */
742 s += state.last_dc_val[ci];
743 state.last_dc_val[ci] = s;
744 /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
745 (*block)[0] = (JCOEF) (s << Al);
746 }
747
748 /* Completed MCU, so update state */
749 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
750 ASSIGN_STATE(entropy->saved, state);
751 }
752
753 /* Account for restart interval (no-op if not using restarts) */
754 entropy->restarts_to_go--;
755
756 return TRUE;
757}
758
759
760/*
761 * MCU decoding for AC initial scan (either spectral selection,
762 * or first pass of successive approximation).
763 */
764
765METHODDEF(boolean)
766decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
767{
768 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
769 register int s, k, r;
770 unsigned int EOBRUN;
771 int Se, Al;
772 const int * natural_order;
773 JBLOCKROW block;
774 BITREAD_STATE_VARS;
775 d_derived_tbl * tbl;
776
777 /* Process restart marker if needed; may have to suspend */
778 if (cinfo->restart_interval) {
779 if (entropy->restarts_to_go == 0)
780 if (! process_restart(cinfo))
781 return FALSE;
782 }
783
784 /* If we've run out of data, just leave the MCU set to zeroes.
785 * This way, we return uniform gray for the remainder of the segment.
786 */
787 if (! entropy->insufficient_data) {
788
789 Se = cinfo->Se;
790 Al = cinfo->Al;
791 natural_order = cinfo->natural_order;
792
793 /* Load up working state.
794 * We can avoid loading/saving bitread state if in an EOB run.
795 */
796 EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
797
798 /* There is always only one block per MCU */
799
800 if (EOBRUN > 0) /* if it's a band of zeroes... */
801 EOBRUN--; /* ...process it now (we do nothing) */
802 else {
803 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
804 block = MCU_data[0];
805 tbl = entropy->ac_derived_tbl;
806
807 for (k = cinfo->Ss; k <= Se; k++) {
808 HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
809 r = s >> 4;
810 s &= 15;
811 if (s) {
812 k += r;
813 CHECK_BIT_BUFFER(br_state, s, return FALSE);
814 r = GET_BITS(s);
815 s = HUFF_EXTEND(r, s);
816 /* Scale and output coefficient in natural (dezigzagged) order */
817 (*block)[natural_order[k]] = (JCOEF) (s << Al);
818 } else {
819 if (r == 15) { /* ZRL */
820 k += 15; /* skip 15 zeroes in band */
821 } else { /* EOBr, run length is 2^r + appended bits */
822 EOBRUN = 1 << r;
823 if (r) { /* EOBr, r > 0 */
824 CHECK_BIT_BUFFER(br_state, r, return FALSE);
825 r = GET_BITS(r);
826 EOBRUN += r;
827 }
828 EOBRUN--; /* this band is processed at this moment */
829 break; /* force end-of-band */
830 }
831 }
832 }
833
834 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
835 }
836
837 /* Completed MCU, so update state */
838 entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
839 }
840
841 /* Account for restart interval (no-op if not using restarts) */
842 entropy->restarts_to_go--;
843
844 return TRUE;
845}
846
847
848/*
849 * MCU decoding for DC successive approximation refinement scan.
850 * Note: we assume such scans can be multi-component, although the spec
851 * is not very clear on the point.
852 */
853
854METHODDEF(boolean)
855decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
856{
857 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
858 int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
859 int blkn;
860 JBLOCKROW block;
861 BITREAD_STATE_VARS;
862
863 /* Process restart marker if needed; may have to suspend */
864 if (cinfo->restart_interval) {
865 if (entropy->restarts_to_go == 0)
866 if (! process_restart(cinfo))
867 return FALSE;
868 }
869
870 /* Not worth the cycles to check insufficient_data here,
871 * since we will not change the data anyway if we read zeroes.
872 */
873
874 /* Load up working state */
875 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
876
877 /* Outer loop handles each block in the MCU */
878
879 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
880 block = MCU_data[blkn];
881
882 /* Encoded data is simply the next bit of the two's-complement DC value */
883 CHECK_BIT_BUFFER(br_state, 1, return FALSE);
884 if (GET_BITS(1))
885 (*block)[0] |= p1;
886 /* Note: since we use |=, repeating the assignment later is safe */
887 }
888
889 /* Completed MCU, so update state */
890 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
891
892 /* Account for restart interval (no-op if not using restarts) */
893 entropy->restarts_to_go--;
894
895 return TRUE;
896}
897
898
899/*
900 * MCU decoding for AC successive approximation refinement scan.
901 */
902
903METHODDEF(boolean)
904decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
905{
906 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
907 register int s, k, r;
908 unsigned int EOBRUN;
909 int Se, p1, m1;
910 const int * natural_order;
911 JBLOCKROW block;
912 JCOEFPTR thiscoef;
913 BITREAD_STATE_VARS;
914 d_derived_tbl * tbl;
915 int num_newnz;
916 int newnz_pos[DCTSIZE2];
917
918 /* Process restart marker if needed; may have to suspend */
919 if (cinfo->restart_interval) {
920 if (entropy->restarts_to_go == 0)
921 if (! process_restart(cinfo))
922 return FALSE;
923 }
924
925 /* If we've run out of data, don't modify the MCU.
926 */
927 if (! entropy->insufficient_data) {
928
929 Se = cinfo->Se;
930 p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
931 m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
932 natural_order = cinfo->natural_order;
933
934 /* Load up working state */
935 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
936 EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
937
938 /* There is always only one block per MCU */
939 block = MCU_data[0];
940 tbl = entropy->ac_derived_tbl;
941
942 /* If we are forced to suspend, we must undo the assignments to any newly
943 * nonzero coefficients in the block, because otherwise we'd get confused
944 * next time about which coefficients were already nonzero.
945 * But we need not undo addition of bits to already-nonzero coefficients;
946 * instead, we can test the current bit to see if we already did it.
947 */
948 num_newnz = 0;
949
950 /* initialize coefficient loop counter to start of band */
951 k = cinfo->Ss;
952
953 if (EOBRUN == 0) {
954 for (; k <= Se; k++) {
955 HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
956 r = s >> 4;
957 s &= 15;
958 if (s) {
959 if (s != 1) /* size of new coef should always be 1 */
960 WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
961 CHECK_BIT_BUFFER(br_state, 1, goto undoit);
962 if (GET_BITS(1))
963 s = p1; /* newly nonzero coef is positive */
964 else
965 s = m1; /* newly nonzero coef is negative */
966 } else {
967 if (r != 15) {
968 EOBRUN = 1 << r; /* EOBr, run length is 2^r + appended bits */
969 if (r) {
970 CHECK_BIT_BUFFER(br_state, r, goto undoit);
971 r = GET_BITS(r);
972 EOBRUN += r;
973 }
974 break; /* rest of block is handled by EOB logic */
975 }
976 /* note s = 0 for processing ZRL */
977 }
978 /* Advance over already-nonzero coefs and r still-zero coefs,
979 * appending correction bits to the nonzeroes. A correction bit is 1
980 * if the absolute value of the coefficient must be increased.
981 */
982 do {
983 thiscoef = *block + natural_order[k];
984 if (*thiscoef != 0) {
985 CHECK_BIT_BUFFER(br_state, 1, goto undoit);
986 if (GET_BITS(1)) {
987 if ((*thiscoef & p1) == 0) { /* do nothing if already set it */
988 if (*thiscoef >= 0)
989 *thiscoef += p1;
990 else
991 *thiscoef += m1;
992 }
993 }
994 } else {
995 if (--r < 0)
996 break; /* reached target zero coefficient */
997 }
998 k++;
999 } while (k <= Se);
1000 if (s) {
1001 int pos = natural_order[k];
1002 /* Output newly nonzero coefficient */
1003 (*block)[pos] = (JCOEF) s;
1004 /* Remember its position in case we have to suspend */
1005 newnz_pos[num_newnz++] = pos;
1006 }
1007 }
1008 }
1009
1010 if (EOBRUN > 0) {
1011 /* Scan any remaining coefficient positions after the end-of-band
1012 * (the last newly nonzero coefficient, if any). Append a correction
1013 * bit to each already-nonzero coefficient. A correction bit is 1
1014 * if the absolute value of the coefficient must be increased.
1015 */
1016 for (; k <= Se; k++) {
1017 thiscoef = *block + natural_order[k];
1018 if (*thiscoef != 0) {
1019 CHECK_BIT_BUFFER(br_state, 1, goto undoit);
1020 if (GET_BITS(1)) {
1021 if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */
1022 if (*thiscoef >= 0)
1023 *thiscoef += p1;
1024 else
1025 *thiscoef += m1;
1026 }
1027 }
1028 }
1029 }
1030 /* Count one block completed in EOB run */
1031 EOBRUN--;
1032 }
1033
1034 /* Completed MCU, so update state */
1035 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
1036 entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
1037 }
1038
1039 /* Account for restart interval (no-op if not using restarts) */
1040 entropy->restarts_to_go--;
1041
1042 return TRUE;
1043
1044undoit:
1045 /* Re-zero any output coefficients that we made newly nonzero */
1046 while (num_newnz > 0)
1047 (*block)[newnz_pos[--num_newnz]] = 0;
1048
1049 return FALSE;
1050}
1051
1052
1053/*
1054 * Decode one MCU's worth of Huffman-compressed coefficients,
1055 * partial blocks.
1056 */
1057
1058METHODDEF(boolean)
1059decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
1060{
1061 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1062 const int * natural_order;
1063 int Se, blkn;
1064 BITREAD_STATE_VARS;
1065 savable_state state;
1066
1067 /* Process restart marker if needed; may have to suspend */
1068 if (cinfo->restart_interval) {
1069 if (entropy->restarts_to_go == 0)
1070 if (! process_restart(cinfo))
1071 return FALSE;
1072 }
1073
1074 /* If we've run out of data, just leave the MCU set to zeroes.
1075 * This way, we return uniform gray for the remainder of the segment.
1076 */
1077 if (! entropy->insufficient_data) {
1078
1079 natural_order = cinfo->natural_order;
1080 Se = cinfo->lim_Se;
1081
1082 /* Load up working state */
1083 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
1084 ASSIGN_STATE(state, entropy->saved);
1085
1086 /* Outer loop handles each block in the MCU */
1087
1088 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
1089 JBLOCKROW block = MCU_data[blkn];
1090 d_derived_tbl * htbl;
1091 register int s, k, r;
1092 int coef_limit, ci;
1093
1094 /* Decode a single block's worth of coefficients */
1095
1096 /* Section F.2.2.1: decode the DC coefficient difference */
1097 htbl = entropy->dc_cur_tbls[blkn];
1098 HUFF_DECODE(s, br_state, htbl, return FALSE, label1);
1099
1100 htbl = entropy->ac_cur_tbls[blkn];
1101 k = 1;
1102 coef_limit = entropy->coef_limit[blkn];
1103 if (coef_limit) {
1104 /* Convert DC difference to actual value, update last_dc_val */
1105 if (s) {
1106 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1107 r = GET_BITS(s);
1108 s = HUFF_EXTEND(r, s);
1109 }
1110 ci = cinfo->MCU_membership[blkn];
1111 s += state.last_dc_val[ci];
1112 state.last_dc_val[ci] = s;
1113 /* Output the DC coefficient */
1114 (*block)[0] = (JCOEF) s;
1115
1116 /* Section F.2.2.2: decode the AC coefficients */
1117 /* Since zeroes are skipped, output area must be cleared beforehand */
1118 for (; k < coef_limit; k++) {
1119 HUFF_DECODE(s, br_state, htbl, return FALSE, label2);
1120
1121 r = s >> 4;
1122 s &= 15;
1123
1124 if (s) {
1125 k += r;
1126 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1127 r = GET_BITS(s);
1128 s = HUFF_EXTEND(r, s);
1129 /* Output coefficient in natural (dezigzagged) order.
1130 * Note: the extra entries in natural_order[] will save us
1131 * if k > Se, which could happen if the data is corrupted.
1132 */
1133 (*block)[natural_order[k]] = (JCOEF) s;
1134 } else {
1135 if (r != 15)
1136 goto EndOfBlock;
1137 k += 15;
1138 }
1139 }
1140 } else {
1141 if (s) {
1142 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1143 DROP_BITS(s);
1144 }
1145 }
1146
1147 /* Section F.2.2.2: decode the AC coefficients */
1148 /* In this path we just discard the values */
1149 for (; k <= Se; k++) {
1150 HUFF_DECODE(s, br_state, htbl, return FALSE, label3);
1151
1152 r = s >> 4;
1153 s &= 15;
1154
1155 if (s) {
1156 k += r;
1157 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1158 DROP_BITS(s);
1159 } else {
1160 if (r != 15)
1161 break;
1162 k += 15;
1163 }
1164 }
1165
1166 EndOfBlock: ;
1167 }
1168
1169 /* Completed MCU, so update state */
1170 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
1171 ASSIGN_STATE(entropy->saved, state);
1172 }
1173
1174 /* Account for restart interval (no-op if not using restarts) */
1175 entropy->restarts_to_go--;
1176
1177 return TRUE;
1178}
1179
1180
1181/*
1182 * Decode one MCU's worth of Huffman-compressed coefficients,
1183 * full-size blocks.
1184 */
1185
1186METHODDEF(boolean)
1187decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
1188{
1189 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1190 int blkn;
1191 BITREAD_STATE_VARS;
1192 savable_state state;
1193
1194 /* Process restart marker if needed; may have to suspend */
1195 if (cinfo->restart_interval) {
1196 if (entropy->restarts_to_go == 0)
1197 if (! process_restart(cinfo))
1198 return FALSE;
1199 }
1200
1201 /* If we've run out of data, just leave the MCU set to zeroes.
1202 * This way, we return uniform gray for the remainder of the segment.
1203 */
1204 if (! entropy->insufficient_data) {
1205
1206 /* Load up working state */
1207 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
1208 ASSIGN_STATE(state, entropy->saved);
1209
1210 /* Outer loop handles each block in the MCU */
1211
1212 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
1213 JBLOCKROW block = MCU_data[blkn];
1214 d_derived_tbl * htbl;
1215 register int s, k, r;
1216 int coef_limit, ci;
1217
1218 /* Decode a single block's worth of coefficients */
1219
1220 /* Section F.2.2.1: decode the DC coefficient difference */
1221 htbl = entropy->dc_cur_tbls[blkn];
1222 HUFF_DECODE(s, br_state, htbl, return FALSE, label1);
1223
1224 htbl = entropy->ac_cur_tbls[blkn];
1225 k = 1;
1226 coef_limit = entropy->coef_limit[blkn];
1227 if (coef_limit) {
1228 /* Convert DC difference to actual value, update last_dc_val */
1229 if (s) {
1230 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1231 r = GET_BITS(s);
1232 s = HUFF_EXTEND(r, s);
1233 }
1234 ci = cinfo->MCU_membership[blkn];
1235 s += state.last_dc_val[ci];
1236 state.last_dc_val[ci] = s;
1237 /* Output the DC coefficient */
1238 (*block)[0] = (JCOEF) s;
1239
1240 /* Section F.2.2.2: decode the AC coefficients */
1241 /* Since zeroes are skipped, output area must be cleared beforehand */
1242 for (; k < coef_limit; k++) {
1243 HUFF_DECODE(s, br_state, htbl, return FALSE, label2);
1244
1245 r = s >> 4;
1246 s &= 15;
1247
1248 if (s) {
1249 k += r;
1250 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1251 r = GET_BITS(s);
1252 s = HUFF_EXTEND(r, s);
1253 /* Output coefficient in natural (dezigzagged) order.
1254 * Note: the extra entries in jpeg_natural_order[] will save us
1255 * if k >= DCTSIZE2, which could happen if the data is corrupted.
1256 */
1257 (*block)[jpeg_natural_order[k]] = (JCOEF) s;
1258 } else {
1259 if (r != 15)
1260 goto EndOfBlock;
1261 k += 15;
1262 }
1263 }
1264 } else {
1265 if (s) {
1266 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1267 DROP_BITS(s);
1268 }
1269 }
1270
1271 /* Section F.2.2.2: decode the AC coefficients */
1272 /* In this path we just discard the values */
1273 for (; k < DCTSIZE2; k++) {
1274 HUFF_DECODE(s, br_state, htbl, return FALSE, label3);
1275
1276 r = s >> 4;
1277 s &= 15;
1278
1279 if (s) {
1280 k += r;
1281 CHECK_BIT_BUFFER(br_state, s, return FALSE);
1282 DROP_BITS(s);
1283 } else {
1284 if (r != 15)
1285 break;
1286 k += 15;
1287 }
1288 }
1289
1290 EndOfBlock: ;
1291 }
1292
1293 /* Completed MCU, so update state */
1294 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
1295 ASSIGN_STATE(entropy->saved, state);
1296 }
1297
1298 /* Account for restart interval (no-op if not using restarts) */
1299 entropy->restarts_to_go--;
1300
1301 return TRUE;
1302}
1303
1304
1305/*
1306 * Initialize for a Huffman-compressed scan.
1307 */
1308
1309METHODDEF(void)
1310start_pass_huff_decoder (j_decompress_ptr cinfo)
1311{
1312 huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
1313 int ci, blkn, tbl, i;
1314 jpeg_component_info * compptr;
1315
1316 if (cinfo->progressive_mode) {
1317 /* Validate progressive scan parameters */
1318 if (cinfo->Ss == 0) {
1319 if (cinfo->Se != 0)
1320 goto bad;
1321 } else {
1322 /* need not check Ss/Se < 0 since they came from unsigned bytes */
1323 if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se)
1324 goto bad;
1325 /* AC scans may have only one component */
1326 if (cinfo->comps_in_scan != 1)
1327 goto bad;
1328 }
1329 if (cinfo->Ah != 0) {
1330 /* Successive approximation refinement scan: must have Al = Ah-1. */
1331 if (cinfo->Ah-1 != cinfo->Al)
1332 goto bad;
1333 }
1334 if (cinfo->Al > 13) { /* need not check for < 0 */
1335 /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
1336 * but the spec doesn't say so, and we try to be liberal about what we
1337 * accept. Note: large Al values could result in out-of-range DC
1338 * coefficients during early scans, leading to bizarre displays due to
1339 * overflows in the IDCT math. But we won't crash.
1340 */
1341 bad:
1342 ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
1343 cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
1344 }
1345 /* Update progression status, and verify that scan order is legal.
1346 * Note that inter-scan inconsistencies are treated as warnings
1347 * not fatal errors ... not clear if this is right way to behave.
1348 */
1349 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
1350 int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
1351 int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];
1352 if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
1353 WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
1354 for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
1355 int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
1356 if (cinfo->Ah != expected)
1357 WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
1358 coef_bit_ptr[coefi] = cinfo->Al;
1359 }
1360 }
1361
1362 /* Select MCU decoding routine */
1363 if (cinfo->Ah == 0) {
1364 if (cinfo->Ss == 0)
1365 entropy->pub.decode_mcu = decode_mcu_DC_first;
1366 else
1367 entropy->pub.decode_mcu = decode_mcu_AC_first;
1368 } else {
1369 if (cinfo->Ss == 0)
1370 entropy->pub.decode_mcu = decode_mcu_DC_refine;
1371 else
1372 entropy->pub.decode_mcu = decode_mcu_AC_refine;
1373 }
1374
1375 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
1376 compptr = cinfo->cur_comp_info[ci];
1377 /* Make sure requested tables are present, and compute derived tables.
1378 * We may build same derived table more than once, but it's not expensive.
1379 */
1380 if (cinfo->Ss == 0) {
1381 if (cinfo->Ah == 0) { /* DC refinement needs no table */
1382 tbl = compptr->dc_tbl_no;
1383 jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,
1384 & entropy->derived_tbls[tbl]);
1385 }
1386 } else {
1387 tbl = compptr->ac_tbl_no;
1388 jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,
1389 & entropy->derived_tbls[tbl]);
1390 /* remember the single active table */
1391 entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
1392 }
1393 /* Initialize DC predictions to 0 */
1394 entropy->saved.last_dc_val[ci] = 0;
1395 }
1396
1397 /* Initialize private state variables */
1398 entropy->saved.EOBRUN = 0;
1399 } else {
1400 /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
1401 * This ought to be an error condition, but we make it a warning because
1402 * there are some baseline files out there with all zeroes in these bytes.
1403 */
1404 if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||
1405 ((cinfo->is_baseline || cinfo->Se < DCTSIZE2) &&
1406 cinfo->Se != cinfo->lim_Se))
1407 WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
1408
1409 /* Select MCU decoding routine */
1410 /* We retain the hard-coded case for full-size blocks.
1411 * This is not necessary, but it appears that this version is slightly
1412 * more performant in the given implementation.
1413 * With an improved implementation we would prefer a single optimized
1414 * function.
1415 */
1416 if (cinfo->lim_Se != DCTSIZE2-1)
1417 entropy->pub.decode_mcu = decode_mcu_sub;
1418 else
1419 entropy->pub.decode_mcu = decode_mcu;
1420
1421 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
1422 compptr = cinfo->cur_comp_info[ci];
1423 /* Compute derived values for Huffman tables */
1424 /* We may do this more than once for a table, but it's not expensive */
1425 tbl = compptr->dc_tbl_no;
1426 jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,
1427 & entropy->dc_derived_tbls[tbl]);
1428 if (cinfo->lim_Se) { /* AC needs no table when not present */
1429 tbl = compptr->ac_tbl_no;
1430 jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,
1431 & entropy->ac_derived_tbls[tbl]);
1432 }
1433 /* Initialize DC predictions to 0 */
1434 entropy->saved.last_dc_val[ci] = 0;
1435 }
1436
1437 /* Precalculate decoding info for each block in an MCU of this scan */
1438 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
1439 ci = cinfo->MCU_membership[blkn];
1440 compptr = cinfo->cur_comp_info[ci];
1441 /* Precalculate which table to use for each block */
1442 entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
1443 entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
1444 /* Decide whether we really care about the coefficient values */
1445 if (compptr->component_needed) {
1446 ci = compptr->DCT_v_scaled_size;
1447 i = compptr->DCT_h_scaled_size;
1448 switch (cinfo->lim_Se) {
1449 case (1*1-1):
1450 entropy->coef_limit[blkn] = 1;
1451 break;
1452 case (2*2-1):
1453 if (ci <= 0 || ci > 2) ci = 2;
1454 if (i <= 0 || i > 2) i = 2;
1455 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order2[ci - 1][i - 1];
1456 break;
1457 case (3*3-1):
1458 if (ci <= 0 || ci > 3) ci = 3;
1459 if (i <= 0 || i > 3) i = 3;
1460 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order3[ci - 1][i - 1];
1461 break;
1462 case (4*4-1):
1463 if (ci <= 0 || ci > 4) ci = 4;
1464 if (i <= 0 || i > 4) i = 4;
1465 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order4[ci - 1][i - 1];
1466 break;
1467 case (5*5-1):
1468 if (ci <= 0 || ci > 5) ci = 5;
1469 if (i <= 0 || i > 5) i = 5;
1470 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order5[ci - 1][i - 1];
1471 break;
1472 case (6*6-1):
1473 if (ci <= 0 || ci > 6) ci = 6;
1474 if (i <= 0 || i > 6) i = 6;
1475 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order6[ci - 1][i - 1];
1476 break;
1477 case (7*7-1):
1478 if (ci <= 0 || ci > 7) ci = 7;
1479 if (i <= 0 || i > 7) i = 7;
1480 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order7[ci - 1][i - 1];
1481 break;
1482 default:
1483 if (ci <= 0 || ci > 8) ci = 8;
1484 if (i <= 0 || i > 8) i = 8;
1485 entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1];
1486 break;
1487 }
1488 } else {
1489 entropy->coef_limit[blkn] = 0;
1490 }
1491 }
1492 }
1493
1494 /* Initialize bitread state variables */
1495 entropy->bitstate.bits_left = 0;
1496 entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
1497 entropy->insufficient_data = FALSE;
1498
1499 /* Initialize restart counter */
1500 entropy->restarts_to_go = cinfo->restart_interval;
1501}
1502
1503
1504/*
1505 * Module initialization routine for Huffman entropy decoding.
1506 */
1507
1508GLOBAL(void)
1509jinit_huff_decoder (j_decompress_ptr cinfo)
1510{
1511 huff_entropy_ptr entropy;
1512 int i;
1513
1514 entropy = (huff_entropy_ptr)
1515 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1516 SIZEOF(huff_entropy_decoder));
1517 cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
1518 entropy->pub.start_pass = start_pass_huff_decoder;
1519
1520 if (cinfo->progressive_mode) {
1521 /* Create progression status table */
1522 int *coef_bit_ptr, ci;
1523 cinfo->coef_bits = (int (*)[DCTSIZE2])
1524 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1525 cinfo->num_components*DCTSIZE2*SIZEOF(int));
1526 coef_bit_ptr = & cinfo->coef_bits[0][0];
1527 for (ci = 0; ci < cinfo->num_components; ci++)
1528 for (i = 0; i < DCTSIZE2; i++)
1529 *coef_bit_ptr++ = -1;
1530
1531 /* Mark derived tables unallocated */
1532 for (i = 0; i < NUM_HUFF_TBLS; i++) {
1533 entropy->derived_tbls[i] = NULL;
1534 }
1535 } else {
1536 /* Mark tables unallocated */
1537 for (i = 0; i < NUM_HUFF_TBLS; i++) {
1538 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
1539 }
1540 }
1541}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdinput.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdinput.c
new file mode 100644
index 0000000..85e7e8f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdinput.c
@@ -0,0 +1,661 @@
1/*
2 * jdinput.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2002-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains input control logic for the JPEG decompressor.
10 * These routines are concerned with controlling the decompressor's input
11 * processing (marker reading and coefficient decoding). The actual input
12 * reading is done in jdmarker.c, jdhuff.c, and jdarith.c.
13 */
14
15#define JPEG_INTERNALS
16#include "jinclude.h"
17#include "jpeglib.h"
18
19
20/* Private state */
21
22typedef struct {
23 struct jpeg_input_controller pub; /* public fields */
24
25 int inheaders; /* Nonzero until first SOS is reached */
26} my_input_controller;
27
28typedef my_input_controller * my_inputctl_ptr;
29
30
31/* Forward declarations */
32METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));
33
34
35/*
36 * Routines to calculate various quantities related to the size of the image.
37 */
38
39
40/*
41 * Compute output image dimensions and related values.
42 * NOTE: this is exported for possible use by application.
43 * Hence it mustn't do anything that can't be done twice.
44 */
45
46GLOBAL(void)
47jpeg_core_output_dimensions (j_decompress_ptr cinfo)
48/* Do computations that are needed before master selection phase.
49 * This function is used for transcoding and full decompression.
50 */
51{
52#ifdef IDCT_SCALING_SUPPORTED
53 int ci;
54 jpeg_component_info *compptr;
55
56 /* Compute actual output image dimensions and DCT scaling choices. */
57 if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom) {
58 /* Provide 1/block_size scaling */
59 cinfo->output_width = (JDIMENSION)
60 jdiv_round_up((long) cinfo->image_width, (long) cinfo->block_size);
61 cinfo->output_height = (JDIMENSION)
62 jdiv_round_up((long) cinfo->image_height, (long) cinfo->block_size);
63 cinfo->min_DCT_h_scaled_size = 1;
64 cinfo->min_DCT_v_scaled_size = 1;
65 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 2) {
66 /* Provide 2/block_size scaling */
67 cinfo->output_width = (JDIMENSION)
68 jdiv_round_up((long) cinfo->image_width * 2L, (long) cinfo->block_size);
69 cinfo->output_height = (JDIMENSION)
70 jdiv_round_up((long) cinfo->image_height * 2L, (long) cinfo->block_size);
71 cinfo->min_DCT_h_scaled_size = 2;
72 cinfo->min_DCT_v_scaled_size = 2;
73 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 3) {
74 /* Provide 3/block_size scaling */
75 cinfo->output_width = (JDIMENSION)
76 jdiv_round_up((long) cinfo->image_width * 3L, (long) cinfo->block_size);
77 cinfo->output_height = (JDIMENSION)
78 jdiv_round_up((long) cinfo->image_height * 3L, (long) cinfo->block_size);
79 cinfo->min_DCT_h_scaled_size = 3;
80 cinfo->min_DCT_v_scaled_size = 3;
81 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 4) {
82 /* Provide 4/block_size scaling */
83 cinfo->output_width = (JDIMENSION)
84 jdiv_round_up((long) cinfo->image_width * 4L, (long) cinfo->block_size);
85 cinfo->output_height = (JDIMENSION)
86 jdiv_round_up((long) cinfo->image_height * 4L, (long) cinfo->block_size);
87 cinfo->min_DCT_h_scaled_size = 4;
88 cinfo->min_DCT_v_scaled_size = 4;
89 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 5) {
90 /* Provide 5/block_size scaling */
91 cinfo->output_width = (JDIMENSION)
92 jdiv_round_up((long) cinfo->image_width * 5L, (long) cinfo->block_size);
93 cinfo->output_height = (JDIMENSION)
94 jdiv_round_up((long) cinfo->image_height * 5L, (long) cinfo->block_size);
95 cinfo->min_DCT_h_scaled_size = 5;
96 cinfo->min_DCT_v_scaled_size = 5;
97 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 6) {
98 /* Provide 6/block_size scaling */
99 cinfo->output_width = (JDIMENSION)
100 jdiv_round_up((long) cinfo->image_width * 6L, (long) cinfo->block_size);
101 cinfo->output_height = (JDIMENSION)
102 jdiv_round_up((long) cinfo->image_height * 6L, (long) cinfo->block_size);
103 cinfo->min_DCT_h_scaled_size = 6;
104 cinfo->min_DCT_v_scaled_size = 6;
105 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 7) {
106 /* Provide 7/block_size scaling */
107 cinfo->output_width = (JDIMENSION)
108 jdiv_round_up((long) cinfo->image_width * 7L, (long) cinfo->block_size);
109 cinfo->output_height = (JDIMENSION)
110 jdiv_round_up((long) cinfo->image_height * 7L, (long) cinfo->block_size);
111 cinfo->min_DCT_h_scaled_size = 7;
112 cinfo->min_DCT_v_scaled_size = 7;
113 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 8) {
114 /* Provide 8/block_size scaling */
115 cinfo->output_width = (JDIMENSION)
116 jdiv_round_up((long) cinfo->image_width * 8L, (long) cinfo->block_size);
117 cinfo->output_height = (JDIMENSION)
118 jdiv_round_up((long) cinfo->image_height * 8L, (long) cinfo->block_size);
119 cinfo->min_DCT_h_scaled_size = 8;
120 cinfo->min_DCT_v_scaled_size = 8;
121 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 9) {
122 /* Provide 9/block_size scaling */
123 cinfo->output_width = (JDIMENSION)
124 jdiv_round_up((long) cinfo->image_width * 9L, (long) cinfo->block_size);
125 cinfo->output_height = (JDIMENSION)
126 jdiv_round_up((long) cinfo->image_height * 9L, (long) cinfo->block_size);
127 cinfo->min_DCT_h_scaled_size = 9;
128 cinfo->min_DCT_v_scaled_size = 9;
129 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 10) {
130 /* Provide 10/block_size scaling */
131 cinfo->output_width = (JDIMENSION)
132 jdiv_round_up((long) cinfo->image_width * 10L, (long) cinfo->block_size);
133 cinfo->output_height = (JDIMENSION)
134 jdiv_round_up((long) cinfo->image_height * 10L, (long) cinfo->block_size);
135 cinfo->min_DCT_h_scaled_size = 10;
136 cinfo->min_DCT_v_scaled_size = 10;
137 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 11) {
138 /* Provide 11/block_size scaling */
139 cinfo->output_width = (JDIMENSION)
140 jdiv_round_up((long) cinfo->image_width * 11L, (long) cinfo->block_size);
141 cinfo->output_height = (JDIMENSION)
142 jdiv_round_up((long) cinfo->image_height * 11L, (long) cinfo->block_size);
143 cinfo->min_DCT_h_scaled_size = 11;
144 cinfo->min_DCT_v_scaled_size = 11;
145 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 12) {
146 /* Provide 12/block_size scaling */
147 cinfo->output_width = (JDIMENSION)
148 jdiv_round_up((long) cinfo->image_width * 12L, (long) cinfo->block_size);
149 cinfo->output_height = (JDIMENSION)
150 jdiv_round_up((long) cinfo->image_height * 12L, (long) cinfo->block_size);
151 cinfo->min_DCT_h_scaled_size = 12;
152 cinfo->min_DCT_v_scaled_size = 12;
153 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 13) {
154 /* Provide 13/block_size scaling */
155 cinfo->output_width = (JDIMENSION)
156 jdiv_round_up((long) cinfo->image_width * 13L, (long) cinfo->block_size);
157 cinfo->output_height = (JDIMENSION)
158 jdiv_round_up((long) cinfo->image_height * 13L, (long) cinfo->block_size);
159 cinfo->min_DCT_h_scaled_size = 13;
160 cinfo->min_DCT_v_scaled_size = 13;
161 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 14) {
162 /* Provide 14/block_size scaling */
163 cinfo->output_width = (JDIMENSION)
164 jdiv_round_up((long) cinfo->image_width * 14L, (long) cinfo->block_size);
165 cinfo->output_height = (JDIMENSION)
166 jdiv_round_up((long) cinfo->image_height * 14L, (long) cinfo->block_size);
167 cinfo->min_DCT_h_scaled_size = 14;
168 cinfo->min_DCT_v_scaled_size = 14;
169 } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 15) {
170 /* Provide 15/block_size scaling */
171 cinfo->output_width = (JDIMENSION)
172 jdiv_round_up((long) cinfo->image_width * 15L, (long) cinfo->block_size);
173 cinfo->output_height = (JDIMENSION)
174 jdiv_round_up((long) cinfo->image_height * 15L, (long) cinfo->block_size);
175 cinfo->min_DCT_h_scaled_size = 15;
176 cinfo->min_DCT_v_scaled_size = 15;
177 } else {
178 /* Provide 16/block_size scaling */
179 cinfo->output_width = (JDIMENSION)
180 jdiv_round_up((long) cinfo->image_width * 16L, (long) cinfo->block_size);
181 cinfo->output_height = (JDIMENSION)
182 jdiv_round_up((long) cinfo->image_height * 16L, (long) cinfo->block_size);
183 cinfo->min_DCT_h_scaled_size = 16;
184 cinfo->min_DCT_v_scaled_size = 16;
185 }
186
187 /* Recompute dimensions of components */
188 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
189 ci++, compptr++) {
190 compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size;
191 compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size;
192 }
193
194#else /* !IDCT_SCALING_SUPPORTED */
195
196 /* Hardwire it to "no scaling" */
197 cinfo->output_width = cinfo->image_width;
198 cinfo->output_height = cinfo->image_height;
199 /* jdinput.c has already initialized DCT_scaled_size,
200 * and has computed unscaled downsampled_width and downsampled_height.
201 */
202
203#endif /* IDCT_SCALING_SUPPORTED */
204}
205
206
207LOCAL(void)
208initial_setup (j_decompress_ptr cinfo)
209/* Called once, when first SOS marker is reached */
210{
211 int ci;
212 jpeg_component_info *compptr;
213
214 /* Make sure image isn't bigger than I can handle */
215 if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
216 (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
217 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
218
219 /* For now, precision must match compiled-in value... */
220 if (cinfo->data_precision != BITS_IN_JSAMPLE)
221 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
222
223 /* Check that number of components won't exceed internal array sizes */
224 if (cinfo->num_components > MAX_COMPONENTS)
225 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
226 MAX_COMPONENTS);
227
228 /* Compute maximum sampling factors; check factor validity */
229 cinfo->max_h_samp_factor = 1;
230 cinfo->max_v_samp_factor = 1;
231 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
232 ci++, compptr++) {
233 if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
234 compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
235 ERREXIT(cinfo, JERR_BAD_SAMPLING);
236 cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
237 compptr->h_samp_factor);
238 cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
239 compptr->v_samp_factor);
240 }
241
242 /* Derive block_size, natural_order, and lim_Se */
243 if (cinfo->is_baseline || (cinfo->progressive_mode &&
244 cinfo->comps_in_scan)) { /* no pseudo SOS marker */
245 cinfo->block_size = DCTSIZE;
246 cinfo->natural_order = jpeg_natural_order;
247 cinfo->lim_Se = DCTSIZE2-1;
248 } else
249 switch (cinfo->Se) {
250 case (1*1-1):
251 cinfo->block_size = 1;
252 cinfo->natural_order = jpeg_natural_order; /* not needed */
253 cinfo->lim_Se = cinfo->Se;
254 break;
255 case (2*2-1):
256 cinfo->block_size = 2;
257 cinfo->natural_order = jpeg_natural_order2;
258 cinfo->lim_Se = cinfo->Se;
259 break;
260 case (3*3-1):
261 cinfo->block_size = 3;
262 cinfo->natural_order = jpeg_natural_order3;
263 cinfo->lim_Se = cinfo->Se;
264 break;
265 case (4*4-1):
266 cinfo->block_size = 4;
267 cinfo->natural_order = jpeg_natural_order4;
268 cinfo->lim_Se = cinfo->Se;
269 break;
270 case (5*5-1):
271 cinfo->block_size = 5;
272 cinfo->natural_order = jpeg_natural_order5;
273 cinfo->lim_Se = cinfo->Se;
274 break;
275 case (6*6-1):
276 cinfo->block_size = 6;
277 cinfo->natural_order = jpeg_natural_order6;
278 cinfo->lim_Se = cinfo->Se;
279 break;
280 case (7*7-1):
281 cinfo->block_size = 7;
282 cinfo->natural_order = jpeg_natural_order7;
283 cinfo->lim_Se = cinfo->Se;
284 break;
285 case (8*8-1):
286 cinfo->block_size = 8;
287 cinfo->natural_order = jpeg_natural_order;
288 cinfo->lim_Se = DCTSIZE2-1;
289 break;
290 case (9*9-1):
291 cinfo->block_size = 9;
292 cinfo->natural_order = jpeg_natural_order;
293 cinfo->lim_Se = DCTSIZE2-1;
294 break;
295 case (10*10-1):
296 cinfo->block_size = 10;
297 cinfo->natural_order = jpeg_natural_order;
298 cinfo->lim_Se = DCTSIZE2-1;
299 break;
300 case (11*11-1):
301 cinfo->block_size = 11;
302 cinfo->natural_order = jpeg_natural_order;
303 cinfo->lim_Se = DCTSIZE2-1;
304 break;
305 case (12*12-1):
306 cinfo->block_size = 12;
307 cinfo->natural_order = jpeg_natural_order;
308 cinfo->lim_Se = DCTSIZE2-1;
309 break;
310 case (13*13-1):
311 cinfo->block_size = 13;
312 cinfo->natural_order = jpeg_natural_order;
313 cinfo->lim_Se = DCTSIZE2-1;
314 break;
315 case (14*14-1):
316 cinfo->block_size = 14;
317 cinfo->natural_order = jpeg_natural_order;
318 cinfo->lim_Se = DCTSIZE2-1;
319 break;
320 case (15*15-1):
321 cinfo->block_size = 15;
322 cinfo->natural_order = jpeg_natural_order;
323 cinfo->lim_Se = DCTSIZE2-1;
324 break;
325 case (16*16-1):
326 cinfo->block_size = 16;
327 cinfo->natural_order = jpeg_natural_order;
328 cinfo->lim_Se = DCTSIZE2-1;
329 break;
330 default:
331 ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
332 cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
333 break;
334 }
335
336 /* We initialize DCT_scaled_size and min_DCT_scaled_size to block_size.
337 * In the full decompressor,
338 * this will be overridden by jpeg_calc_output_dimensions in jdmaster.c;
339 * but in the transcoder,
340 * jpeg_calc_output_dimensions is not used, so we must do it here.
341 */
342 cinfo->min_DCT_h_scaled_size = cinfo->block_size;
343 cinfo->min_DCT_v_scaled_size = cinfo->block_size;
344
345 /* Compute dimensions of components */
346 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
347 ci++, compptr++) {
348 compptr->DCT_h_scaled_size = cinfo->block_size;
349 compptr->DCT_v_scaled_size = cinfo->block_size;
350 /* Size in DCT blocks */
351 compptr->width_in_blocks = (JDIMENSION)
352 jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
353 (long) (cinfo->max_h_samp_factor * cinfo->block_size));
354 compptr->height_in_blocks = (JDIMENSION)
355 jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
356 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
357 /* downsampled_width and downsampled_height will also be overridden by
358 * jdmaster.c if we are doing full decompression. The transcoder library
359 * doesn't use these values, but the calling application might.
360 */
361 /* Size in samples */
362 compptr->downsampled_width = (JDIMENSION)
363 jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
364 (long) cinfo->max_h_samp_factor);
365 compptr->downsampled_height = (JDIMENSION)
366 jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
367 (long) cinfo->max_v_samp_factor);
368 /* Mark component needed, until color conversion says otherwise */
369 compptr->component_needed = TRUE;
370 /* Mark no quantization table yet saved for component */
371 compptr->quant_table = NULL;
372 }
373
374 /* Compute number of fully interleaved MCU rows. */
375 cinfo->total_iMCU_rows = (JDIMENSION)
376 jdiv_round_up((long) cinfo->image_height,
377 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
378
379 /* Decide whether file contains multiple scans */
380 if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
381 cinfo->inputctl->has_multiple_scans = TRUE;
382 else
383 cinfo->inputctl->has_multiple_scans = FALSE;
384}
385
386
387LOCAL(void)
388per_scan_setup (j_decompress_ptr cinfo)
389/* Do computations that are needed before processing a JPEG scan */
390/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */
391{
392 int ci, mcublks, tmp;
393 jpeg_component_info *compptr;
394
395 if (cinfo->comps_in_scan == 1) {
396
397 /* Noninterleaved (single-component) scan */
398 compptr = cinfo->cur_comp_info[0];
399
400 /* Overall image size in MCUs */
401 cinfo->MCUs_per_row = compptr->width_in_blocks;
402 cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
403
404 /* For noninterleaved scan, always one block per MCU */
405 compptr->MCU_width = 1;
406 compptr->MCU_height = 1;
407 compptr->MCU_blocks = 1;
408 compptr->MCU_sample_width = compptr->DCT_h_scaled_size;
409 compptr->last_col_width = 1;
410 /* For noninterleaved scans, it is convenient to define last_row_height
411 * as the number of block rows present in the last iMCU row.
412 */
413 tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
414 if (tmp == 0) tmp = compptr->v_samp_factor;
415 compptr->last_row_height = tmp;
416
417 /* Prepare array describing MCU composition */
418 cinfo->blocks_in_MCU = 1;
419 cinfo->MCU_membership[0] = 0;
420
421 } else {
422
423 /* Interleaved (multi-component) scan */
424 if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
425 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
426 MAX_COMPS_IN_SCAN);
427
428 /* Overall image size in MCUs */
429 cinfo->MCUs_per_row = (JDIMENSION)
430 jdiv_round_up((long) cinfo->image_width,
431 (long) (cinfo->max_h_samp_factor * cinfo->block_size));
432 cinfo->MCU_rows_in_scan = (JDIMENSION)
433 jdiv_round_up((long) cinfo->image_height,
434 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
435
436 cinfo->blocks_in_MCU = 0;
437
438 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
439 compptr = cinfo->cur_comp_info[ci];
440 /* Sampling factors give # of blocks of component in each MCU */
441 compptr->MCU_width = compptr->h_samp_factor;
442 compptr->MCU_height = compptr->v_samp_factor;
443 compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
444 compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size;
445 /* Figure number of non-dummy blocks in last MCU column & row */
446 tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
447 if (tmp == 0) tmp = compptr->MCU_width;
448 compptr->last_col_width = tmp;
449 tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
450 if (tmp == 0) tmp = compptr->MCU_height;
451 compptr->last_row_height = tmp;
452 /* Prepare array describing MCU composition */
453 mcublks = compptr->MCU_blocks;
454 if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
455 ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
456 while (mcublks-- > 0) {
457 cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
458 }
459 }
460
461 }
462}
463
464
465/*
466 * Save away a copy of the Q-table referenced by each component present
467 * in the current scan, unless already saved during a prior scan.
468 *
469 * In a multiple-scan JPEG file, the encoder could assign different components
470 * the same Q-table slot number, but change table definitions between scans
471 * so that each component uses a different Q-table. (The IJG encoder is not
472 * currently capable of doing this, but other encoders might.) Since we want
473 * to be able to dequantize all the components at the end of the file, this
474 * means that we have to save away the table actually used for each component.
475 * We do this by copying the table at the start of the first scan containing
476 * the component.
477 * The JPEG spec prohibits the encoder from changing the contents of a Q-table
478 * slot between scans of a component using that slot. If the encoder does so
479 * anyway, this decoder will simply use the Q-table values that were current
480 * at the start of the first scan for the component.
481 *
482 * The decompressor output side looks only at the saved quant tables,
483 * not at the current Q-table slots.
484 */
485
486LOCAL(void)
487latch_quant_tables (j_decompress_ptr cinfo)
488{
489 int ci, qtblno;
490 jpeg_component_info *compptr;
491 JQUANT_TBL * qtbl;
492
493 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
494 compptr = cinfo->cur_comp_info[ci];
495 /* No work if we already saved Q-table for this component */
496 if (compptr->quant_table != NULL)
497 continue;
498 /* Make sure specified quantization table is present */
499 qtblno = compptr->quant_tbl_no;
500 if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
501 cinfo->quant_tbl_ptrs[qtblno] == NULL)
502 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
503 /* OK, save away the quantization table */
504 qtbl = (JQUANT_TBL *)
505 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
506 SIZEOF(JQUANT_TBL));
507 MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
508 compptr->quant_table = qtbl;
509 }
510}
511
512
513/*
514 * Initialize the input modules to read a scan of compressed data.
515 * The first call to this is done by jdmaster.c after initializing
516 * the entire decompressor (during jpeg_start_decompress).
517 * Subsequent calls come from consume_markers, below.
518 */
519
520METHODDEF(void)
521start_input_pass (j_decompress_ptr cinfo)
522{
523 per_scan_setup(cinfo);
524 latch_quant_tables(cinfo);
525 (*cinfo->entropy->start_pass) (cinfo);
526 (*cinfo->coef->start_input_pass) (cinfo);
527 cinfo->inputctl->consume_input = cinfo->coef->consume_data;
528}
529
530
531/*
532 * Finish up after inputting a compressed-data scan.
533 * This is called by the coefficient controller after it has read all
534 * the expected data of the scan.
535 */
536
537METHODDEF(void)
538finish_input_pass (j_decompress_ptr cinfo)
539{
540 cinfo->inputctl->consume_input = consume_markers;
541}
542
543
544/*
545 * Read JPEG markers before, between, or after compressed-data scans.
546 * Change state as necessary when a new scan is reached.
547 * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
548 *
549 * The consume_input method pointer points either here or to the
550 * coefficient controller's consume_data routine, depending on whether
551 * we are reading a compressed data segment or inter-segment markers.
552 *
553 * Note: This function should NOT return a pseudo SOS marker (with zero
554 * component number) to the caller. A pseudo marker received by
555 * read_markers is processed and then skipped for other markers.
556 */
557
558METHODDEF(int)
559consume_markers (j_decompress_ptr cinfo)
560{
561 my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
562 int val;
563
564 if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
565 return JPEG_REACHED_EOI;
566
567 for (;;) { /* Loop to pass pseudo SOS marker */
568 val = (*cinfo->marker->read_markers) (cinfo);
569
570 switch (val) {
571 case JPEG_REACHED_SOS: /* Found SOS */
572 if (inputctl->inheaders) { /* 1st SOS */
573 if (inputctl->inheaders == 1)
574 initial_setup(cinfo);
575 if (cinfo->comps_in_scan == 0) { /* pseudo SOS marker */
576 inputctl->inheaders = 2;
577 break;
578 }
579 inputctl->inheaders = 0;
580 /* Note: start_input_pass must be called by jdmaster.c
581 * before any more input can be consumed. jdapimin.c is
582 * responsible for enforcing this sequencing.
583 */
584 } else { /* 2nd or later SOS marker */
585 if (! inputctl->pub.has_multiple_scans)
586 ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
587 if (cinfo->comps_in_scan == 0) /* unexpected pseudo SOS marker */
588 break;
589 start_input_pass(cinfo);
590 }
591 return val;
592 case JPEG_REACHED_EOI: /* Found EOI */
593 inputctl->pub.eoi_reached = TRUE;
594 if (inputctl->inheaders) { /* Tables-only datastream, apparently */
595 if (cinfo->marker->saw_SOF)
596 ERREXIT(cinfo, JERR_SOF_NO_SOS);
597 } else {
598 /* Prevent infinite loop in coef ctlr's decompress_data routine
599 * if user set output_scan_number larger than number of scans.
600 */
601 if (cinfo->output_scan_number > cinfo->input_scan_number)
602 cinfo->output_scan_number = cinfo->input_scan_number;
603 }
604 return val;
605 case JPEG_SUSPENDED:
606 return val;
607 default:
608 return val;
609 }
610 }
611}
612
613
614/*
615 * Reset state to begin a fresh datastream.
616 */
617
618METHODDEF(void)
619reset_input_controller (j_decompress_ptr cinfo)
620{
621 my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
622
623 inputctl->pub.consume_input = consume_markers;
624 inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
625 inputctl->pub.eoi_reached = FALSE;
626 inputctl->inheaders = 1;
627 /* Reset other modules */
628 (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
629 (*cinfo->marker->reset_marker_reader) (cinfo);
630 /* Reset progression state -- would be cleaner if entropy decoder did this */
631 cinfo->coef_bits = NULL;
632}
633
634
635/*
636 * Initialize the input controller module.
637 * This is called only once, when the decompression object is created.
638 */
639
640GLOBAL(void)
641jinit_input_controller (j_decompress_ptr cinfo)
642{
643 my_inputctl_ptr inputctl;
644
645 /* Create subobject in permanent pool */
646 inputctl = (my_inputctl_ptr)
647 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
648 SIZEOF(my_input_controller));
649 cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
650 /* Initialize method pointers */
651 inputctl->pub.consume_input = consume_markers;
652 inputctl->pub.reset_input_controller = reset_input_controller;
653 inputctl->pub.start_input_pass = start_input_pass;
654 inputctl->pub.finish_input_pass = finish_input_pass;
655 /* Initialize state: can't use reset_input_controller since we don't
656 * want to try to reset other modules yet.
657 */
658 inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
659 inputctl->pub.eoi_reached = FALSE;
660 inputctl->inheaders = 1;
661}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmainct.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmainct.c
new file mode 100644
index 0000000..995aa39
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmainct.c
@@ -0,0 +1,512 @@
1/*
2 * jdmainct.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains the main buffer controller for decompression.
9 * The main buffer lies between the JPEG decompressor proper and the
10 * post-processor; it holds downsampled data in the JPEG colorspace.
11 *
12 * Note that this code is bypassed in raw-data mode, since the application
13 * supplies the equivalent of the main buffer in that case.
14 */
15
16#define JPEG_INTERNALS
17#include "jinclude.h"
18#include "jpeglib.h"
19
20
21/*
22 * In the current system design, the main buffer need never be a full-image
23 * buffer; any full-height buffers will be found inside the coefficient or
24 * postprocessing controllers. Nonetheless, the main controller is not
25 * trivial. Its responsibility is to provide context rows for upsampling/
26 * rescaling, and doing this in an efficient fashion is a bit tricky.
27 *
28 * Postprocessor input data is counted in "row groups". A row group
29 * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
30 * sample rows of each component. (We require DCT_scaled_size values to be
31 * chosen such that these numbers are integers. In practice DCT_scaled_size
32 * values will likely be powers of two, so we actually have the stronger
33 * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)
34 * Upsampling will typically produce max_v_samp_factor pixel rows from each
35 * row group (times any additional scale factor that the upsampler is
36 * applying).
37 *
38 * The coefficient controller will deliver data to us one iMCU row at a time;
39 * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
40 * exactly min_DCT_scaled_size row groups. (This amount of data corresponds
41 * to one row of MCUs when the image is fully interleaved.) Note that the
42 * number of sample rows varies across components, but the number of row
43 * groups does not. Some garbage sample rows may be included in the last iMCU
44 * row at the bottom of the image.
45 *
46 * Depending on the vertical scaling algorithm used, the upsampler may need
47 * access to the sample row(s) above and below its current input row group.
48 * The upsampler is required to set need_context_rows TRUE at global selection
49 * time if so. When need_context_rows is FALSE, this controller can simply
50 * obtain one iMCU row at a time from the coefficient controller and dole it
51 * out as row groups to the postprocessor.
52 *
53 * When need_context_rows is TRUE, this controller guarantees that the buffer
54 * passed to postprocessing contains at least one row group's worth of samples
55 * above and below the row group(s) being processed. Note that the context
56 * rows "above" the first passed row group appear at negative row offsets in
57 * the passed buffer. At the top and bottom of the image, the required
58 * context rows are manufactured by duplicating the first or last real sample
59 * row; this avoids having special cases in the upsampling inner loops.
60 *
61 * The amount of context is fixed at one row group just because that's a
62 * convenient number for this controller to work with. The existing
63 * upsamplers really only need one sample row of context. An upsampler
64 * supporting arbitrary output rescaling might wish for more than one row
65 * group of context when shrinking the image; tough, we don't handle that.
66 * (This is justified by the assumption that downsizing will be handled mostly
67 * by adjusting the DCT_scaled_size values, so that the actual scale factor at
68 * the upsample step needn't be much less than one.)
69 *
70 * To provide the desired context, we have to retain the last two row groups
71 * of one iMCU row while reading in the next iMCU row. (The last row group
72 * can't be processed until we have another row group for its below-context,
73 * and so we have to save the next-to-last group too for its above-context.)
74 * We could do this most simply by copying data around in our buffer, but
75 * that'd be very slow. We can avoid copying any data by creating a rather
76 * strange pointer structure. Here's how it works. We allocate a workspace
77 * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
78 * of row groups per iMCU row). We create two sets of redundant pointers to
79 * the workspace. Labeling the physical row groups 0 to M+1, the synthesized
80 * pointer lists look like this:
81 * M+1 M-1
82 * master pointer --> 0 master pointer --> 0
83 * 1 1
84 * ... ...
85 * M-3 M-3
86 * M-2 M
87 * M-1 M+1
88 * M M-2
89 * M+1 M-1
90 * 0 0
91 * We read alternate iMCU rows using each master pointer; thus the last two
92 * row groups of the previous iMCU row remain un-overwritten in the workspace.
93 * The pointer lists are set up so that the required context rows appear to
94 * be adjacent to the proper places when we pass the pointer lists to the
95 * upsampler.
96 *
97 * The above pictures describe the normal state of the pointer lists.
98 * At top and bottom of the image, we diddle the pointer lists to duplicate
99 * the first or last sample row as necessary (this is cheaper than copying
100 * sample rows around).
101 *
102 * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
103 * situation each iMCU row provides only one row group so the buffering logic
104 * must be different (eg, we must read two iMCU rows before we can emit the
105 * first row group). For now, we simply do not support providing context
106 * rows when min_DCT_scaled_size is 1. That combination seems unlikely to
107 * be worth providing --- if someone wants a 1/8th-size preview, they probably
108 * want it quick and dirty, so a context-free upsampler is sufficient.
109 */
110
111
112/* Private buffer controller object */
113
114typedef struct {
115 struct jpeg_d_main_controller pub; /* public fields */
116
117 /* Pointer to allocated workspace (M or M+2 row groups). */
118 JSAMPARRAY buffer[MAX_COMPONENTS];
119
120 boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
121 JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
122
123 /* Remaining fields are only used in the context case. */
124
125 /* These are the master pointers to the funny-order pointer lists. */
126 JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
127
128 int whichptr; /* indicates which pointer set is now in use */
129 int context_state; /* process_data state machine status */
130 JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
131 JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
132} my_main_controller;
133
134typedef my_main_controller * my_main_ptr;
135
136/* context_state values: */
137#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */
138#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */
139#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */
140
141
142/* Forward declarations */
143METHODDEF(void) process_data_simple_main
144 JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
145 JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
146METHODDEF(void) process_data_context_main
147 JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
148 JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
149#ifdef QUANT_2PASS_SUPPORTED
150METHODDEF(void) process_data_crank_post
151 JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
152 JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
153#endif
154
155
156LOCAL(void)
157alloc_funny_pointers (j_decompress_ptr cinfo)
158/* Allocate space for the funny pointer lists.
159 * This is done only once, not once per pass.
160 */
161{
162 my_main_ptr main = (my_main_ptr) cinfo->main;
163 int ci, rgroup;
164 int M = cinfo->min_DCT_v_scaled_size;
165 jpeg_component_info *compptr;
166 JSAMPARRAY xbuf;
167
168 /* Get top-level space for component array pointers.
169 * We alloc both arrays with one call to save a few cycles.
170 */
171 main->xbuffer[0] = (JSAMPIMAGE)
172 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
173 cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
174 main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
175
176 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
177 ci++, compptr++) {
178 rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
179 cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
180 /* Get space for pointer lists --- M+4 row groups in each list.
181 * We alloc both pointer lists with one call to save a few cycles.
182 */
183 xbuf = (JSAMPARRAY)
184 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
185 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
186 xbuf += rgroup; /* want one row group at negative offsets */
187 main->xbuffer[0][ci] = xbuf;
188 xbuf += rgroup * (M + 4);
189 main->xbuffer[1][ci] = xbuf;
190 }
191}
192
193
194LOCAL(void)
195make_funny_pointers (j_decompress_ptr cinfo)
196/* Create the funny pointer lists discussed in the comments above.
197 * The actual workspace is already allocated (in main->buffer),
198 * and the space for the pointer lists is allocated too.
199 * This routine just fills in the curiously ordered lists.
200 * This will be repeated at the beginning of each pass.
201 */
202{
203 my_main_ptr main = (my_main_ptr) cinfo->main;
204 int ci, i, rgroup;
205 int M = cinfo->min_DCT_v_scaled_size;
206 jpeg_component_info *compptr;
207 JSAMPARRAY buf, xbuf0, xbuf1;
208
209 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
210 ci++, compptr++) {
211 rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
212 cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
213 xbuf0 = main->xbuffer[0][ci];
214 xbuf1 = main->xbuffer[1][ci];
215 /* First copy the workspace pointers as-is */
216 buf = main->buffer[ci];
217 for (i = 0; i < rgroup * (M + 2); i++) {
218 xbuf0[i] = xbuf1[i] = buf[i];
219 }
220 /* In the second list, put the last four row groups in swapped order */
221 for (i = 0; i < rgroup * 2; i++) {
222 xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];
223 xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];
224 }
225 /* The wraparound pointers at top and bottom will be filled later
226 * (see set_wraparound_pointers, below). Initially we want the "above"
227 * pointers to duplicate the first actual data line. This only needs
228 * to happen in xbuffer[0].
229 */
230 for (i = 0; i < rgroup; i++) {
231 xbuf0[i - rgroup] = xbuf0[0];
232 }
233 }
234}
235
236
237LOCAL(void)
238set_wraparound_pointers (j_decompress_ptr cinfo)
239/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
240 * This changes the pointer list state from top-of-image to the normal state.
241 */
242{
243 my_main_ptr main = (my_main_ptr) cinfo->main;
244 int ci, i, rgroup;
245 int M = cinfo->min_DCT_v_scaled_size;
246 jpeg_component_info *compptr;
247 JSAMPARRAY xbuf0, xbuf1;
248
249 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
250 ci++, compptr++) {
251 rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
252 cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
253 xbuf0 = main->xbuffer[0][ci];
254 xbuf1 = main->xbuffer[1][ci];
255 for (i = 0; i < rgroup; i++) {
256 xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
257 xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
258 xbuf0[rgroup*(M+2) + i] = xbuf0[i];
259 xbuf1[rgroup*(M+2) + i] = xbuf1[i];
260 }
261 }
262}
263
264
265LOCAL(void)
266set_bottom_pointers (j_decompress_ptr cinfo)
267/* Change the pointer lists to duplicate the last sample row at the bottom
268 * of the image. whichptr indicates which xbuffer holds the final iMCU row.
269 * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
270 */
271{
272 my_main_ptr main = (my_main_ptr) cinfo->main;
273 int ci, i, rgroup, iMCUheight, rows_left;
274 jpeg_component_info *compptr;
275 JSAMPARRAY xbuf;
276
277 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
278 ci++, compptr++) {
279 /* Count sample rows in one iMCU row and in one row group */
280 iMCUheight = compptr->v_samp_factor * compptr->DCT_v_scaled_size;
281 rgroup = iMCUheight / cinfo->min_DCT_v_scaled_size;
282 /* Count nondummy sample rows remaining for this component */
283 rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);
284 if (rows_left == 0) rows_left = iMCUheight;
285 /* Count nondummy row groups. Should get same answer for each component,
286 * so we need only do it once.
287 */
288 if (ci == 0) {
289 main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
290 }
291 /* Duplicate the last real sample row rgroup*2 times; this pads out the
292 * last partial rowgroup and ensures at least one full rowgroup of context.
293 */
294 xbuf = main->xbuffer[main->whichptr][ci];
295 for (i = 0; i < rgroup * 2; i++) {
296 xbuf[rows_left + i] = xbuf[rows_left-1];
297 }
298 }
299}
300
301
302/*
303 * Initialize for a processing pass.
304 */
305
306METHODDEF(void)
307start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
308{
309 my_main_ptr main = (my_main_ptr) cinfo->main;
310
311 switch (pass_mode) {
312 case JBUF_PASS_THRU:
313 if (cinfo->upsample->need_context_rows) {
314 main->pub.process_data = process_data_context_main;
315 make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
316 main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
317 main->context_state = CTX_PREPARE_FOR_IMCU;
318 main->iMCU_row_ctr = 0;
319 } else {
320 /* Simple case with no context needed */
321 main->pub.process_data = process_data_simple_main;
322 }
323 main->buffer_full = FALSE; /* Mark buffer empty */
324 main->rowgroup_ctr = 0;
325 break;
326#ifdef QUANT_2PASS_SUPPORTED
327 case JBUF_CRANK_DEST:
328 /* For last pass of 2-pass quantization, just crank the postprocessor */
329 main->pub.process_data = process_data_crank_post;
330 break;
331#endif
332 default:
333 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
334 break;
335 }
336}
337
338
339/*
340 * Process some data.
341 * This handles the simple case where no context is required.
342 */
343
344METHODDEF(void)
345process_data_simple_main (j_decompress_ptr cinfo,
346 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
347 JDIMENSION out_rows_avail)
348{
349 my_main_ptr main = (my_main_ptr) cinfo->main;
350 JDIMENSION rowgroups_avail;
351
352 /* Read input data if we haven't filled the main buffer yet */
353 if (! main->buffer_full) {
354 if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
355 return; /* suspension forced, can do nothing more */
356 main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
357 }
358
359 /* There are always min_DCT_scaled_size row groups in an iMCU row. */
360 rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
361 /* Note: at the bottom of the image, we may pass extra garbage row groups
362 * to the postprocessor. The postprocessor has to check for bottom
363 * of image anyway (at row resolution), so no point in us doing it too.
364 */
365
366 /* Feed the postprocessor */
367 (*cinfo->post->post_process_data) (cinfo, main->buffer,
368 &main->rowgroup_ctr, rowgroups_avail,
369 output_buf, out_row_ctr, out_rows_avail);
370
371 /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
372 if (main->rowgroup_ctr >= rowgroups_avail) {
373 main->buffer_full = FALSE;
374 main->rowgroup_ctr = 0;
375 }
376}
377
378
379/*
380 * Process some data.
381 * This handles the case where context rows must be provided.
382 */
383
384METHODDEF(void)
385process_data_context_main (j_decompress_ptr cinfo,
386 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
387 JDIMENSION out_rows_avail)
388{
389 my_main_ptr main = (my_main_ptr) cinfo->main;
390
391 /* Read input data if we haven't filled the main buffer yet */
392 if (! main->buffer_full) {
393 if (! (*cinfo->coef->decompress_data) (cinfo,
394 main->xbuffer[main->whichptr]))
395 return; /* suspension forced, can do nothing more */
396 main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
397 main->iMCU_row_ctr++; /* count rows received */
398 }
399
400 /* Postprocessor typically will not swallow all the input data it is handed
401 * in one call (due to filling the output buffer first). Must be prepared
402 * to exit and restart. This switch lets us keep track of how far we got.
403 * Note that each case falls through to the next on successful completion.
404 */
405 switch (main->context_state) {
406 case CTX_POSTPONED_ROW:
407 /* Call postprocessor using previously set pointers for postponed row */
408 (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
409 &main->rowgroup_ctr, main->rowgroups_avail,
410 output_buf, out_row_ctr, out_rows_avail);
411 if (main->rowgroup_ctr < main->rowgroups_avail)
412 return; /* Need to suspend */
413 main->context_state = CTX_PREPARE_FOR_IMCU;
414 if (*out_row_ctr >= out_rows_avail)
415 return; /* Postprocessor exactly filled output buf */
416 /*FALLTHROUGH*/
417 case CTX_PREPARE_FOR_IMCU:
418 /* Prepare to process first M-1 row groups of this iMCU row */
419 main->rowgroup_ctr = 0;
420 main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1);
421 /* Check for bottom of image: if so, tweak pointers to "duplicate"
422 * the last sample row, and adjust rowgroups_avail to ignore padding rows.
423 */
424 if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
425 set_bottom_pointers(cinfo);
426 main->context_state = CTX_PROCESS_IMCU;
427 /*FALLTHROUGH*/
428 case CTX_PROCESS_IMCU:
429 /* Call postprocessor using previously set pointers */
430 (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
431 &main->rowgroup_ctr, main->rowgroups_avail,
432 output_buf, out_row_ctr, out_rows_avail);
433 if (main->rowgroup_ctr < main->rowgroups_avail)
434 return; /* Need to suspend */
435 /* After the first iMCU, change wraparound pointers to normal state */
436 if (main->iMCU_row_ctr == 1)
437 set_wraparound_pointers(cinfo);
438 /* Prepare to load new iMCU row using other xbuffer list */
439 main->whichptr ^= 1; /* 0=>1 or 1=>0 */
440 main->buffer_full = FALSE;
441 /* Still need to process last row group of this iMCU row, */
442 /* which is saved at index M+1 of the other xbuffer */
443 main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1);
444 main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2);
445 main->context_state = CTX_POSTPONED_ROW;
446 }
447}
448
449
450/*
451 * Process some data.
452 * Final pass of two-pass quantization: just call the postprocessor.
453 * Source data will be the postprocessor controller's internal buffer.
454 */
455
456#ifdef QUANT_2PASS_SUPPORTED
457
458METHODDEF(void)
459process_data_crank_post (j_decompress_ptr cinfo,
460 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
461 JDIMENSION out_rows_avail)
462{
463 (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,
464 (JDIMENSION *) NULL, (JDIMENSION) 0,
465 output_buf, out_row_ctr, out_rows_avail);
466}
467
468#endif /* QUANT_2PASS_SUPPORTED */
469
470
471/*
472 * Initialize main buffer controller.
473 */
474
475GLOBAL(void)
476jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
477{
478 my_main_ptr main;
479 int ci, rgroup, ngroups;
480 jpeg_component_info *compptr;
481
482 main = (my_main_ptr)
483 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
484 SIZEOF(my_main_controller));
485 cinfo->main = (struct jpeg_d_main_controller *) main;
486 main->pub.start_pass = start_pass_main;
487
488 if (need_full_buffer) /* shouldn't happen */
489 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
490
491 /* Allocate the workspace.
492 * ngroups is the number of row groups we need.
493 */
494 if (cinfo->upsample->need_context_rows) {
495 if (cinfo->min_DCT_v_scaled_size < 2) /* unsupported, see comments above */
496 ERREXIT(cinfo, JERR_NOTIMPL);
497 alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
498 ngroups = cinfo->min_DCT_v_scaled_size + 2;
499 } else {
500 ngroups = cinfo->min_DCT_v_scaled_size;
501 }
502
503 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
504 ci++, compptr++) {
505 rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
506 cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
507 main->buffer[ci] = (*cinfo->mem->alloc_sarray)
508 ((j_common_ptr) cinfo, JPOOL_IMAGE,
509 compptr->width_in_blocks * compptr->DCT_h_scaled_size,
510 (JDIMENSION) (rgroup * ngroups));
511 }
512}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmarker.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmarker.c
new file mode 100644
index 0000000..e062822
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmarker.c
@@ -0,0 +1,1406 @@
1/*
2 * jdmarker.c
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * Modified 2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains routines to decode JPEG datastream markers.
10 * Most of the complexity arises from our desire to support input
11 * suspension: if not all of the data for a marker is available,
12 * we must exit back to the application. On resumption, we reprocess
13 * the marker.
14 */
15
16#define JPEG_INTERNALS
17#include "jinclude.h"
18#include "jpeglib.h"
19
20
21typedef enum { /* JPEG marker codes */
22 M_SOF0 = 0xc0,
23 M_SOF1 = 0xc1,
24 M_SOF2 = 0xc2,
25 M_SOF3 = 0xc3,
26
27 M_SOF5 = 0xc5,
28 M_SOF6 = 0xc6,
29 M_SOF7 = 0xc7,
30
31 M_JPG = 0xc8,
32 M_SOF9 = 0xc9,
33 M_SOF10 = 0xca,
34 M_SOF11 = 0xcb,
35
36 M_SOF13 = 0xcd,
37 M_SOF14 = 0xce,
38 M_SOF15 = 0xcf,
39
40 M_DHT = 0xc4,
41
42 M_DAC = 0xcc,
43
44 M_RST0 = 0xd0,
45 M_RST1 = 0xd1,
46 M_RST2 = 0xd2,
47 M_RST3 = 0xd3,
48 M_RST4 = 0xd4,
49 M_RST5 = 0xd5,
50 M_RST6 = 0xd6,
51 M_RST7 = 0xd7,
52
53 M_SOI = 0xd8,
54 M_EOI = 0xd9,
55 M_SOS = 0xda,
56 M_DQT = 0xdb,
57 M_DNL = 0xdc,
58 M_DRI = 0xdd,
59 M_DHP = 0xde,
60 M_EXP = 0xdf,
61
62 M_APP0 = 0xe0,
63 M_APP1 = 0xe1,
64 M_APP2 = 0xe2,
65 M_APP3 = 0xe3,
66 M_APP4 = 0xe4,
67 M_APP5 = 0xe5,
68 M_APP6 = 0xe6,
69 M_APP7 = 0xe7,
70 M_APP8 = 0xe8,
71 M_APP9 = 0xe9,
72 M_APP10 = 0xea,
73 M_APP11 = 0xeb,
74 M_APP12 = 0xec,
75 M_APP13 = 0xed,
76 M_APP14 = 0xee,
77 M_APP15 = 0xef,
78
79 M_JPG0 = 0xf0,
80 M_JPG13 = 0xfd,
81 M_COM = 0xfe,
82
83 M_TEM = 0x01,
84
85 M_ERROR = 0x100
86} JPEG_MARKER;
87
88
89/* Private state */
90
91typedef struct {
92 struct jpeg_marker_reader pub; /* public fields */
93
94 /* Application-overridable marker processing methods */
95 jpeg_marker_parser_method process_COM;
96 jpeg_marker_parser_method process_APPn[16];
97
98 /* Limit on marker data length to save for each marker type */
99 unsigned int length_limit_COM;
100 unsigned int length_limit_APPn[16];
101
102 /* Status of COM/APPn marker saving */
103 jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */
104 unsigned int bytes_read; /* data bytes read so far in marker */
105 /* Note: cur_marker is not linked into marker_list until it's all read. */
106} my_marker_reader;
107
108typedef my_marker_reader * my_marker_ptr;
109
110
111/*
112 * Macros for fetching data from the data source module.
113 *
114 * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect
115 * the current restart point; we update them only when we have reached a
116 * suitable place to restart if a suspension occurs.
117 */
118
119/* Declare and initialize local copies of input pointer/count */
120#define INPUT_VARS(cinfo) \
121 struct jpeg_source_mgr * datasrc = (cinfo)->src; \
122 const JOCTET * next_input_byte = datasrc->next_input_byte; \
123 size_t bytes_in_buffer = datasrc->bytes_in_buffer
124
125/* Unload the local copies --- do this only at a restart boundary */
126#define INPUT_SYNC(cinfo) \
127 ( datasrc->next_input_byte = next_input_byte, \
128 datasrc->bytes_in_buffer = bytes_in_buffer )
129
130/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */
131#define INPUT_RELOAD(cinfo) \
132 ( next_input_byte = datasrc->next_input_byte, \
133 bytes_in_buffer = datasrc->bytes_in_buffer )
134
135/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.
136 * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,
137 * but we must reload the local copies after a successful fill.
138 */
139#define MAKE_BYTE_AVAIL(cinfo,action) \
140 if (bytes_in_buffer == 0) { \
141 if (! (*datasrc->fill_input_buffer) (cinfo)) \
142 { action; } \
143 INPUT_RELOAD(cinfo); \
144 }
145
146/* Read a byte into variable V.
147 * If must suspend, take the specified action (typically "return FALSE").
148 */
149#define INPUT_BYTE(cinfo,V,action) \
150 MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
151 bytes_in_buffer--; \
152 V = GETJOCTET(*next_input_byte++); )
153
154/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
155 * V should be declared unsigned int or perhaps INT32.
156 */
157#define INPUT_2BYTES(cinfo,V,action) \
158 MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
159 bytes_in_buffer--; \
160 V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \
161 MAKE_BYTE_AVAIL(cinfo,action); \
162 bytes_in_buffer--; \
163 V += GETJOCTET(*next_input_byte++); )
164
165
166/*
167 * Routines to process JPEG markers.
168 *
169 * Entry condition: JPEG marker itself has been read and its code saved
170 * in cinfo->unread_marker; input restart point is just after the marker.
171 *
172 * Exit: if return TRUE, have read and processed any parameters, and have
173 * updated the restart point to point after the parameters.
174 * If return FALSE, was forced to suspend before reaching end of
175 * marker parameters; restart point has not been moved. Same routine
176 * will be called again after application supplies more input data.
177 *
178 * This approach to suspension assumes that all of a marker's parameters
179 * can fit into a single input bufferload. This should hold for "normal"
180 * markers. Some COM/APPn markers might have large parameter segments
181 * that might not fit. If we are simply dropping such a marker, we use
182 * skip_input_data to get past it, and thereby put the problem on the
183 * source manager's shoulders. If we are saving the marker's contents
184 * into memory, we use a slightly different convention: when forced to
185 * suspend, the marker processor updates the restart point to the end of
186 * what its consumed (ie, the end of the buffer) before returning FALSE.
187 * On resumption, cinfo->unread_marker still contains the marker code,
188 * but the data source will point to the next chunk of marker data.
189 * The marker processor must retain internal state to deal with this.
190 *
191 * Note that we don't bother to avoid duplicate trace messages if a
192 * suspension occurs within marker parameters. Other side effects
193 * require more care.
194 */
195
196
197LOCAL(boolean)
198get_soi (j_decompress_ptr cinfo)
199/* Process an SOI marker */
200{
201 int i;
202
203 TRACEMS(cinfo, 1, JTRC_SOI);
204
205 if (cinfo->marker->saw_SOI)
206 ERREXIT(cinfo, JERR_SOI_DUPLICATE);
207
208 /* Reset all parameters that are defined to be reset by SOI */
209
210 for (i = 0; i < NUM_ARITH_TBLS; i++) {
211 cinfo->arith_dc_L[i] = 0;
212 cinfo->arith_dc_U[i] = 1;
213 cinfo->arith_ac_K[i] = 5;
214 }
215 cinfo->restart_interval = 0;
216
217 /* Set initial assumptions for colorspace etc */
218
219 cinfo->jpeg_color_space = JCS_UNKNOWN;
220 cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */
221
222 cinfo->saw_JFIF_marker = FALSE;
223 cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
224 cinfo->JFIF_minor_version = 1;
225 cinfo->density_unit = 0;
226 cinfo->X_density = 1;
227 cinfo->Y_density = 1;
228 cinfo->saw_Adobe_marker = FALSE;
229 cinfo->Adobe_transform = 0;
230
231 cinfo->marker->saw_SOI = TRUE;
232
233 return TRUE;
234}
235
236
237LOCAL(boolean)
238get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog,
239 boolean is_arith)
240/* Process a SOFn marker */
241{
242 INT32 length;
243 int c, ci;
244 jpeg_component_info * compptr;
245 INPUT_VARS(cinfo);
246
247 cinfo->is_baseline = is_baseline;
248 cinfo->progressive_mode = is_prog;
249 cinfo->arith_code = is_arith;
250
251 INPUT_2BYTES(cinfo, length, return FALSE);
252
253 INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
254 INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);
255 INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);
256 INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);
257
258 length -= 8;
259
260 TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,
261 (int) cinfo->image_width, (int) cinfo->image_height,
262 cinfo->num_components);
263
264 if (cinfo->marker->saw_SOF)
265 ERREXIT(cinfo, JERR_SOF_DUPLICATE);
266
267 /* We don't support files in which the image height is initially specified */
268 /* as 0 and is later redefined by DNL. As long as we have to check that, */
269 /* might as well have a general sanity check. */
270 if (cinfo->image_height <= 0 || cinfo->image_width <= 0
271 || cinfo->num_components <= 0)
272 ERREXIT(cinfo, JERR_EMPTY_IMAGE);
273
274 if (length != (cinfo->num_components * 3))
275 ERREXIT(cinfo, JERR_BAD_LENGTH);
276
277 if (cinfo->comp_info == NULL) /* do only once, even if suspend */
278 cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
279 ((j_common_ptr) cinfo, JPOOL_IMAGE,
280 cinfo->num_components * SIZEOF(jpeg_component_info));
281
282 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
283 ci++, compptr++) {
284 compptr->component_index = ci;
285 INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
286 INPUT_BYTE(cinfo, c, return FALSE);
287 compptr->h_samp_factor = (c >> 4) & 15;
288 compptr->v_samp_factor = (c ) & 15;
289 INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);
290
291 TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
292 compptr->component_id, compptr->h_samp_factor,
293 compptr->v_samp_factor, compptr->quant_tbl_no);
294 }
295
296 cinfo->marker->saw_SOF = TRUE;
297
298 INPUT_SYNC(cinfo);
299 return TRUE;
300}
301
302
303LOCAL(boolean)
304get_sos (j_decompress_ptr cinfo)
305/* Process a SOS marker */
306{
307 INT32 length;
308 int i, ci, n, c, cc;
309 jpeg_component_info * compptr;
310 INPUT_VARS(cinfo);
311
312 if (! cinfo->marker->saw_SOF)
313 ERREXIT(cinfo, JERR_SOS_NO_SOF);
314
315 INPUT_2BYTES(cinfo, length, return FALSE);
316
317 INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */
318
319 TRACEMS1(cinfo, 1, JTRC_SOS, n);
320
321 if (length != (n * 2 + 6) || n > MAX_COMPS_IN_SCAN ||
322 (n == 0 && !cinfo->progressive_mode))
323 /* pseudo SOS marker only allowed in progressive mode */
324 ERREXIT(cinfo, JERR_BAD_LENGTH);
325
326 cinfo->comps_in_scan = n;
327
328 /* Collect the component-spec parameters */
329
330 for (i = 0; i < n; i++) {
331 INPUT_BYTE(cinfo, cc, return FALSE);
332 INPUT_BYTE(cinfo, c, return FALSE);
333
334 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
335 ci++, compptr++) {
336 if (cc == compptr->component_id)
337 goto id_found;
338 }
339
340 ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
341
342 id_found:
343
344 cinfo->cur_comp_info[i] = compptr;
345 compptr->dc_tbl_no = (c >> 4) & 15;
346 compptr->ac_tbl_no = (c ) & 15;
347
348 TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
349 compptr->dc_tbl_no, compptr->ac_tbl_no);
350 }
351
352 /* Collect the additional scan parameters Ss, Se, Ah/Al. */
353 INPUT_BYTE(cinfo, c, return FALSE);
354 cinfo->Ss = c;
355 INPUT_BYTE(cinfo, c, return FALSE);
356 cinfo->Se = c;
357 INPUT_BYTE(cinfo, c, return FALSE);
358 cinfo->Ah = (c >> 4) & 15;
359 cinfo->Al = (c ) & 15;
360
361 TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,
362 cinfo->Ah, cinfo->Al);
363
364 /* Prepare to scan data & restart markers */
365 cinfo->marker->next_restart_num = 0;
366
367 /* Count another (non-pseudo) SOS marker */
368 if (n) cinfo->input_scan_number++;
369
370 INPUT_SYNC(cinfo);
371 return TRUE;
372}
373
374
375#ifdef D_ARITH_CODING_SUPPORTED
376
377LOCAL(boolean)
378get_dac (j_decompress_ptr cinfo)
379/* Process a DAC marker */
380{
381 INT32 length;
382 int index, val;
383 INPUT_VARS(cinfo);
384
385 INPUT_2BYTES(cinfo, length, return FALSE);
386 length -= 2;
387
388 while (length > 0) {
389 INPUT_BYTE(cinfo, index, return FALSE);
390 INPUT_BYTE(cinfo, val, return FALSE);
391
392 length -= 2;
393
394 TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
395
396 if (index < 0 || index >= (2*NUM_ARITH_TBLS))
397 ERREXIT1(cinfo, JERR_DAC_INDEX, index);
398
399 if (index >= NUM_ARITH_TBLS) { /* define AC table */
400 cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;
401 } else { /* define DC table */
402 cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);
403 cinfo->arith_dc_U[index] = (UINT8) (val >> 4);
404 if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
405 ERREXIT1(cinfo, JERR_DAC_VALUE, val);
406 }
407 }
408
409 if (length != 0)
410 ERREXIT(cinfo, JERR_BAD_LENGTH);
411
412 INPUT_SYNC(cinfo);
413 return TRUE;
414}
415
416#else /* ! D_ARITH_CODING_SUPPORTED */
417
418#define get_dac(cinfo) skip_variable(cinfo)
419
420#endif /* D_ARITH_CODING_SUPPORTED */
421
422
423LOCAL(boolean)
424get_dht (j_decompress_ptr cinfo)
425/* Process a DHT marker */
426{
427 INT32 length;
428 UINT8 bits[17];
429 UINT8 huffval[256];
430 int i, index, count;
431 JHUFF_TBL **htblptr;
432 INPUT_VARS(cinfo);
433
434 INPUT_2BYTES(cinfo, length, return FALSE);
435 length -= 2;
436
437 while (length > 16) {
438 INPUT_BYTE(cinfo, index, return FALSE);
439
440 TRACEMS1(cinfo, 1, JTRC_DHT, index);
441
442 bits[0] = 0;
443 count = 0;
444 for (i = 1; i <= 16; i++) {
445 INPUT_BYTE(cinfo, bits[i], return FALSE);
446 count += bits[i];
447 }
448
449 length -= 1 + 16;
450
451 TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
452 bits[1], bits[2], bits[3], bits[4],
453 bits[5], bits[6], bits[7], bits[8]);
454 TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
455 bits[9], bits[10], bits[11], bits[12],
456 bits[13], bits[14], bits[15], bits[16]);
457
458 /* Here we just do minimal validation of the counts to avoid walking
459 * off the end of our table space. jdhuff.c will check more carefully.
460 */
461 if (count > 256 || ((INT32) count) > length)
462 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
463
464 for (i = 0; i < count; i++)
465 INPUT_BYTE(cinfo, huffval[i], return FALSE);
466
467 length -= count;
468
469 if (index & 0x10) { /* AC table definition */
470 index -= 0x10;
471 htblptr = &cinfo->ac_huff_tbl_ptrs[index];
472 } else { /* DC table definition */
473 htblptr = &cinfo->dc_huff_tbl_ptrs[index];
474 }
475
476 if (index < 0 || index >= NUM_HUFF_TBLS)
477 ERREXIT1(cinfo, JERR_DHT_INDEX, index);
478
479 if (*htblptr == NULL)
480 *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
481
482 MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
483 MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
484 }
485
486 if (length != 0)
487 ERREXIT(cinfo, JERR_BAD_LENGTH);
488
489 INPUT_SYNC(cinfo);
490 return TRUE;
491}
492
493
494LOCAL(boolean)
495get_dqt (j_decompress_ptr cinfo)
496/* Process a DQT marker */
497{
498 INT32 length, count, i;
499 int n, prec;
500 unsigned int tmp;
501 JQUANT_TBL *quant_ptr;
502 const int *natural_order;
503 INPUT_VARS(cinfo);
504
505 INPUT_2BYTES(cinfo, length, return FALSE);
506 length -= 2;
507
508 while (length > 0) {
509 length--;
510 INPUT_BYTE(cinfo, n, return FALSE);
511 prec = n >> 4;
512 n &= 0x0F;
513
514 TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
515
516 if (n >= NUM_QUANT_TBLS)
517 ERREXIT1(cinfo, JERR_DQT_INDEX, n);
518
519 if (cinfo->quant_tbl_ptrs[n] == NULL)
520 cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);
521 quant_ptr = cinfo->quant_tbl_ptrs[n];
522
523 if (prec) {
524 if (length < DCTSIZE2 * 2) {
525 /* Initialize full table for safety. */
526 for (i = 0; i < DCTSIZE2; i++) {
527 quant_ptr->quantval[i] = 1;
528 }
529 count = length >> 1;
530 } else
531 count = DCTSIZE2;
532 } else {
533 if (length < DCTSIZE2) {
534 /* Initialize full table for safety. */
535 for (i = 0; i < DCTSIZE2; i++) {
536 quant_ptr->quantval[i] = 1;
537 }
538 count = length;
539 } else
540 count = DCTSIZE2;
541 }
542
543 switch (count) {
544 case (2*2): natural_order = jpeg_natural_order2; break;
545 case (3*3): natural_order = jpeg_natural_order3; break;
546 case (4*4): natural_order = jpeg_natural_order4; break;
547 case (5*5): natural_order = jpeg_natural_order5; break;
548 case (6*6): natural_order = jpeg_natural_order6; break;
549 case (7*7): natural_order = jpeg_natural_order7; break;
550 default: natural_order = jpeg_natural_order; break;
551 }
552
553 for (i = 0; i < count; i++) {
554 if (prec)
555 INPUT_2BYTES(cinfo, tmp, return FALSE);
556 else
557 INPUT_BYTE(cinfo, tmp, return FALSE);
558 /* We convert the zigzag-order table to natural array order. */
559 quant_ptr->quantval[natural_order[i]] = (UINT16) tmp;
560 }
561
562 if (cinfo->err->trace_level >= 2) {
563 for (i = 0; i < DCTSIZE2; i += 8) {
564 TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
565 quant_ptr->quantval[i], quant_ptr->quantval[i+1],
566 quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],
567 quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],
568 quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);
569 }
570 }
571
572 length -= count;
573 if (prec) length -= count;
574 }
575
576 if (length != 0)
577 ERREXIT(cinfo, JERR_BAD_LENGTH);
578
579 INPUT_SYNC(cinfo);
580 return TRUE;
581}
582
583
584LOCAL(boolean)
585get_dri (j_decompress_ptr cinfo)
586/* Process a DRI marker */
587{
588 INT32 length;
589 unsigned int tmp;
590 INPUT_VARS(cinfo);
591
592 INPUT_2BYTES(cinfo, length, return FALSE);
593
594 if (length != 4)
595 ERREXIT(cinfo, JERR_BAD_LENGTH);
596
597 INPUT_2BYTES(cinfo, tmp, return FALSE);
598
599 TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
600
601 cinfo->restart_interval = tmp;
602
603 INPUT_SYNC(cinfo);
604 return TRUE;
605}
606
607
608/*
609 * Routines for processing APPn and COM markers.
610 * These are either saved in memory or discarded, per application request.
611 * APP0 and APP14 are specially checked to see if they are
612 * JFIF and Adobe markers, respectively.
613 */
614
615#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */
616#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */
617#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */
618
619
620LOCAL(void)
621examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
622 unsigned int datalen, INT32 remaining)
623/* Examine first few bytes from an APP0.
624 * Take appropriate action if it is a JFIF marker.
625 * datalen is # of bytes at data[], remaining is length of rest of marker data.
626 */
627{
628 INT32 totallen = (INT32) datalen + remaining;
629
630 if (datalen >= APP0_DATA_LEN &&
631 GETJOCTET(data[0]) == 0x4A &&
632 GETJOCTET(data[1]) == 0x46 &&
633 GETJOCTET(data[2]) == 0x49 &&
634 GETJOCTET(data[3]) == 0x46 &&
635 GETJOCTET(data[4]) == 0) {
636 /* Found JFIF APP0 marker: save info */
637 cinfo->saw_JFIF_marker = TRUE;
638 cinfo->JFIF_major_version = GETJOCTET(data[5]);
639 cinfo->JFIF_minor_version = GETJOCTET(data[6]);
640 cinfo->density_unit = GETJOCTET(data[7]);
641 cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
642 cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
643 /* Check version.
644 * Major version must be 1, anything else signals an incompatible change.
645 * (We used to treat this as an error, but now it's a nonfatal warning,
646 * because some bozo at Hijaak couldn't read the spec.)
647 * Minor version should be 0..2, but process anyway if newer.
648 */
649 if (cinfo->JFIF_major_version != 1)
650 WARNMS2(cinfo, JWRN_JFIF_MAJOR,
651 cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
652 /* Generate trace messages */
653 TRACEMS5(cinfo, 1, JTRC_JFIF,
654 cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
655 cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
656 /* Validate thumbnail dimensions and issue appropriate messages */
657 if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
658 TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
659 GETJOCTET(data[12]), GETJOCTET(data[13]));
660 totallen -= APP0_DATA_LEN;
661 if (totallen !=
662 ((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))
663 TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
664 } else if (datalen >= 6 &&
665 GETJOCTET(data[0]) == 0x4A &&
666 GETJOCTET(data[1]) == 0x46 &&
667 GETJOCTET(data[2]) == 0x58 &&
668 GETJOCTET(data[3]) == 0x58 &&
669 GETJOCTET(data[4]) == 0) {
670 /* Found JFIF "JFXX" extension APP0 marker */
671 /* The library doesn't actually do anything with these,
672 * but we try to produce a helpful trace message.
673 */
674 switch (GETJOCTET(data[5])) {
675 case 0x10:
676 TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);
677 break;
678 case 0x11:
679 TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);
680 break;
681 case 0x13:
682 TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);
683 break;
684 default:
685 TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
686 GETJOCTET(data[5]), (int) totallen);
687 break;
688 }
689 } else {
690 /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
691 TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);
692 }
693}
694
695
696LOCAL(void)
697examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
698 unsigned int datalen, INT32 remaining)
699/* Examine first few bytes from an APP14.
700 * Take appropriate action if it is an Adobe marker.
701 * datalen is # of bytes at data[], remaining is length of rest of marker data.
702 */
703{
704 unsigned int version, flags0, flags1, transform;
705
706 if (datalen >= APP14_DATA_LEN &&
707 GETJOCTET(data[0]) == 0x41 &&
708 GETJOCTET(data[1]) == 0x64 &&
709 GETJOCTET(data[2]) == 0x6F &&
710 GETJOCTET(data[3]) == 0x62 &&
711 GETJOCTET(data[4]) == 0x65) {
712 /* Found Adobe APP14 marker */
713 version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
714 flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
715 flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
716 transform = GETJOCTET(data[11]);
717 TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
718 cinfo->saw_Adobe_marker = TRUE;
719 cinfo->Adobe_transform = (UINT8) transform;
720 } else {
721 /* Start of APP14 does not match "Adobe", or too short */
722 TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
723 }
724}
725
726
727METHODDEF(boolean)
728get_interesting_appn (j_decompress_ptr cinfo)
729/* Process an APP0 or APP14 marker without saving it */
730{
731 INT32 length;
732 JOCTET b[APPN_DATA_LEN];
733 unsigned int i, numtoread;
734 INPUT_VARS(cinfo);
735
736 INPUT_2BYTES(cinfo, length, return FALSE);
737 length -= 2;
738
739 /* get the interesting part of the marker data */
740 if (length >= APPN_DATA_LEN)
741 numtoread = APPN_DATA_LEN;
742 else if (length > 0)
743 numtoread = (unsigned int) length;
744 else
745 numtoread = 0;
746 for (i = 0; i < numtoread; i++)
747 INPUT_BYTE(cinfo, b[i], return FALSE);
748 length -= numtoread;
749
750 /* process it */
751 switch (cinfo->unread_marker) {
752 case M_APP0:
753 examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
754 break;
755 case M_APP14:
756 examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
757 break;
758 default:
759 /* can't get here unless jpeg_save_markers chooses wrong processor */
760 ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
761 break;
762 }
763
764 /* skip any remaining data -- could be lots */
765 INPUT_SYNC(cinfo);
766 if (length > 0)
767 (*cinfo->src->skip_input_data) (cinfo, (long) length);
768
769 return TRUE;
770}
771
772
773#ifdef SAVE_MARKERS_SUPPORTED
774
775METHODDEF(boolean)
776save_marker (j_decompress_ptr cinfo)
777/* Save an APPn or COM marker into the marker list */
778{
779 my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
780 jpeg_saved_marker_ptr cur_marker = marker->cur_marker;
781 unsigned int bytes_read, data_length;
782 JOCTET FAR * data;
783 INT32 length = 0;
784 INPUT_VARS(cinfo);
785
786 if (cur_marker == NULL) {
787 /* begin reading a marker */
788 INPUT_2BYTES(cinfo, length, return FALSE);
789 length -= 2;
790 if (length >= 0) { /* watch out for bogus length word */
791 /* figure out how much we want to save */
792 unsigned int limit;
793 if (cinfo->unread_marker == (int) M_COM)
794 limit = marker->length_limit_COM;
795 else
796 limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];
797 if ((unsigned int) length < limit)
798 limit = (unsigned int) length;
799 /* allocate and initialize the marker item */
800 cur_marker = (jpeg_saved_marker_ptr)
801 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
802 SIZEOF(struct jpeg_marker_struct) + limit);
803 cur_marker->next = NULL;
804 cur_marker->marker = (UINT8) cinfo->unread_marker;
805 cur_marker->original_length = (unsigned int) length;
806 cur_marker->data_length = limit;
807 /* data area is just beyond the jpeg_marker_struct */
808 data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);
809 marker->cur_marker = cur_marker;
810 marker->bytes_read = 0;
811 bytes_read = 0;
812 data_length = limit;
813 } else {
814 /* deal with bogus length word */
815 bytes_read = data_length = 0;
816 data = NULL;
817 }
818 } else {
819 /* resume reading a marker */
820 bytes_read = marker->bytes_read;
821 data_length = cur_marker->data_length;
822 data = cur_marker->data + bytes_read;
823 }
824
825 while (bytes_read < data_length) {
826 INPUT_SYNC(cinfo); /* move the restart point to here */
827 marker->bytes_read = bytes_read;
828 /* If there's not at least one byte in buffer, suspend */
829 MAKE_BYTE_AVAIL(cinfo, return FALSE);
830 /* Copy bytes with reasonable rapidity */
831 while (bytes_read < data_length && bytes_in_buffer > 0) {
832 *data++ = *next_input_byte++;
833 bytes_in_buffer--;
834 bytes_read++;
835 }
836 }
837
838 /* Done reading what we want to read */
839 if (cur_marker != NULL) { /* will be NULL if bogus length word */
840 /* Add new marker to end of list */
841 if (cinfo->marker_list == NULL) {
842 cinfo->marker_list = cur_marker;
843 } else {
844 jpeg_saved_marker_ptr prev = cinfo->marker_list;
845 while (prev->next != NULL)
846 prev = prev->next;
847 prev->next = cur_marker;
848 }
849 /* Reset pointer & calc remaining data length */
850 data = cur_marker->data;
851 length = cur_marker->original_length - data_length;
852 }
853 /* Reset to initial state for next marker */
854 marker->cur_marker = NULL;
855
856 /* Process the marker if interesting; else just make a generic trace msg */
857 switch (cinfo->unread_marker) {
858 case M_APP0:
859 examine_app0(cinfo, data, data_length, length);
860 break;
861 case M_APP14:
862 examine_app14(cinfo, data, data_length, length);
863 break;
864 default:
865 TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
866 (int) (data_length + length));
867 break;
868 }
869
870 /* skip any remaining data -- could be lots */
871 INPUT_SYNC(cinfo); /* do before skip_input_data */
872 if (length > 0)
873 (*cinfo->src->skip_input_data) (cinfo, (long) length);
874
875 return TRUE;
876}
877
878#endif /* SAVE_MARKERS_SUPPORTED */
879
880
881METHODDEF(boolean)
882skip_variable (j_decompress_ptr cinfo)
883/* Skip over an unknown or uninteresting variable-length marker */
884{
885 INT32 length;
886 INPUT_VARS(cinfo);
887
888 INPUT_2BYTES(cinfo, length, return FALSE);
889 length -= 2;
890
891 TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);
892
893 INPUT_SYNC(cinfo); /* do before skip_input_data */
894 if (length > 0)
895 (*cinfo->src->skip_input_data) (cinfo, (long) length);
896
897 return TRUE;
898}
899
900
901/*
902 * Find the next JPEG marker, save it in cinfo->unread_marker.
903 * Returns FALSE if had to suspend before reaching a marker;
904 * in that case cinfo->unread_marker is unchanged.
905 *
906 * Note that the result might not be a valid marker code,
907 * but it will never be 0 or FF.
908 */
909
910LOCAL(boolean)
911next_marker (j_decompress_ptr cinfo)
912{
913 int c;
914 INPUT_VARS(cinfo);
915
916 for (;;) {
917 INPUT_BYTE(cinfo, c, return FALSE);
918 /* Skip any non-FF bytes.
919 * This may look a bit inefficient, but it will not occur in a valid file.
920 * We sync after each discarded byte so that a suspending data source
921 * can discard the byte from its buffer.
922 */
923 while (c != 0xFF) {
924 cinfo->marker->discarded_bytes++;
925 INPUT_SYNC(cinfo);
926 INPUT_BYTE(cinfo, c, return FALSE);
927 }
928 /* This loop swallows any duplicate FF bytes. Extra FFs are legal as
929 * pad bytes, so don't count them in discarded_bytes. We assume there
930 * will not be so many consecutive FF bytes as to overflow a suspending
931 * data source's input buffer.
932 */
933 do {
934 INPUT_BYTE(cinfo, c, return FALSE);
935 } while (c == 0xFF);
936 if (c != 0)
937 break; /* found a valid marker, exit loop */
938 /* Reach here if we found a stuffed-zero data sequence (FF/00).
939 * Discard it and loop back to try again.
940 */
941 cinfo->marker->discarded_bytes += 2;
942 INPUT_SYNC(cinfo);
943 }
944
945 if (cinfo->marker->discarded_bytes != 0) {
946 WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
947 cinfo->marker->discarded_bytes = 0;
948 }
949
950 cinfo->unread_marker = c;
951
952 INPUT_SYNC(cinfo);
953 return TRUE;
954}
955
956
957LOCAL(boolean)
958first_marker (j_decompress_ptr cinfo)
959/* Like next_marker, but used to obtain the initial SOI marker. */
960/* For this marker, we do not allow preceding garbage or fill; otherwise,
961 * we might well scan an entire input file before realizing it ain't JPEG.
962 * If an application wants to process non-JFIF files, it must seek to the
963 * SOI before calling the JPEG library.
964 */
965{
966 int c, c2;
967 INPUT_VARS(cinfo);
968
969 INPUT_BYTE(cinfo, c, return FALSE);
970 INPUT_BYTE(cinfo, c2, return FALSE);
971 if (c != 0xFF || c2 != (int) M_SOI)
972 ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
973
974 cinfo->unread_marker = c2;
975
976 INPUT_SYNC(cinfo);
977 return TRUE;
978}
979
980
981/*
982 * Read markers until SOS or EOI.
983 *
984 * Returns same codes as are defined for jpeg_consume_input:
985 * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
986 *
987 * Note: This function may return a pseudo SOS marker (with zero
988 * component number) for treat by input controller's consume_input.
989 * consume_input itself should filter out (skip) the pseudo marker
990 * after processing for the caller.
991 */
992
993METHODDEF(int)
994read_markers (j_decompress_ptr cinfo)
995{
996 /* Outer loop repeats once for each marker. */
997 for (;;) {
998 /* Collect the marker proper, unless we already did. */
999 /* NB: first_marker() enforces the requirement that SOI appear first. */
1000 if (cinfo->unread_marker == 0) {
1001 if (! cinfo->marker->saw_SOI) {
1002 if (! first_marker(cinfo))
1003 return JPEG_SUSPENDED;
1004 } else {
1005 if (! next_marker(cinfo))
1006 return JPEG_SUSPENDED;
1007 }
1008 }
1009 /* At this point cinfo->unread_marker contains the marker code and the
1010 * input point is just past the marker proper, but before any parameters.
1011 * A suspension will cause us to return with this state still true.
1012 */
1013 switch (cinfo->unread_marker) {
1014 case M_SOI:
1015 if (! get_soi(cinfo))
1016 return JPEG_SUSPENDED;
1017 break;
1018
1019 case M_SOF0: /* Baseline */
1020 if (! get_sof(cinfo, TRUE, FALSE, FALSE))
1021 return JPEG_SUSPENDED;
1022 break;
1023
1024 case M_SOF1: /* Extended sequential, Huffman */
1025 if (! get_sof(cinfo, FALSE, FALSE, FALSE))
1026 return JPEG_SUSPENDED;
1027 break;
1028
1029 case M_SOF2: /* Progressive, Huffman */
1030 if (! get_sof(cinfo, FALSE, TRUE, FALSE))
1031 return JPEG_SUSPENDED;
1032 break;
1033
1034 case M_SOF9: /* Extended sequential, arithmetic */
1035 if (! get_sof(cinfo, FALSE, FALSE, TRUE))
1036 return JPEG_SUSPENDED;
1037 break;
1038
1039 case M_SOF10: /* Progressive, arithmetic */
1040 if (! get_sof(cinfo, FALSE, TRUE, TRUE))
1041 return JPEG_SUSPENDED;
1042 break;
1043
1044 /* Currently unsupported SOFn types */
1045 case M_SOF3: /* Lossless, Huffman */
1046 case M_SOF5: /* Differential sequential, Huffman */
1047 case M_SOF6: /* Differential progressive, Huffman */
1048 case M_SOF7: /* Differential lossless, Huffman */
1049 case M_JPG: /* Reserved for JPEG extensions */
1050 case M_SOF11: /* Lossless, arithmetic */
1051 case M_SOF13: /* Differential sequential, arithmetic */
1052 case M_SOF14: /* Differential progressive, arithmetic */
1053 case M_SOF15: /* Differential lossless, arithmetic */
1054 ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);
1055 break;
1056
1057 case M_SOS:
1058 if (! get_sos(cinfo))
1059 return JPEG_SUSPENDED;
1060 cinfo->unread_marker = 0; /* processed the marker */
1061 return JPEG_REACHED_SOS;
1062
1063 case M_EOI:
1064 TRACEMS(cinfo, 1, JTRC_EOI);
1065 cinfo->unread_marker = 0; /* processed the marker */
1066 return JPEG_REACHED_EOI;
1067
1068 case M_DAC:
1069 if (! get_dac(cinfo))
1070 return JPEG_SUSPENDED;
1071 break;
1072
1073 case M_DHT:
1074 if (! get_dht(cinfo))
1075 return JPEG_SUSPENDED;
1076 break;
1077
1078 case M_DQT:
1079 if (! get_dqt(cinfo))
1080 return JPEG_SUSPENDED;
1081 break;
1082
1083 case M_DRI:
1084 if (! get_dri(cinfo))
1085 return JPEG_SUSPENDED;
1086 break;
1087
1088 case M_APP0:
1089 case M_APP1:
1090 case M_APP2:
1091 case M_APP3:
1092 case M_APP4:
1093 case M_APP5:
1094 case M_APP6:
1095 case M_APP7:
1096 case M_APP8:
1097 case M_APP9:
1098 case M_APP10:
1099 case M_APP11:
1100 case M_APP12:
1101 case M_APP13:
1102 case M_APP14:
1103 case M_APP15:
1104 if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[
1105 cinfo->unread_marker - (int) M_APP0]) (cinfo))
1106 return JPEG_SUSPENDED;
1107 break;
1108
1109 case M_COM:
1110 if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))
1111 return JPEG_SUSPENDED;
1112 break;
1113
1114 case M_RST0: /* these are all parameterless */
1115 case M_RST1:
1116 case M_RST2:
1117 case M_RST3:
1118 case M_RST4:
1119 case M_RST5:
1120 case M_RST6:
1121 case M_RST7:
1122 case M_TEM:
1123 TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);
1124 break;
1125
1126 case M_DNL: /* Ignore DNL ... perhaps the wrong thing */
1127 if (! skip_variable(cinfo))
1128 return JPEG_SUSPENDED;
1129 break;
1130
1131 default: /* must be DHP, EXP, JPGn, or RESn */
1132 /* For now, we treat the reserved markers as fatal errors since they are
1133 * likely to be used to signal incompatible JPEG Part 3 extensions.
1134 * Once the JPEG 3 version-number marker is well defined, this code
1135 * ought to change!
1136 */
1137 ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
1138 break;
1139 }
1140 /* Successfully processed marker, so reset state variable */
1141 cinfo->unread_marker = 0;
1142 } /* end loop */
1143}
1144
1145
1146/*
1147 * Read a restart marker, which is expected to appear next in the datastream;
1148 * if the marker is not there, take appropriate recovery action.
1149 * Returns FALSE if suspension is required.
1150 *
1151 * This is called by the entropy decoder after it has read an appropriate
1152 * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder
1153 * has already read a marker from the data source. Under normal conditions
1154 * cinfo->unread_marker will be reset to 0 before returning; if not reset,
1155 * it holds a marker which the decoder will be unable to read past.
1156 */
1157
1158METHODDEF(boolean)
1159read_restart_marker (j_decompress_ptr cinfo)
1160{
1161 /* Obtain a marker unless we already did. */
1162 /* Note that next_marker will complain if it skips any data. */
1163 if (cinfo->unread_marker == 0) {
1164 if (! next_marker(cinfo))
1165 return FALSE;
1166 }
1167
1168 if (cinfo->unread_marker ==
1169 ((int) M_RST0 + cinfo->marker->next_restart_num)) {
1170 /* Normal case --- swallow the marker and let entropy decoder continue */
1171 TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
1172 cinfo->unread_marker = 0;
1173 } else {
1174 /* Uh-oh, the restart markers have been messed up. */
1175 /* Let the data source manager determine how to resync. */
1176 if (! (*cinfo->src->resync_to_restart) (cinfo,
1177 cinfo->marker->next_restart_num))
1178 return FALSE;
1179 }
1180
1181 /* Update next-restart state */
1182 cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;
1183
1184 return TRUE;
1185}
1186
1187
1188/*
1189 * This is the default resync_to_restart method for data source managers
1190 * to use if they don't have any better approach. Some data source managers
1191 * may be able to back up, or may have additional knowledge about the data
1192 * which permits a more intelligent recovery strategy; such managers would
1193 * presumably supply their own resync method.
1194 *
1195 * read_restart_marker calls resync_to_restart if it finds a marker other than
1196 * the restart marker it was expecting. (This code is *not* used unless
1197 * a nonzero restart interval has been declared.) cinfo->unread_marker is
1198 * the marker code actually found (might be anything, except 0 or FF).
1199 * The desired restart marker number (0..7) is passed as a parameter.
1200 * This routine is supposed to apply whatever error recovery strategy seems
1201 * appropriate in order to position the input stream to the next data segment.
1202 * Note that cinfo->unread_marker is treated as a marker appearing before
1203 * the current data-source input point; usually it should be reset to zero
1204 * before returning.
1205 * Returns FALSE if suspension is required.
1206 *
1207 * This implementation is substantially constrained by wanting to treat the
1208 * input as a data stream; this means we can't back up. Therefore, we have
1209 * only the following actions to work with:
1210 * 1. Simply discard the marker and let the entropy decoder resume at next
1211 * byte of file.
1212 * 2. Read forward until we find another marker, discarding intervening
1213 * data. (In theory we could look ahead within the current bufferload,
1214 * without having to discard data if we don't find the desired marker.
1215 * This idea is not implemented here, in part because it makes behavior
1216 * dependent on buffer size and chance buffer-boundary positions.)
1217 * 3. Leave the marker unread (by failing to zero cinfo->unread_marker).
1218 * This will cause the entropy decoder to process an empty data segment,
1219 * inserting dummy zeroes, and then we will reprocess the marker.
1220 *
1221 * #2 is appropriate if we think the desired marker lies ahead, while #3 is
1222 * appropriate if the found marker is a future restart marker (indicating
1223 * that we have missed the desired restart marker, probably because it got
1224 * corrupted).
1225 * We apply #2 or #3 if the found marker is a restart marker no more than
1226 * two counts behind or ahead of the expected one. We also apply #2 if the
1227 * found marker is not a legal JPEG marker code (it's certainly bogus data).
1228 * If the found marker is a restart marker more than 2 counts away, we do #1
1229 * (too much risk that the marker is erroneous; with luck we will be able to
1230 * resync at some future point).
1231 * For any valid non-restart JPEG marker, we apply #3. This keeps us from
1232 * overrunning the end of a scan. An implementation limited to single-scan
1233 * files might find it better to apply #2 for markers other than EOI, since
1234 * any other marker would have to be bogus data in that case.
1235 */
1236
1237GLOBAL(boolean)
1238jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
1239{
1240 int marker = cinfo->unread_marker;
1241 int action = 1;
1242
1243 /* Always put up a warning. */
1244 WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
1245
1246 /* Outer loop handles repeated decision after scanning forward. */
1247 for (;;) {
1248 if (marker < (int) M_SOF0)
1249 action = 2; /* invalid marker */
1250 else if (marker < (int) M_RST0 || marker > (int) M_RST7)
1251 action = 3; /* valid non-restart marker */
1252 else {
1253 if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
1254 marker == ((int) M_RST0 + ((desired+2) & 7)))
1255 action = 3; /* one of the next two expected restarts */
1256 else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
1257 marker == ((int) M_RST0 + ((desired-2) & 7)))
1258 action = 2; /* a prior restart, so advance */
1259 else
1260 action = 1; /* desired restart or too far away */
1261 }
1262 TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
1263 switch (action) {
1264 case 1:
1265 /* Discard marker and let entropy decoder resume processing. */
1266 cinfo->unread_marker = 0;
1267 return TRUE;
1268 case 2:
1269 /* Scan to the next marker, and repeat the decision loop. */
1270 if (! next_marker(cinfo))
1271 return FALSE;
1272 marker = cinfo->unread_marker;
1273 break;
1274 case 3:
1275 /* Return without advancing past this marker. */
1276 /* Entropy decoder will be forced to process an empty segment. */
1277 return TRUE;
1278 }
1279 } /* end loop */
1280}
1281
1282
1283/*
1284 * Reset marker processing state to begin a fresh datastream.
1285 */
1286
1287METHODDEF(void)
1288reset_marker_reader (j_decompress_ptr cinfo)
1289{
1290 my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
1291
1292 cinfo->comp_info = NULL; /* until allocated by get_sof */
1293 cinfo->input_scan_number = 0; /* no SOS seen yet */
1294 cinfo->unread_marker = 0; /* no pending marker */
1295 marker->pub.saw_SOI = FALSE; /* set internal state too */
1296 marker->pub.saw_SOF = FALSE;
1297 marker->pub.discarded_bytes = 0;
1298 marker->cur_marker = NULL;
1299}
1300
1301
1302/*
1303 * Initialize the marker reader module.
1304 * This is called only once, when the decompression object is created.
1305 */
1306
1307GLOBAL(void)
1308jinit_marker_reader (j_decompress_ptr cinfo)
1309{
1310 my_marker_ptr marker;
1311 int i;
1312
1313 /* Create subobject in permanent pool */
1314 marker = (my_marker_ptr)
1315 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
1316 SIZEOF(my_marker_reader));
1317 cinfo->marker = (struct jpeg_marker_reader *) marker;
1318 /* Initialize public method pointers */
1319 marker->pub.reset_marker_reader = reset_marker_reader;
1320 marker->pub.read_markers = read_markers;
1321 marker->pub.read_restart_marker = read_restart_marker;
1322 /* Initialize COM/APPn processing.
1323 * By default, we examine and then discard APP0 and APP14,
1324 * but simply discard COM and all other APPn.
1325 */
1326 marker->process_COM = skip_variable;
1327 marker->length_limit_COM = 0;
1328 for (i = 0; i < 16; i++) {
1329 marker->process_APPn[i] = skip_variable;
1330 marker->length_limit_APPn[i] = 0;
1331 }
1332 marker->process_APPn[0] = get_interesting_appn;
1333 marker->process_APPn[14] = get_interesting_appn;
1334 /* Reset marker processing state */
1335 reset_marker_reader(cinfo);
1336}
1337
1338
1339/*
1340 * Control saving of COM and APPn markers into marker_list.
1341 */
1342
1343#ifdef SAVE_MARKERS_SUPPORTED
1344
1345GLOBAL(void)
1346jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
1347 unsigned int length_limit)
1348{
1349 my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
1350 long maxlength;
1351 jpeg_marker_parser_method processor;
1352
1353 /* Length limit mustn't be larger than what we can allocate
1354 * (should only be a concern in a 16-bit environment).
1355 */
1356 maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
1357 if (((long) length_limit) > maxlength)
1358 length_limit = (unsigned int) maxlength;
1359
1360 /* Choose processor routine to use.
1361 * APP0/APP14 have special requirements.
1362 */
1363 if (length_limit) {
1364 processor = save_marker;
1365 /* If saving APP0/APP14, save at least enough for our internal use. */
1366 if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
1367 length_limit = APP0_DATA_LEN;
1368 else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
1369 length_limit = APP14_DATA_LEN;
1370 } else {
1371 processor = skip_variable;
1372 /* If discarding APP0/APP14, use our regular on-the-fly processor. */
1373 if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
1374 processor = get_interesting_appn;
1375 }
1376
1377 if (marker_code == (int) M_COM) {
1378 marker->process_COM = processor;
1379 marker->length_limit_COM = length_limit;
1380 } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
1381 marker->process_APPn[marker_code - (int) M_APP0] = processor;
1382 marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
1383 } else
1384 ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
1385}
1386
1387#endif /* SAVE_MARKERS_SUPPORTED */
1388
1389
1390/*
1391 * Install a special processing method for COM or APPn markers.
1392 */
1393
1394GLOBAL(void)
1395jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
1396 jpeg_marker_parser_method routine)
1397{
1398 my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
1399
1400 if (marker_code == (int) M_COM)
1401 marker->process_COM = routine;
1402 else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
1403 marker->process_APPn[marker_code - (int) M_APP0] = routine;
1404 else
1405 ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
1406}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmaster.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmaster.c
new file mode 100644
index 0000000..03d4dd0
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmaster.c
@@ -0,0 +1,531 @@
1/*
2 * jdmaster.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2002-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains master control logic for the JPEG decompressor.
10 * These routines are concerned with selecting the modules to be executed
11 * and with determining the number of passes and the work to be done in each
12 * pass.
13 */
14
15#define JPEG_INTERNALS
16#include "jinclude.h"
17#include "jpeglib.h"
18
19
20/* Private state */
21
22typedef struct {
23 struct jpeg_decomp_master pub; /* public fields */
24
25 int pass_number; /* # of passes completed */
26
27 boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
28
29 /* Saved references to initialized quantizer modules,
30 * in case we need to switch modes.
31 */
32 struct jpeg_color_quantizer * quantizer_1pass;
33 struct jpeg_color_quantizer * quantizer_2pass;
34} my_decomp_master;
35
36typedef my_decomp_master * my_master_ptr;
37
38
39/*
40 * Determine whether merged upsample/color conversion should be used.
41 * CRUCIAL: this must match the actual capabilities of jdmerge.c!
42 */
43
44LOCAL(boolean)
45use_merged_upsample (j_decompress_ptr cinfo)
46{
47#ifdef UPSAMPLE_MERGING_SUPPORTED
48 /* Merging is the equivalent of plain box-filter upsampling */
49 if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
50 return FALSE;
51 /* jdmerge.c only supports YCC=>RGB color conversion */
52 if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
53 cinfo->out_color_space != JCS_RGB ||
54 cinfo->out_color_components != RGB_PIXELSIZE)
55 return FALSE;
56 /* and it only handles 2h1v or 2h2v sampling ratios */
57 if (cinfo->comp_info[0].h_samp_factor != 2 ||
58 cinfo->comp_info[1].h_samp_factor != 1 ||
59 cinfo->comp_info[2].h_samp_factor != 1 ||
60 cinfo->comp_info[0].v_samp_factor > 2 ||
61 cinfo->comp_info[1].v_samp_factor != 1 ||
62 cinfo->comp_info[2].v_samp_factor != 1)
63 return FALSE;
64 /* furthermore, it doesn't work if we've scaled the IDCTs differently */
65 if (cinfo->comp_info[0].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size ||
66 cinfo->comp_info[1].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size ||
67 cinfo->comp_info[2].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size ||
68 cinfo->comp_info[0].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size ||
69 cinfo->comp_info[1].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size ||
70 cinfo->comp_info[2].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size)
71 return FALSE;
72 /* ??? also need to test for upsample-time rescaling, when & if supported */
73 return TRUE; /* by golly, it'll work... */
74#else
75 return FALSE;
76#endif
77}
78
79
80/*
81 * Compute output image dimensions and related values.
82 * NOTE: this is exported for possible use by application.
83 * Hence it mustn't do anything that can't be done twice.
84 * Also note that it may be called before the master module is initialized!
85 */
86
87GLOBAL(void)
88jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
89/* Do computations that are needed before master selection phase.
90 * This function is used for full decompression.
91 */
92{
93#ifdef IDCT_SCALING_SUPPORTED
94 int ci;
95 jpeg_component_info *compptr;
96#endif
97
98 /* Prevent application from calling me at wrong times */
99 if (cinfo->global_state != DSTATE_READY)
100 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
101
102 /* Compute core output image dimensions and DCT scaling choices. */
103 jpeg_core_output_dimensions(cinfo);
104
105#ifdef IDCT_SCALING_SUPPORTED
106
107 /* In selecting the actual DCT scaling for each component, we try to
108 * scale up the chroma components via IDCT scaling rather than upsampling.
109 * This saves time if the upsampler gets to use 1:1 scaling.
110 * Note this code adapts subsampling ratios which are powers of 2.
111 */
112 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
113 ci++, compptr++) {
114 int ssize = 1;
115 while (cinfo->min_DCT_h_scaled_size * ssize <=
116 (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
117 (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
118 ssize = ssize * 2;
119 }
120 compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
121 ssize = 1;
122 while (cinfo->min_DCT_v_scaled_size * ssize <=
123 (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
124 (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
125 ssize = ssize * 2;
126 }
127 compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
128
129 /* We don't support IDCT ratios larger than 2. */
130 if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2)
131 compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
132 else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
133 compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
134 }
135
136 /* Recompute downsampled dimensions of components;
137 * application needs to know these if using raw downsampled data.
138 */
139 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
140 ci++, compptr++) {
141 /* Size in samples, after IDCT scaling */
142 compptr->downsampled_width = (JDIMENSION)
143 jdiv_round_up((long) cinfo->image_width *
144 (long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size),
145 (long) (cinfo->max_h_samp_factor * cinfo->block_size));
146 compptr->downsampled_height = (JDIMENSION)
147 jdiv_round_up((long) cinfo->image_height *
148 (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),
149 (long) (cinfo->max_v_samp_factor * cinfo->block_size));
150 }
151
152#endif /* IDCT_SCALING_SUPPORTED */
153
154 /* Report number of components in selected colorspace. */
155 /* Probably this should be in the color conversion module... */
156 switch (cinfo->out_color_space) {
157 case JCS_GRAYSCALE:
158 cinfo->out_color_components = 1;
159 break;
160 case JCS_RGB:
161 cinfo->out_color_components = RGB_PIXELSIZE;
162 break;
163 case JCS_YCbCr:
164 cinfo->out_color_components = 3;
165 break;
166 case JCS_CMYK:
167 case JCS_YCCK:
168 cinfo->out_color_components = 4;
169 break;
170 default: /* else must be same colorspace as in file */
171 cinfo->out_color_components = cinfo->num_components;
172 break;
173 }
174 cinfo->output_components = (cinfo->quantize_colors ? 1 :
175 cinfo->out_color_components);
176
177 /* See if upsampler will want to emit more than one row at a time */
178 if (use_merged_upsample(cinfo))
179 cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
180 else
181 cinfo->rec_outbuf_height = 1;
182}
183
184
185/*
186 * Several decompression processes need to range-limit values to the range
187 * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
188 * due to noise introduced by quantization, roundoff error, etc. These
189 * processes are inner loops and need to be as fast as possible. On most
190 * machines, particularly CPUs with pipelines or instruction prefetch,
191 * a (subscript-check-less) C table lookup
192 * x = sample_range_limit[x];
193 * is faster than explicit tests
194 * if (x < 0) x = 0;
195 * else if (x > MAXJSAMPLE) x = MAXJSAMPLE;
196 * These processes all use a common table prepared by the routine below.
197 *
198 * For most steps we can mathematically guarantee that the initial value
199 * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
200 * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial
201 * limiting step (just after the IDCT), a wildly out-of-range value is
202 * possible if the input data is corrupt. To avoid any chance of indexing
203 * off the end of memory and getting a bad-pointer trap, we perform the
204 * post-IDCT limiting thus:
205 * x = range_limit[x & MASK];
206 * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
207 * samples. Under normal circumstances this is more than enough range and
208 * a correct output will be generated; with bogus input data the mask will
209 * cause wraparound, and we will safely generate a bogus-but-in-range output.
210 * For the post-IDCT step, we want to convert the data from signed to unsigned
211 * representation by adding CENTERJSAMPLE at the same time that we limit it.
212 * So the post-IDCT limiting table ends up looking like this:
213 * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
214 * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
215 * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
216 * 0,1,...,CENTERJSAMPLE-1
217 * Negative inputs select values from the upper half of the table after
218 * masking.
219 *
220 * We can save some space by overlapping the start of the post-IDCT table
221 * with the simpler range limiting table. The post-IDCT table begins at
222 * sample_range_limit + CENTERJSAMPLE.
223 *
224 * Note that the table is allocated in near data space on PCs; it's small
225 * enough and used often enough to justify this.
226 */
227
228LOCAL(void)
229prepare_range_limit_table (j_decompress_ptr cinfo)
230/* Allocate and fill in the sample_range_limit table */
231{
232 JSAMPLE * table;
233 int i;
234
235 table = (JSAMPLE *)
236 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
237 (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
238 table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */
239 cinfo->sample_range_limit = table;
240 /* First segment of "simple" table: limit[x] = 0 for x < 0 */
241 MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
242 /* Main part of "simple" table: limit[x] = x */
243 for (i = 0; i <= MAXJSAMPLE; i++)
244 table[i] = (JSAMPLE) i;
245 table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */
246 /* End of simple table, rest of first half of post-IDCT table */
247 for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
248 table[i] = MAXJSAMPLE;
249 /* Second half of post-IDCT table */
250 MEMZERO(table + (2 * (MAXJSAMPLE+1)),
251 (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
252 MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
253 cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
254}
255
256
257/*
258 * Master selection of decompression modules.
259 * This is done once at jpeg_start_decompress time. We determine
260 * which modules will be used and give them appropriate initialization calls.
261 * We also initialize the decompressor input side to begin consuming data.
262 *
263 * Since jpeg_read_header has finished, we know what is in the SOF
264 * and (first) SOS markers. We also have all the application parameter
265 * settings.
266 */
267
268LOCAL(void)
269master_selection (j_decompress_ptr cinfo)
270{
271 my_master_ptr master = (my_master_ptr) cinfo->master;
272 boolean use_c_buffer;
273 long samplesperrow;
274 JDIMENSION jd_samplesperrow;
275
276 /* Initialize dimensions and other stuff */
277 jpeg_calc_output_dimensions(cinfo);
278 prepare_range_limit_table(cinfo);
279
280 /* Width of an output scanline must be representable as JDIMENSION. */
281 samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
282 jd_samplesperrow = (JDIMENSION) samplesperrow;
283 if ((long) jd_samplesperrow != samplesperrow)
284 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
285
286 /* Initialize my private state */
287 master->pass_number = 0;
288 master->using_merged_upsample = use_merged_upsample(cinfo);
289
290 /* Color quantizer selection */
291 master->quantizer_1pass = NULL;
292 master->quantizer_2pass = NULL;
293 /* No mode changes if not using buffered-image mode. */
294 if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
295 cinfo->enable_1pass_quant = FALSE;
296 cinfo->enable_external_quant = FALSE;
297 cinfo->enable_2pass_quant = FALSE;
298 }
299 if (cinfo->quantize_colors) {
300 if (cinfo->raw_data_out)
301 ERREXIT(cinfo, JERR_NOTIMPL);
302 /* 2-pass quantizer only works in 3-component color space. */
303 if (cinfo->out_color_components != 3) {
304 cinfo->enable_1pass_quant = TRUE;
305 cinfo->enable_external_quant = FALSE;
306 cinfo->enable_2pass_quant = FALSE;
307 cinfo->colormap = NULL;
308 } else if (cinfo->colormap != NULL) {
309 cinfo->enable_external_quant = TRUE;
310 } else if (cinfo->two_pass_quantize) {
311 cinfo->enable_2pass_quant = TRUE;
312 } else {
313 cinfo->enable_1pass_quant = TRUE;
314 }
315
316 if (cinfo->enable_1pass_quant) {
317#ifdef QUANT_1PASS_SUPPORTED
318 jinit_1pass_quantizer(cinfo);
319 master->quantizer_1pass = cinfo->cquantize;
320#else
321 ERREXIT(cinfo, JERR_NOT_COMPILED);
322#endif
323 }
324
325 /* We use the 2-pass code to map to external colormaps. */
326 if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
327#ifdef QUANT_2PASS_SUPPORTED
328 jinit_2pass_quantizer(cinfo);
329 master->quantizer_2pass = cinfo->cquantize;
330#else
331 ERREXIT(cinfo, JERR_NOT_COMPILED);
332#endif
333 }
334 /* If both quantizers are initialized, the 2-pass one is left active;
335 * this is necessary for starting with quantization to an external map.
336 */
337 }
338
339 /* Post-processing: in particular, color conversion first */
340 if (! cinfo->raw_data_out) {
341 if (master->using_merged_upsample) {
342#ifdef UPSAMPLE_MERGING_SUPPORTED
343 jinit_merged_upsampler(cinfo); /* does color conversion too */
344#else
345 ERREXIT(cinfo, JERR_NOT_COMPILED);
346#endif
347 } else {
348 jinit_color_deconverter(cinfo);
349 jinit_upsampler(cinfo);
350 }
351 jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
352 }
353 /* Inverse DCT */
354 jinit_inverse_dct(cinfo);
355 /* Entropy decoding: either Huffman or arithmetic coding. */
356 if (cinfo->arith_code)
357 jinit_arith_decoder(cinfo);
358 else {
359 jinit_huff_decoder(cinfo);
360 }
361
362 /* Initialize principal buffer controllers. */
363 use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
364 jinit_d_coef_controller(cinfo, use_c_buffer);
365
366 if (! cinfo->raw_data_out)
367 jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
368
369 /* We can now tell the memory manager to allocate virtual arrays. */
370 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
371
372 /* Initialize input side of decompressor to consume first scan. */
373 (*cinfo->inputctl->start_input_pass) (cinfo);
374
375#ifdef D_MULTISCAN_FILES_SUPPORTED
376 /* If jpeg_start_decompress will read the whole file, initialize
377 * progress monitoring appropriately. The input step is counted
378 * as one pass.
379 */
380 if (cinfo->progress != NULL && ! cinfo->buffered_image &&
381 cinfo->inputctl->has_multiple_scans) {
382 int nscans;
383 /* Estimate number of scans to set pass_limit. */
384 if (cinfo->progressive_mode) {
385 /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
386 nscans = 2 + 3 * cinfo->num_components;
387 } else {
388 /* For a nonprogressive multiscan file, estimate 1 scan per component. */
389 nscans = cinfo->num_components;
390 }
391 cinfo->progress->pass_counter = 0L;
392 cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
393 cinfo->progress->completed_passes = 0;
394 cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
395 /* Count the input pass as done */
396 master->pass_number++;
397 }
398#endif /* D_MULTISCAN_FILES_SUPPORTED */
399}
400
401
402/*
403 * Per-pass setup.
404 * This is called at the beginning of each output pass. We determine which
405 * modules will be active during this pass and give them appropriate
406 * start_pass calls. We also set is_dummy_pass to indicate whether this
407 * is a "real" output pass or a dummy pass for color quantization.
408 * (In the latter case, jdapistd.c will crank the pass to completion.)
409 */
410
411METHODDEF(void)
412prepare_for_output_pass (j_decompress_ptr cinfo)
413{
414 my_master_ptr master = (my_master_ptr) cinfo->master;
415
416 if (master->pub.is_dummy_pass) {
417#ifdef QUANT_2PASS_SUPPORTED
418 /* Final pass of 2-pass quantization */
419 master->pub.is_dummy_pass = FALSE;
420 (*cinfo->cquantize->start_pass) (cinfo, FALSE);
421 (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
422 (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
423#else
424 ERREXIT(cinfo, JERR_NOT_COMPILED);
425#endif /* QUANT_2PASS_SUPPORTED */
426 } else {
427 if (cinfo->quantize_colors && cinfo->colormap == NULL) {
428 /* Select new quantization method */
429 if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
430 cinfo->cquantize = master->quantizer_2pass;
431 master->pub.is_dummy_pass = TRUE;
432 } else if (cinfo->enable_1pass_quant) {
433 cinfo->cquantize = master->quantizer_1pass;
434 } else {
435 ERREXIT(cinfo, JERR_MODE_CHANGE);
436 }
437 }
438 (*cinfo->idct->start_pass) (cinfo);
439 (*cinfo->coef->start_output_pass) (cinfo);
440 if (! cinfo->raw_data_out) {
441 if (! master->using_merged_upsample)
442 (*cinfo->cconvert->start_pass) (cinfo);
443 (*cinfo->upsample->start_pass) (cinfo);
444 if (cinfo->quantize_colors)
445 (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
446 (*cinfo->post->start_pass) (cinfo,
447 (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
448 (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
449 }
450 }
451
452 /* Set up progress monitor's pass info if present */
453 if (cinfo->progress != NULL) {
454 cinfo->progress->completed_passes = master->pass_number;
455 cinfo->progress->total_passes = master->pass_number +
456 (master->pub.is_dummy_pass ? 2 : 1);
457 /* In buffered-image mode, we assume one more output pass if EOI not
458 * yet reached, but no more passes if EOI has been reached.
459 */
460 if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {
461 cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
462 }
463 }
464}
465
466
467/*
468 * Finish up at end of an output pass.
469 */
470
471METHODDEF(void)
472finish_output_pass (j_decompress_ptr cinfo)
473{
474 my_master_ptr master = (my_master_ptr) cinfo->master;
475
476 if (cinfo->quantize_colors)
477 (*cinfo->cquantize->finish_pass) (cinfo);
478 master->pass_number++;
479}
480
481
482#ifdef D_MULTISCAN_FILES_SUPPORTED
483
484/*
485 * Switch to a new external colormap between output passes.
486 */
487
488GLOBAL(void)
489jpeg_new_colormap (j_decompress_ptr cinfo)
490{
491 my_master_ptr master = (my_master_ptr) cinfo->master;
492
493 /* Prevent application from calling me at wrong times */
494 if (cinfo->global_state != DSTATE_BUFIMAGE)
495 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
496
497 if (cinfo->quantize_colors && cinfo->enable_external_quant &&
498 cinfo->colormap != NULL) {
499 /* Select 2-pass quantizer for external colormap use */
500 cinfo->cquantize = master->quantizer_2pass;
501 /* Notify quantizer of colormap change */
502 (*cinfo->cquantize->new_color_map) (cinfo);
503 master->pub.is_dummy_pass = FALSE; /* just in case */
504 } else
505 ERREXIT(cinfo, JERR_MODE_CHANGE);
506}
507
508#endif /* D_MULTISCAN_FILES_SUPPORTED */
509
510
511/*
512 * Initialize master decompression control and select active modules.
513 * This is performed at the start of jpeg_start_decompress.
514 */
515
516GLOBAL(void)
517jinit_master_decompress (j_decompress_ptr cinfo)
518{
519 my_master_ptr master;
520
521 master = (my_master_ptr)
522 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
523 SIZEOF(my_decomp_master));
524 cinfo->master = (struct jpeg_decomp_master *) master;
525 master->pub.prepare_for_output_pass = prepare_for_output_pass;
526 master->pub.finish_output_pass = finish_output_pass;
527
528 master->pub.is_dummy_pass = FALSE;
529
530 master_selection(cinfo);
531}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmerge.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmerge.c
new file mode 100644
index 0000000..9e3a595
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdmerge.c
@@ -0,0 +1,400 @@
1/*
2 * jdmerge.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains code for merged upsampling/color conversion.
9 *
10 * This file combines functions from jdsample.c and jdcolor.c;
11 * read those files first to understand what's going on.
12 *
13 * When the chroma components are to be upsampled by simple replication
14 * (ie, box filtering), we can save some work in color conversion by
15 * calculating all the output pixels corresponding to a pair of chroma
16 * samples at one time. In the conversion equations
17 * R = Y + K1 * Cr
18 * G = Y + K2 * Cb + K3 * Cr
19 * B = Y + K4 * Cb
20 * only the Y term varies among the group of pixels corresponding to a pair
21 * of chroma samples, so the rest of the terms can be calculated just once.
22 * At typical sampling ratios, this eliminates half or three-quarters of the
23 * multiplications needed for color conversion.
24 *
25 * This file currently provides implementations for the following cases:
26 * YCbCr => RGB color conversion only.
27 * Sampling ratios of 2h1v or 2h2v.
28 * No scaling needed at upsample time.
29 * Corner-aligned (non-CCIR601) sampling alignment.
30 * Other special cases could be added, but in most applications these are
31 * the only common cases. (For uncommon cases we fall back on the more
32 * general code in jdsample.c and jdcolor.c.)
33 */
34
35#define JPEG_INTERNALS
36#include "jinclude.h"
37#include "jpeglib.h"
38
39#ifdef UPSAMPLE_MERGING_SUPPORTED
40
41
42/* Private subobject */
43
44typedef struct {
45 struct jpeg_upsampler pub; /* public fields */
46
47 /* Pointer to routine to do actual upsampling/conversion of one row group */
48 JMETHOD(void, upmethod, (j_decompress_ptr cinfo,
49 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
50 JSAMPARRAY output_buf));
51
52 /* Private state for YCC->RGB conversion */
53 int * Cr_r_tab; /* => table for Cr to R conversion */
54 int * Cb_b_tab; /* => table for Cb to B conversion */
55 INT32 * Cr_g_tab; /* => table for Cr to G conversion */
56 INT32 * Cb_g_tab; /* => table for Cb to G conversion */
57
58 /* For 2:1 vertical sampling, we produce two output rows at a time.
59 * We need a "spare" row buffer to hold the second output row if the
60 * application provides just a one-row buffer; we also use the spare
61 * to discard the dummy last row if the image height is odd.
62 */
63 JSAMPROW spare_row;
64 boolean spare_full; /* T if spare buffer is occupied */
65
66 JDIMENSION out_row_width; /* samples per output row */
67 JDIMENSION rows_to_go; /* counts rows remaining in image */
68} my_upsampler;
69
70typedef my_upsampler * my_upsample_ptr;
71
72#define SCALEBITS 16 /* speediest right-shift on some machines */
73#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
74#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
75
76
77/*
78 * Initialize tables for YCC->RGB colorspace conversion.
79 * This is taken directly from jdcolor.c; see that file for more info.
80 */
81
82LOCAL(void)
83build_ycc_rgb_table (j_decompress_ptr cinfo)
84{
85 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
86 int i;
87 INT32 x;
88 SHIFT_TEMPS
89
90 upsample->Cr_r_tab = (int *)
91 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
92 (MAXJSAMPLE+1) * SIZEOF(int));
93 upsample->Cb_b_tab = (int *)
94 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
95 (MAXJSAMPLE+1) * SIZEOF(int));
96 upsample->Cr_g_tab = (INT32 *)
97 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
98 (MAXJSAMPLE+1) * SIZEOF(INT32));
99 upsample->Cb_g_tab = (INT32 *)
100 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
101 (MAXJSAMPLE+1) * SIZEOF(INT32));
102
103 for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
104 /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
105 /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
106 /* Cr=>R value is nearest int to 1.40200 * x */
107 upsample->Cr_r_tab[i] = (int)
108 RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
109 /* Cb=>B value is nearest int to 1.77200 * x */
110 upsample->Cb_b_tab[i] = (int)
111 RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
112 /* Cr=>G value is scaled-up -0.71414 * x */
113 upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
114 /* Cb=>G value is scaled-up -0.34414 * x */
115 /* We also add in ONE_HALF so that need not do it in inner loop */
116 upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
117 }
118}
119
120
121/*
122 * Initialize for an upsampling pass.
123 */
124
125METHODDEF(void)
126start_pass_merged_upsample (j_decompress_ptr cinfo)
127{
128 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
129
130 /* Mark the spare buffer empty */
131 upsample->spare_full = FALSE;
132 /* Initialize total-height counter for detecting bottom of image */
133 upsample->rows_to_go = cinfo->output_height;
134}
135
136
137/*
138 * Control routine to do upsampling (and color conversion).
139 *
140 * The control routine just handles the row buffering considerations.
141 */
142
143METHODDEF(void)
144merged_2v_upsample (j_decompress_ptr cinfo,
145 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
146 JDIMENSION in_row_groups_avail,
147 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
148 JDIMENSION out_rows_avail)
149/* 2:1 vertical sampling case: may need a spare row. */
150{
151 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
152 JSAMPROW work_ptrs[2];
153 JDIMENSION num_rows; /* number of rows returned to caller */
154
155 if (upsample->spare_full) {
156 /* If we have a spare row saved from a previous cycle, just return it. */
157 jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
158 1, upsample->out_row_width);
159 num_rows = 1;
160 upsample->spare_full = FALSE;
161 } else {
162 /* Figure number of rows to return to caller. */
163 num_rows = 2;
164 /* Not more than the distance to the end of the image. */
165 if (num_rows > upsample->rows_to_go)
166 num_rows = upsample->rows_to_go;
167 /* And not more than what the client can accept: */
168 out_rows_avail -= *out_row_ctr;
169 if (num_rows > out_rows_avail)
170 num_rows = out_rows_avail;
171 /* Create output pointer array for upsampler. */
172 work_ptrs[0] = output_buf[*out_row_ctr];
173 if (num_rows > 1) {
174 work_ptrs[1] = output_buf[*out_row_ctr + 1];
175 } else {
176 work_ptrs[1] = upsample->spare_row;
177 upsample->spare_full = TRUE;
178 }
179 /* Now do the upsampling. */
180 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
181 }
182
183 /* Adjust counts */
184 *out_row_ctr += num_rows;
185 upsample->rows_to_go -= num_rows;
186 /* When the buffer is emptied, declare this input row group consumed */
187 if (! upsample->spare_full)
188 (*in_row_group_ctr)++;
189}
190
191
192METHODDEF(void)
193merged_1v_upsample (j_decompress_ptr cinfo,
194 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
195 JDIMENSION in_row_groups_avail,
196 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
197 JDIMENSION out_rows_avail)
198/* 1:1 vertical sampling case: much easier, never need a spare row. */
199{
200 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
201
202 /* Just do the upsampling. */
203 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
204 output_buf + *out_row_ctr);
205 /* Adjust counts */
206 (*out_row_ctr)++;
207 (*in_row_group_ctr)++;
208}
209
210
211/*
212 * These are the routines invoked by the control routines to do
213 * the actual upsampling/conversion. One row group is processed per call.
214 *
215 * Note: since we may be writing directly into application-supplied buffers,
216 * we have to be honest about the output width; we can't assume the buffer
217 * has been rounded up to an even width.
218 */
219
220
221/*
222 * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
223 */
224
225METHODDEF(void)
226h2v1_merged_upsample (j_decompress_ptr cinfo,
227 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
228 JSAMPARRAY output_buf)
229{
230 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
231 register int y, cred, cgreen, cblue;
232 int cb, cr;
233 register JSAMPROW outptr;
234 JSAMPROW inptr0, inptr1, inptr2;
235 JDIMENSION col;
236 /* copy these pointers into registers if possible */
237 register JSAMPLE * range_limit = cinfo->sample_range_limit;
238 int * Crrtab = upsample->Cr_r_tab;
239 int * Cbbtab = upsample->Cb_b_tab;
240 INT32 * Crgtab = upsample->Cr_g_tab;
241 INT32 * Cbgtab = upsample->Cb_g_tab;
242 SHIFT_TEMPS
243
244 inptr0 = input_buf[0][in_row_group_ctr];
245 inptr1 = input_buf[1][in_row_group_ctr];
246 inptr2 = input_buf[2][in_row_group_ctr];
247 outptr = output_buf[0];
248 /* Loop for each pair of output pixels */
249 for (col = cinfo->output_width >> 1; col > 0; col--) {
250 /* Do the chroma part of the calculation */
251 cb = GETJSAMPLE(*inptr1++);
252 cr = GETJSAMPLE(*inptr2++);
253 cred = Crrtab[cr];
254 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
255 cblue = Cbbtab[cb];
256 /* Fetch 2 Y values and emit 2 pixels */
257 y = GETJSAMPLE(*inptr0++);
258 outptr[RGB_RED] = range_limit[y + cred];
259 outptr[RGB_GREEN] = range_limit[y + cgreen];
260 outptr[RGB_BLUE] = range_limit[y + cblue];
261 outptr += RGB_PIXELSIZE;
262 y = GETJSAMPLE(*inptr0++);
263 outptr[RGB_RED] = range_limit[y + cred];
264 outptr[RGB_GREEN] = range_limit[y + cgreen];
265 outptr[RGB_BLUE] = range_limit[y + cblue];
266 outptr += RGB_PIXELSIZE;
267 }
268 /* If image width is odd, do the last output column separately */
269 if (cinfo->output_width & 1) {
270 cb = GETJSAMPLE(*inptr1);
271 cr = GETJSAMPLE(*inptr2);
272 cred = Crrtab[cr];
273 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
274 cblue = Cbbtab[cb];
275 y = GETJSAMPLE(*inptr0);
276 outptr[RGB_RED] = range_limit[y + cred];
277 outptr[RGB_GREEN] = range_limit[y + cgreen];
278 outptr[RGB_BLUE] = range_limit[y + cblue];
279 }
280}
281
282
283/*
284 * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
285 */
286
287METHODDEF(void)
288h2v2_merged_upsample (j_decompress_ptr cinfo,
289 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
290 JSAMPARRAY output_buf)
291{
292 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
293 register int y, cred, cgreen, cblue;
294 int cb, cr;
295 register JSAMPROW outptr0, outptr1;
296 JSAMPROW inptr00, inptr01, inptr1, inptr2;
297 JDIMENSION col;
298 /* copy these pointers into registers if possible */
299 register JSAMPLE * range_limit = cinfo->sample_range_limit;
300 int * Crrtab = upsample->Cr_r_tab;
301 int * Cbbtab = upsample->Cb_b_tab;
302 INT32 * Crgtab = upsample->Cr_g_tab;
303 INT32 * Cbgtab = upsample->Cb_g_tab;
304 SHIFT_TEMPS
305
306 inptr00 = input_buf[0][in_row_group_ctr*2];
307 inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
308 inptr1 = input_buf[1][in_row_group_ctr];
309 inptr2 = input_buf[2][in_row_group_ctr];
310 outptr0 = output_buf[0];
311 outptr1 = output_buf[1];
312 /* Loop for each group of output pixels */
313 for (col = cinfo->output_width >> 1; col > 0; col--) {
314 /* Do the chroma part of the calculation */
315 cb = GETJSAMPLE(*inptr1++);
316 cr = GETJSAMPLE(*inptr2++);
317 cred = Crrtab[cr];
318 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
319 cblue = Cbbtab[cb];
320 /* Fetch 4 Y values and emit 4 pixels */
321 y = GETJSAMPLE(*inptr00++);
322 outptr0[RGB_RED] = range_limit[y + cred];
323 outptr0[RGB_GREEN] = range_limit[y + cgreen];
324 outptr0[RGB_BLUE] = range_limit[y + cblue];
325 outptr0 += RGB_PIXELSIZE;
326 y = GETJSAMPLE(*inptr00++);
327 outptr0[RGB_RED] = range_limit[y + cred];
328 outptr0[RGB_GREEN] = range_limit[y + cgreen];
329 outptr0[RGB_BLUE] = range_limit[y + cblue];
330 outptr0 += RGB_PIXELSIZE;
331 y = GETJSAMPLE(*inptr01++);
332 outptr1[RGB_RED] = range_limit[y + cred];
333 outptr1[RGB_GREEN] = range_limit[y + cgreen];
334 outptr1[RGB_BLUE] = range_limit[y + cblue];
335 outptr1 += RGB_PIXELSIZE;
336 y = GETJSAMPLE(*inptr01++);
337 outptr1[RGB_RED] = range_limit[y + cred];
338 outptr1[RGB_GREEN] = range_limit[y + cgreen];
339 outptr1[RGB_BLUE] = range_limit[y + cblue];
340 outptr1 += RGB_PIXELSIZE;
341 }
342 /* If image width is odd, do the last output column separately */
343 if (cinfo->output_width & 1) {
344 cb = GETJSAMPLE(*inptr1);
345 cr = GETJSAMPLE(*inptr2);
346 cred = Crrtab[cr];
347 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
348 cblue = Cbbtab[cb];
349 y = GETJSAMPLE(*inptr00);
350 outptr0[RGB_RED] = range_limit[y + cred];
351 outptr0[RGB_GREEN] = range_limit[y + cgreen];
352 outptr0[RGB_BLUE] = range_limit[y + cblue];
353 y = GETJSAMPLE(*inptr01);
354 outptr1[RGB_RED] = range_limit[y + cred];
355 outptr1[RGB_GREEN] = range_limit[y + cgreen];
356 outptr1[RGB_BLUE] = range_limit[y + cblue];
357 }
358}
359
360
361/*
362 * Module initialization routine for merged upsampling/color conversion.
363 *
364 * NB: this is called under the conditions determined by use_merged_upsample()
365 * in jdmaster.c. That routine MUST correspond to the actual capabilities
366 * of this module; no safety checks are made here.
367 */
368
369GLOBAL(void)
370jinit_merged_upsampler (j_decompress_ptr cinfo)
371{
372 my_upsample_ptr upsample;
373
374 upsample = (my_upsample_ptr)
375 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
376 SIZEOF(my_upsampler));
377 cinfo->upsample = (struct jpeg_upsampler *) upsample;
378 upsample->pub.start_pass = start_pass_merged_upsample;
379 upsample->pub.need_context_rows = FALSE;
380
381 upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
382
383 if (cinfo->max_v_samp_factor == 2) {
384 upsample->pub.upsample = merged_2v_upsample;
385 upsample->upmethod = h2v2_merged_upsample;
386 /* Allocate a spare row buffer */
387 upsample->spare_row = (JSAMPROW)
388 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
389 (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
390 } else {
391 upsample->pub.upsample = merged_1v_upsample;
392 upsample->upmethod = h2v1_merged_upsample;
393 /* No spare row needed */
394 upsample->spare_row = NULL;
395 }
396
397 build_ycc_rgb_table(cinfo);
398}
399
400#endif /* UPSAMPLE_MERGING_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdosaobj.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdosaobj.txt
new file mode 100644
index 0000000..b3b15ad
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdosaobj.txt
@@ -0,0 +1,16 @@
1This archive contains already-assembled object files for JMEMDOSA.ASM
2of the Independent JPEG Group's JPEG package. These files will be helpful
3if you want to compile the IJG code for DOS, but don't have an assembler.
4
5These files were prepared from the 3/13/1992 version of JMEMDOSA.ASM,
6which is still unchanged as of mid-1998. You can use these files with
7releases 3 through 6 of the IJG code, and probably future releases too.
8
9To use these files, copy the proper version to JMEMDOSA.OBJ. Make sure
10this file has a newer date than JMEMDOSA.ASM. Then compile the code as
11usual.
12
13Object files included:
14
15JDOSAMSC.OBJ For Microsoft C version 5 or later.
16JDOSABCC.OBJ For Borland C version 3.0 or later.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdpostct.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdpostct.c
new file mode 100644
index 0000000..7ba9eed
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdpostct.c
@@ -0,0 +1,290 @@
1/*
2 * jdpostct.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains the decompression postprocessing controller.
9 * This controller manages the upsampling, color conversion, and color
10 * quantization/reduction steps; specifically, it controls the buffering
11 * between upsample/color conversion and color quantization/reduction.
12 *
13 * If no color quantization/reduction is required, then this module has no
14 * work to do, and it just hands off to the upsample/color conversion code.
15 * An integrated upsample/convert/quantize process would replace this module
16 * entirely.
17 */
18
19#define JPEG_INTERNALS
20#include "jinclude.h"
21#include "jpeglib.h"
22
23
24/* Private buffer controller object */
25
26typedef struct {
27 struct jpeg_d_post_controller pub; /* public fields */
28
29 /* Color quantization source buffer: this holds output data from
30 * the upsample/color conversion step to be passed to the quantizer.
31 * For two-pass color quantization, we need a full-image buffer;
32 * for one-pass operation, a strip buffer is sufficient.
33 */
34 jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */
35 JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */
36 JDIMENSION strip_height; /* buffer size in rows */
37 /* for two-pass mode only: */
38 JDIMENSION starting_row; /* row # of first row in current strip */
39 JDIMENSION next_row; /* index of next row to fill/empty in strip */
40} my_post_controller;
41
42typedef my_post_controller * my_post_ptr;
43
44
45/* Forward declarations */
46METHODDEF(void) post_process_1pass
47 JPP((j_decompress_ptr cinfo,
48 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
49 JDIMENSION in_row_groups_avail,
50 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
51 JDIMENSION out_rows_avail));
52#ifdef QUANT_2PASS_SUPPORTED
53METHODDEF(void) post_process_prepass
54 JPP((j_decompress_ptr cinfo,
55 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
56 JDIMENSION in_row_groups_avail,
57 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
58 JDIMENSION out_rows_avail));
59METHODDEF(void) post_process_2pass
60 JPP((j_decompress_ptr cinfo,
61 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
62 JDIMENSION in_row_groups_avail,
63 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
64 JDIMENSION out_rows_avail));
65#endif
66
67
68/*
69 * Initialize for a processing pass.
70 */
71
72METHODDEF(void)
73start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
74{
75 my_post_ptr post = (my_post_ptr) cinfo->post;
76
77 switch (pass_mode) {
78 case JBUF_PASS_THRU:
79 if (cinfo->quantize_colors) {
80 /* Single-pass processing with color quantization. */
81 post->pub.post_process_data = post_process_1pass;
82 /* We could be doing buffered-image output before starting a 2-pass
83 * color quantization; in that case, jinit_d_post_controller did not
84 * allocate a strip buffer. Use the virtual-array buffer as workspace.
85 */
86 if (post->buffer == NULL) {
87 post->buffer = (*cinfo->mem->access_virt_sarray)
88 ((j_common_ptr) cinfo, post->whole_image,
89 (JDIMENSION) 0, post->strip_height, TRUE);
90 }
91 } else {
92 /* For single-pass processing without color quantization,
93 * I have no work to do; just call the upsampler directly.
94 */
95 post->pub.post_process_data = cinfo->upsample->upsample;
96 }
97 break;
98#ifdef QUANT_2PASS_SUPPORTED
99 case JBUF_SAVE_AND_PASS:
100 /* First pass of 2-pass quantization */
101 if (post->whole_image == NULL)
102 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
103 post->pub.post_process_data = post_process_prepass;
104 break;
105 case JBUF_CRANK_DEST:
106 /* Second pass of 2-pass quantization */
107 if (post->whole_image == NULL)
108 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
109 post->pub.post_process_data = post_process_2pass;
110 break;
111#endif /* QUANT_2PASS_SUPPORTED */
112 default:
113 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
114 break;
115 }
116 post->starting_row = post->next_row = 0;
117}
118
119
120/*
121 * Process some data in the one-pass (strip buffer) case.
122 * This is used for color precision reduction as well as one-pass quantization.
123 */
124
125METHODDEF(void)
126post_process_1pass (j_decompress_ptr cinfo,
127 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
128 JDIMENSION in_row_groups_avail,
129 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
130 JDIMENSION out_rows_avail)
131{
132 my_post_ptr post = (my_post_ptr) cinfo->post;
133 JDIMENSION num_rows, max_rows;
134
135 /* Fill the buffer, but not more than what we can dump out in one go. */
136 /* Note we rely on the upsampler to detect bottom of image. */
137 max_rows = out_rows_avail - *out_row_ctr;
138 if (max_rows > post->strip_height)
139 max_rows = post->strip_height;
140 num_rows = 0;
141 (*cinfo->upsample->upsample) (cinfo,
142 input_buf, in_row_group_ctr, in_row_groups_avail,
143 post->buffer, &num_rows, max_rows);
144 /* Quantize and emit data. */
145 (*cinfo->cquantize->color_quantize) (cinfo,
146 post->buffer, output_buf + *out_row_ctr, (int) num_rows);
147 *out_row_ctr += num_rows;
148}
149
150
151#ifdef QUANT_2PASS_SUPPORTED
152
153/*
154 * Process some data in the first pass of 2-pass quantization.
155 */
156
157METHODDEF(void)
158post_process_prepass (j_decompress_ptr cinfo,
159 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
160 JDIMENSION in_row_groups_avail,
161 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
162 JDIMENSION out_rows_avail)
163{
164 my_post_ptr post = (my_post_ptr) cinfo->post;
165 JDIMENSION old_next_row, num_rows;
166
167 /* Reposition virtual buffer if at start of strip. */
168 if (post->next_row == 0) {
169 post->buffer = (*cinfo->mem->access_virt_sarray)
170 ((j_common_ptr) cinfo, post->whole_image,
171 post->starting_row, post->strip_height, TRUE);
172 }
173
174 /* Upsample some data (up to a strip height's worth). */
175 old_next_row = post->next_row;
176 (*cinfo->upsample->upsample) (cinfo,
177 input_buf, in_row_group_ctr, in_row_groups_avail,
178 post->buffer, &post->next_row, post->strip_height);
179
180 /* Allow quantizer to scan new data. No data is emitted, */
181 /* but we advance out_row_ctr so outer loop can tell when we're done. */
182 if (post->next_row > old_next_row) {
183 num_rows = post->next_row - old_next_row;
184 (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
185 (JSAMPARRAY) NULL, (int) num_rows);
186 *out_row_ctr += num_rows;
187 }
188
189 /* Advance if we filled the strip. */
190 if (post->next_row >= post->strip_height) {
191 post->starting_row += post->strip_height;
192 post->next_row = 0;
193 }
194}
195
196
197/*
198 * Process some data in the second pass of 2-pass quantization.
199 */
200
201METHODDEF(void)
202post_process_2pass (j_decompress_ptr cinfo,
203 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
204 JDIMENSION in_row_groups_avail,
205 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
206 JDIMENSION out_rows_avail)
207{
208 my_post_ptr post = (my_post_ptr) cinfo->post;
209 JDIMENSION num_rows, max_rows;
210
211 /* Reposition virtual buffer if at start of strip. */
212 if (post->next_row == 0) {
213 post->buffer = (*cinfo->mem->access_virt_sarray)
214 ((j_common_ptr) cinfo, post->whole_image,
215 post->starting_row, post->strip_height, FALSE);
216 }
217
218 /* Determine number of rows to emit. */
219 num_rows = post->strip_height - post->next_row; /* available in strip */
220 max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
221 if (num_rows > max_rows)
222 num_rows = max_rows;
223 /* We have to check bottom of image here, can't depend on upsampler. */
224 max_rows = cinfo->output_height - post->starting_row;
225 if (num_rows > max_rows)
226 num_rows = max_rows;
227
228 /* Quantize and emit data. */
229 (*cinfo->cquantize->color_quantize) (cinfo,
230 post->buffer + post->next_row, output_buf + *out_row_ctr,
231 (int) num_rows);
232 *out_row_ctr += num_rows;
233
234 /* Advance if we filled the strip. */
235 post->next_row += num_rows;
236 if (post->next_row >= post->strip_height) {
237 post->starting_row += post->strip_height;
238 post->next_row = 0;
239 }
240}
241
242#endif /* QUANT_2PASS_SUPPORTED */
243
244
245/*
246 * Initialize postprocessing controller.
247 */
248
249GLOBAL(void)
250jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
251{
252 my_post_ptr post;
253
254 post = (my_post_ptr)
255 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
256 SIZEOF(my_post_controller));
257 cinfo->post = (struct jpeg_d_post_controller *) post;
258 post->pub.start_pass = start_pass_dpost;
259 post->whole_image = NULL; /* flag for no virtual arrays */
260 post->buffer = NULL; /* flag for no strip buffer */
261
262 /* Create the quantization buffer, if needed */
263 if (cinfo->quantize_colors) {
264 /* The buffer strip height is max_v_samp_factor, which is typically
265 * an efficient number of rows for upsampling to return.
266 * (In the presence of output rescaling, we might want to be smarter?)
267 */
268 post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
269 if (need_full_buffer) {
270 /* Two-pass color quantization: need full-image storage. */
271 /* We round up the number of rows to a multiple of the strip height. */
272#ifdef QUANT_2PASS_SUPPORTED
273 post->whole_image = (*cinfo->mem->request_virt_sarray)
274 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
275 cinfo->output_width * cinfo->out_color_components,
276 (JDIMENSION) jround_up((long) cinfo->output_height,
277 (long) post->strip_height),
278 post->strip_height);
279#else
280 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
281#endif /* QUANT_2PASS_SUPPORTED */
282 } else {
283 /* One-pass color quantization: just make a strip buffer. */
284 post->buffer = (*cinfo->mem->alloc_sarray)
285 ((j_common_ptr) cinfo, JPOOL_IMAGE,
286 cinfo->output_width * cinfo->out_color_components,
287 post->strip_height);
288 }
289 }
290}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdsample.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdsample.c
new file mode 100644
index 0000000..94f9599
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdsample.c
@@ -0,0 +1,361 @@
1/*
2 * jdsample.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modified 2002-2008 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains upsampling routines.
10 *
11 * Upsampling input data is counted in "row groups". A row group
12 * is defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)
13 * sample rows of each component. Upsampling will normally produce
14 * max_v_samp_factor pixel rows from each row group (but this could vary
15 * if the upsampler is applying a scale factor of its own).
16 *
17 * An excellent reference for image resampling is
18 * Digital Image Warping, George Wolberg, 1990.
19 * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
20 */
21
22#define JPEG_INTERNALS
23#include "jinclude.h"
24#include "jpeglib.h"
25
26
27/* Pointer to routine to upsample a single component */
28typedef JMETHOD(void, upsample1_ptr,
29 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
30 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
31
32/* Private subobject */
33
34typedef struct {
35 struct jpeg_upsampler pub; /* public fields */
36
37 /* Color conversion buffer. When using separate upsampling and color
38 * conversion steps, this buffer holds one upsampled row group until it
39 * has been color converted and output.
40 * Note: we do not allocate any storage for component(s) which are full-size,
41 * ie do not need rescaling. The corresponding entry of color_buf[] is
42 * simply set to point to the input data array, thereby avoiding copying.
43 */
44 JSAMPARRAY color_buf[MAX_COMPONENTS];
45
46 /* Per-component upsampling method pointers */
47 upsample1_ptr methods[MAX_COMPONENTS];
48
49 int next_row_out; /* counts rows emitted from color_buf */
50 JDIMENSION rows_to_go; /* counts rows remaining in image */
51
52 /* Height of an input row group for each component. */
53 int rowgroup_height[MAX_COMPONENTS];
54
55 /* These arrays save pixel expansion factors so that int_expand need not
56 * recompute them each time. They are unused for other upsampling methods.
57 */
58 UINT8 h_expand[MAX_COMPONENTS];
59 UINT8 v_expand[MAX_COMPONENTS];
60} my_upsampler;
61
62typedef my_upsampler * my_upsample_ptr;
63
64
65/*
66 * Initialize for an upsampling pass.
67 */
68
69METHODDEF(void)
70start_pass_upsample (j_decompress_ptr cinfo)
71{
72 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
73
74 /* Mark the conversion buffer empty */
75 upsample->next_row_out = cinfo->max_v_samp_factor;
76 /* Initialize total-height counter for detecting bottom of image */
77 upsample->rows_to_go = cinfo->output_height;
78}
79
80
81/*
82 * Control routine to do upsampling (and color conversion).
83 *
84 * In this version we upsample each component independently.
85 * We upsample one row group into the conversion buffer, then apply
86 * color conversion a row at a time.
87 */
88
89METHODDEF(void)
90sep_upsample (j_decompress_ptr cinfo,
91 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
92 JDIMENSION in_row_groups_avail,
93 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
94 JDIMENSION out_rows_avail)
95{
96 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
97 int ci;
98 jpeg_component_info * compptr;
99 JDIMENSION num_rows;
100
101 /* Fill the conversion buffer, if it's empty */
102 if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
103 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
104 ci++, compptr++) {
105 /* Invoke per-component upsample method. Notice we pass a POINTER
106 * to color_buf[ci], so that fullsize_upsample can change it.
107 */
108 (*upsample->methods[ci]) (cinfo, compptr,
109 input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
110 upsample->color_buf + ci);
111 }
112 upsample->next_row_out = 0;
113 }
114
115 /* Color-convert and emit rows */
116
117 /* How many we have in the buffer: */
118 num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);
119 /* Not more than the distance to the end of the image. Need this test
120 * in case the image height is not a multiple of max_v_samp_factor:
121 */
122 if (num_rows > upsample->rows_to_go)
123 num_rows = upsample->rows_to_go;
124 /* And not more than what the client can accept: */
125 out_rows_avail -= *out_row_ctr;
126 if (num_rows > out_rows_avail)
127 num_rows = out_rows_avail;
128
129 (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
130 (JDIMENSION) upsample->next_row_out,
131 output_buf + *out_row_ctr,
132 (int) num_rows);
133
134 /* Adjust counts */
135 *out_row_ctr += num_rows;
136 upsample->rows_to_go -= num_rows;
137 upsample->next_row_out += num_rows;
138 /* When the buffer is emptied, declare this input row group consumed */
139 if (upsample->next_row_out >= cinfo->max_v_samp_factor)
140 (*in_row_group_ctr)++;
141}
142
143
144/*
145 * These are the routines invoked by sep_upsample to upsample pixel values
146 * of a single component. One row group is processed per call.
147 */
148
149
150/*
151 * For full-size components, we just make color_buf[ci] point at the
152 * input buffer, and thus avoid copying any data. Note that this is
153 * safe only because sep_upsample doesn't declare the input row group
154 * "consumed" until we are done color converting and emitting it.
155 */
156
157METHODDEF(void)
158fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
159 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
160{
161 *output_data_ptr = input_data;
162}
163
164
165/*
166 * This is a no-op version used for "uninteresting" components.
167 * These components will not be referenced by color conversion.
168 */
169
170METHODDEF(void)
171noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
172 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
173{
174 *output_data_ptr = NULL; /* safety check */
175}
176
177
178/*
179 * This version handles any integral sampling ratios.
180 * This is not used for typical JPEG files, so it need not be fast.
181 * Nor, for that matter, is it particularly accurate: the algorithm is
182 * simple replication of the input pixel onto the corresponding output
183 * pixels. The hi-falutin sampling literature refers to this as a
184 * "box filter". A box filter tends to introduce visible artifacts,
185 * so if you are actually going to use 3:1 or 4:1 sampling ratios
186 * you would be well advised to improve this code.
187 */
188
189METHODDEF(void)
190int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
191 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
192{
193 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
194 JSAMPARRAY output_data = *output_data_ptr;
195 register JSAMPROW inptr, outptr;
196 register JSAMPLE invalue;
197 register int h;
198 JSAMPROW outend;
199 int h_expand, v_expand;
200 int inrow, outrow;
201
202 h_expand = upsample->h_expand[compptr->component_index];
203 v_expand = upsample->v_expand[compptr->component_index];
204
205 inrow = outrow = 0;
206 while (outrow < cinfo->max_v_samp_factor) {
207 /* Generate one output row with proper horizontal expansion */
208 inptr = input_data[inrow];
209 outptr = output_data[outrow];
210 outend = outptr + cinfo->output_width;
211 while (outptr < outend) {
212 invalue = *inptr++; /* don't need GETJSAMPLE() here */
213 for (h = h_expand; h > 0; h--) {
214 *outptr++ = invalue;
215 }
216 }
217 /* Generate any additional output rows by duplicating the first one */
218 if (v_expand > 1) {
219 jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
220 v_expand-1, cinfo->output_width);
221 }
222 inrow++;
223 outrow += v_expand;
224 }
225}
226
227
228/*
229 * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
230 * It's still a box filter.
231 */
232
233METHODDEF(void)
234h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
235 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
236{
237 JSAMPARRAY output_data = *output_data_ptr;
238 register JSAMPROW inptr, outptr;
239 register JSAMPLE invalue;
240 JSAMPROW outend;
241 int outrow;
242
243 for (outrow = 0; outrow < cinfo->max_v_samp_factor; outrow++) {
244 inptr = input_data[outrow];
245 outptr = output_data[outrow];
246 outend = outptr + cinfo->output_width;
247 while (outptr < outend) {
248 invalue = *inptr++; /* don't need GETJSAMPLE() here */
249 *outptr++ = invalue;
250 *outptr++ = invalue;
251 }
252 }
253}
254
255
256/*
257 * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.
258 * It's still a box filter.
259 */
260
261METHODDEF(void)
262h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
263 JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
264{
265 JSAMPARRAY output_data = *output_data_ptr;
266 register JSAMPROW inptr, outptr;
267 register JSAMPLE invalue;
268 JSAMPROW outend;
269 int inrow, outrow;
270
271 inrow = outrow = 0;
272 while (outrow < cinfo->max_v_samp_factor) {
273 inptr = input_data[inrow];
274 outptr = output_data[outrow];
275 outend = outptr + cinfo->output_width;
276 while (outptr < outend) {
277 invalue = *inptr++; /* don't need GETJSAMPLE() here */
278 *outptr++ = invalue;
279 *outptr++ = invalue;
280 }
281 jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
282 1, cinfo->output_width);
283 inrow++;
284 outrow += 2;
285 }
286}
287
288
289/*
290 * Module initialization routine for upsampling.
291 */
292
293GLOBAL(void)
294jinit_upsampler (j_decompress_ptr cinfo)
295{
296 my_upsample_ptr upsample;
297 int ci;
298 jpeg_component_info * compptr;
299 boolean need_buffer;
300 int h_in_group, v_in_group, h_out_group, v_out_group;
301
302 upsample = (my_upsample_ptr)
303 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
304 SIZEOF(my_upsampler));
305 cinfo->upsample = (struct jpeg_upsampler *) upsample;
306 upsample->pub.start_pass = start_pass_upsample;
307 upsample->pub.upsample = sep_upsample;
308 upsample->pub.need_context_rows = FALSE; /* until we find out differently */
309
310 if (cinfo->CCIR601_sampling) /* this isn't supported */
311 ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
312
313 /* Verify we can handle the sampling factors, select per-component methods,
314 * and create storage as needed.
315 */
316 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
317 ci++, compptr++) {
318 /* Compute size of an "input group" after IDCT scaling. This many samples
319 * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
320 */
321 h_in_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) /
322 cinfo->min_DCT_h_scaled_size;
323 v_in_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
324 cinfo->min_DCT_v_scaled_size;
325 h_out_group = cinfo->max_h_samp_factor;
326 v_out_group = cinfo->max_v_samp_factor;
327 upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
328 need_buffer = TRUE;
329 if (! compptr->component_needed) {
330 /* Don't bother to upsample an uninteresting component. */
331 upsample->methods[ci] = noop_upsample;
332 need_buffer = FALSE;
333 } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
334 /* Fullsize components can be processed without any work. */
335 upsample->methods[ci] = fullsize_upsample;
336 need_buffer = FALSE;
337 } else if (h_in_group * 2 == h_out_group &&
338 v_in_group == v_out_group) {
339 /* Special case for 2h1v upsampling */
340 upsample->methods[ci] = h2v1_upsample;
341 } else if (h_in_group * 2 == h_out_group &&
342 v_in_group * 2 == v_out_group) {
343 /* Special case for 2h2v upsampling */
344 upsample->methods[ci] = h2v2_upsample;
345 } else if ((h_out_group % h_in_group) == 0 &&
346 (v_out_group % v_in_group) == 0) {
347 /* Generic integral-factors upsampling method */
348 upsample->methods[ci] = int_upsample;
349 upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);
350 upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
351 } else
352 ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
353 if (need_buffer) {
354 upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
355 ((j_common_ptr) cinfo, JPOOL_IMAGE,
356 (JDIMENSION) jround_up((long) cinfo->output_width,
357 (long) cinfo->max_h_samp_factor),
358 (JDIMENSION) cinfo->max_v_samp_factor);
359 }
360 }
361}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdtrans.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdtrans.c
new file mode 100644
index 0000000..a51d69d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jdtrans.c
@@ -0,0 +1,140 @@
1/*
2 * jdtrans.c
3 *
4 * Copyright (C) 1995-1997, Thomas G. Lane.
5 * Modified 2000-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains library routines for transcoding decompression,
10 * that is, reading raw DCT coefficient arrays from an input JPEG file.
11 * The routines in jdapimin.c will also be needed by a transcoder.
12 */
13
14#define JPEG_INTERNALS
15#include "jinclude.h"
16#include "jpeglib.h"
17
18
19/* Forward declarations */
20LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));
21
22
23/*
24 * Read the coefficient arrays from a JPEG file.
25 * jpeg_read_header must be completed before calling this.
26 *
27 * The entire image is read into a set of virtual coefficient-block arrays,
28 * one per component. The return value is a pointer to the array of
29 * virtual-array descriptors. These can be manipulated directly via the
30 * JPEG memory manager, or handed off to jpeg_write_coefficients().
31 * To release the memory occupied by the virtual arrays, call
32 * jpeg_finish_decompress() when done with the data.
33 *
34 * An alternative usage is to simply obtain access to the coefficient arrays
35 * during a buffered-image-mode decompression operation. This is allowed
36 * after any jpeg_finish_output() call. The arrays can be accessed until
37 * jpeg_finish_decompress() is called. (Note that any call to the library
38 * may reposition the arrays, so don't rely on access_virt_barray() results
39 * to stay valid across library calls.)
40 *
41 * Returns NULL if suspended. This case need be checked only if
42 * a suspending data source is used.
43 */
44
45GLOBAL(jvirt_barray_ptr *)
46jpeg_read_coefficients (j_decompress_ptr cinfo)
47{
48 if (cinfo->global_state == DSTATE_READY) {
49 /* First call: initialize active modules */
50 transdecode_master_selection(cinfo);
51 cinfo->global_state = DSTATE_RDCOEFS;
52 }
53 if (cinfo->global_state == DSTATE_RDCOEFS) {
54 /* Absorb whole file into the coef buffer */
55 for (;;) {
56 int retcode;
57 /* Call progress monitor hook if present */
58 if (cinfo->progress != NULL)
59 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
60 /* Absorb some more input */
61 retcode = (*cinfo->inputctl->consume_input) (cinfo);
62 if (retcode == JPEG_SUSPENDED)
63 return NULL;
64 if (retcode == JPEG_REACHED_EOI)
65 break;
66 /* Advance progress counter if appropriate */
67 if (cinfo->progress != NULL &&
68 (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
69 if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
70 /* startup underestimated number of scans; ratchet up one scan */
71 cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
72 }
73 }
74 }
75 /* Set state so that jpeg_finish_decompress does the right thing */
76 cinfo->global_state = DSTATE_STOPPING;
77 }
78 /* At this point we should be in state DSTATE_STOPPING if being used
79 * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access
80 * to the coefficients during a full buffered-image-mode decompression.
81 */
82 if ((cinfo->global_state == DSTATE_STOPPING ||
83 cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {
84 return cinfo->coef->coef_arrays;
85 }
86 /* Oops, improper usage */
87 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
88 return NULL; /* keep compiler happy */
89}
90
91
92/*
93 * Master selection of decompression modules for transcoding.
94 * This substitutes for jdmaster.c's initialization of the full decompressor.
95 */
96
97LOCAL(void)
98transdecode_master_selection (j_decompress_ptr cinfo)
99{
100 /* This is effectively a buffered-image operation. */
101 cinfo->buffered_image = TRUE;
102
103 /* Compute output image dimensions and related values. */
104 jpeg_core_output_dimensions(cinfo);
105
106 /* Entropy decoding: either Huffman or arithmetic coding. */
107 if (cinfo->arith_code)
108 jinit_arith_decoder(cinfo);
109 else {
110 jinit_huff_decoder(cinfo);
111 }
112
113 /* Always get a full-image coefficient buffer. */
114 jinit_d_coef_controller(cinfo, TRUE);
115
116 /* We can now tell the memory manager to allocate virtual arrays. */
117 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
118
119 /* Initialize input side of decompressor to consume first scan. */
120 (*cinfo->inputctl->start_input_pass) (cinfo);
121
122 /* Initialize progress monitoring. */
123 if (cinfo->progress != NULL) {
124 int nscans;
125 /* Estimate number of scans to set pass_limit. */
126 if (cinfo->progressive_mode) {
127 /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
128 nscans = 2 + 3 * cinfo->num_components;
129 } else if (cinfo->inputctl->has_multiple_scans) {
130 /* For a nonprogressive multiscan file, estimate 1 scan per component. */
131 nscans = cinfo->num_components;
132 } else {
133 nscans = 1;
134 }
135 cinfo->progress->pass_counter = 0L;
136 cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
137 cinfo->progress->completed_passes = 0;
138 cinfo->progress->total_passes = 1;
139 }
140}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.c
new file mode 100644
index 0000000..c98aed7
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.c
@@ -0,0 +1,252 @@
1/*
2 * jerror.c
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains simple error-reporting and trace-message routines.
9 * These are suitable for Unix-like systems and others where writing to
10 * stderr is the right thing to do. Many applications will want to replace
11 * some or all of these routines.
12 *
13 * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,
14 * you get a Windows-specific hack to display error messages in a dialog box.
15 * It ain't much, but it beats dropping error messages into the bit bucket,
16 * which is what happens to output to stderr under most Windows C compilers.
17 *
18 * These routines are used by both the compression and decompression code.
19 */
20
21/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
22#include "jinclude.h"
23#include "jpeglib.h"
24#include "jversion.h"
25#include "jerror.h"
26
27#ifdef USE_WINDOWS_MESSAGEBOX
28#include <windows.h>
29#endif
30
31#ifndef EXIT_FAILURE /* define exit() codes if not provided */
32#define EXIT_FAILURE 1
33#endif
34
35
36/*
37 * Create the message string table.
38 * We do this from the master message list in jerror.h by re-reading
39 * jerror.h with a suitable definition for macro JMESSAGE.
40 * The message table is made an external symbol just in case any applications
41 * want to refer to it directly.
42 */
43
44#ifdef NEED_SHORT_EXTERNAL_NAMES
45#define jpeg_std_message_table jMsgTable
46#endif
47
48#define JMESSAGE(code,string) string ,
49
50const char * const jpeg_std_message_table[] = {
51#include "jerror.h"
52 NULL
53};
54
55
56/*
57 * Error exit handler: must not return to caller.
58 *
59 * Applications may override this if they want to get control back after
60 * an error. Typically one would longjmp somewhere instead of exiting.
61 * The setjmp buffer can be made a private field within an expanded error
62 * handler object. Note that the info needed to generate an error message
63 * is stored in the error object, so you can generate the message now or
64 * later, at your convenience.
65 * You should make sure that the JPEG object is cleaned up (with jpeg_abort
66 * or jpeg_destroy) at some point.
67 */
68
69METHODDEF(void)
70error_exit (j_common_ptr cinfo)
71{
72 /* Always display the message */
73 (*cinfo->err->output_message) (cinfo);
74
75 /* Let the memory manager delete any temp files before we die */
76 jpeg_destroy(cinfo);
77
78 exit(EXIT_FAILURE);
79}
80
81
82/*
83 * Actual output of an error or trace message.
84 * Applications may override this method to send JPEG messages somewhere
85 * other than stderr.
86 *
87 * On Windows, printing to stderr is generally completely useless,
88 * so we provide optional code to produce an error-dialog popup.
89 * Most Windows applications will still prefer to override this routine,
90 * but if they don't, it'll do something at least marginally useful.
91 *
92 * NOTE: to use the library in an environment that doesn't support the
93 * C stdio library, you may have to delete the call to fprintf() entirely,
94 * not just not use this routine.
95 */
96
97METHODDEF(void)
98output_message (j_common_ptr cinfo)
99{
100 char buffer[JMSG_LENGTH_MAX];
101
102 /* Create the message */
103 (*cinfo->err->format_message) (cinfo, buffer);
104
105#ifdef USE_WINDOWS_MESSAGEBOX
106 /* Display it in a message dialog box */
107 MessageBox(GetActiveWindow(), buffer, "JPEG Library Error",
108 MB_OK | MB_ICONERROR);
109#else
110 /* Send it to stderr, adding a newline */
111 fprintf(stderr, "%s\n", buffer);
112#endif
113}
114
115
116/*
117 * Decide whether to emit a trace or warning message.
118 * msg_level is one of:
119 * -1: recoverable corrupt-data warning, may want to abort.
120 * 0: important advisory messages (always display to user).
121 * 1: first level of tracing detail.
122 * 2,3,...: successively more detailed tracing messages.
123 * An application might override this method if it wanted to abort on warnings
124 * or change the policy about which messages to display.
125 */
126
127METHODDEF(void)
128emit_message (j_common_ptr cinfo, int msg_level)
129{
130 struct jpeg_error_mgr * err = cinfo->err;
131
132 if (msg_level < 0) {
133 /* It's a warning message. Since corrupt files may generate many warnings,
134 * the policy implemented here is to show only the first warning,
135 * unless trace_level >= 3.
136 */
137 if (err->num_warnings == 0 || err->trace_level >= 3)
138 (*err->output_message) (cinfo);
139 /* Always count warnings in num_warnings. */
140 err->num_warnings++;
141 } else {
142 /* It's a trace message. Show it if trace_level >= msg_level. */
143 if (err->trace_level >= msg_level)
144 (*err->output_message) (cinfo);
145 }
146}
147
148
149/*
150 * Format a message string for the most recent JPEG error or message.
151 * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX
152 * characters. Note that no '\n' character is added to the string.
153 * Few applications should need to override this method.
154 */
155
156METHODDEF(void)
157format_message (j_common_ptr cinfo, char * buffer)
158{
159 struct jpeg_error_mgr * err = cinfo->err;
160 int msg_code = err->msg_code;
161 const char * msgtext = NULL;
162 const char * msgptr;
163 char ch;
164 boolean isstring;
165
166 /* Look up message string in proper table */
167 if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
168 msgtext = err->jpeg_message_table[msg_code];
169 } else if (err->addon_message_table != NULL &&
170 msg_code >= err->first_addon_message &&
171 msg_code <= err->last_addon_message) {
172 msgtext = err->addon_message_table[msg_code - err->first_addon_message];
173 }
174
175 /* Defend against bogus message number */
176 if (msgtext == NULL) {
177 err->msg_parm.i[0] = msg_code;
178 msgtext = err->jpeg_message_table[0];
179 }
180
181 /* Check for string parameter, as indicated by %s in the message text */
182 isstring = FALSE;
183 msgptr = msgtext;
184 while ((ch = *msgptr++) != '\0') {
185 if (ch == '%') {
186 if (*msgptr == 's') isstring = TRUE;
187 break;
188 }
189 }
190
191 /* Format the message into the passed buffer */
192 if (isstring)
193 sprintf(buffer, msgtext, err->msg_parm.s);
194 else
195 sprintf(buffer, msgtext,
196 err->msg_parm.i[0], err->msg_parm.i[1],
197 err->msg_parm.i[2], err->msg_parm.i[3],
198 err->msg_parm.i[4], err->msg_parm.i[5],
199 err->msg_parm.i[6], err->msg_parm.i[7]);
200}
201
202
203/*
204 * Reset error state variables at start of a new image.
205 * This is called during compression startup to reset trace/error
206 * processing to default state, without losing any application-specific
207 * method pointers. An application might possibly want to override
208 * this method if it has additional error processing state.
209 */
210
211METHODDEF(void)
212reset_error_mgr (j_common_ptr cinfo)
213{
214 cinfo->err->num_warnings = 0;
215 /* trace_level is not reset since it is an application-supplied parameter */
216 cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */
217}
218
219
220/*
221 * Fill in the standard error-handling methods in a jpeg_error_mgr object.
222 * Typical call is:
223 * struct jpeg_compress_struct cinfo;
224 * struct jpeg_error_mgr err;
225 *
226 * cinfo.err = jpeg_std_error(&err);
227 * after which the application may override some of the methods.
228 */
229
230GLOBAL(struct jpeg_error_mgr *)
231jpeg_std_error (struct jpeg_error_mgr * err)
232{
233 err->error_exit = error_exit;
234 err->emit_message = emit_message;
235 err->output_message = output_message;
236 err->format_message = format_message;
237 err->reset_error_mgr = reset_error_mgr;
238
239 err->trace_level = 0; /* default = no tracing */
240 err->num_warnings = 0; /* no warnings emitted yet */
241 err->msg_code = 0; /* may be useful as a flag for "no error" */
242
243 /* Initialize message table pointers */
244 err->jpeg_message_table = jpeg_std_message_table;
245 err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
246
247 err->addon_message_table = NULL;
248 err->first_addon_message = 0; /* for safety */
249 err->last_addon_message = 0;
250
251 return err;
252}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.h
new file mode 100644
index 0000000..478b74d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jerror.h
@@ -0,0 +1,304 @@
1/*
2 * jerror.h
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * Modified 1997-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file defines the error and message codes for the JPEG library.
10 * Edit this file to add new codes, or to translate the message strings to
11 * some other language.
12 * A set of error-reporting macros are defined too. Some applications using
13 * the JPEG library may wish to include this file to get the error codes
14 * and/or the macros.
15 */
16
17/*
18 * To define the enum list of message codes, include this file without
19 * defining macro JMESSAGE. To create a message string table, include it
20 * again with a suitable JMESSAGE definition (see jerror.c for an example).
21 */
22#ifndef JMESSAGE
23#ifndef JERROR_H
24/* First time through, define the enum list */
25#define JMAKE_ENUM_LIST
26#else
27/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
28#define JMESSAGE(code,string)
29#endif /* JERROR_H */
30#endif /* JMESSAGE */
31
32#ifdef JMAKE_ENUM_LIST
33
34typedef enum {
35
36#define JMESSAGE(code,string) code ,
37
38#endif /* JMAKE_ENUM_LIST */
39
40JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
41
42/* For maintenance convenience, list is alphabetical by message code name */
43JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
44JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
45JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
46JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
47JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
48JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
49JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported")
50JMESSAGE(JERR_BAD_DROP_SAMPLING,
51 "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
52JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
53JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
54JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
55JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
56JMESSAGE(JERR_BAD_LIB_VERSION,
57 "Wrong JPEG library version: library is %d, caller expects %d")
58JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
59JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
60JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
61JMESSAGE(JERR_BAD_PROGRESSION,
62 "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
63JMESSAGE(JERR_BAD_PROG_SCRIPT,
64 "Invalid progressive parameters at scan script entry %d")
65JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
66JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
67JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
68JMESSAGE(JERR_BAD_STRUCT_SIZE,
69 "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
70JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
71JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
72JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
73JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
74JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
75JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
76JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
77JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
78JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
79JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
80JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
81JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
82JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
83JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
84JMESSAGE(JERR_FILE_READ, "Input file read error")
85JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
86JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
87JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
88JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
89JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
90JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
91JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
92JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
93 "Cannot transcode due to multiple use of quantization table %d")
94JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
95JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
96JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
97JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
98JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
99JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
100JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
101JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
102JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
103JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
104JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
105JMESSAGE(JERR_QUANT_COMPONENTS,
106 "Cannot quantize more than %d color components")
107JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
108JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
109JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
110JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
111JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
112JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
113JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
114JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
115JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
116JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
117JMESSAGE(JERR_TFILE_WRITE,
118 "Write failed on temporary file --- out of disk space?")
119JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
120JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
121JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
122JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
123JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
124JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
125JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
126JMESSAGE(JMSG_VERSION, JVERSION)
127JMESSAGE(JTRC_16BIT_TABLES,
128 "Caution: quantization tables are too coarse for baseline JPEG")
129JMESSAGE(JTRC_ADOBE,
130 "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
131JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
132JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
133JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
134JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
135JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
136JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
137JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
138JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
139JMESSAGE(JTRC_EOI, "End Of Image")
140JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
141JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
142JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
143 "Warning: thumbnail image size does not match data length %u")
144JMESSAGE(JTRC_JFIF_EXTENSION,
145 "JFIF extension marker: type 0x%02x, length %u")
146JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
147JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
148JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
149JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
150JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
151JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
152JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
153JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
154JMESSAGE(JTRC_RST, "RST%d")
155JMESSAGE(JTRC_SMOOTH_NOTIMPL,
156 "Smoothing not supported with nonstandard sampling ratios")
157JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
158JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
159JMESSAGE(JTRC_SOI, "Start of Image")
160JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
161JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
162JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
163JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
164JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
165JMESSAGE(JTRC_THUMB_JPEG,
166 "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
167JMESSAGE(JTRC_THUMB_PALETTE,
168 "JFIF extension marker: palette thumbnail image, length %u")
169JMESSAGE(JTRC_THUMB_RGB,
170 "JFIF extension marker: RGB thumbnail image, length %u")
171JMESSAGE(JTRC_UNKNOWN_IDS,
172 "Unrecognized component IDs %d %d %d, assuming YCbCr")
173JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
174JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
175JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
176JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
177JMESSAGE(JWRN_BOGUS_PROGRESSION,
178 "Inconsistent progression sequence for component %d coefficient %d")
179JMESSAGE(JWRN_EXTRANEOUS_DATA,
180 "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
181JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
182JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
183JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
184JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
185JMESSAGE(JWRN_MUST_RESYNC,
186 "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
187JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
188JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
189
190#ifdef JMAKE_ENUM_LIST
191
192 JMSG_LASTMSGCODE
193} J_MESSAGE_CODE;
194
195#undef JMAKE_ENUM_LIST
196#endif /* JMAKE_ENUM_LIST */
197
198/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
199#undef JMESSAGE
200
201
202#ifndef JERROR_H
203#define JERROR_H
204
205/* Macros to simplify using the error and trace message stuff */
206/* The first parameter is either type of cinfo pointer */
207
208/* Fatal errors (print message and exit) */
209#define ERREXIT(cinfo,code) \
210 ((cinfo)->err->msg_code = (code), \
211 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
212#define ERREXIT1(cinfo,code,p1) \
213 ((cinfo)->err->msg_code = (code), \
214 (cinfo)->err->msg_parm.i[0] = (p1), \
215 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
216#define ERREXIT2(cinfo,code,p1,p2) \
217 ((cinfo)->err->msg_code = (code), \
218 (cinfo)->err->msg_parm.i[0] = (p1), \
219 (cinfo)->err->msg_parm.i[1] = (p2), \
220 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
221#define ERREXIT3(cinfo,code,p1,p2,p3) \
222 ((cinfo)->err->msg_code = (code), \
223 (cinfo)->err->msg_parm.i[0] = (p1), \
224 (cinfo)->err->msg_parm.i[1] = (p2), \
225 (cinfo)->err->msg_parm.i[2] = (p3), \
226 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
227#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
228 ((cinfo)->err->msg_code = (code), \
229 (cinfo)->err->msg_parm.i[0] = (p1), \
230 (cinfo)->err->msg_parm.i[1] = (p2), \
231 (cinfo)->err->msg_parm.i[2] = (p3), \
232 (cinfo)->err->msg_parm.i[3] = (p4), \
233 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
234#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \
235 ((cinfo)->err->msg_code = (code), \
236 (cinfo)->err->msg_parm.i[0] = (p1), \
237 (cinfo)->err->msg_parm.i[1] = (p2), \
238 (cinfo)->err->msg_parm.i[2] = (p3), \
239 (cinfo)->err->msg_parm.i[3] = (p4), \
240 (cinfo)->err->msg_parm.i[4] = (p5), \
241 (cinfo)->err->msg_parm.i[5] = (p6), \
242 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
243#define ERREXITS(cinfo,code,str) \
244 ((cinfo)->err->msg_code = (code), \
245 strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
246 (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
247
248#define MAKESTMT(stuff) do { stuff } while (0)
249
250/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
251#define WARNMS(cinfo,code) \
252 ((cinfo)->err->msg_code = (code), \
253 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
254#define WARNMS1(cinfo,code,p1) \
255 ((cinfo)->err->msg_code = (code), \
256 (cinfo)->err->msg_parm.i[0] = (p1), \
257 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
258#define WARNMS2(cinfo,code,p1,p2) \
259 ((cinfo)->err->msg_code = (code), \
260 (cinfo)->err->msg_parm.i[0] = (p1), \
261 (cinfo)->err->msg_parm.i[1] = (p2), \
262 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
263
264/* Informational/debugging messages */
265#define TRACEMS(cinfo,lvl,code) \
266 ((cinfo)->err->msg_code = (code), \
267 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
268#define TRACEMS1(cinfo,lvl,code,p1) \
269 ((cinfo)->err->msg_code = (code), \
270 (cinfo)->err->msg_parm.i[0] = (p1), \
271 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
272#define TRACEMS2(cinfo,lvl,code,p1,p2) \
273 ((cinfo)->err->msg_code = (code), \
274 (cinfo)->err->msg_parm.i[0] = (p1), \
275 (cinfo)->err->msg_parm.i[1] = (p2), \
276 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
277#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
278 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
279 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
280 (cinfo)->err->msg_code = (code); \
281 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
282#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
283 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
284 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
285 (cinfo)->err->msg_code = (code); \
286 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
287#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
288 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
289 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
290 _mp[4] = (p5); \
291 (cinfo)->err->msg_code = (code); \
292 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
293#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
294 MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
295 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
296 _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
297 (cinfo)->err->msg_code = (code); \
298 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
299#define TRACEMSS(cinfo,lvl,code,str) \
300 ((cinfo)->err->msg_code = (code), \
301 strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
302 (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
303
304#endif /* JERROR_H */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctflt.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctflt.c
new file mode 100644
index 0000000..3c1b174
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctflt.c
@@ -0,0 +1,174 @@
1/*
2 * jfdctflt.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * Modified 2003-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a floating-point implementation of the
10 * forward DCT (Discrete Cosine Transform).
11 *
12 * This implementation should be more accurate than either of the integer
13 * DCT implementations. However, it may not give the same results on all
14 * machines because of differences in roundoff behavior. Speed will depend
15 * on the hardware's floating point capacity.
16 *
17 * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
18 * on each column. Direct algorithms are also available, but they are
19 * much more complex and seem not to be any faster when reduced to code.
20 *
21 * This implementation is based on Arai, Agui, and Nakajima's algorithm for
22 * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
23 * Japanese, but the algorithm is described in the Pennebaker & Mitchell
24 * JPEG textbook (see REFERENCES section in file README). The following code
25 * is based directly on figure 4-8 in P&M.
26 * While an 8-point DCT cannot be done in less than 11 multiplies, it is
27 * possible to arrange the computation so that many of the multiplies are
28 * simple scalings of the final outputs. These multiplies can then be
29 * folded into the multiplications or divisions by the JPEG quantization
30 * table entries. The AA&N method leaves only 5 multiplies and 29 adds
31 * to be done in the DCT itself.
32 * The primary disadvantage of this method is that with a fixed-point
33 * implementation, accuracy is lost due to imprecise representation of the
34 * scaled quantization values. However, that problem does not arise if
35 * we use floating point arithmetic.
36 */
37
38#define JPEG_INTERNALS
39#include "jinclude.h"
40#include "jpeglib.h"
41#include "jdct.h" /* Private declarations for DCT subsystem */
42
43#ifdef DCT_FLOAT_SUPPORTED
44
45
46/*
47 * This module is specialized to the case DCTSIZE = 8.
48 */
49
50#if DCTSIZE != 8
51 Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
52#endif
53
54
55/*
56 * Perform the forward DCT on one block of samples.
57 */
58
59GLOBAL(void)
60jpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col)
61{
62 FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
63 FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
64 FAST_FLOAT z1, z2, z3, z4, z5, z11, z13;
65 FAST_FLOAT *dataptr;
66 JSAMPROW elemptr;
67 int ctr;
68
69 /* Pass 1: process rows. */
70
71 dataptr = data;
72 for (ctr = 0; ctr < DCTSIZE; ctr++) {
73 elemptr = sample_data[ctr] + start_col;
74
75 /* Load data into workspace */
76 tmp0 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]));
77 tmp7 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]));
78 tmp1 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]));
79 tmp6 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]));
80 tmp2 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]));
81 tmp5 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]));
82 tmp3 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]));
83 tmp4 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]));
84
85 /* Even part */
86
87 tmp10 = tmp0 + tmp3; /* phase 2 */
88 tmp13 = tmp0 - tmp3;
89 tmp11 = tmp1 + tmp2;
90 tmp12 = tmp1 - tmp2;
91
92 /* Apply unsigned->signed conversion */
93 dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
94 dataptr[4] = tmp10 - tmp11;
95
96 z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */
97 dataptr[2] = tmp13 + z1; /* phase 5 */
98 dataptr[6] = tmp13 - z1;
99
100 /* Odd part */
101
102 tmp10 = tmp4 + tmp5; /* phase 2 */
103 tmp11 = tmp5 + tmp6;
104 tmp12 = tmp6 + tmp7;
105
106 /* The rotator is modified from fig 4-8 to avoid extra negations. */
107 z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */
108 z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */
109 z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */
110 z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */
111
112 z11 = tmp7 + z3; /* phase 5 */
113 z13 = tmp7 - z3;
114
115 dataptr[5] = z13 + z2; /* phase 6 */
116 dataptr[3] = z13 - z2;
117 dataptr[1] = z11 + z4;
118 dataptr[7] = z11 - z4;
119
120 dataptr += DCTSIZE; /* advance pointer to next row */
121 }
122
123 /* Pass 2: process columns. */
124
125 dataptr = data;
126 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
127 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
128 tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
129 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
130 tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
131 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
132 tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
133 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
134 tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
135
136 /* Even part */
137
138 tmp10 = tmp0 + tmp3; /* phase 2 */
139 tmp13 = tmp0 - tmp3;
140 tmp11 = tmp1 + tmp2;
141 tmp12 = tmp1 - tmp2;
142
143 dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
144 dataptr[DCTSIZE*4] = tmp10 - tmp11;
145
146 z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */
147 dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
148 dataptr[DCTSIZE*6] = tmp13 - z1;
149
150 /* Odd part */
151
152 tmp10 = tmp4 + tmp5; /* phase 2 */
153 tmp11 = tmp5 + tmp6;
154 tmp12 = tmp6 + tmp7;
155
156 /* The rotator is modified from fig 4-8 to avoid extra negations. */
157 z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */
158 z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */
159 z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */
160 z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */
161
162 z11 = tmp7 + z3; /* phase 5 */
163 z13 = tmp7 - z3;
164
165 dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
166 dataptr[DCTSIZE*3] = z13 - z2;
167 dataptr[DCTSIZE*1] = z11 + z4;
168 dataptr[DCTSIZE*7] = z11 - z4;
169
170 dataptr++; /* advance pointer to next column */
171 }
172}
173
174#endif /* DCT_FLOAT_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctfst.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctfst.c
new file mode 100644
index 0000000..82b9231
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctfst.c
@@ -0,0 +1,230 @@
1/*
2 * jfdctfst.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * Modified 2003-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a fast, not so accurate integer implementation of the
10 * forward DCT (Discrete Cosine Transform).
11 *
12 * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
13 * on each column. Direct algorithms are also available, but they are
14 * much more complex and seem not to be any faster when reduced to code.
15 *
16 * This implementation is based on Arai, Agui, and Nakajima's algorithm for
17 * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
18 * Japanese, but the algorithm is described in the Pennebaker & Mitchell
19 * JPEG textbook (see REFERENCES section in file README). The following code
20 * is based directly on figure 4-8 in P&M.
21 * While an 8-point DCT cannot be done in less than 11 multiplies, it is
22 * possible to arrange the computation so that many of the multiplies are
23 * simple scalings of the final outputs. These multiplies can then be
24 * folded into the multiplications or divisions by the JPEG quantization
25 * table entries. The AA&N method leaves only 5 multiplies and 29 adds
26 * to be done in the DCT itself.
27 * The primary disadvantage of this method is that with fixed-point math,
28 * accuracy is lost due to imprecise representation of the scaled
29 * quantization values. The smaller the quantization table entry, the less
30 * precise the scaled value, so this implementation does worse with high-
31 * quality-setting files than with low-quality ones.
32 */
33
34#define JPEG_INTERNALS
35#include "jinclude.h"
36#include "jpeglib.h"
37#include "jdct.h" /* Private declarations for DCT subsystem */
38
39#ifdef DCT_IFAST_SUPPORTED
40
41
42/*
43 * This module is specialized to the case DCTSIZE = 8.
44 */
45
46#if DCTSIZE != 8
47 Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
48#endif
49
50
51/* Scaling decisions are generally the same as in the LL&M algorithm;
52 * see jfdctint.c for more details. However, we choose to descale
53 * (right shift) multiplication products as soon as they are formed,
54 * rather than carrying additional fractional bits into subsequent additions.
55 * This compromises accuracy slightly, but it lets us save a few shifts.
56 * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
57 * everywhere except in the multiplications proper; this saves a good deal
58 * of work on 16-bit-int machines.
59 *
60 * Again to save a few shifts, the intermediate results between pass 1 and
61 * pass 2 are not upscaled, but are represented only to integral precision.
62 *
63 * A final compromise is to represent the multiplicative constants to only
64 * 8 fractional bits, rather than 13. This saves some shifting work on some
65 * machines, and may also reduce the cost of multiplication (since there
66 * are fewer one-bits in the constants).
67 */
68
69#define CONST_BITS 8
70
71
72/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
73 * causing a lot of useless floating-point operations at run time.
74 * To get around this we use the following pre-calculated constants.
75 * If you change CONST_BITS you may want to add appropriate values.
76 * (With a reasonable C compiler, you can just rely on the FIX() macro...)
77 */
78
79#if CONST_BITS == 8
80#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */
81#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */
82#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */
83#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */
84#else
85#define FIX_0_382683433 FIX(0.382683433)
86#define FIX_0_541196100 FIX(0.541196100)
87#define FIX_0_707106781 FIX(0.707106781)
88#define FIX_1_306562965 FIX(1.306562965)
89#endif
90
91
92/* We can gain a little more speed, with a further compromise in accuracy,
93 * by omitting the addition in a descaling shift. This yields an incorrectly
94 * rounded result half the time...
95 */
96
97#ifndef USE_ACCURATE_ROUNDING
98#undef DESCALE
99#define DESCALE(x,n) RIGHT_SHIFT(x, n)
100#endif
101
102
103/* Multiply a DCTELEM variable by an INT32 constant, and immediately
104 * descale to yield a DCTELEM result.
105 */
106
107#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
108
109
110/*
111 * Perform the forward DCT on one block of samples.
112 */
113
114GLOBAL(void)
115jpeg_fdct_ifast (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
116{
117 DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
118 DCTELEM tmp10, tmp11, tmp12, tmp13;
119 DCTELEM z1, z2, z3, z4, z5, z11, z13;
120 DCTELEM *dataptr;
121 JSAMPROW elemptr;
122 int ctr;
123 SHIFT_TEMPS
124
125 /* Pass 1: process rows. */
126
127 dataptr = data;
128 for (ctr = 0; ctr < DCTSIZE; ctr++) {
129 elemptr = sample_data[ctr] + start_col;
130
131 /* Load data into workspace */
132 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);
133 tmp7 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);
134 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);
135 tmp6 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);
136 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);
137 tmp5 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
138 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);
139 tmp4 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
140
141 /* Even part */
142
143 tmp10 = tmp0 + tmp3; /* phase 2 */
144 tmp13 = tmp0 - tmp3;
145 tmp11 = tmp1 + tmp2;
146 tmp12 = tmp1 - tmp2;
147
148 /* Apply unsigned->signed conversion */
149 dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
150 dataptr[4] = tmp10 - tmp11;
151
152 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
153 dataptr[2] = tmp13 + z1; /* phase 5 */
154 dataptr[6] = tmp13 - z1;
155
156 /* Odd part */
157
158 tmp10 = tmp4 + tmp5; /* phase 2 */
159 tmp11 = tmp5 + tmp6;
160 tmp12 = tmp6 + tmp7;
161
162 /* The rotator is modified from fig 4-8 to avoid extra negations. */
163 z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
164 z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
165 z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
166 z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
167
168 z11 = tmp7 + z3; /* phase 5 */
169 z13 = tmp7 - z3;
170
171 dataptr[5] = z13 + z2; /* phase 6 */
172 dataptr[3] = z13 - z2;
173 dataptr[1] = z11 + z4;
174 dataptr[7] = z11 - z4;
175
176 dataptr += DCTSIZE; /* advance pointer to next row */
177 }
178
179 /* Pass 2: process columns. */
180
181 dataptr = data;
182 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
183 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
184 tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
185 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
186 tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
187 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
188 tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
189 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
190 tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
191
192 /* Even part */
193
194 tmp10 = tmp0 + tmp3; /* phase 2 */
195 tmp13 = tmp0 - tmp3;
196 tmp11 = tmp1 + tmp2;
197 tmp12 = tmp1 - tmp2;
198
199 dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
200 dataptr[DCTSIZE*4] = tmp10 - tmp11;
201
202 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
203 dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
204 dataptr[DCTSIZE*6] = tmp13 - z1;
205
206 /* Odd part */
207
208 tmp10 = tmp4 + tmp5; /* phase 2 */
209 tmp11 = tmp5 + tmp6;
210 tmp12 = tmp6 + tmp7;
211
212 /* The rotator is modified from fig 4-8 to avoid extra negations. */
213 z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
214 z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
215 z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
216 z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
217
218 z11 = tmp7 + z3; /* phase 5 */
219 z13 = tmp7 - z3;
220
221 dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
222 dataptr[DCTSIZE*3] = z13 - z2;
223 dataptr[DCTSIZE*1] = z11 + z4;
224 dataptr[DCTSIZE*7] = z11 - z4;
225
226 dataptr++; /* advance pointer to next column */
227 }
228}
229
230#endif /* DCT_IFAST_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctint.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctint.c
new file mode 100644
index 0000000..529eaf8
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jfdctint.c
@@ -0,0 +1,4348 @@
1/*
2 * jfdctint.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modification developed 2003-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a slow-but-accurate integer implementation of the
10 * forward DCT (Discrete Cosine Transform).
11 *
12 * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
13 * on each column. Direct algorithms are also available, but they are
14 * much more complex and seem not to be any faster when reduced to code.
15 *
16 * This implementation is based on an algorithm described in
17 * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
18 * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
19 * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
20 * The primary algorithm described there uses 11 multiplies and 29 adds.
21 * We use their alternate method with 12 multiplies and 32 adds.
22 * The advantage of this method is that no data path contains more than one
23 * multiplication; this allows a very simple and accurate implementation in
24 * scaled fixed-point arithmetic, with a minimal number of shifts.
25 *
26 * We also provide FDCT routines with various input sample block sizes for
27 * direct resolution reduction or enlargement and for direct resolving the
28 * common 2x1 and 1x2 subsampling cases without additional resampling: NxN
29 * (N=1...16), 2NxN, and Nx2N (N=1...8) pixels for one 8x8 output DCT block.
30 *
31 * For N<8 we fill the remaining block coefficients with zero.
32 * For N>8 we apply a partial N-point FDCT on the input samples, computing
33 * just the lower 8 frequency coefficients and discarding the rest.
34 *
35 * We must scale the output coefficients of the N-point FDCT appropriately
36 * to the standard 8-point FDCT level by 8/N per 1-D pass. This scaling
37 * is folded into the constant multipliers (pass 2) and/or final/initial
38 * shifting.
39 *
40 * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases
41 * since there would be too many additional constants to pre-calculate.
42 */
43
44#define JPEG_INTERNALS
45#include "jinclude.h"
46#include "jpeglib.h"
47#include "jdct.h" /* Private declarations for DCT subsystem */
48
49#ifdef DCT_ISLOW_SUPPORTED
50
51
52/*
53 * This module is specialized to the case DCTSIZE = 8.
54 */
55
56#if DCTSIZE != 8
57 Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
58#endif
59
60
61/*
62 * The poop on this scaling stuff is as follows:
63 *
64 * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
65 * larger than the true DCT outputs. The final outputs are therefore
66 * a factor of N larger than desired; since N=8 this can be cured by
67 * a simple right shift at the end of the algorithm. The advantage of
68 * this arrangement is that we save two multiplications per 1-D DCT,
69 * because the y0 and y4 outputs need not be divided by sqrt(N).
70 * In the IJG code, this factor of 8 is removed by the quantization step
71 * (in jcdctmgr.c), NOT in this module.
72 *
73 * We have to do addition and subtraction of the integer inputs, which
74 * is no problem, and multiplication by fractional constants, which is
75 * a problem to do in integer arithmetic. We multiply all the constants
76 * by CONST_SCALE and convert them to integer constants (thus retaining
77 * CONST_BITS bits of precision in the constants). After doing a
78 * multiplication we have to divide the product by CONST_SCALE, with proper
79 * rounding, to produce the correct output. This division can be done
80 * cheaply as a right shift of CONST_BITS bits. We postpone shifting
81 * as long as possible so that partial sums can be added together with
82 * full fractional precision.
83 *
84 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
85 * they are represented to better-than-integral precision. These outputs
86 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
87 * with the recommended scaling. (For 12-bit sample data, the intermediate
88 * array is INT32 anyway.)
89 *
90 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
91 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
92 * shows that the values given below are the most effective.
93 */
94
95#if BITS_IN_JSAMPLE == 8
96#define CONST_BITS 13
97#define PASS1_BITS 2
98#else
99#define CONST_BITS 13
100#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
101#endif
102
103/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
104 * causing a lot of useless floating-point operations at run time.
105 * To get around this we use the following pre-calculated constants.
106 * If you change CONST_BITS you may want to add appropriate values.
107 * (With a reasonable C compiler, you can just rely on the FIX() macro...)
108 */
109
110#if CONST_BITS == 13
111#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
112#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
113#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
114#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
115#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
116#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
117#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
118#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
119#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
120#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
121#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
122#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
123#else
124#define FIX_0_298631336 FIX(0.298631336)
125#define FIX_0_390180644 FIX(0.390180644)
126#define FIX_0_541196100 FIX(0.541196100)
127#define FIX_0_765366865 FIX(0.765366865)
128#define FIX_0_899976223 FIX(0.899976223)
129#define FIX_1_175875602 FIX(1.175875602)
130#define FIX_1_501321110 FIX(1.501321110)
131#define FIX_1_847759065 FIX(1.847759065)
132#define FIX_1_961570560 FIX(1.961570560)
133#define FIX_2_053119869 FIX(2.053119869)
134#define FIX_2_562915447 FIX(2.562915447)
135#define FIX_3_072711026 FIX(3.072711026)
136#endif
137
138
139/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
140 * For 8-bit samples with the recommended scaling, all the variable
141 * and constant values involved are no more than 16 bits wide, so a
142 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
143 * For 12-bit samples, a full 32-bit multiplication will be needed.
144 */
145
146#if BITS_IN_JSAMPLE == 8
147#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
148#else
149#define MULTIPLY(var,const) ((var) * (const))
150#endif
151
152
153/*
154 * Perform the forward DCT on one block of samples.
155 */
156
157GLOBAL(void)
158jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
159{
160 INT32 tmp0, tmp1, tmp2, tmp3;
161 INT32 tmp10, tmp11, tmp12, tmp13;
162 INT32 z1;
163 DCTELEM *dataptr;
164 JSAMPROW elemptr;
165 int ctr;
166 SHIFT_TEMPS
167
168 /* Pass 1: process rows. */
169 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
170 /* furthermore, we scale the results by 2**PASS1_BITS. */
171
172 dataptr = data;
173 for (ctr = 0; ctr < DCTSIZE; ctr++) {
174 elemptr = sample_data[ctr] + start_col;
175
176 /* Even part per LL&M figure 1 --- note that published figure is faulty;
177 * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
178 */
179
180 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);
181 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);
182 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);
183 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);
184
185 tmp10 = tmp0 + tmp3;
186 tmp12 = tmp0 - tmp3;
187 tmp11 = tmp1 + tmp2;
188 tmp13 = tmp1 - tmp2;
189
190 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);
191 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);
192 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
193 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
194
195 /* Apply unsigned->signed conversion */
196 dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);
197 dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
198
199 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
200 /* Add fudge factor here for final descale. */
201 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
202 dataptr[2] = (DCTELEM) RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865),
203 CONST_BITS-PASS1_BITS);
204 dataptr[6] = (DCTELEM) RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065),
205 CONST_BITS-PASS1_BITS);
206
207 /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
208 * cK represents sqrt(2) * cos(K*pi/16).
209 * i0..i3 in the paper are tmp0..tmp3 here.
210 */
211
212 tmp10 = tmp0 + tmp3;
213 tmp11 = tmp1 + tmp2;
214 tmp12 = tmp0 + tmp2;
215 tmp13 = tmp1 + tmp3;
216 z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */
217 /* Add fudge factor here for final descale. */
218 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
219
220 tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */
221 tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */
222 tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */
223 tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */
224 tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */
225 tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */
226 tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */
227 tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */
228
229 tmp12 += z1;
230 tmp13 += z1;
231
232 dataptr[1] = (DCTELEM)
233 RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS);
234 dataptr[3] = (DCTELEM)
235 RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS);
236 dataptr[5] = (DCTELEM)
237 RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS);
238 dataptr[7] = (DCTELEM)
239 RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS);
240
241 dataptr += DCTSIZE; /* advance pointer to next row */
242 }
243
244 /* Pass 2: process columns.
245 * We remove the PASS1_BITS scaling, but leave the results scaled up
246 * by an overall factor of 8.
247 */
248
249 dataptr = data;
250 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
251 /* Even part per LL&M figure 1 --- note that published figure is faulty;
252 * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
253 */
254
255 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
256 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
257 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
258 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
259
260 /* Add fudge factor here for final descale. */
261 tmp10 = tmp0 + tmp3 + (ONE << (PASS1_BITS-1));
262 tmp12 = tmp0 - tmp3;
263 tmp11 = tmp1 + tmp2;
264 tmp13 = tmp1 - tmp2;
265
266 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
267 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
268 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
269 tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
270
271 dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS);
272 dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS);
273
274 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
275 /* Add fudge factor here for final descale. */
276 z1 += ONE << (CONST_BITS+PASS1_BITS-1);
277 dataptr[DCTSIZE*2] = (DCTELEM)
278 RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), CONST_BITS+PASS1_BITS);
279 dataptr[DCTSIZE*6] = (DCTELEM)
280 RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), CONST_BITS+PASS1_BITS);
281
282 /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
283 * cK represents sqrt(2) * cos(K*pi/16).
284 * i0..i3 in the paper are tmp0..tmp3 here.
285 */
286
287 tmp10 = tmp0 + tmp3;
288 tmp11 = tmp1 + tmp2;
289 tmp12 = tmp0 + tmp2;
290 tmp13 = tmp1 + tmp3;
291 z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */
292 /* Add fudge factor here for final descale. */
293 z1 += ONE << (CONST_BITS+PASS1_BITS-1);
294
295 tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */
296 tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */
297 tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */
298 tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */
299 tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */
300 tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */
301 tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */
302 tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */
303
304 tmp12 += z1;
305 tmp13 += z1;
306
307 dataptr[DCTSIZE*1] = (DCTELEM)
308 RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS+PASS1_BITS);
309 dataptr[DCTSIZE*3] = (DCTELEM)
310 RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS+PASS1_BITS);
311 dataptr[DCTSIZE*5] = (DCTELEM)
312 RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS+PASS1_BITS);
313 dataptr[DCTSIZE*7] = (DCTELEM)
314 RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS+PASS1_BITS);
315
316 dataptr++; /* advance pointer to next column */
317 }
318}
319
320#ifdef DCT_SCALING_SUPPORTED
321
322
323/*
324 * Perform the forward DCT on a 7x7 sample block.
325 */
326
327GLOBAL(void)
328jpeg_fdct_7x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
329{
330 INT32 tmp0, tmp1, tmp2, tmp3;
331 INT32 tmp10, tmp11, tmp12;
332 INT32 z1, z2, z3;
333 DCTELEM *dataptr;
334 JSAMPROW elemptr;
335 int ctr;
336 SHIFT_TEMPS
337
338 /* Pre-zero output coefficient block. */
339 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
340
341 /* Pass 1: process rows. */
342 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
343 /* furthermore, we scale the results by 2**PASS1_BITS. */
344 /* cK represents sqrt(2) * cos(K*pi/14). */
345
346 dataptr = data;
347 for (ctr = 0; ctr < 7; ctr++) {
348 elemptr = sample_data[ctr] + start_col;
349
350 /* Even part */
351
352 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[6]);
353 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[5]);
354 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[4]);
355 tmp3 = GETJSAMPLE(elemptr[3]);
356
357 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[6]);
358 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[5]);
359 tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);
360
361 z1 = tmp0 + tmp2;
362 /* Apply unsigned->signed conversion */
363 dataptr[0] = (DCTELEM)
364 ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);
365 tmp3 += tmp3;
366 z1 -= tmp3;
367 z1 -= tmp3;
368 z1 = MULTIPLY(z1, FIX(0.353553391)); /* (c2+c6-c4)/2 */
369 z2 = MULTIPLY(tmp0 - tmp2, FIX(0.920609002)); /* (c2+c4-c6)/2 */
370 z3 = MULTIPLY(tmp1 - tmp2, FIX(0.314692123)); /* c6 */
371 dataptr[2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS-PASS1_BITS);
372 z1 -= z2;
373 z2 = MULTIPLY(tmp0 - tmp1, FIX(0.881747734)); /* c4 */
374 dataptr[4] = (DCTELEM)
375 DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.707106781)), /* c2+c6-c4 */
376 CONST_BITS-PASS1_BITS);
377 dataptr[6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS-PASS1_BITS);
378
379 /* Odd part */
380
381 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(0.935414347)); /* (c3+c1-c5)/2 */
382 tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.170262339)); /* (c3+c5-c1)/2 */
383 tmp0 = tmp1 - tmp2;
384 tmp1 += tmp2;
385 tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.378756276)); /* -c1 */
386 tmp1 += tmp2;
387 tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.613604268)); /* c5 */
388 tmp0 += tmp3;
389 tmp2 += tmp3 + MULTIPLY(tmp12, FIX(1.870828693)); /* c3+c1-c5 */
390
391 dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS);
392 dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS);
393 dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS);
394
395 dataptr += DCTSIZE; /* advance pointer to next row */
396 }
397
398 /* Pass 2: process columns.
399 * We remove the PASS1_BITS scaling, but leave the results scaled up
400 * by an overall factor of 8.
401 * We must also scale the output by (8/7)**2 = 64/49, which we fold
402 * into the constant multipliers:
403 * cK now represents sqrt(2) * cos(K*pi/14) * 64/49.
404 */
405
406 dataptr = data;
407 for (ctr = 0; ctr < 7; ctr++) {
408 /* Even part */
409
410 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*6];
411 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*5];
412 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*4];
413 tmp3 = dataptr[DCTSIZE*3];
414
415 tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*6];
416 tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*5];
417 tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*4];
418
419 z1 = tmp0 + tmp2;
420 dataptr[DCTSIZE*0] = (DCTELEM)
421 DESCALE(MULTIPLY(z1 + tmp1 + tmp3, FIX(1.306122449)), /* 64/49 */
422 CONST_BITS+PASS1_BITS);
423 tmp3 += tmp3;
424 z1 -= tmp3;
425 z1 -= tmp3;
426 z1 = MULTIPLY(z1, FIX(0.461784020)); /* (c2+c6-c4)/2 */
427 z2 = MULTIPLY(tmp0 - tmp2, FIX(1.202428084)); /* (c2+c4-c6)/2 */
428 z3 = MULTIPLY(tmp1 - tmp2, FIX(0.411026446)); /* c6 */
429 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS+PASS1_BITS);
430 z1 -= z2;
431 z2 = MULTIPLY(tmp0 - tmp1, FIX(1.151670509)); /* c4 */
432 dataptr[DCTSIZE*4] = (DCTELEM)
433 DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.923568041)), /* c2+c6-c4 */
434 CONST_BITS+PASS1_BITS);
435 dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+PASS1_BITS);
436
437 /* Odd part */
438
439 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.221765677)); /* (c3+c1-c5)/2 */
440 tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.222383464)); /* (c3+c5-c1)/2 */
441 tmp0 = tmp1 - tmp2;
442 tmp1 += tmp2;
443 tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.800824523)); /* -c1 */
444 tmp1 += tmp2;
445 tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.801442310)); /* c5 */
446 tmp0 += tmp3;
447 tmp2 += tmp3 + MULTIPLY(tmp12, FIX(2.443531355)); /* c3+c1-c5 */
448
449 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS);
450 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS);
451 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS);
452
453 dataptr++; /* advance pointer to next column */
454 }
455}
456
457
458/*
459 * Perform the forward DCT on a 6x6 sample block.
460 */
461
462GLOBAL(void)
463jpeg_fdct_6x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
464{
465 INT32 tmp0, tmp1, tmp2;
466 INT32 tmp10, tmp11, tmp12;
467 DCTELEM *dataptr;
468 JSAMPROW elemptr;
469 int ctr;
470 SHIFT_TEMPS
471
472 /* Pre-zero output coefficient block. */
473 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
474
475 /* Pass 1: process rows. */
476 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
477 /* furthermore, we scale the results by 2**PASS1_BITS. */
478 /* cK represents sqrt(2) * cos(K*pi/12). */
479
480 dataptr = data;
481 for (ctr = 0; ctr < 6; ctr++) {
482 elemptr = sample_data[ctr] + start_col;
483
484 /* Even part */
485
486 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]);
487 tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]);
488 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]);
489
490 tmp10 = tmp0 + tmp2;
491 tmp12 = tmp0 - tmp2;
492
493 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]);
494 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
495 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
496
497 /* Apply unsigned->signed conversion */
498 dataptr[0] = (DCTELEM)
499 ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);
500 dataptr[2] = (DCTELEM)
501 DESCALE(MULTIPLY(tmp12, FIX(1.224744871)), /* c2 */
502 CONST_BITS-PASS1_BITS);
503 dataptr[4] = (DCTELEM)
504 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */
505 CONST_BITS-PASS1_BITS);
506
507 /* Odd part */
508
509 tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)), /* c5 */
510 CONST_BITS-PASS1_BITS);
511
512 dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << PASS1_BITS));
513 dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << PASS1_BITS);
514 dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << PASS1_BITS));
515
516 dataptr += DCTSIZE; /* advance pointer to next row */
517 }
518
519 /* Pass 2: process columns.
520 * We remove the PASS1_BITS scaling, but leave the results scaled up
521 * by an overall factor of 8.
522 * We must also scale the output by (8/6)**2 = 16/9, which we fold
523 * into the constant multipliers:
524 * cK now represents sqrt(2) * cos(K*pi/12) * 16/9.
525 */
526
527 dataptr = data;
528 for (ctr = 0; ctr < 6; ctr++) {
529 /* Even part */
530
531 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5];
532 tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4];
533 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
534
535 tmp10 = tmp0 + tmp2;
536 tmp12 = tmp0 - tmp2;
537
538 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5];
539 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4];
540 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
541
542 dataptr[DCTSIZE*0] = (DCTELEM)
543 DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)), /* 16/9 */
544 CONST_BITS+PASS1_BITS);
545 dataptr[DCTSIZE*2] = (DCTELEM)
546 DESCALE(MULTIPLY(tmp12, FIX(2.177324216)), /* c2 */
547 CONST_BITS+PASS1_BITS);
548 dataptr[DCTSIZE*4] = (DCTELEM)
549 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */
550 CONST_BITS+PASS1_BITS);
551
552 /* Odd part */
553
554 tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829)); /* c5 */
555
556 dataptr[DCTSIZE*1] = (DCTELEM)
557 DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */
558 CONST_BITS+PASS1_BITS);
559 dataptr[DCTSIZE*3] = (DCTELEM)
560 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)), /* 16/9 */
561 CONST_BITS+PASS1_BITS);
562 dataptr[DCTSIZE*5] = (DCTELEM)
563 DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)), /* 16/9 */
564 CONST_BITS+PASS1_BITS);
565
566 dataptr++; /* advance pointer to next column */
567 }
568}
569
570
571/*
572 * Perform the forward DCT on a 5x5 sample block.
573 */
574
575GLOBAL(void)
576jpeg_fdct_5x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
577{
578 INT32 tmp0, tmp1, tmp2;
579 INT32 tmp10, tmp11;
580 DCTELEM *dataptr;
581 JSAMPROW elemptr;
582 int ctr;
583 SHIFT_TEMPS
584
585 /* Pre-zero output coefficient block. */
586 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
587
588 /* Pass 1: process rows. */
589 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
590 /* furthermore, we scale the results by 2**PASS1_BITS. */
591 /* We scale the results further by 2 as part of output adaption */
592 /* scaling for different DCT size. */
593 /* cK represents sqrt(2) * cos(K*pi/10). */
594
595 dataptr = data;
596 for (ctr = 0; ctr < 5; ctr++) {
597 elemptr = sample_data[ctr] + start_col;
598
599 /* Even part */
600
601 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[4]);
602 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[3]);
603 tmp2 = GETJSAMPLE(elemptr[2]);
604
605 tmp10 = tmp0 + tmp1;
606 tmp11 = tmp0 - tmp1;
607
608 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);
609 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);
610
611 /* Apply unsigned->signed conversion */
612 dataptr[0] = (DCTELEM)
613 ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1));
614 tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */
615 tmp10 -= tmp2 << 2;
616 tmp10 = MULTIPLY(tmp10, FIX(0.353553391)); /* (c2-c4)/2 */
617 dataptr[2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS-PASS1_BITS-1);
618 dataptr[4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS-PASS1_BITS-1);
619
620 /* Odd part */
621
622 tmp10 = MULTIPLY(tmp0 + tmp1, FIX(0.831253876)); /* c3 */
623
624 dataptr[1] = (DCTELEM)
625 DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.513743148)), /* c1-c3 */
626 CONST_BITS-PASS1_BITS-1);
627 dataptr[3] = (DCTELEM)
628 DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.176250899)), /* c1+c3 */
629 CONST_BITS-PASS1_BITS-1);
630
631 dataptr += DCTSIZE; /* advance pointer to next row */
632 }
633
634 /* Pass 2: process columns.
635 * We remove the PASS1_BITS scaling, but leave the results scaled up
636 * by an overall factor of 8.
637 * We must also scale the output by (8/5)**2 = 64/25, which we partially
638 * fold into the constant multipliers (other part was done in pass 1):
639 * cK now represents sqrt(2) * cos(K*pi/10) * 32/25.
640 */
641
642 dataptr = data;
643 for (ctr = 0; ctr < 5; ctr++) {
644 /* Even part */
645
646 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*4];
647 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*3];
648 tmp2 = dataptr[DCTSIZE*2];
649
650 tmp10 = tmp0 + tmp1;
651 tmp11 = tmp0 - tmp1;
652
653 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*4];
654 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*3];
655
656 dataptr[DCTSIZE*0] = (DCTELEM)
657 DESCALE(MULTIPLY(tmp10 + tmp2, FIX(1.28)), /* 32/25 */
658 CONST_BITS+PASS1_BITS);
659 tmp11 = MULTIPLY(tmp11, FIX(1.011928851)); /* (c2+c4)/2 */
660 tmp10 -= tmp2 << 2;
661 tmp10 = MULTIPLY(tmp10, FIX(0.452548340)); /* (c2-c4)/2 */
662 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS+PASS1_BITS);
663 dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS+PASS1_BITS);
664
665 /* Odd part */
666
667 tmp10 = MULTIPLY(tmp0 + tmp1, FIX(1.064004961)); /* c3 */
668
669 dataptr[DCTSIZE*1] = (DCTELEM)
670 DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.657591230)), /* c1-c3 */
671 CONST_BITS+PASS1_BITS);
672 dataptr[DCTSIZE*3] = (DCTELEM)
673 DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.785601151)), /* c1+c3 */
674 CONST_BITS+PASS1_BITS);
675
676 dataptr++; /* advance pointer to next column */
677 }
678}
679
680
681/*
682 * Perform the forward DCT on a 4x4 sample block.
683 */
684
685GLOBAL(void)
686jpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
687{
688 INT32 tmp0, tmp1;
689 INT32 tmp10, tmp11;
690 DCTELEM *dataptr;
691 JSAMPROW elemptr;
692 int ctr;
693 SHIFT_TEMPS
694
695 /* Pre-zero output coefficient block. */
696 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
697
698 /* Pass 1: process rows. */
699 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
700 /* furthermore, we scale the results by 2**PASS1_BITS. */
701 /* We must also scale the output by (8/4)**2 = 2**2, which we add here. */
702 /* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */
703
704 dataptr = data;
705 for (ctr = 0; ctr < 4; ctr++) {
706 elemptr = sample_data[ctr] + start_col;
707
708 /* Even part */
709
710 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
711 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
712
713 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
714 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
715
716 /* Apply unsigned->signed conversion */
717 dataptr[0] = (DCTELEM)
718 ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2));
719 dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2));
720
721 /* Odd part */
722
723 tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
724 /* Add fudge factor here for final descale. */
725 tmp0 += ONE << (CONST_BITS-PASS1_BITS-3);
726
727 dataptr[1] = (DCTELEM)
728 RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
729 CONST_BITS-PASS1_BITS-2);
730 dataptr[3] = (DCTELEM)
731 RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
732 CONST_BITS-PASS1_BITS-2);
733
734 dataptr += DCTSIZE; /* advance pointer to next row */
735 }
736
737 /* Pass 2: process columns.
738 * We remove the PASS1_BITS scaling, but leave the results scaled up
739 * by an overall factor of 8.
740 */
741
742 dataptr = data;
743 for (ctr = 0; ctr < 4; ctr++) {
744 /* Even part */
745
746 /* Add fudge factor here for final descale. */
747 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3] + (ONE << (PASS1_BITS-1));
748 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2];
749
750 tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
751 tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
752
753 dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);
754 dataptr[DCTSIZE*2] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);
755
756 /* Odd part */
757
758 tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
759 /* Add fudge factor here for final descale. */
760 tmp0 += ONE << (CONST_BITS+PASS1_BITS-1);
761
762 dataptr[DCTSIZE*1] = (DCTELEM)
763 RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
764 CONST_BITS+PASS1_BITS);
765 dataptr[DCTSIZE*3] = (DCTELEM)
766 RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
767 CONST_BITS+PASS1_BITS);
768
769 dataptr++; /* advance pointer to next column */
770 }
771}
772
773
774/*
775 * Perform the forward DCT on a 3x3 sample block.
776 */
777
778GLOBAL(void)
779jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
780{
781 INT32 tmp0, tmp1, tmp2;
782 DCTELEM *dataptr;
783 JSAMPROW elemptr;
784 int ctr;
785 SHIFT_TEMPS
786
787 /* Pre-zero output coefficient block. */
788 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
789
790 /* Pass 1: process rows. */
791 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
792 /* furthermore, we scale the results by 2**PASS1_BITS. */
793 /* We scale the results further by 2**2 as part of output adaption */
794 /* scaling for different DCT size. */
795 /* cK represents sqrt(2) * cos(K*pi/6). */
796
797 dataptr = data;
798 for (ctr = 0; ctr < 3; ctr++) {
799 elemptr = sample_data[ctr] + start_col;
800
801 /* Even part */
802
803 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[2]);
804 tmp1 = GETJSAMPLE(elemptr[1]);
805
806 tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);
807
808 /* Apply unsigned->signed conversion */
809 dataptr[0] = (DCTELEM)
810 ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2));
811 dataptr[2] = (DCTELEM)
812 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(0.707106781)), /* c2 */
813 CONST_BITS-PASS1_BITS-2);
814
815 /* Odd part */
816
817 dataptr[1] = (DCTELEM)
818 DESCALE(MULTIPLY(tmp2, FIX(1.224744871)), /* c1 */
819 CONST_BITS-PASS1_BITS-2);
820
821 dataptr += DCTSIZE; /* advance pointer to next row */
822 }
823
824 /* Pass 2: process columns.
825 * We remove the PASS1_BITS scaling, but leave the results scaled up
826 * by an overall factor of 8.
827 * We must also scale the output by (8/3)**2 = 64/9, which we partially
828 * fold into the constant multipliers (other part was done in pass 1):
829 * cK now represents sqrt(2) * cos(K*pi/6) * 16/9.
830 */
831
832 dataptr = data;
833 for (ctr = 0; ctr < 3; ctr++) {
834 /* Even part */
835
836 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*2];
837 tmp1 = dataptr[DCTSIZE*1];
838
839 tmp2 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*2];
840
841 dataptr[DCTSIZE*0] = (DCTELEM)
842 DESCALE(MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */
843 CONST_BITS+PASS1_BITS);
844 dataptr[DCTSIZE*2] = (DCTELEM)
845 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(1.257078722)), /* c2 */
846 CONST_BITS+PASS1_BITS);
847
848 /* Odd part */
849
850 dataptr[DCTSIZE*1] = (DCTELEM)
851 DESCALE(MULTIPLY(tmp2, FIX(2.177324216)), /* c1 */
852 CONST_BITS+PASS1_BITS);
853
854 dataptr++; /* advance pointer to next column */
855 }
856}
857
858
859/*
860 * Perform the forward DCT on a 2x2 sample block.
861 */
862
863GLOBAL(void)
864jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
865{
866 INT32 tmp0, tmp1, tmp2, tmp3;
867 JSAMPROW elemptr;
868
869 /* Pre-zero output coefficient block. */
870 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
871
872 /* Pass 1: process rows. */
873 /* Note results are scaled up by sqrt(8) compared to a true DCT. */
874
875 /* Row 0 */
876 elemptr = sample_data[0] + start_col;
877
878 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[1]);
879 tmp1 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[1]);
880
881 /* Row 1 */
882 elemptr = sample_data[1] + start_col;
883
884 tmp2 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[1]);
885 tmp3 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[1]);
886
887 /* Pass 2: process columns.
888 * We leave the results scaled up by an overall factor of 8.
889 * We must also scale the output by (8/2)**2 = 2**4.
890 */
891
892 /* Column 0 */
893 /* Apply unsigned->signed conversion */
894 data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4);
895 data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp2) << 4);
896
897 /* Column 1 */
898 data[DCTSIZE*0+1] = (DCTELEM) ((tmp1 + tmp3) << 4);
899 data[DCTSIZE*1+1] = (DCTELEM) ((tmp1 - tmp3) << 4);
900}
901
902
903/*
904 * Perform the forward DCT on a 1x1 sample block.
905 */
906
907GLOBAL(void)
908jpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
909{
910 /* Pre-zero output coefficient block. */
911 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
912
913 /* We leave the result scaled up by an overall factor of 8. */
914 /* We must also scale the output by (8/1)**2 = 2**6. */
915 /* Apply unsigned->signed conversion */
916 data[0] = (DCTELEM)
917 ((GETJSAMPLE(sample_data[0][start_col]) - CENTERJSAMPLE) << 6);
918}
919
920
921/*
922 * Perform the forward DCT on a 9x9 sample block.
923 */
924
925GLOBAL(void)
926jpeg_fdct_9x9 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
927{
928 INT32 tmp0, tmp1, tmp2, tmp3, tmp4;
929 INT32 tmp10, tmp11, tmp12, tmp13;
930 INT32 z1, z2;
931 DCTELEM workspace[8];
932 DCTELEM *dataptr;
933 DCTELEM *wsptr;
934 JSAMPROW elemptr;
935 int ctr;
936 SHIFT_TEMPS
937
938 /* Pass 1: process rows. */
939 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
940 /* we scale the results further by 2 as part of output adaption */
941 /* scaling for different DCT size. */
942 /* cK represents sqrt(2) * cos(K*pi/18). */
943
944 dataptr = data;
945 ctr = 0;
946 for (;;) {
947 elemptr = sample_data[ctr] + start_col;
948
949 /* Even part */
950
951 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[8]);
952 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[7]);
953 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[6]);
954 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[5]);
955 tmp4 = GETJSAMPLE(elemptr[4]);
956
957 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[8]);
958 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[7]);
959 tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[6]);
960 tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[5]);
961
962 z1 = tmp0 + tmp2 + tmp3;
963 z2 = tmp1 + tmp4;
964 /* Apply unsigned->signed conversion */
965 dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1);
966 dataptr[6] = (DCTELEM)
967 DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)), /* c6 */
968 CONST_BITS-1);
969 z1 = MULTIPLY(tmp0 - tmp2, FIX(1.328926049)); /* c2 */
970 z2 = MULTIPLY(tmp1 - tmp4 - tmp4, FIX(0.707106781)); /* c6 */
971 dataptr[2] = (DCTELEM)
972 DESCALE(MULTIPLY(tmp2 - tmp3, FIX(1.083350441)) /* c4 */
973 + z1 + z2, CONST_BITS-1);
974 dataptr[4] = (DCTELEM)
975 DESCALE(MULTIPLY(tmp3 - tmp0, FIX(0.245575608)) /* c8 */
976 + z1 - z2, CONST_BITS-1);
977
978 /* Odd part */
979
980 dataptr[3] = (DCTELEM)
981 DESCALE(MULTIPLY(tmp10 - tmp12 - tmp13, FIX(1.224744871)), /* c3 */
982 CONST_BITS-1);
983
984 tmp11 = MULTIPLY(tmp11, FIX(1.224744871)); /* c3 */
985 tmp0 = MULTIPLY(tmp10 + tmp12, FIX(0.909038955)); /* c5 */
986 tmp1 = MULTIPLY(tmp10 + tmp13, FIX(0.483689525)); /* c7 */
987
988 dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp0 + tmp1, CONST_BITS-1);
989
990 tmp2 = MULTIPLY(tmp12 - tmp13, FIX(1.392728481)); /* c1 */
991
992 dataptr[5] = (DCTELEM) DESCALE(tmp0 - tmp11 - tmp2, CONST_BITS-1);
993 dataptr[7] = (DCTELEM) DESCALE(tmp1 - tmp11 + tmp2, CONST_BITS-1);
994
995 ctr++;
996
997 if (ctr != DCTSIZE) {
998 if (ctr == 9)
999 break; /* Done. */
1000 dataptr += DCTSIZE; /* advance pointer to next row */
1001 } else
1002 dataptr = workspace; /* switch pointer to extended workspace */
1003 }
1004
1005 /* Pass 2: process columns.
1006 * We leave the results scaled up by an overall factor of 8.
1007 * We must also scale the output by (8/9)**2 = 64/81, which we partially
1008 * fold into the constant multipliers and final/initial shifting:
1009 * cK now represents sqrt(2) * cos(K*pi/18) * 128/81.
1010 */
1011
1012 dataptr = data;
1013 wsptr = workspace;
1014 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
1015 /* Even part */
1016
1017 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*0];
1018 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*7];
1019 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*6];
1020 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*5];
1021 tmp4 = dataptr[DCTSIZE*4];
1022
1023 tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*0];
1024 tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*7];
1025 tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*6];
1026 tmp13 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*5];
1027
1028 z1 = tmp0 + tmp2 + tmp3;
1029 z2 = tmp1 + tmp4;
1030 dataptr[DCTSIZE*0] = (DCTELEM)
1031 DESCALE(MULTIPLY(z1 + z2, FIX(1.580246914)), /* 128/81 */
1032 CONST_BITS+2);
1033 dataptr[DCTSIZE*6] = (DCTELEM)
1034 DESCALE(MULTIPLY(z1 - z2 - z2, FIX(1.117403309)), /* c6 */
1035 CONST_BITS+2);
1036 z1 = MULTIPLY(tmp0 - tmp2, FIX(2.100031287)); /* c2 */
1037 z2 = MULTIPLY(tmp1 - tmp4 - tmp4, FIX(1.117403309)); /* c6 */
1038 dataptr[DCTSIZE*2] = (DCTELEM)
1039 DESCALE(MULTIPLY(tmp2 - tmp3, FIX(1.711961190)) /* c4 */
1040 + z1 + z2, CONST_BITS+2);
1041 dataptr[DCTSIZE*4] = (DCTELEM)
1042 DESCALE(MULTIPLY(tmp3 - tmp0, FIX(0.388070096)) /* c8 */
1043 + z1 - z2, CONST_BITS+2);
1044
1045 /* Odd part */
1046
1047 dataptr[DCTSIZE*3] = (DCTELEM)
1048 DESCALE(MULTIPLY(tmp10 - tmp12 - tmp13, FIX(1.935399303)), /* c3 */
1049 CONST_BITS+2);
1050
1051 tmp11 = MULTIPLY(tmp11, FIX(1.935399303)); /* c3 */
1052 tmp0 = MULTIPLY(tmp10 + tmp12, FIX(1.436506004)); /* c5 */
1053 tmp1 = MULTIPLY(tmp10 + tmp13, FIX(0.764348879)); /* c7 */
1054
1055 dataptr[DCTSIZE*1] = (DCTELEM)
1056 DESCALE(tmp11 + tmp0 + tmp1, CONST_BITS+2);
1057
1058 tmp2 = MULTIPLY(tmp12 - tmp13, FIX(2.200854883)); /* c1 */
1059
1060 dataptr[DCTSIZE*5] = (DCTELEM)
1061 DESCALE(tmp0 - tmp11 - tmp2, CONST_BITS+2);
1062 dataptr[DCTSIZE*7] = (DCTELEM)
1063 DESCALE(tmp1 - tmp11 + tmp2, CONST_BITS+2);
1064
1065 dataptr++; /* advance pointer to next column */
1066 wsptr++; /* advance pointer to next column */
1067 }
1068}
1069
1070
1071/*
1072 * Perform the forward DCT on a 10x10 sample block.
1073 */
1074
1075GLOBAL(void)
1076jpeg_fdct_10x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
1077{
1078 INT32 tmp0, tmp1, tmp2, tmp3, tmp4;
1079 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
1080 DCTELEM workspace[8*2];
1081 DCTELEM *dataptr;
1082 DCTELEM *wsptr;
1083 JSAMPROW elemptr;
1084 int ctr;
1085 SHIFT_TEMPS
1086
1087 /* Pass 1: process rows. */
1088 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
1089 /* we scale the results further by 2 as part of output adaption */
1090 /* scaling for different DCT size. */
1091 /* cK represents sqrt(2) * cos(K*pi/20). */
1092
1093 dataptr = data;
1094 ctr = 0;
1095 for (;;) {
1096 elemptr = sample_data[ctr] + start_col;
1097
1098 /* Even part */
1099
1100 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[9]);
1101 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[8]);
1102 tmp12 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[7]);
1103 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[6]);
1104 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[5]);
1105
1106 tmp10 = tmp0 + tmp4;
1107 tmp13 = tmp0 - tmp4;
1108 tmp11 = tmp1 + tmp3;
1109 tmp14 = tmp1 - tmp3;
1110
1111 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[9]);
1112 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[8]);
1113 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[7]);
1114 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);
1115 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);
1116
1117 /* Apply unsigned->signed conversion */
1118 dataptr[0] = (DCTELEM)
1119 ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1);
1120 tmp12 += tmp12;
1121 dataptr[4] = (DCTELEM)
1122 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.144122806)) - /* c4 */
1123 MULTIPLY(tmp11 - tmp12, FIX(0.437016024)), /* c8 */
1124 CONST_BITS-1);
1125 tmp10 = MULTIPLY(tmp13 + tmp14, FIX(0.831253876)); /* c6 */
1126 dataptr[2] = (DCTELEM)
1127 DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.513743148)), /* c2-c6 */
1128 CONST_BITS-1);
1129 dataptr[6] = (DCTELEM)
1130 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.176250899)), /* c2+c6 */
1131 CONST_BITS-1);
1132
1133 /* Odd part */
1134
1135 tmp10 = tmp0 + tmp4;
1136 tmp11 = tmp1 - tmp3;
1137 dataptr[5] = (DCTELEM) ((tmp10 - tmp11 - tmp2) << 1);
1138 tmp2 <<= CONST_BITS;
1139 dataptr[1] = (DCTELEM)
1140 DESCALE(MULTIPLY(tmp0, FIX(1.396802247)) + /* c1 */
1141 MULTIPLY(tmp1, FIX(1.260073511)) + tmp2 + /* c3 */
1142 MULTIPLY(tmp3, FIX(0.642039522)) + /* c7 */
1143 MULTIPLY(tmp4, FIX(0.221231742)), /* c9 */
1144 CONST_BITS-1);
1145 tmp12 = MULTIPLY(tmp0 - tmp4, FIX(0.951056516)) - /* (c3+c7)/2 */
1146 MULTIPLY(tmp1 + tmp3, FIX(0.587785252)); /* (c1-c9)/2 */
1147 tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.309016994)) + /* (c3-c7)/2 */
1148 (tmp11 << (CONST_BITS - 1)) - tmp2;
1149 dataptr[3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS-1);
1150 dataptr[7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS-1);
1151
1152 ctr++;
1153
1154 if (ctr != DCTSIZE) {
1155 if (ctr == 10)
1156 break; /* Done. */
1157 dataptr += DCTSIZE; /* advance pointer to next row */
1158 } else
1159 dataptr = workspace; /* switch pointer to extended workspace */
1160 }
1161
1162 /* Pass 2: process columns.
1163 * We leave the results scaled up by an overall factor of 8.
1164 * We must also scale the output by (8/10)**2 = 16/25, which we partially
1165 * fold into the constant multipliers and final/initial shifting:
1166 * cK now represents sqrt(2) * cos(K*pi/20) * 32/25.
1167 */
1168
1169 dataptr = data;
1170 wsptr = workspace;
1171 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
1172 /* Even part */
1173
1174 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*1];
1175 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*0];
1176 tmp12 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*7];
1177 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*6];
1178 tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];
1179
1180 tmp10 = tmp0 + tmp4;
1181 tmp13 = tmp0 - tmp4;
1182 tmp11 = tmp1 + tmp3;
1183 tmp14 = tmp1 - tmp3;
1184
1185 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*1];
1186 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*0];
1187 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*7];
1188 tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*6];
1189 tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
1190
1191 dataptr[DCTSIZE*0] = (DCTELEM)
1192 DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(1.28)), /* 32/25 */
1193 CONST_BITS+2);
1194 tmp12 += tmp12;
1195 dataptr[DCTSIZE*4] = (DCTELEM)
1196 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.464477191)) - /* c4 */
1197 MULTIPLY(tmp11 - tmp12, FIX(0.559380511)), /* c8 */
1198 CONST_BITS+2);
1199 tmp10 = MULTIPLY(tmp13 + tmp14, FIX(1.064004961)); /* c6 */
1200 dataptr[DCTSIZE*2] = (DCTELEM)
1201 DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.657591230)), /* c2-c6 */
1202 CONST_BITS+2);
1203 dataptr[DCTSIZE*6] = (DCTELEM)
1204 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.785601151)), /* c2+c6 */
1205 CONST_BITS+2);
1206
1207 /* Odd part */
1208
1209 tmp10 = tmp0 + tmp4;
1210 tmp11 = tmp1 - tmp3;
1211 dataptr[DCTSIZE*5] = (DCTELEM)
1212 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp2, FIX(1.28)), /* 32/25 */
1213 CONST_BITS+2);
1214 tmp2 = MULTIPLY(tmp2, FIX(1.28)); /* 32/25 */
1215 dataptr[DCTSIZE*1] = (DCTELEM)
1216 DESCALE(MULTIPLY(tmp0, FIX(1.787906876)) + /* c1 */
1217 MULTIPLY(tmp1, FIX(1.612894094)) + tmp2 + /* c3 */
1218 MULTIPLY(tmp3, FIX(0.821810588)) + /* c7 */
1219 MULTIPLY(tmp4, FIX(0.283176630)), /* c9 */
1220 CONST_BITS+2);
1221 tmp12 = MULTIPLY(tmp0 - tmp4, FIX(1.217352341)) - /* (c3+c7)/2 */
1222 MULTIPLY(tmp1 + tmp3, FIX(0.752365123)); /* (c1-c9)/2 */
1223 tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.395541753)) + /* (c3-c7)/2 */
1224 MULTIPLY(tmp11, FIX(0.64)) - tmp2; /* 16/25 */
1225 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS+2);
1226 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS+2);
1227
1228 dataptr++; /* advance pointer to next column */
1229 wsptr++; /* advance pointer to next column */
1230 }
1231}
1232
1233
1234/*
1235 * Perform the forward DCT on an 11x11 sample block.
1236 */
1237
1238GLOBAL(void)
1239jpeg_fdct_11x11 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
1240{
1241 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
1242 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
1243 INT32 z1, z2, z3;
1244 DCTELEM workspace[8*3];
1245 DCTELEM *dataptr;
1246 DCTELEM *wsptr;
1247 JSAMPROW elemptr;
1248 int ctr;
1249 SHIFT_TEMPS
1250
1251 /* Pass 1: process rows. */
1252 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
1253 /* we scale the results further by 2 as part of output adaption */
1254 /* scaling for different DCT size. */
1255 /* cK represents sqrt(2) * cos(K*pi/22). */
1256
1257 dataptr = data;
1258 ctr = 0;
1259 for (;;) {
1260 elemptr = sample_data[ctr] + start_col;
1261
1262 /* Even part */
1263
1264 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[10]);
1265 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[9]);
1266 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[8]);
1267 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[7]);
1268 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[6]);
1269 tmp5 = GETJSAMPLE(elemptr[5]);
1270
1271 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[10]);
1272 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[9]);
1273 tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[8]);
1274 tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]);
1275 tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]);
1276
1277 /* Apply unsigned->signed conversion */
1278 dataptr[0] = (DCTELEM)
1279 ((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1);
1280 tmp5 += tmp5;
1281 tmp0 -= tmp5;
1282 tmp1 -= tmp5;
1283 tmp2 -= tmp5;
1284 tmp3 -= tmp5;
1285 tmp4 -= tmp5;
1286 z1 = MULTIPLY(tmp0 + tmp3, FIX(1.356927976)) + /* c2 */
1287 MULTIPLY(tmp2 + tmp4, FIX(0.201263574)); /* c10 */
1288 z2 = MULTIPLY(tmp1 - tmp3, FIX(0.926112931)); /* c6 */
1289 z3 = MULTIPLY(tmp0 - tmp1, FIX(1.189712156)); /* c4 */
1290 dataptr[2] = (DCTELEM)
1291 DESCALE(z1 + z2 - MULTIPLY(tmp3, FIX(1.018300590)) /* c2+c8-c6 */
1292 - MULTIPLY(tmp4, FIX(1.390975730)), /* c4+c10 */
1293 CONST_BITS-1);
1294 dataptr[4] = (DCTELEM)
1295 DESCALE(z2 + z3 + MULTIPLY(tmp1, FIX(0.062335650)) /* c4-c6-c10 */
1296 - MULTIPLY(tmp2, FIX(1.356927976)) /* c2 */
1297 + MULTIPLY(tmp4, FIX(0.587485545)), /* c8 */
1298 CONST_BITS-1);
1299 dataptr[6] = (DCTELEM)
1300 DESCALE(z1 + z3 - MULTIPLY(tmp0, FIX(1.620527200)) /* c2+c4-c6 */
1301 - MULTIPLY(tmp2, FIX(0.788749120)), /* c8+c10 */
1302 CONST_BITS-1);
1303
1304 /* Odd part */
1305
1306 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.286413905)); /* c3 */
1307 tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.068791298)); /* c5 */
1308 tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.764581576)); /* c7 */
1309 tmp0 = tmp1 + tmp2 + tmp3 - MULTIPLY(tmp10, FIX(1.719967871)) /* c7+c5+c3-c1 */
1310 + MULTIPLY(tmp14, FIX(0.398430003)); /* c9 */
1311 tmp4 = MULTIPLY(tmp11 + tmp12, - FIX(0.764581576)); /* -c7 */
1312 tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.399818907)); /* -c1 */
1313 tmp1 += tmp4 + tmp5 + MULTIPLY(tmp11, FIX(1.276416582)) /* c9+c7+c1-c3 */
1314 - MULTIPLY(tmp14, FIX(1.068791298)); /* c5 */
1315 tmp10 = MULTIPLY(tmp12 + tmp13, FIX(0.398430003)); /* c9 */
1316 tmp2 += tmp4 + tmp10 - MULTIPLY(tmp12, FIX(1.989053629)) /* c9+c5+c3-c7 */
1317 + MULTIPLY(tmp14, FIX(1.399818907)); /* c1 */
1318 tmp3 += tmp5 + tmp10 + MULTIPLY(tmp13, FIX(1.305598626)) /* c1+c5-c9-c7 */
1319 - MULTIPLY(tmp14, FIX(1.286413905)); /* c3 */
1320
1321 dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-1);
1322 dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-1);
1323 dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-1);
1324 dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS-1);
1325
1326 ctr++;
1327
1328 if (ctr != DCTSIZE) {
1329 if (ctr == 11)
1330 break; /* Done. */
1331 dataptr += DCTSIZE; /* advance pointer to next row */
1332 } else
1333 dataptr = workspace; /* switch pointer to extended workspace */
1334 }
1335
1336 /* Pass 2: process columns.
1337 * We leave the results scaled up by an overall factor of 8.
1338 * We must also scale the output by (8/11)**2 = 64/121, which we partially
1339 * fold into the constant multipliers and final/initial shifting:
1340 * cK now represents sqrt(2) * cos(K*pi/22) * 128/121.
1341 */
1342
1343 dataptr = data;
1344 wsptr = workspace;
1345 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
1346 /* Even part */
1347
1348 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*2];
1349 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*1];
1350 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*0];
1351 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*7];
1352 tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*6];
1353 tmp5 = dataptr[DCTSIZE*5];
1354
1355 tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*2];
1356 tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*1];
1357 tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*0];
1358 tmp13 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*7];
1359 tmp14 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*6];
1360
1361 dataptr[DCTSIZE*0] = (DCTELEM)
1362 DESCALE(MULTIPLY(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5,
1363 FIX(1.057851240)), /* 128/121 */
1364 CONST_BITS+2);
1365 tmp5 += tmp5;
1366 tmp0 -= tmp5;
1367 tmp1 -= tmp5;
1368 tmp2 -= tmp5;
1369 tmp3 -= tmp5;
1370 tmp4 -= tmp5;
1371 z1 = MULTIPLY(tmp0 + tmp3, FIX(1.435427942)) + /* c2 */
1372 MULTIPLY(tmp2 + tmp4, FIX(0.212906922)); /* c10 */
1373 z2 = MULTIPLY(tmp1 - tmp3, FIX(0.979689713)); /* c6 */
1374 z3 = MULTIPLY(tmp0 - tmp1, FIX(1.258538479)); /* c4 */
1375 dataptr[DCTSIZE*2] = (DCTELEM)
1376 DESCALE(z1 + z2 - MULTIPLY(tmp3, FIX(1.077210542)) /* c2+c8-c6 */
1377 - MULTIPLY(tmp4, FIX(1.471445400)), /* c4+c10 */
1378 CONST_BITS+2);
1379 dataptr[DCTSIZE*4] = (DCTELEM)
1380 DESCALE(z2 + z3 + MULTIPLY(tmp1, FIX(0.065941844)) /* c4-c6-c10 */
1381 - MULTIPLY(tmp2, FIX(1.435427942)) /* c2 */
1382 + MULTIPLY(tmp4, FIX(0.621472312)), /* c8 */
1383 CONST_BITS+2);
1384 dataptr[DCTSIZE*6] = (DCTELEM)
1385 DESCALE(z1 + z3 - MULTIPLY(tmp0, FIX(1.714276708)) /* c2+c4-c6 */
1386 - MULTIPLY(tmp2, FIX(0.834379234)), /* c8+c10 */
1387 CONST_BITS+2);
1388
1389 /* Odd part */
1390
1391 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.360834544)); /* c3 */
1392 tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.130622199)); /* c5 */
1393 tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.808813568)); /* c7 */
1394 tmp0 = tmp1 + tmp2 + tmp3 - MULTIPLY(tmp10, FIX(1.819470145)) /* c7+c5+c3-c1 */
1395 + MULTIPLY(tmp14, FIX(0.421479672)); /* c9 */
1396 tmp4 = MULTIPLY(tmp11 + tmp12, - FIX(0.808813568)); /* -c7 */
1397 tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.480800167)); /* -c1 */
1398 tmp1 += tmp4 + tmp5 + MULTIPLY(tmp11, FIX(1.350258864)) /* c9+c7+c1-c3 */
1399 - MULTIPLY(tmp14, FIX(1.130622199)); /* c5 */
1400 tmp10 = MULTIPLY(tmp12 + tmp13, FIX(0.421479672)); /* c9 */
1401 tmp2 += tmp4 + tmp10 - MULTIPLY(tmp12, FIX(2.104122847)) /* c9+c5+c3-c7 */
1402 + MULTIPLY(tmp14, FIX(1.480800167)); /* c1 */
1403 tmp3 += tmp5 + tmp10 + MULTIPLY(tmp13, FIX(1.381129125)) /* c1+c5-c9-c7 */
1404 - MULTIPLY(tmp14, FIX(1.360834544)); /* c3 */
1405
1406 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+2);
1407 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+2);
1408 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+2);
1409 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+2);
1410
1411 dataptr++; /* advance pointer to next column */
1412 wsptr++; /* advance pointer to next column */
1413 }
1414}
1415
1416
1417/*
1418 * Perform the forward DCT on a 12x12 sample block.
1419 */
1420
1421GLOBAL(void)
1422jpeg_fdct_12x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
1423{
1424 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
1425 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1426 DCTELEM workspace[8*4];
1427 DCTELEM *dataptr;
1428 DCTELEM *wsptr;
1429 JSAMPROW elemptr;
1430 int ctr;
1431 SHIFT_TEMPS
1432
1433 /* Pass 1: process rows. */
1434 /* Note results are scaled up by sqrt(8) compared to a true DCT. */
1435 /* cK represents sqrt(2) * cos(K*pi/24). */
1436
1437 dataptr = data;
1438 ctr = 0;
1439 for (;;) {
1440 elemptr = sample_data[ctr] + start_col;
1441
1442 /* Even part */
1443
1444 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[11]);
1445 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[10]);
1446 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[9]);
1447 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[8]);
1448 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[7]);
1449 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[6]);
1450
1451 tmp10 = tmp0 + tmp5;
1452 tmp13 = tmp0 - tmp5;
1453 tmp11 = tmp1 + tmp4;
1454 tmp14 = tmp1 - tmp4;
1455 tmp12 = tmp2 + tmp3;
1456 tmp15 = tmp2 - tmp3;
1457
1458 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[11]);
1459 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[10]);
1460 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[9]);
1461 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[8]);
1462 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);
1463 tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);
1464
1465 /* Apply unsigned->signed conversion */
1466 dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE);
1467 dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15);
1468 dataptr[4] = (DCTELEM)
1469 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.224744871)), /* c4 */
1470 CONST_BITS);
1471 dataptr[2] = (DCTELEM)
1472 DESCALE(tmp14 - tmp15 + MULTIPLY(tmp13 + tmp15, FIX(1.366025404)), /* c2 */
1473 CONST_BITS);
1474
1475 /* Odd part */
1476
1477 tmp10 = MULTIPLY(tmp1 + tmp4, FIX_0_541196100); /* c9 */
1478 tmp14 = tmp10 + MULTIPLY(tmp1, FIX_0_765366865); /* c3-c9 */
1479 tmp15 = tmp10 - MULTIPLY(tmp4, FIX_1_847759065); /* c3+c9 */
1480 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.121971054)); /* c5 */
1481 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.860918669)); /* c7 */
1482 tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.580774953)) /* c5+c7-c1 */
1483 + MULTIPLY(tmp5, FIX(0.184591911)); /* c11 */
1484 tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.184591911)); /* -c11 */
1485 tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.339493912)) /* c1+c5-c11 */
1486 + MULTIPLY(tmp5, FIX(0.860918669)); /* c7 */
1487 tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.725788011)) /* c1+c11-c7 */
1488 - MULTIPLY(tmp5, FIX(1.121971054)); /* c5 */
1489 tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.306562965)) /* c3 */
1490 - MULTIPLY(tmp2 + tmp5, FIX_0_541196100); /* c9 */
1491
1492 dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS);
1493 dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS);
1494 dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS);
1495 dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS);
1496
1497 ctr++;
1498
1499 if (ctr != DCTSIZE) {
1500 if (ctr == 12)
1501 break; /* Done. */
1502 dataptr += DCTSIZE; /* advance pointer to next row */
1503 } else
1504 dataptr = workspace; /* switch pointer to extended workspace */
1505 }
1506
1507 /* Pass 2: process columns.
1508 * We leave the results scaled up by an overall factor of 8.
1509 * We must also scale the output by (8/12)**2 = 4/9, which we partially
1510 * fold into the constant multipliers and final shifting:
1511 * cK now represents sqrt(2) * cos(K*pi/24) * 8/9.
1512 */
1513
1514 dataptr = data;
1515 wsptr = workspace;
1516 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
1517 /* Even part */
1518
1519 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*3];
1520 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*2];
1521 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*1];
1522 tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*0];
1523 tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*7];
1524 tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*6];
1525
1526 tmp10 = tmp0 + tmp5;
1527 tmp13 = tmp0 - tmp5;
1528 tmp11 = tmp1 + tmp4;
1529 tmp14 = tmp1 - tmp4;
1530 tmp12 = tmp2 + tmp3;
1531 tmp15 = tmp2 - tmp3;
1532
1533 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*3];
1534 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*2];
1535 tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*1];
1536 tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*0];
1537 tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*7];
1538 tmp5 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*6];
1539
1540 dataptr[DCTSIZE*0] = (DCTELEM)
1541 DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(0.888888889)), /* 8/9 */
1542 CONST_BITS+1);
1543 dataptr[DCTSIZE*6] = (DCTELEM)
1544 DESCALE(MULTIPLY(tmp13 - tmp14 - tmp15, FIX(0.888888889)), /* 8/9 */
1545 CONST_BITS+1);
1546 dataptr[DCTSIZE*4] = (DCTELEM)
1547 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.088662108)), /* c4 */
1548 CONST_BITS+1);
1549 dataptr[DCTSIZE*2] = (DCTELEM)
1550 DESCALE(MULTIPLY(tmp14 - tmp15, FIX(0.888888889)) + /* 8/9 */
1551 MULTIPLY(tmp13 + tmp15, FIX(1.214244803)), /* c2 */
1552 CONST_BITS+1);
1553
1554 /* Odd part */
1555
1556 tmp10 = MULTIPLY(tmp1 + tmp4, FIX(0.481063200)); /* c9 */
1557 tmp14 = tmp10 + MULTIPLY(tmp1, FIX(0.680326102)); /* c3-c9 */
1558 tmp15 = tmp10 - MULTIPLY(tmp4, FIX(1.642452502)); /* c3+c9 */
1559 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(0.997307603)); /* c5 */
1560 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.765261039)); /* c7 */
1561 tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.516244403)) /* c5+c7-c1 */
1562 + MULTIPLY(tmp5, FIX(0.164081699)); /* c11 */
1563 tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.164081699)); /* -c11 */
1564 tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.079550144)) /* c1+c5-c11 */
1565 + MULTIPLY(tmp5, FIX(0.765261039)); /* c7 */
1566 tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.645144899)) /* c1+c11-c7 */
1567 - MULTIPLY(tmp5, FIX(0.997307603)); /* c5 */
1568 tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.161389302)) /* c3 */
1569 - MULTIPLY(tmp2 + tmp5, FIX(0.481063200)); /* c9 */
1570
1571 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+1);
1572 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+1);
1573 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+1);
1574 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+1);
1575
1576 dataptr++; /* advance pointer to next column */
1577 wsptr++; /* advance pointer to next column */
1578 }
1579}
1580
1581
1582/*
1583 * Perform the forward DCT on a 13x13 sample block.
1584 */
1585
1586GLOBAL(void)
1587jpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
1588{
1589 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
1590 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1591 INT32 z1, z2;
1592 DCTELEM workspace[8*5];
1593 DCTELEM *dataptr;
1594 DCTELEM *wsptr;
1595 JSAMPROW elemptr;
1596 int ctr;
1597 SHIFT_TEMPS
1598
1599 /* Pass 1: process rows. */
1600 /* Note results are scaled up by sqrt(8) compared to a true DCT. */
1601 /* cK represents sqrt(2) * cos(K*pi/26). */
1602
1603 dataptr = data;
1604 ctr = 0;
1605 for (;;) {
1606 elemptr = sample_data[ctr] + start_col;
1607
1608 /* Even part */
1609
1610 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[12]);
1611 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[11]);
1612 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[10]);
1613 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[9]);
1614 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[8]);
1615 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[7]);
1616 tmp6 = GETJSAMPLE(elemptr[6]);
1617
1618 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[12]);
1619 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[11]);
1620 tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[10]);
1621 tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[9]);
1622 tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]);
1623 tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]);
1624
1625 /* Apply unsigned->signed conversion */
1626 dataptr[0] = (DCTELEM)
1627 (tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE);
1628 tmp6 += tmp6;
1629 tmp0 -= tmp6;
1630 tmp1 -= tmp6;
1631 tmp2 -= tmp6;
1632 tmp3 -= tmp6;
1633 tmp4 -= tmp6;
1634 tmp5 -= tmp6;
1635 dataptr[2] = (DCTELEM)
1636 DESCALE(MULTIPLY(tmp0, FIX(1.373119086)) + /* c2 */
1637 MULTIPLY(tmp1, FIX(1.058554052)) + /* c6 */
1638 MULTIPLY(tmp2, FIX(0.501487041)) - /* c10 */
1639 MULTIPLY(tmp3, FIX(0.170464608)) - /* c12 */
1640 MULTIPLY(tmp4, FIX(0.803364869)) - /* c8 */
1641 MULTIPLY(tmp5, FIX(1.252223920)), /* c4 */
1642 CONST_BITS);
1643 z1 = MULTIPLY(tmp0 - tmp2, FIX(1.155388986)) - /* (c4+c6)/2 */
1644 MULTIPLY(tmp3 - tmp4, FIX(0.435816023)) - /* (c2-c10)/2 */
1645 MULTIPLY(tmp1 - tmp5, FIX(0.316450131)); /* (c8-c12)/2 */
1646 z2 = MULTIPLY(tmp0 + tmp2, FIX(0.096834934)) - /* (c4-c6)/2 */
1647 MULTIPLY(tmp3 + tmp4, FIX(0.937303064)) + /* (c2+c10)/2 */
1648 MULTIPLY(tmp1 + tmp5, FIX(0.486914739)); /* (c8+c12)/2 */
1649
1650 dataptr[4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS);
1651 dataptr[6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS);
1652
1653 /* Odd part */
1654
1655 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.322312651)); /* c3 */
1656 tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.163874945)); /* c5 */
1657 tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.937797057)) + /* c7 */
1658 MULTIPLY(tmp14 + tmp15, FIX(0.338443458)); /* c11 */
1659 tmp0 = tmp1 + tmp2 + tmp3 -
1660 MULTIPLY(tmp10, FIX(2.020082300)) + /* c3+c5+c7-c1 */
1661 MULTIPLY(tmp14, FIX(0.318774355)); /* c9-c11 */
1662 tmp4 = MULTIPLY(tmp14 - tmp15, FIX(0.937797057)) - /* c7 */
1663 MULTIPLY(tmp11 + tmp12, FIX(0.338443458)); /* c11 */
1664 tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.163874945)); /* -c5 */
1665 tmp1 += tmp4 + tmp5 +
1666 MULTIPLY(tmp11, FIX(0.837223564)) - /* c5+c9+c11-c3 */
1667 MULTIPLY(tmp14, FIX(2.341699410)); /* c1+c7 */
1668 tmp6 = MULTIPLY(tmp12 + tmp13, - FIX(0.657217813)); /* -c9 */
1669 tmp2 += tmp4 + tmp6 -
1670 MULTIPLY(tmp12, FIX(1.572116027)) + /* c1+c5-c9-c11 */
1671 MULTIPLY(tmp15, FIX(2.260109708)); /* c3+c7 */
1672 tmp3 += tmp5 + tmp6 +
1673 MULTIPLY(tmp13, FIX(2.205608352)) - /* c3+c5+c9-c7 */
1674 MULTIPLY(tmp15, FIX(1.742345811)); /* c1+c11 */
1675
1676 dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS);
1677 dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS);
1678 dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS);
1679 dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS);
1680
1681 ctr++;
1682
1683 if (ctr != DCTSIZE) {
1684 if (ctr == 13)
1685 break; /* Done. */
1686 dataptr += DCTSIZE; /* advance pointer to next row */
1687 } else
1688 dataptr = workspace; /* switch pointer to extended workspace */
1689 }
1690
1691 /* Pass 2: process columns.
1692 * We leave the results scaled up by an overall factor of 8.
1693 * We must also scale the output by (8/13)**2 = 64/169, which we partially
1694 * fold into the constant multipliers and final shifting:
1695 * cK now represents sqrt(2) * cos(K*pi/26) * 128/169.
1696 */
1697
1698 dataptr = data;
1699 wsptr = workspace;
1700 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
1701 /* Even part */
1702
1703 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*4];
1704 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*3];
1705 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*2];
1706 tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*1];
1707 tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*0];
1708 tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*7];
1709 tmp6 = dataptr[DCTSIZE*6];
1710
1711 tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*4];
1712 tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*3];
1713 tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*2];
1714 tmp13 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*1];
1715 tmp14 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*0];
1716 tmp15 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*7];
1717
1718 dataptr[DCTSIZE*0] = (DCTELEM)
1719 DESCALE(MULTIPLY(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6,
1720 FIX(0.757396450)), /* 128/169 */
1721 CONST_BITS+1);
1722 tmp6 += tmp6;
1723 tmp0 -= tmp6;
1724 tmp1 -= tmp6;
1725 tmp2 -= tmp6;
1726 tmp3 -= tmp6;
1727 tmp4 -= tmp6;
1728 tmp5 -= tmp6;
1729 dataptr[DCTSIZE*2] = (DCTELEM)
1730 DESCALE(MULTIPLY(tmp0, FIX(1.039995521)) + /* c2 */
1731 MULTIPLY(tmp1, FIX(0.801745081)) + /* c6 */
1732 MULTIPLY(tmp2, FIX(0.379824504)) - /* c10 */
1733 MULTIPLY(tmp3, FIX(0.129109289)) - /* c12 */
1734 MULTIPLY(tmp4, FIX(0.608465700)) - /* c8 */
1735 MULTIPLY(tmp5, FIX(0.948429952)), /* c4 */
1736 CONST_BITS+1);
1737 z1 = MULTIPLY(tmp0 - tmp2, FIX(0.875087516)) - /* (c4+c6)/2 */
1738 MULTIPLY(tmp3 - tmp4, FIX(0.330085509)) - /* (c2-c10)/2 */
1739 MULTIPLY(tmp1 - tmp5, FIX(0.239678205)); /* (c8-c12)/2 */
1740 z2 = MULTIPLY(tmp0 + tmp2, FIX(0.073342435)) - /* (c4-c6)/2 */
1741 MULTIPLY(tmp3 + tmp4, FIX(0.709910013)) + /* (c2+c10)/2 */
1742 MULTIPLY(tmp1 + tmp5, FIX(0.368787494)); /* (c8+c12)/2 */
1743
1744 dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+1);
1745 dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS+1);
1746
1747 /* Odd part */
1748
1749 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.001514908)); /* c3 */
1750 tmp2 = MULTIPLY(tmp10 + tmp12, FIX(0.881514751)); /* c5 */
1751 tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.710284161)) + /* c7 */
1752 MULTIPLY(tmp14 + tmp15, FIX(0.256335874)); /* c11 */
1753 tmp0 = tmp1 + tmp2 + tmp3 -
1754 MULTIPLY(tmp10, FIX(1.530003162)) + /* c3+c5+c7-c1 */
1755 MULTIPLY(tmp14, FIX(0.241438564)); /* c9-c11 */
1756 tmp4 = MULTIPLY(tmp14 - tmp15, FIX(0.710284161)) - /* c7 */
1757 MULTIPLY(tmp11 + tmp12, FIX(0.256335874)); /* c11 */
1758 tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(0.881514751)); /* -c5 */
1759 tmp1 += tmp4 + tmp5 +
1760 MULTIPLY(tmp11, FIX(0.634110155)) - /* c5+c9+c11-c3 */
1761 MULTIPLY(tmp14, FIX(1.773594819)); /* c1+c7 */
1762 tmp6 = MULTIPLY(tmp12 + tmp13, - FIX(0.497774438)); /* -c9 */
1763 tmp2 += tmp4 + tmp6 -
1764 MULTIPLY(tmp12, FIX(1.190715098)) + /* c1+c5-c9-c11 */
1765 MULTIPLY(tmp15, FIX(1.711799069)); /* c3+c7 */
1766 tmp3 += tmp5 + tmp6 +
1767 MULTIPLY(tmp13, FIX(1.670519935)) - /* c3+c5+c9-c7 */
1768 MULTIPLY(tmp15, FIX(1.319646532)); /* c1+c11 */
1769
1770 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+1);
1771 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+1);
1772 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+1);
1773 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+1);
1774
1775 dataptr++; /* advance pointer to next column */
1776 wsptr++; /* advance pointer to next column */
1777 }
1778}
1779
1780
1781/*
1782 * Perform the forward DCT on a 14x14 sample block.
1783 */
1784
1785GLOBAL(void)
1786jpeg_fdct_14x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
1787{
1788 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
1789 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
1790 DCTELEM workspace[8*6];
1791 DCTELEM *dataptr;
1792 DCTELEM *wsptr;
1793 JSAMPROW elemptr;
1794 int ctr;
1795 SHIFT_TEMPS
1796
1797 /* Pass 1: process rows. */
1798 /* Note results are scaled up by sqrt(8) compared to a true DCT. */
1799 /* cK represents sqrt(2) * cos(K*pi/28). */
1800
1801 dataptr = data;
1802 ctr = 0;
1803 for (;;) {
1804 elemptr = sample_data[ctr] + start_col;
1805
1806 /* Even part */
1807
1808 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[13]);
1809 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[12]);
1810 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[11]);
1811 tmp13 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[10]);
1812 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[9]);
1813 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[8]);
1814 tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[7]);
1815
1816 tmp10 = tmp0 + tmp6;
1817 tmp14 = tmp0 - tmp6;
1818 tmp11 = tmp1 + tmp5;
1819 tmp15 = tmp1 - tmp5;
1820 tmp12 = tmp2 + tmp4;
1821 tmp16 = tmp2 - tmp4;
1822
1823 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[13]);
1824 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[12]);
1825 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[11]);
1826 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[10]);
1827 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[9]);
1828 tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);
1829 tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);
1830
1831 /* Apply unsigned->signed conversion */
1832 dataptr[0] = (DCTELEM)
1833 (tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE);
1834 tmp13 += tmp13;
1835 dataptr[4] = (DCTELEM)
1836 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.274162392)) + /* c4 */
1837 MULTIPLY(tmp11 - tmp13, FIX(0.314692123)) - /* c12 */
1838 MULTIPLY(tmp12 - tmp13, FIX(0.881747734)), /* c8 */
1839 CONST_BITS);
1840
1841 tmp10 = MULTIPLY(tmp14 + tmp15, FIX(1.105676686)); /* c6 */
1842
1843 dataptr[2] = (DCTELEM)
1844 DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.273079590)) /* c2-c6 */
1845 + MULTIPLY(tmp16, FIX(0.613604268)), /* c10 */
1846 CONST_BITS);
1847 dataptr[6] = (DCTELEM)
1848 DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.719280954)) /* c6+c10 */
1849 - MULTIPLY(tmp16, FIX(1.378756276)), /* c2 */
1850 CONST_BITS);
1851
1852 /* Odd part */
1853
1854 tmp10 = tmp1 + tmp2;
1855 tmp11 = tmp5 - tmp4;
1856 dataptr[7] = (DCTELEM) (tmp0 - tmp10 + tmp3 - tmp11 - tmp6);
1857 tmp3 <<= CONST_BITS;
1858 tmp10 = MULTIPLY(tmp10, - FIX(0.158341681)); /* -c13 */
1859 tmp11 = MULTIPLY(tmp11, FIX(1.405321284)); /* c1 */
1860 tmp10 += tmp11 - tmp3;
1861 tmp11 = MULTIPLY(tmp0 + tmp2, FIX(1.197448846)) + /* c5 */
1862 MULTIPLY(tmp4 + tmp6, FIX(0.752406978)); /* c9 */
1863 dataptr[5] = (DCTELEM)
1864 DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(2.373959773)) /* c3+c5-c13 */
1865 + MULTIPLY(tmp4, FIX(1.119999435)), /* c1+c11-c9 */
1866 CONST_BITS);
1867 tmp12 = MULTIPLY(tmp0 + tmp1, FIX(1.334852607)) + /* c3 */
1868 MULTIPLY(tmp5 - tmp6, FIX(0.467085129)); /* c11 */
1869 dataptr[3] = (DCTELEM)
1870 DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.424103948)) /* c3-c9-c13 */
1871 - MULTIPLY(tmp5, FIX(3.069855259)), /* c1+c5+c11 */
1872 CONST_BITS);
1873 dataptr[1] = (DCTELEM)
1874 DESCALE(tmp11 + tmp12 + tmp3 + tmp6 -
1875 MULTIPLY(tmp0 + tmp6, FIX(1.126980169)), /* c3+c5-c1 */
1876 CONST_BITS);
1877
1878 ctr++;
1879
1880 if (ctr != DCTSIZE) {
1881 if (ctr == 14)
1882 break; /* Done. */
1883 dataptr += DCTSIZE; /* advance pointer to next row */
1884 } else
1885 dataptr = workspace; /* switch pointer to extended workspace */
1886 }
1887
1888 /* Pass 2: process columns.
1889 * We leave the results scaled up by an overall factor of 8.
1890 * We must also scale the output by (8/14)**2 = 16/49, which we partially
1891 * fold into the constant multipliers and final shifting:
1892 * cK now represents sqrt(2) * cos(K*pi/28) * 32/49.
1893 */
1894
1895 dataptr = data;
1896 wsptr = workspace;
1897 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
1898 /* Even part */
1899
1900 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*5];
1901 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*4];
1902 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*3];
1903 tmp13 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*2];
1904 tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*1];
1905 tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*0];
1906 tmp6 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];
1907
1908 tmp10 = tmp0 + tmp6;
1909 tmp14 = tmp0 - tmp6;
1910 tmp11 = tmp1 + tmp5;
1911 tmp15 = tmp1 - tmp5;
1912 tmp12 = tmp2 + tmp4;
1913 tmp16 = tmp2 - tmp4;
1914
1915 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*5];
1916 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*4];
1917 tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*3];
1918 tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*2];
1919 tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*1];
1920 tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*0];
1921 tmp6 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
1922
1923 dataptr[DCTSIZE*0] = (DCTELEM)
1924 DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12 + tmp13,
1925 FIX(0.653061224)), /* 32/49 */
1926 CONST_BITS+1);
1927 tmp13 += tmp13;
1928 dataptr[DCTSIZE*4] = (DCTELEM)
1929 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(0.832106052)) + /* c4 */
1930 MULTIPLY(tmp11 - tmp13, FIX(0.205513223)) - /* c12 */
1931 MULTIPLY(tmp12 - tmp13, FIX(0.575835255)), /* c8 */
1932 CONST_BITS+1);
1933
1934 tmp10 = MULTIPLY(tmp14 + tmp15, FIX(0.722074570)); /* c6 */
1935
1936 dataptr[DCTSIZE*2] = (DCTELEM)
1937 DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.178337691)) /* c2-c6 */
1938 + MULTIPLY(tmp16, FIX(0.400721155)), /* c10 */
1939 CONST_BITS+1);
1940 dataptr[DCTSIZE*6] = (DCTELEM)
1941 DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.122795725)) /* c6+c10 */
1942 - MULTIPLY(tmp16, FIX(0.900412262)), /* c2 */
1943 CONST_BITS+1);
1944
1945 /* Odd part */
1946
1947 tmp10 = tmp1 + tmp2;
1948 tmp11 = tmp5 - tmp4;
1949 dataptr[DCTSIZE*7] = (DCTELEM)
1950 DESCALE(MULTIPLY(tmp0 - tmp10 + tmp3 - tmp11 - tmp6,
1951 FIX(0.653061224)), /* 32/49 */
1952 CONST_BITS+1);
1953 tmp3 = MULTIPLY(tmp3 , FIX(0.653061224)); /* 32/49 */
1954 tmp10 = MULTIPLY(tmp10, - FIX(0.103406812)); /* -c13 */
1955 tmp11 = MULTIPLY(tmp11, FIX(0.917760839)); /* c1 */
1956 tmp10 += tmp11 - tmp3;
1957 tmp11 = MULTIPLY(tmp0 + tmp2, FIX(0.782007410)) + /* c5 */
1958 MULTIPLY(tmp4 + tmp6, FIX(0.491367823)); /* c9 */
1959 dataptr[DCTSIZE*5] = (DCTELEM)
1960 DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(1.550341076)) /* c3+c5-c13 */
1961 + MULTIPLY(tmp4, FIX(0.731428202)), /* c1+c11-c9 */
1962 CONST_BITS+1);
1963 tmp12 = MULTIPLY(tmp0 + tmp1, FIX(0.871740478)) + /* c3 */
1964 MULTIPLY(tmp5 - tmp6, FIX(0.305035186)); /* c11 */
1965 dataptr[DCTSIZE*3] = (DCTELEM)
1966 DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.276965844)) /* c3-c9-c13 */
1967 - MULTIPLY(tmp5, FIX(2.004803435)), /* c1+c5+c11 */
1968 CONST_BITS+1);
1969 dataptr[DCTSIZE*1] = (DCTELEM)
1970 DESCALE(tmp11 + tmp12 + tmp3
1971 - MULTIPLY(tmp0, FIX(0.735987049)) /* c3+c5-c1 */
1972 - MULTIPLY(tmp6, FIX(0.082925825)), /* c9-c11-c13 */
1973 CONST_BITS+1);
1974
1975 dataptr++; /* advance pointer to next column */
1976 wsptr++; /* advance pointer to next column */
1977 }
1978}
1979
1980
1981/*
1982 * Perform the forward DCT on a 15x15 sample block.
1983 */
1984
1985GLOBAL(void)
1986jpeg_fdct_15x15 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
1987{
1988 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
1989 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
1990 INT32 z1, z2, z3;
1991 DCTELEM workspace[8*7];
1992 DCTELEM *dataptr;
1993 DCTELEM *wsptr;
1994 JSAMPROW elemptr;
1995 int ctr;
1996 SHIFT_TEMPS
1997
1998 /* Pass 1: process rows. */
1999 /* Note results are scaled up by sqrt(8) compared to a true DCT. */
2000 /* cK represents sqrt(2) * cos(K*pi/30). */
2001
2002 dataptr = data;
2003 ctr = 0;
2004 for (;;) {
2005 elemptr = sample_data[ctr] + start_col;
2006
2007 /* Even part */
2008
2009 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[14]);
2010 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[13]);
2011 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[12]);
2012 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[11]);
2013 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[10]);
2014 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[9]);
2015 tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[8]);
2016 tmp7 = GETJSAMPLE(elemptr[7]);
2017
2018 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[14]);
2019 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[13]);
2020 tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[12]);
2021 tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[11]);
2022 tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[10]);
2023 tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[9]);
2024 tmp16 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[8]);
2025
2026 z1 = tmp0 + tmp4 + tmp5;
2027 z2 = tmp1 + tmp3 + tmp6;
2028 z3 = tmp2 + tmp7;
2029 /* Apply unsigned->signed conversion */
2030 dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE);
2031 z3 += z3;
2032 dataptr[6] = (DCTELEM)
2033 DESCALE(MULTIPLY(z1 - z3, FIX(1.144122806)) - /* c6 */
2034 MULTIPLY(z2 - z3, FIX(0.437016024)), /* c12 */
2035 CONST_BITS);
2036 tmp2 += ((tmp1 + tmp4) >> 1) - tmp7 - tmp7;
2037 z1 = MULTIPLY(tmp3 - tmp2, FIX(1.531135173)) - /* c2+c14 */
2038 MULTIPLY(tmp6 - tmp2, FIX(2.238241955)); /* c4+c8 */
2039 z2 = MULTIPLY(tmp5 - tmp2, FIX(0.798468008)) - /* c8-c14 */
2040 MULTIPLY(tmp0 - tmp2, FIX(0.091361227)); /* c2-c4 */
2041 z3 = MULTIPLY(tmp0 - tmp3, FIX(1.383309603)) + /* c2 */
2042 MULTIPLY(tmp6 - tmp5, FIX(0.946293579)) + /* c8 */
2043 MULTIPLY(tmp1 - tmp4, FIX(0.790569415)); /* (c6+c12)/2 */
2044
2045 dataptr[2] = (DCTELEM) DESCALE(z1 + z3, CONST_BITS);
2046 dataptr[4] = (DCTELEM) DESCALE(z2 + z3, CONST_BITS);
2047
2048 /* Odd part */
2049
2050 tmp2 = MULTIPLY(tmp10 - tmp12 - tmp13 + tmp15 + tmp16,
2051 FIX(1.224744871)); /* c5 */
2052 tmp1 = MULTIPLY(tmp10 - tmp14 - tmp15, FIX(1.344997024)) + /* c3 */
2053 MULTIPLY(tmp11 - tmp13 - tmp16, FIX(0.831253876)); /* c9 */
2054 tmp12 = MULTIPLY(tmp12, FIX(1.224744871)); /* c5 */
2055 tmp4 = MULTIPLY(tmp10 - tmp16, FIX(1.406466353)) + /* c1 */
2056 MULTIPLY(tmp11 + tmp14, FIX(1.344997024)) + /* c3 */
2057 MULTIPLY(tmp13 + tmp15, FIX(0.575212477)); /* c11 */
2058 tmp0 = MULTIPLY(tmp13, FIX(0.475753014)) - /* c7-c11 */
2059 MULTIPLY(tmp14, FIX(0.513743148)) + /* c3-c9 */
2060 MULTIPLY(tmp16, FIX(1.700497885)) + tmp4 + tmp12; /* c1+c13 */
2061 tmp3 = MULTIPLY(tmp10, - FIX(0.355500862)) - /* -(c1-c7) */
2062 MULTIPLY(tmp11, FIX(2.176250899)) - /* c3+c9 */
2063 MULTIPLY(tmp15, FIX(0.869244010)) + tmp4 - tmp12; /* c11+c13 */
2064
2065 dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS);
2066 dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS);
2067 dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS);
2068 dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS);
2069
2070 ctr++;
2071
2072 if (ctr != DCTSIZE) {
2073 if (ctr == 15)
2074 break; /* Done. */
2075 dataptr += DCTSIZE; /* advance pointer to next row */
2076 } else
2077 dataptr = workspace; /* switch pointer to extended workspace */
2078 }
2079
2080 /* Pass 2: process columns.
2081 * We leave the results scaled up by an overall factor of 8.
2082 * We must also scale the output by (8/15)**2 = 64/225, which we partially
2083 * fold into the constant multipliers and final shifting:
2084 * cK now represents sqrt(2) * cos(K*pi/30) * 256/225.
2085 */
2086
2087 dataptr = data;
2088 wsptr = workspace;
2089 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
2090 /* Even part */
2091
2092 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*6];
2093 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*5];
2094 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*4];
2095 tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*3];
2096 tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*2];
2097 tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*1];
2098 tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*0];
2099 tmp7 = dataptr[DCTSIZE*7];
2100
2101 tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*6];
2102 tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*5];
2103 tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*4];
2104 tmp13 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*3];
2105 tmp14 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*2];
2106 tmp15 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*1];
2107 tmp16 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*0];
2108
2109 z1 = tmp0 + tmp4 + tmp5;
2110 z2 = tmp1 + tmp3 + tmp6;
2111 z3 = tmp2 + tmp7;
2112 dataptr[DCTSIZE*0] = (DCTELEM)
2113 DESCALE(MULTIPLY(z1 + z2 + z3, FIX(1.137777778)), /* 256/225 */
2114 CONST_BITS+2);
2115 z3 += z3;
2116 dataptr[DCTSIZE*6] = (DCTELEM)
2117 DESCALE(MULTIPLY(z1 - z3, FIX(1.301757503)) - /* c6 */
2118 MULTIPLY(z2 - z3, FIX(0.497227121)), /* c12 */
2119 CONST_BITS+2);
2120 tmp2 += ((tmp1 + tmp4) >> 1) - tmp7 - tmp7;
2121 z1 = MULTIPLY(tmp3 - tmp2, FIX(1.742091575)) - /* c2+c14 */
2122 MULTIPLY(tmp6 - tmp2, FIX(2.546621957)); /* c4+c8 */
2123 z2 = MULTIPLY(tmp5 - tmp2, FIX(0.908479156)) - /* c8-c14 */
2124 MULTIPLY(tmp0 - tmp2, FIX(0.103948774)); /* c2-c4 */
2125 z3 = MULTIPLY(tmp0 - tmp3, FIX(1.573898926)) + /* c2 */
2126 MULTIPLY(tmp6 - tmp5, FIX(1.076671805)) + /* c8 */
2127 MULTIPLY(tmp1 - tmp4, FIX(0.899492312)); /* (c6+c12)/2 */
2128
2129 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z3, CONST_BITS+2);
2130 dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z2 + z3, CONST_BITS+2);
2131
2132 /* Odd part */
2133
2134 tmp2 = MULTIPLY(tmp10 - tmp12 - tmp13 + tmp15 + tmp16,
2135 FIX(1.393487498)); /* c5 */
2136 tmp1 = MULTIPLY(tmp10 - tmp14 - tmp15, FIX(1.530307725)) + /* c3 */
2137 MULTIPLY(tmp11 - tmp13 - tmp16, FIX(0.945782187)); /* c9 */
2138 tmp12 = MULTIPLY(tmp12, FIX(1.393487498)); /* c5 */
2139 tmp4 = MULTIPLY(tmp10 - tmp16, FIX(1.600246161)) + /* c1 */
2140 MULTIPLY(tmp11 + tmp14, FIX(1.530307725)) + /* c3 */
2141 MULTIPLY(tmp13 + tmp15, FIX(0.654463974)); /* c11 */
2142 tmp0 = MULTIPLY(tmp13, FIX(0.541301207)) - /* c7-c11 */
2143 MULTIPLY(tmp14, FIX(0.584525538)) + /* c3-c9 */
2144 MULTIPLY(tmp16, FIX(1.934788705)) + tmp4 + tmp12; /* c1+c13 */
2145 tmp3 = MULTIPLY(tmp10, - FIX(0.404480980)) - /* -(c1-c7) */
2146 MULTIPLY(tmp11, FIX(2.476089912)) - /* c3+c9 */
2147 MULTIPLY(tmp15, FIX(0.989006518)) + tmp4 - tmp12; /* c11+c13 */
2148
2149 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+2);
2150 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+2);
2151 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+2);
2152 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+2);
2153
2154 dataptr++; /* advance pointer to next column */
2155 wsptr++; /* advance pointer to next column */
2156 }
2157}
2158
2159
2160/*
2161 * Perform the forward DCT on a 16x16 sample block.
2162 */
2163
2164GLOBAL(void)
2165jpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
2166{
2167 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
2168 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17;
2169 DCTELEM workspace[DCTSIZE2];
2170 DCTELEM *dataptr;
2171 DCTELEM *wsptr;
2172 JSAMPROW elemptr;
2173 int ctr;
2174 SHIFT_TEMPS
2175
2176 /* Pass 1: process rows. */
2177 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
2178 /* furthermore, we scale the results by 2**PASS1_BITS. */
2179 /* cK represents sqrt(2) * cos(K*pi/32). */
2180
2181 dataptr = data;
2182 ctr = 0;
2183 for (;;) {
2184 elemptr = sample_data[ctr] + start_col;
2185
2186 /* Even part */
2187
2188 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[15]);
2189 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[14]);
2190 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[13]);
2191 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[12]);
2192 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[11]);
2193 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[10]);
2194 tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[9]);
2195 tmp7 = GETJSAMPLE(elemptr[7]) + GETJSAMPLE(elemptr[8]);
2196
2197 tmp10 = tmp0 + tmp7;
2198 tmp14 = tmp0 - tmp7;
2199 tmp11 = tmp1 + tmp6;
2200 tmp15 = tmp1 - tmp6;
2201 tmp12 = tmp2 + tmp5;
2202 tmp16 = tmp2 - tmp5;
2203 tmp13 = tmp3 + tmp4;
2204 tmp17 = tmp3 - tmp4;
2205
2206 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[15]);
2207 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[14]);
2208 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[13]);
2209 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[12]);
2210 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[11]);
2211 tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[10]);
2212 tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);
2213 tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);
2214
2215 /* Apply unsigned->signed conversion */
2216 dataptr[0] = (DCTELEM)
2217 ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);
2218 dataptr[4] = (DCTELEM)
2219 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */
2220 MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */
2221 CONST_BITS-PASS1_BITS);
2222
2223 tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */
2224 MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */
2225
2226 dataptr[2] = (DCTELEM)
2227 DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */
2228 + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+c10 */
2229 CONST_BITS-PASS1_BITS);
2230 dataptr[6] = (DCTELEM)
2231 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */
2232 - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */
2233 CONST_BITS-PASS1_BITS);
2234
2235 /* Odd part */
2236
2237 tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */
2238 MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */
2239 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */
2240 MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */
2241 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */
2242 MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */
2243 tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */
2244 MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */
2245 tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */
2246 MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */
2247 tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */
2248 MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */
2249 tmp10 = tmp11 + tmp12 + tmp13 -
2250 MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */
2251 MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */
2252 tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */
2253 - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */
2254 tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */
2255 + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */
2256 tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */
2257 + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */
2258
2259 dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);
2260 dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);
2261 dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);
2262 dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);
2263
2264 ctr++;
2265
2266 if (ctr != DCTSIZE) {
2267 if (ctr == DCTSIZE * 2)
2268 break; /* Done. */
2269 dataptr += DCTSIZE; /* advance pointer to next row */
2270 } else
2271 dataptr = workspace; /* switch pointer to extended workspace */
2272 }
2273
2274 /* Pass 2: process columns.
2275 * We remove the PASS1_BITS scaling, but leave the results scaled up
2276 * by an overall factor of 8.
2277 * We must also scale the output by (8/16)**2 = 1/2**2.
2278 */
2279
2280 dataptr = data;
2281 wsptr = workspace;
2282 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
2283 /* Even part */
2284
2285 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*7];
2286 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*6];
2287 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*5];
2288 tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*4];
2289 tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*3];
2290 tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*2];
2291 tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*1];
2292 tmp7 = dataptr[DCTSIZE*7] + wsptr[DCTSIZE*0];
2293
2294 tmp10 = tmp0 + tmp7;
2295 tmp14 = tmp0 - tmp7;
2296 tmp11 = tmp1 + tmp6;
2297 tmp15 = tmp1 - tmp6;
2298 tmp12 = tmp2 + tmp5;
2299 tmp16 = tmp2 - tmp5;
2300 tmp13 = tmp3 + tmp4;
2301 tmp17 = tmp3 - tmp4;
2302
2303 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*7];
2304 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*6];
2305 tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*5];
2306 tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*4];
2307 tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*3];
2308 tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*2];
2309 tmp6 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*1];
2310 tmp7 = dataptr[DCTSIZE*7] - wsptr[DCTSIZE*0];
2311
2312 dataptr[DCTSIZE*0] = (DCTELEM)
2313 DESCALE(tmp10 + tmp11 + tmp12 + tmp13, PASS1_BITS+2);
2314 dataptr[DCTSIZE*4] = (DCTELEM)
2315 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */
2316 MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */
2317 CONST_BITS+PASS1_BITS+2);
2318
2319 tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */
2320 MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */
2321
2322 dataptr[DCTSIZE*2] = (DCTELEM)
2323 DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */
2324 + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+10 */
2325 CONST_BITS+PASS1_BITS+2);
2326 dataptr[DCTSIZE*6] = (DCTELEM)
2327 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */
2328 - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */
2329 CONST_BITS+PASS1_BITS+2);
2330
2331 /* Odd part */
2332
2333 tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */
2334 MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */
2335 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */
2336 MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */
2337 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */
2338 MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */
2339 tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */
2340 MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */
2341 tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */
2342 MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */
2343 tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */
2344 MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */
2345 tmp10 = tmp11 + tmp12 + tmp13 -
2346 MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */
2347 MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */
2348 tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */
2349 - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */
2350 tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */
2351 + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */
2352 tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */
2353 + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */
2354
2355 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS+2);
2356 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS+2);
2357 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS+2);
2358 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS+2);
2359
2360 dataptr++; /* advance pointer to next column */
2361 wsptr++; /* advance pointer to next column */
2362 }
2363}
2364
2365
2366/*
2367 * Perform the forward DCT on a 16x8 sample block.
2368 *
2369 * 16-point FDCT in pass 1 (rows), 8-point in pass 2 (columns).
2370 */
2371
2372GLOBAL(void)
2373jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
2374{
2375 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
2376 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17;
2377 INT32 z1;
2378 DCTELEM *dataptr;
2379 JSAMPROW elemptr;
2380 int ctr;
2381 SHIFT_TEMPS
2382
2383 /* Pass 1: process rows. */
2384 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
2385 /* furthermore, we scale the results by 2**PASS1_BITS. */
2386 /* 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32). */
2387
2388 dataptr = data;
2389 ctr = 0;
2390 for (ctr = 0; ctr < DCTSIZE; ctr++) {
2391 elemptr = sample_data[ctr] + start_col;
2392
2393 /* Even part */
2394
2395 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[15]);
2396 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[14]);
2397 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[13]);
2398 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[12]);
2399 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[11]);
2400 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[10]);
2401 tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[9]);
2402 tmp7 = GETJSAMPLE(elemptr[7]) + GETJSAMPLE(elemptr[8]);
2403
2404 tmp10 = tmp0 + tmp7;
2405 tmp14 = tmp0 - tmp7;
2406 tmp11 = tmp1 + tmp6;
2407 tmp15 = tmp1 - tmp6;
2408 tmp12 = tmp2 + tmp5;
2409 tmp16 = tmp2 - tmp5;
2410 tmp13 = tmp3 + tmp4;
2411 tmp17 = tmp3 - tmp4;
2412
2413 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[15]);
2414 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[14]);
2415 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[13]);
2416 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[12]);
2417 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[11]);
2418 tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[10]);
2419 tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);
2420 tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);
2421
2422 /* Apply unsigned->signed conversion */
2423 dataptr[0] = (DCTELEM)
2424 ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);
2425 dataptr[4] = (DCTELEM)
2426 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */
2427 MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */
2428 CONST_BITS-PASS1_BITS);
2429
2430 tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */
2431 MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */
2432
2433 dataptr[2] = (DCTELEM)
2434 DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */
2435 + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+c10 */
2436 CONST_BITS-PASS1_BITS);
2437 dataptr[6] = (DCTELEM)
2438 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */
2439 - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */
2440 CONST_BITS-PASS1_BITS);
2441
2442 /* Odd part */
2443
2444 tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */
2445 MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */
2446 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */
2447 MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */
2448 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */
2449 MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */
2450 tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */
2451 MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */
2452 tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */
2453 MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */
2454 tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */
2455 MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */
2456 tmp10 = tmp11 + tmp12 + tmp13 -
2457 MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */
2458 MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */
2459 tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */
2460 - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */
2461 tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */
2462 + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */
2463 tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */
2464 + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */
2465
2466 dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);
2467 dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);
2468 dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);
2469 dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);
2470
2471 dataptr += DCTSIZE; /* advance pointer to next row */
2472 }
2473
2474 /* Pass 2: process columns.
2475 * We remove the PASS1_BITS scaling, but leave the results scaled up
2476 * by an overall factor of 8.
2477 * We must also scale the output by 8/16 = 1/2.
2478 */
2479
2480 dataptr = data;
2481 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
2482 /* Even part per LL&M figure 1 --- note that published figure is faulty;
2483 * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
2484 */
2485
2486 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
2487 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
2488 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
2489 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
2490
2491 tmp10 = tmp0 + tmp3;
2492 tmp12 = tmp0 - tmp3;
2493 tmp11 = tmp1 + tmp2;
2494 tmp13 = tmp1 - tmp2;
2495
2496 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
2497 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
2498 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
2499 tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
2500
2501 dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS+1);
2502 dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS+1);
2503
2504 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
2505 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865),
2506 CONST_BITS+PASS1_BITS+1);
2507 dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065),
2508 CONST_BITS+PASS1_BITS+1);
2509
2510 /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
2511 * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
2512 * i0..i3 in the paper are tmp0..tmp3 here.
2513 */
2514
2515 tmp10 = tmp0 + tmp3;
2516 tmp11 = tmp1 + tmp2;
2517 tmp12 = tmp0 + tmp2;
2518 tmp13 = tmp1 + tmp3;
2519 z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */
2520
2521 tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */
2522 tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */
2523 tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */
2524 tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */
2525 tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */
2526 tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */
2527 tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */
2528 tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */
2529
2530 tmp12 += z1;
2531 tmp13 += z1;
2532
2533 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0 + tmp10 + tmp12,
2534 CONST_BITS+PASS1_BITS+1);
2535 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1 + tmp11 + tmp13,
2536 CONST_BITS+PASS1_BITS+1);
2537 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2 + tmp11 + tmp12,
2538 CONST_BITS+PASS1_BITS+1);
2539 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3 + tmp10 + tmp13,
2540 CONST_BITS+PASS1_BITS+1);
2541
2542 dataptr++; /* advance pointer to next column */
2543 }
2544}
2545
2546
2547/*
2548 * Perform the forward DCT on a 14x7 sample block.
2549 *
2550 * 14-point FDCT in pass 1 (rows), 7-point in pass 2 (columns).
2551 */
2552
2553GLOBAL(void)
2554jpeg_fdct_14x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
2555{
2556 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
2557 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
2558 INT32 z1, z2, z3;
2559 DCTELEM *dataptr;
2560 JSAMPROW elemptr;
2561 int ctr;
2562 SHIFT_TEMPS
2563
2564 /* Zero bottom row of output coefficient block. */
2565 MEMZERO(&data[DCTSIZE*7], SIZEOF(DCTELEM) * DCTSIZE);
2566
2567 /* Pass 1: process rows. */
2568 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
2569 /* furthermore, we scale the results by 2**PASS1_BITS. */
2570 /* 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28). */
2571
2572 dataptr = data;
2573 for (ctr = 0; ctr < 7; ctr++) {
2574 elemptr = sample_data[ctr] + start_col;
2575
2576 /* Even part */
2577
2578 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[13]);
2579 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[12]);
2580 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[11]);
2581 tmp13 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[10]);
2582 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[9]);
2583 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[8]);
2584 tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[7]);
2585
2586 tmp10 = tmp0 + tmp6;
2587 tmp14 = tmp0 - tmp6;
2588 tmp11 = tmp1 + tmp5;
2589 tmp15 = tmp1 - tmp5;
2590 tmp12 = tmp2 + tmp4;
2591 tmp16 = tmp2 - tmp4;
2592
2593 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[13]);
2594 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[12]);
2595 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[11]);
2596 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[10]);
2597 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[9]);
2598 tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);
2599 tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);
2600
2601 /* Apply unsigned->signed conversion */
2602 dataptr[0] = (DCTELEM)
2603 ((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS);
2604 tmp13 += tmp13;
2605 dataptr[4] = (DCTELEM)
2606 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.274162392)) + /* c4 */
2607 MULTIPLY(tmp11 - tmp13, FIX(0.314692123)) - /* c12 */
2608 MULTIPLY(tmp12 - tmp13, FIX(0.881747734)), /* c8 */
2609 CONST_BITS-PASS1_BITS);
2610
2611 tmp10 = MULTIPLY(tmp14 + tmp15, FIX(1.105676686)); /* c6 */
2612
2613 dataptr[2] = (DCTELEM)
2614 DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.273079590)) /* c2-c6 */
2615 + MULTIPLY(tmp16, FIX(0.613604268)), /* c10 */
2616 CONST_BITS-PASS1_BITS);
2617 dataptr[6] = (DCTELEM)
2618 DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.719280954)) /* c6+c10 */
2619 - MULTIPLY(tmp16, FIX(1.378756276)), /* c2 */
2620 CONST_BITS-PASS1_BITS);
2621
2622 /* Odd part */
2623
2624 tmp10 = tmp1 + tmp2;
2625 tmp11 = tmp5 - tmp4;
2626 dataptr[7] = (DCTELEM) ((tmp0 - tmp10 + tmp3 - tmp11 - tmp6) << PASS1_BITS);
2627 tmp3 <<= CONST_BITS;
2628 tmp10 = MULTIPLY(tmp10, - FIX(0.158341681)); /* -c13 */
2629 tmp11 = MULTIPLY(tmp11, FIX(1.405321284)); /* c1 */
2630 tmp10 += tmp11 - tmp3;
2631 tmp11 = MULTIPLY(tmp0 + tmp2, FIX(1.197448846)) + /* c5 */
2632 MULTIPLY(tmp4 + tmp6, FIX(0.752406978)); /* c9 */
2633 dataptr[5] = (DCTELEM)
2634 DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(2.373959773)) /* c3+c5-c13 */
2635 + MULTIPLY(tmp4, FIX(1.119999435)), /* c1+c11-c9 */
2636 CONST_BITS-PASS1_BITS);
2637 tmp12 = MULTIPLY(tmp0 + tmp1, FIX(1.334852607)) + /* c3 */
2638 MULTIPLY(tmp5 - tmp6, FIX(0.467085129)); /* c11 */
2639 dataptr[3] = (DCTELEM)
2640 DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.424103948)) /* c3-c9-c13 */
2641 - MULTIPLY(tmp5, FIX(3.069855259)), /* c1+c5+c11 */
2642 CONST_BITS-PASS1_BITS);
2643 dataptr[1] = (DCTELEM)
2644 DESCALE(tmp11 + tmp12 + tmp3 + tmp6 -
2645 MULTIPLY(tmp0 + tmp6, FIX(1.126980169)), /* c3+c5-c1 */
2646 CONST_BITS-PASS1_BITS);
2647
2648 dataptr += DCTSIZE; /* advance pointer to next row */
2649 }
2650
2651 /* Pass 2: process columns.
2652 * We remove the PASS1_BITS scaling, but leave the results scaled up
2653 * by an overall factor of 8.
2654 * We must also scale the output by (8/14)*(8/7) = 32/49, which we
2655 * partially fold into the constant multipliers and final shifting:
2656 * 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14) * 64/49.
2657 */
2658
2659 dataptr = data;
2660 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
2661 /* Even part */
2662
2663 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*6];
2664 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*5];
2665 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*4];
2666 tmp3 = dataptr[DCTSIZE*3];
2667
2668 tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*6];
2669 tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*5];
2670 tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*4];
2671
2672 z1 = tmp0 + tmp2;
2673 dataptr[DCTSIZE*0] = (DCTELEM)
2674 DESCALE(MULTIPLY(z1 + tmp1 + tmp3, FIX(1.306122449)), /* 64/49 */
2675 CONST_BITS+PASS1_BITS+1);
2676 tmp3 += tmp3;
2677 z1 -= tmp3;
2678 z1 -= tmp3;
2679 z1 = MULTIPLY(z1, FIX(0.461784020)); /* (c2+c6-c4)/2 */
2680 z2 = MULTIPLY(tmp0 - tmp2, FIX(1.202428084)); /* (c2+c4-c6)/2 */
2681 z3 = MULTIPLY(tmp1 - tmp2, FIX(0.411026446)); /* c6 */
2682 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS+PASS1_BITS+1);
2683 z1 -= z2;
2684 z2 = MULTIPLY(tmp0 - tmp1, FIX(1.151670509)); /* c4 */
2685 dataptr[DCTSIZE*4] = (DCTELEM)
2686 DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.923568041)), /* c2+c6-c4 */
2687 CONST_BITS+PASS1_BITS+1);
2688 dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+PASS1_BITS+1);
2689
2690 /* Odd part */
2691
2692 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.221765677)); /* (c3+c1-c5)/2 */
2693 tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.222383464)); /* (c3+c5-c1)/2 */
2694 tmp0 = tmp1 - tmp2;
2695 tmp1 += tmp2;
2696 tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.800824523)); /* -c1 */
2697 tmp1 += tmp2;
2698 tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.801442310)); /* c5 */
2699 tmp0 += tmp3;
2700 tmp2 += tmp3 + MULTIPLY(tmp12, FIX(2.443531355)); /* c3+c1-c5 */
2701
2702 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS+1);
2703 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS+1);
2704 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS+1);
2705
2706 dataptr++; /* advance pointer to next column */
2707 }
2708}
2709
2710
2711/*
2712 * Perform the forward DCT on a 12x6 sample block.
2713 *
2714 * 12-point FDCT in pass 1 (rows), 6-point in pass 2 (columns).
2715 */
2716
2717GLOBAL(void)
2718jpeg_fdct_12x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
2719{
2720 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
2721 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
2722 DCTELEM *dataptr;
2723 JSAMPROW elemptr;
2724 int ctr;
2725 SHIFT_TEMPS
2726
2727 /* Zero 2 bottom rows of output coefficient block. */
2728 MEMZERO(&data[DCTSIZE*6], SIZEOF(DCTELEM) * DCTSIZE * 2);
2729
2730 /* Pass 1: process rows. */
2731 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
2732 /* furthermore, we scale the results by 2**PASS1_BITS. */
2733 /* 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24). */
2734
2735 dataptr = data;
2736 for (ctr = 0; ctr < 6; ctr++) {
2737 elemptr = sample_data[ctr] + start_col;
2738
2739 /* Even part */
2740
2741 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[11]);
2742 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[10]);
2743 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[9]);
2744 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[8]);
2745 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[7]);
2746 tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[6]);
2747
2748 tmp10 = tmp0 + tmp5;
2749 tmp13 = tmp0 - tmp5;
2750 tmp11 = tmp1 + tmp4;
2751 tmp14 = tmp1 - tmp4;
2752 tmp12 = tmp2 + tmp3;
2753 tmp15 = tmp2 - tmp3;
2754
2755 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[11]);
2756 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[10]);
2757 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[9]);
2758 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[8]);
2759 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);
2760 tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);
2761
2762 /* Apply unsigned->signed conversion */
2763 dataptr[0] = (DCTELEM)
2764 ((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS);
2765 dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS);
2766 dataptr[4] = (DCTELEM)
2767 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.224744871)), /* c4 */
2768 CONST_BITS-PASS1_BITS);
2769 dataptr[2] = (DCTELEM)
2770 DESCALE(tmp14 - tmp15 + MULTIPLY(tmp13 + tmp15, FIX(1.366025404)), /* c2 */
2771 CONST_BITS-PASS1_BITS);
2772
2773 /* Odd part */
2774
2775 tmp10 = MULTIPLY(tmp1 + tmp4, FIX_0_541196100); /* c9 */
2776 tmp14 = tmp10 + MULTIPLY(tmp1, FIX_0_765366865); /* c3-c9 */
2777 tmp15 = tmp10 - MULTIPLY(tmp4, FIX_1_847759065); /* c3+c9 */
2778 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.121971054)); /* c5 */
2779 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.860918669)); /* c7 */
2780 tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.580774953)) /* c5+c7-c1 */
2781 + MULTIPLY(tmp5, FIX(0.184591911)); /* c11 */
2782 tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.184591911)); /* -c11 */
2783 tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.339493912)) /* c1+c5-c11 */
2784 + MULTIPLY(tmp5, FIX(0.860918669)); /* c7 */
2785 tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.725788011)) /* c1+c11-c7 */
2786 - MULTIPLY(tmp5, FIX(1.121971054)); /* c5 */
2787 tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.306562965)) /* c3 */
2788 - MULTIPLY(tmp2 + tmp5, FIX_0_541196100); /* c9 */
2789
2790 dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);
2791 dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);
2792 dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);
2793 dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);
2794
2795 dataptr += DCTSIZE; /* advance pointer to next row */
2796 }
2797
2798 /* Pass 2: process columns.
2799 * We remove the PASS1_BITS scaling, but leave the results scaled up
2800 * by an overall factor of 8.
2801 * We must also scale the output by (8/12)*(8/6) = 8/9, which we
2802 * partially fold into the constant multipliers and final shifting:
2803 * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12) * 16/9.
2804 */
2805
2806 dataptr = data;
2807 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
2808 /* Even part */
2809
2810 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5];
2811 tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4];
2812 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
2813
2814 tmp10 = tmp0 + tmp2;
2815 tmp12 = tmp0 - tmp2;
2816
2817 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5];
2818 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4];
2819 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
2820
2821 dataptr[DCTSIZE*0] = (DCTELEM)
2822 DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)), /* 16/9 */
2823 CONST_BITS+PASS1_BITS+1);
2824 dataptr[DCTSIZE*2] = (DCTELEM)
2825 DESCALE(MULTIPLY(tmp12, FIX(2.177324216)), /* c2 */
2826 CONST_BITS+PASS1_BITS+1);
2827 dataptr[DCTSIZE*4] = (DCTELEM)
2828 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */
2829 CONST_BITS+PASS1_BITS+1);
2830
2831 /* Odd part */
2832
2833 tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829)); /* c5 */
2834
2835 dataptr[DCTSIZE*1] = (DCTELEM)
2836 DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */
2837 CONST_BITS+PASS1_BITS+1);
2838 dataptr[DCTSIZE*3] = (DCTELEM)
2839 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)), /* 16/9 */
2840 CONST_BITS+PASS1_BITS+1);
2841 dataptr[DCTSIZE*5] = (DCTELEM)
2842 DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)), /* 16/9 */
2843 CONST_BITS+PASS1_BITS+1);
2844
2845 dataptr++; /* advance pointer to next column */
2846 }
2847}
2848
2849
2850/*
2851 * Perform the forward DCT on a 10x5 sample block.
2852 *
2853 * 10-point FDCT in pass 1 (rows), 5-point in pass 2 (columns).
2854 */
2855
2856GLOBAL(void)
2857jpeg_fdct_10x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
2858{
2859 INT32 tmp0, tmp1, tmp2, tmp3, tmp4;
2860 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
2861 DCTELEM *dataptr;
2862 JSAMPROW elemptr;
2863 int ctr;
2864 SHIFT_TEMPS
2865
2866 /* Zero 3 bottom rows of output coefficient block. */
2867 MEMZERO(&data[DCTSIZE*5], SIZEOF(DCTELEM) * DCTSIZE * 3);
2868
2869 /* Pass 1: process rows. */
2870 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
2871 /* furthermore, we scale the results by 2**PASS1_BITS. */
2872 /* 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20). */
2873
2874 dataptr = data;
2875 for (ctr = 0; ctr < 5; ctr++) {
2876 elemptr = sample_data[ctr] + start_col;
2877
2878 /* Even part */
2879
2880 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[9]);
2881 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[8]);
2882 tmp12 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[7]);
2883 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[6]);
2884 tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[5]);
2885
2886 tmp10 = tmp0 + tmp4;
2887 tmp13 = tmp0 - tmp4;
2888 tmp11 = tmp1 + tmp3;
2889 tmp14 = tmp1 - tmp3;
2890
2891 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[9]);
2892 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[8]);
2893 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[7]);
2894 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);
2895 tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);
2896
2897 /* Apply unsigned->signed conversion */
2898 dataptr[0] = (DCTELEM)
2899 ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS);
2900 tmp12 += tmp12;
2901 dataptr[4] = (DCTELEM)
2902 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.144122806)) - /* c4 */
2903 MULTIPLY(tmp11 - tmp12, FIX(0.437016024)), /* c8 */
2904 CONST_BITS-PASS1_BITS);
2905 tmp10 = MULTIPLY(tmp13 + tmp14, FIX(0.831253876)); /* c6 */
2906 dataptr[2] = (DCTELEM)
2907 DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.513743148)), /* c2-c6 */
2908 CONST_BITS-PASS1_BITS);
2909 dataptr[6] = (DCTELEM)
2910 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.176250899)), /* c2+c6 */
2911 CONST_BITS-PASS1_BITS);
2912
2913 /* Odd part */
2914
2915 tmp10 = tmp0 + tmp4;
2916 tmp11 = tmp1 - tmp3;
2917 dataptr[5] = (DCTELEM) ((tmp10 - tmp11 - tmp2) << PASS1_BITS);
2918 tmp2 <<= CONST_BITS;
2919 dataptr[1] = (DCTELEM)
2920 DESCALE(MULTIPLY(tmp0, FIX(1.396802247)) + /* c1 */
2921 MULTIPLY(tmp1, FIX(1.260073511)) + tmp2 + /* c3 */
2922 MULTIPLY(tmp3, FIX(0.642039522)) + /* c7 */
2923 MULTIPLY(tmp4, FIX(0.221231742)), /* c9 */
2924 CONST_BITS-PASS1_BITS);
2925 tmp12 = MULTIPLY(tmp0 - tmp4, FIX(0.951056516)) - /* (c3+c7)/2 */
2926 MULTIPLY(tmp1 + tmp3, FIX(0.587785252)); /* (c1-c9)/2 */
2927 tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.309016994)) + /* (c3-c7)/2 */
2928 (tmp11 << (CONST_BITS - 1)) - tmp2;
2929 dataptr[3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS-PASS1_BITS);
2930 dataptr[7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS-PASS1_BITS);
2931
2932 dataptr += DCTSIZE; /* advance pointer to next row */
2933 }
2934
2935 /* Pass 2: process columns.
2936 * We remove the PASS1_BITS scaling, but leave the results scaled up
2937 * by an overall factor of 8.
2938 * We must also scale the output by (8/10)*(8/5) = 32/25, which we
2939 * fold into the constant multipliers:
2940 * 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10) * 32/25.
2941 */
2942
2943 dataptr = data;
2944 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
2945 /* Even part */
2946
2947 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*4];
2948 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*3];
2949 tmp2 = dataptr[DCTSIZE*2];
2950
2951 tmp10 = tmp0 + tmp1;
2952 tmp11 = tmp0 - tmp1;
2953
2954 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*4];
2955 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*3];
2956
2957 dataptr[DCTSIZE*0] = (DCTELEM)
2958 DESCALE(MULTIPLY(tmp10 + tmp2, FIX(1.28)), /* 32/25 */
2959 CONST_BITS+PASS1_BITS);
2960 tmp11 = MULTIPLY(tmp11, FIX(1.011928851)); /* (c2+c4)/2 */
2961 tmp10 -= tmp2 << 2;
2962 tmp10 = MULTIPLY(tmp10, FIX(0.452548340)); /* (c2-c4)/2 */
2963 dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS+PASS1_BITS);
2964 dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS+PASS1_BITS);
2965
2966 /* Odd part */
2967
2968 tmp10 = MULTIPLY(tmp0 + tmp1, FIX(1.064004961)); /* c3 */
2969
2970 dataptr[DCTSIZE*1] = (DCTELEM)
2971 DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.657591230)), /* c1-c3 */
2972 CONST_BITS+PASS1_BITS);
2973 dataptr[DCTSIZE*3] = (DCTELEM)
2974 DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.785601151)), /* c1+c3 */
2975 CONST_BITS+PASS1_BITS);
2976
2977 dataptr++; /* advance pointer to next column */
2978 }
2979}
2980
2981
2982/*
2983 * Perform the forward DCT on an 8x4 sample block.
2984 *
2985 * 8-point FDCT in pass 1 (rows), 4-point in pass 2 (columns).
2986 */
2987
2988GLOBAL(void)
2989jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
2990{
2991 INT32 tmp0, tmp1, tmp2, tmp3;
2992 INT32 tmp10, tmp11, tmp12, tmp13;
2993 INT32 z1;
2994 DCTELEM *dataptr;
2995 JSAMPROW elemptr;
2996 int ctr;
2997 SHIFT_TEMPS
2998
2999 /* Zero 4 bottom rows of output coefficient block. */
3000 MEMZERO(&data[DCTSIZE*4], SIZEOF(DCTELEM) * DCTSIZE * 4);
3001
3002 /* Pass 1: process rows. */
3003 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3004 /* furthermore, we scale the results by 2**PASS1_BITS. */
3005 /* We must also scale the output by 8/4 = 2, which we add here. */
3006
3007 dataptr = data;
3008 for (ctr = 0; ctr < 4; ctr++) {
3009 elemptr = sample_data[ctr] + start_col;
3010
3011 /* Even part per LL&M figure 1 --- note that published figure is faulty;
3012 * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
3013 */
3014
3015 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);
3016 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);
3017 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);
3018 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);
3019
3020 tmp10 = tmp0 + tmp3;
3021 tmp12 = tmp0 - tmp3;
3022 tmp11 = tmp1 + tmp2;
3023 tmp13 = tmp1 - tmp2;
3024
3025 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);
3026 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);
3027 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
3028 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
3029
3030 /* Apply unsigned->signed conversion */
3031 dataptr[0] = (DCTELEM)
3032 ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1));
3033 dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1));
3034
3035 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
3036 /* Add fudge factor here for final descale. */
3037 z1 += ONE << (CONST_BITS-PASS1_BITS-2);
3038 dataptr[2] = (DCTELEM) RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865),
3039 CONST_BITS-PASS1_BITS-1);
3040 dataptr[6] = (DCTELEM) RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065),
3041 CONST_BITS-PASS1_BITS-1);
3042
3043 /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
3044 * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
3045 * i0..i3 in the paper are tmp0..tmp3 here.
3046 */
3047
3048 tmp10 = tmp0 + tmp3;
3049 tmp11 = tmp1 + tmp2;
3050 tmp12 = tmp0 + tmp2;
3051 tmp13 = tmp1 + tmp3;
3052 z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */
3053 /* Add fudge factor here for final descale. */
3054 z1 += ONE << (CONST_BITS-PASS1_BITS-2);
3055
3056 tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */
3057 tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */
3058 tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */
3059 tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */
3060 tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */
3061 tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */
3062 tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */
3063 tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */
3064
3065 tmp12 += z1;
3066 tmp13 += z1;
3067
3068 dataptr[1] = (DCTELEM)
3069 RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS-1);
3070 dataptr[3] = (DCTELEM)
3071 RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS-1);
3072 dataptr[5] = (DCTELEM)
3073 RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS-1);
3074 dataptr[7] = (DCTELEM)
3075 RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS-1);
3076
3077 dataptr += DCTSIZE; /* advance pointer to next row */
3078 }
3079
3080 /* Pass 2: process columns.
3081 * We remove the PASS1_BITS scaling, but leave the results scaled up
3082 * by an overall factor of 8.
3083 * 4-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
3084 */
3085
3086 dataptr = data;
3087 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
3088 /* Even part */
3089
3090 /* Add fudge factor here for final descale. */
3091 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3] + (ONE << (PASS1_BITS-1));
3092 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2];
3093
3094 tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
3095 tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
3096
3097 dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);
3098 dataptr[DCTSIZE*2] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);
3099
3100 /* Odd part */
3101
3102 tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
3103 /* Add fudge factor here for final descale. */
3104 tmp0 += ONE << (CONST_BITS+PASS1_BITS-1);
3105
3106 dataptr[DCTSIZE*1] = (DCTELEM)
3107 RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
3108 CONST_BITS+PASS1_BITS);
3109 dataptr[DCTSIZE*3] = (DCTELEM)
3110 RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
3111 CONST_BITS+PASS1_BITS);
3112
3113 dataptr++; /* advance pointer to next column */
3114 }
3115}
3116
3117
3118/*
3119 * Perform the forward DCT on a 6x3 sample block.
3120 *
3121 * 6-point FDCT in pass 1 (rows), 3-point in pass 2 (columns).
3122 */
3123
3124GLOBAL(void)
3125jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3126{
3127 INT32 tmp0, tmp1, tmp2;
3128 INT32 tmp10, tmp11, tmp12;
3129 DCTELEM *dataptr;
3130 JSAMPROW elemptr;
3131 int ctr;
3132 SHIFT_TEMPS
3133
3134 /* Pre-zero output coefficient block. */
3135 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
3136
3137 /* Pass 1: process rows. */
3138 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3139 /* furthermore, we scale the results by 2**PASS1_BITS. */
3140 /* We scale the results further by 2 as part of output adaption */
3141 /* scaling for different DCT size. */
3142 /* 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */
3143
3144 dataptr = data;
3145 for (ctr = 0; ctr < 3; ctr++) {
3146 elemptr = sample_data[ctr] + start_col;
3147
3148 /* Even part */
3149
3150 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]);
3151 tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]);
3152 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]);
3153
3154 tmp10 = tmp0 + tmp2;
3155 tmp12 = tmp0 - tmp2;
3156
3157 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]);
3158 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
3159 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
3160
3161 /* Apply unsigned->signed conversion */
3162 dataptr[0] = (DCTELEM)
3163 ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1));
3164 dataptr[2] = (DCTELEM)
3165 DESCALE(MULTIPLY(tmp12, FIX(1.224744871)), /* c2 */
3166 CONST_BITS-PASS1_BITS-1);
3167 dataptr[4] = (DCTELEM)
3168 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */
3169 CONST_BITS-PASS1_BITS-1);
3170
3171 /* Odd part */
3172
3173 tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)), /* c5 */
3174 CONST_BITS-PASS1_BITS-1);
3175
3176 dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << (PASS1_BITS+1)));
3177 dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << (PASS1_BITS+1));
3178 dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << (PASS1_BITS+1)));
3179
3180 dataptr += DCTSIZE; /* advance pointer to next row */
3181 }
3182
3183 /* Pass 2: process columns.
3184 * We remove the PASS1_BITS scaling, but leave the results scaled up
3185 * by an overall factor of 8.
3186 * We must also scale the output by (8/6)*(8/3) = 32/9, which we partially
3187 * fold into the constant multipliers (other part was done in pass 1):
3188 * 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6) * 16/9.
3189 */
3190
3191 dataptr = data;
3192 for (ctr = 0; ctr < 6; ctr++) {
3193 /* Even part */
3194
3195 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*2];
3196 tmp1 = dataptr[DCTSIZE*1];
3197
3198 tmp2 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*2];
3199
3200 dataptr[DCTSIZE*0] = (DCTELEM)
3201 DESCALE(MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */
3202 CONST_BITS+PASS1_BITS);
3203 dataptr[DCTSIZE*2] = (DCTELEM)
3204 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(1.257078722)), /* c2 */
3205 CONST_BITS+PASS1_BITS);
3206
3207 /* Odd part */
3208
3209 dataptr[DCTSIZE*1] = (DCTELEM)
3210 DESCALE(MULTIPLY(tmp2, FIX(2.177324216)), /* c1 */
3211 CONST_BITS+PASS1_BITS);
3212
3213 dataptr++; /* advance pointer to next column */
3214 }
3215}
3216
3217
3218/*
3219 * Perform the forward DCT on a 4x2 sample block.
3220 *
3221 * 4-point FDCT in pass 1 (rows), 2-point in pass 2 (columns).
3222 */
3223
3224GLOBAL(void)
3225jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3226{
3227 INT32 tmp0, tmp1;
3228 INT32 tmp10, tmp11;
3229 DCTELEM *dataptr;
3230 JSAMPROW elemptr;
3231 int ctr;
3232 SHIFT_TEMPS
3233
3234 /* Pre-zero output coefficient block. */
3235 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
3236
3237 /* Pass 1: process rows. */
3238 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3239 /* furthermore, we scale the results by 2**PASS1_BITS. */
3240 /* We must also scale the output by (8/4)*(8/2) = 2**3, which we add here. */
3241 /* 4-point FDCT kernel, */
3242 /* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */
3243
3244 dataptr = data;
3245 for (ctr = 0; ctr < 2; ctr++) {
3246 elemptr = sample_data[ctr] + start_col;
3247
3248 /* Even part */
3249
3250 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
3251 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
3252
3253 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
3254 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
3255
3256 /* Apply unsigned->signed conversion */
3257 dataptr[0] = (DCTELEM)
3258 ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3));
3259 dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3));
3260
3261 /* Odd part */
3262
3263 tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
3264 /* Add fudge factor here for final descale. */
3265 tmp0 += ONE << (CONST_BITS-PASS1_BITS-4);
3266
3267 dataptr[1] = (DCTELEM)
3268 RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
3269 CONST_BITS-PASS1_BITS-3);
3270 dataptr[3] = (DCTELEM)
3271 RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
3272 CONST_BITS-PASS1_BITS-3);
3273
3274 dataptr += DCTSIZE; /* advance pointer to next row */
3275 }
3276
3277 /* Pass 2: process columns.
3278 * We remove the PASS1_BITS scaling, but leave the results scaled up
3279 * by an overall factor of 8.
3280 */
3281
3282 dataptr = data;
3283 for (ctr = 0; ctr < 4; ctr++) {
3284 /* Even part */
3285
3286 /* Add fudge factor here for final descale. */
3287 tmp0 = dataptr[DCTSIZE*0] + (ONE << (PASS1_BITS-1));
3288 tmp1 = dataptr[DCTSIZE*1];
3289
3290 dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);
3291
3292 /* Odd part */
3293
3294 dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);
3295
3296 dataptr++; /* advance pointer to next column */
3297 }
3298}
3299
3300
3301/*
3302 * Perform the forward DCT on a 2x1 sample block.
3303 *
3304 * 2-point FDCT in pass 1 (rows), 1-point in pass 2 (columns).
3305 */
3306
3307GLOBAL(void)
3308jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3309{
3310 INT32 tmp0, tmp1;
3311 JSAMPROW elemptr;
3312
3313 /* Pre-zero output coefficient block. */
3314 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
3315
3316 elemptr = sample_data[0] + start_col;
3317
3318 tmp0 = GETJSAMPLE(elemptr[0]);
3319 tmp1 = GETJSAMPLE(elemptr[1]);
3320
3321 /* We leave the results scaled up by an overall factor of 8.
3322 * We must also scale the output by (8/2)*(8/1) = 2**5.
3323 */
3324
3325 /* Even part */
3326 /* Apply unsigned->signed conversion */
3327 data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5);
3328
3329 /* Odd part */
3330 data[1] = (DCTELEM) ((tmp0 - tmp1) << 5);
3331}
3332
3333
3334/*
3335 * Perform the forward DCT on an 8x16 sample block.
3336 *
3337 * 8-point FDCT in pass 1 (rows), 16-point in pass 2 (columns).
3338 */
3339
3340GLOBAL(void)
3341jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3342{
3343 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
3344 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17;
3345 INT32 z1;
3346 DCTELEM workspace[DCTSIZE2];
3347 DCTELEM *dataptr;
3348 DCTELEM *wsptr;
3349 JSAMPROW elemptr;
3350 int ctr;
3351 SHIFT_TEMPS
3352
3353 /* Pass 1: process rows. */
3354 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3355 /* furthermore, we scale the results by 2**PASS1_BITS. */
3356
3357 dataptr = data;
3358 ctr = 0;
3359 for (;;) {
3360 elemptr = sample_data[ctr] + start_col;
3361
3362 /* Even part per LL&M figure 1 --- note that published figure is faulty;
3363 * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
3364 */
3365
3366 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]);
3367 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]);
3368 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]);
3369 tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]);
3370
3371 tmp10 = tmp0 + tmp3;
3372 tmp12 = tmp0 - tmp3;
3373 tmp11 = tmp1 + tmp2;
3374 tmp13 = tmp1 - tmp2;
3375
3376 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]);
3377 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]);
3378 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
3379 tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
3380
3381 /* Apply unsigned->signed conversion */
3382 dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);
3383 dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
3384
3385 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
3386 dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865),
3387 CONST_BITS-PASS1_BITS);
3388 dataptr[6] = (DCTELEM) DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065),
3389 CONST_BITS-PASS1_BITS);
3390
3391 /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
3392 * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
3393 * i0..i3 in the paper are tmp0..tmp3 here.
3394 */
3395
3396 tmp10 = tmp0 + tmp3;
3397 tmp11 = tmp1 + tmp2;
3398 tmp12 = tmp0 + tmp2;
3399 tmp13 = tmp1 + tmp3;
3400 z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */
3401
3402 tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */
3403 tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */
3404 tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */
3405 tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */
3406 tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */
3407 tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */
3408 tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */
3409 tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */
3410
3411 tmp12 += z1;
3412 tmp13 += z1;
3413
3414 dataptr[1] = (DCTELEM) DESCALE(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS);
3415 dataptr[3] = (DCTELEM) DESCALE(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS);
3416 dataptr[5] = (DCTELEM) DESCALE(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS);
3417 dataptr[7] = (DCTELEM) DESCALE(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS);
3418
3419 ctr++;
3420
3421 if (ctr != DCTSIZE) {
3422 if (ctr == DCTSIZE * 2)
3423 break; /* Done. */
3424 dataptr += DCTSIZE; /* advance pointer to next row */
3425 } else
3426 dataptr = workspace; /* switch pointer to extended workspace */
3427 }
3428
3429 /* Pass 2: process columns.
3430 * We remove the PASS1_BITS scaling, but leave the results scaled up
3431 * by an overall factor of 8.
3432 * We must also scale the output by 8/16 = 1/2.
3433 * 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32).
3434 */
3435
3436 dataptr = data;
3437 wsptr = workspace;
3438 for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
3439 /* Even part */
3440
3441 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*7];
3442 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*6];
3443 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*5];
3444 tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*4];
3445 tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*3];
3446 tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*2];
3447 tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*1];
3448 tmp7 = dataptr[DCTSIZE*7] + wsptr[DCTSIZE*0];
3449
3450 tmp10 = tmp0 + tmp7;
3451 tmp14 = tmp0 - tmp7;
3452 tmp11 = tmp1 + tmp6;
3453 tmp15 = tmp1 - tmp6;
3454 tmp12 = tmp2 + tmp5;
3455 tmp16 = tmp2 - tmp5;
3456 tmp13 = tmp3 + tmp4;
3457 tmp17 = tmp3 - tmp4;
3458
3459 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*7];
3460 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*6];
3461 tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*5];
3462 tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*4];
3463 tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*3];
3464 tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*2];
3465 tmp6 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*1];
3466 tmp7 = dataptr[DCTSIZE*7] - wsptr[DCTSIZE*0];
3467
3468 dataptr[DCTSIZE*0] = (DCTELEM)
3469 DESCALE(tmp10 + tmp11 + tmp12 + tmp13, PASS1_BITS+1);
3470 dataptr[DCTSIZE*4] = (DCTELEM)
3471 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */
3472 MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */
3473 CONST_BITS+PASS1_BITS+1);
3474
3475 tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */
3476 MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */
3477
3478 dataptr[DCTSIZE*2] = (DCTELEM)
3479 DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */
3480 + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+c10 */
3481 CONST_BITS+PASS1_BITS+1);
3482 dataptr[DCTSIZE*6] = (DCTELEM)
3483 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */
3484 - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */
3485 CONST_BITS+PASS1_BITS+1);
3486
3487 /* Odd part */
3488
3489 tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */
3490 MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */
3491 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */
3492 MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */
3493 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */
3494 MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */
3495 tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */
3496 MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */
3497 tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */
3498 MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */
3499 tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */
3500 MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */
3501 tmp10 = tmp11 + tmp12 + tmp13 -
3502 MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */
3503 MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */
3504 tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */
3505 - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */
3506 tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */
3507 + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */
3508 tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */
3509 + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */
3510
3511 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS+1);
3512 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS+1);
3513 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS+1);
3514 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS+1);
3515
3516 dataptr++; /* advance pointer to next column */
3517 wsptr++; /* advance pointer to next column */
3518 }
3519}
3520
3521
3522/*
3523 * Perform the forward DCT on a 7x14 sample block.
3524 *
3525 * 7-point FDCT in pass 1 (rows), 14-point in pass 2 (columns).
3526 */
3527
3528GLOBAL(void)
3529jpeg_fdct_7x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3530{
3531 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
3532 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
3533 INT32 z1, z2, z3;
3534 DCTELEM workspace[8*6];
3535 DCTELEM *dataptr;
3536 DCTELEM *wsptr;
3537 JSAMPROW elemptr;
3538 int ctr;
3539 SHIFT_TEMPS
3540
3541 /* Pre-zero output coefficient block. */
3542 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
3543
3544 /* Pass 1: process rows. */
3545 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3546 /* furthermore, we scale the results by 2**PASS1_BITS. */
3547 /* 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14). */
3548
3549 dataptr = data;
3550 ctr = 0;
3551 for (;;) {
3552 elemptr = sample_data[ctr] + start_col;
3553
3554 /* Even part */
3555
3556 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[6]);
3557 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[5]);
3558 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[4]);
3559 tmp3 = GETJSAMPLE(elemptr[3]);
3560
3561 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[6]);
3562 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[5]);
3563 tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);
3564
3565 z1 = tmp0 + tmp2;
3566 /* Apply unsigned->signed conversion */
3567 dataptr[0] = (DCTELEM)
3568 ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);
3569 tmp3 += tmp3;
3570 z1 -= tmp3;
3571 z1 -= tmp3;
3572 z1 = MULTIPLY(z1, FIX(0.353553391)); /* (c2+c6-c4)/2 */
3573 z2 = MULTIPLY(tmp0 - tmp2, FIX(0.920609002)); /* (c2+c4-c6)/2 */
3574 z3 = MULTIPLY(tmp1 - tmp2, FIX(0.314692123)); /* c6 */
3575 dataptr[2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS-PASS1_BITS);
3576 z1 -= z2;
3577 z2 = MULTIPLY(tmp0 - tmp1, FIX(0.881747734)); /* c4 */
3578 dataptr[4] = (DCTELEM)
3579 DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.707106781)), /* c2+c6-c4 */
3580 CONST_BITS-PASS1_BITS);
3581 dataptr[6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS-PASS1_BITS);
3582
3583 /* Odd part */
3584
3585 tmp1 = MULTIPLY(tmp10 + tmp11, FIX(0.935414347)); /* (c3+c1-c5)/2 */
3586 tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.170262339)); /* (c3+c5-c1)/2 */
3587 tmp0 = tmp1 - tmp2;
3588 tmp1 += tmp2;
3589 tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.378756276)); /* -c1 */
3590 tmp1 += tmp2;
3591 tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.613604268)); /* c5 */
3592 tmp0 += tmp3;
3593 tmp2 += tmp3 + MULTIPLY(tmp12, FIX(1.870828693)); /* c3+c1-c5 */
3594
3595 dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS);
3596 dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS);
3597 dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS);
3598
3599 ctr++;
3600
3601 if (ctr != DCTSIZE) {
3602 if (ctr == 14)
3603 break; /* Done. */
3604 dataptr += DCTSIZE; /* advance pointer to next row */
3605 } else
3606 dataptr = workspace; /* switch pointer to extended workspace */
3607 }
3608
3609 /* Pass 2: process columns.
3610 * We remove the PASS1_BITS scaling, but leave the results scaled up
3611 * by an overall factor of 8.
3612 * We must also scale the output by (8/7)*(8/14) = 32/49, which we
3613 * fold into the constant multipliers:
3614 * 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28) * 32/49.
3615 */
3616
3617 dataptr = data;
3618 wsptr = workspace;
3619 for (ctr = 0; ctr < 7; ctr++) {
3620 /* Even part */
3621
3622 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*5];
3623 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*4];
3624 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*3];
3625 tmp13 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*2];
3626 tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*1];
3627 tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*0];
3628 tmp6 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];
3629
3630 tmp10 = tmp0 + tmp6;
3631 tmp14 = tmp0 - tmp6;
3632 tmp11 = tmp1 + tmp5;
3633 tmp15 = tmp1 - tmp5;
3634 tmp12 = tmp2 + tmp4;
3635 tmp16 = tmp2 - tmp4;
3636
3637 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*5];
3638 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*4];
3639 tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*3];
3640 tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*2];
3641 tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*1];
3642 tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*0];
3643 tmp6 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
3644
3645 dataptr[DCTSIZE*0] = (DCTELEM)
3646 DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12 + tmp13,
3647 FIX(0.653061224)), /* 32/49 */
3648 CONST_BITS+PASS1_BITS);
3649 tmp13 += tmp13;
3650 dataptr[DCTSIZE*4] = (DCTELEM)
3651 DESCALE(MULTIPLY(tmp10 - tmp13, FIX(0.832106052)) + /* c4 */
3652 MULTIPLY(tmp11 - tmp13, FIX(0.205513223)) - /* c12 */
3653 MULTIPLY(tmp12 - tmp13, FIX(0.575835255)), /* c8 */
3654 CONST_BITS+PASS1_BITS);
3655
3656 tmp10 = MULTIPLY(tmp14 + tmp15, FIX(0.722074570)); /* c6 */
3657
3658 dataptr[DCTSIZE*2] = (DCTELEM)
3659 DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.178337691)) /* c2-c6 */
3660 + MULTIPLY(tmp16, FIX(0.400721155)), /* c10 */
3661 CONST_BITS+PASS1_BITS);
3662 dataptr[DCTSIZE*6] = (DCTELEM)
3663 DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.122795725)) /* c6+c10 */
3664 - MULTIPLY(tmp16, FIX(0.900412262)), /* c2 */
3665 CONST_BITS+PASS1_BITS);
3666
3667 /* Odd part */
3668
3669 tmp10 = tmp1 + tmp2;
3670 tmp11 = tmp5 - tmp4;
3671 dataptr[DCTSIZE*7] = (DCTELEM)
3672 DESCALE(MULTIPLY(tmp0 - tmp10 + tmp3 - tmp11 - tmp6,
3673 FIX(0.653061224)), /* 32/49 */
3674 CONST_BITS+PASS1_BITS);
3675 tmp3 = MULTIPLY(tmp3 , FIX(0.653061224)); /* 32/49 */
3676 tmp10 = MULTIPLY(tmp10, - FIX(0.103406812)); /* -c13 */
3677 tmp11 = MULTIPLY(tmp11, FIX(0.917760839)); /* c1 */
3678 tmp10 += tmp11 - tmp3;
3679 tmp11 = MULTIPLY(tmp0 + tmp2, FIX(0.782007410)) + /* c5 */
3680 MULTIPLY(tmp4 + tmp6, FIX(0.491367823)); /* c9 */
3681 dataptr[DCTSIZE*5] = (DCTELEM)
3682 DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(1.550341076)) /* c3+c5-c13 */
3683 + MULTIPLY(tmp4, FIX(0.731428202)), /* c1+c11-c9 */
3684 CONST_BITS+PASS1_BITS);
3685 tmp12 = MULTIPLY(tmp0 + tmp1, FIX(0.871740478)) + /* c3 */
3686 MULTIPLY(tmp5 - tmp6, FIX(0.305035186)); /* c11 */
3687 dataptr[DCTSIZE*3] = (DCTELEM)
3688 DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.276965844)) /* c3-c9-c13 */
3689 - MULTIPLY(tmp5, FIX(2.004803435)), /* c1+c5+c11 */
3690 CONST_BITS+PASS1_BITS);
3691 dataptr[DCTSIZE*1] = (DCTELEM)
3692 DESCALE(tmp11 + tmp12 + tmp3
3693 - MULTIPLY(tmp0, FIX(0.735987049)) /* c3+c5-c1 */
3694 - MULTIPLY(tmp6, FIX(0.082925825)), /* c9-c11-c13 */
3695 CONST_BITS+PASS1_BITS);
3696
3697 dataptr++; /* advance pointer to next column */
3698 wsptr++; /* advance pointer to next column */
3699 }
3700}
3701
3702
3703/*
3704 * Perform the forward DCT on a 6x12 sample block.
3705 *
3706 * 6-point FDCT in pass 1 (rows), 12-point in pass 2 (columns).
3707 */
3708
3709GLOBAL(void)
3710jpeg_fdct_6x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3711{
3712 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
3713 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
3714 DCTELEM workspace[8*4];
3715 DCTELEM *dataptr;
3716 DCTELEM *wsptr;
3717 JSAMPROW elemptr;
3718 int ctr;
3719 SHIFT_TEMPS
3720
3721 /* Pre-zero output coefficient block. */
3722 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
3723
3724 /* Pass 1: process rows. */
3725 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3726 /* furthermore, we scale the results by 2**PASS1_BITS. */
3727 /* 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */
3728
3729 dataptr = data;
3730 ctr = 0;
3731 for (;;) {
3732 elemptr = sample_data[ctr] + start_col;
3733
3734 /* Even part */
3735
3736 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]);
3737 tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]);
3738 tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]);
3739
3740 tmp10 = tmp0 + tmp2;
3741 tmp12 = tmp0 - tmp2;
3742
3743 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]);
3744 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
3745 tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
3746
3747 /* Apply unsigned->signed conversion */
3748 dataptr[0] = (DCTELEM)
3749 ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);
3750 dataptr[2] = (DCTELEM)
3751 DESCALE(MULTIPLY(tmp12, FIX(1.224744871)), /* c2 */
3752 CONST_BITS-PASS1_BITS);
3753 dataptr[4] = (DCTELEM)
3754 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */
3755 CONST_BITS-PASS1_BITS);
3756
3757 /* Odd part */
3758
3759 tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)), /* c5 */
3760 CONST_BITS-PASS1_BITS);
3761
3762 dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << PASS1_BITS));
3763 dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << PASS1_BITS);
3764 dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << PASS1_BITS));
3765
3766 ctr++;
3767
3768 if (ctr != DCTSIZE) {
3769 if (ctr == 12)
3770 break; /* Done. */
3771 dataptr += DCTSIZE; /* advance pointer to next row */
3772 } else
3773 dataptr = workspace; /* switch pointer to extended workspace */
3774 }
3775
3776 /* Pass 2: process columns.
3777 * We remove the PASS1_BITS scaling, but leave the results scaled up
3778 * by an overall factor of 8.
3779 * We must also scale the output by (8/6)*(8/12) = 8/9, which we
3780 * fold into the constant multipliers:
3781 * 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24) * 8/9.
3782 */
3783
3784 dataptr = data;
3785 wsptr = workspace;
3786 for (ctr = 0; ctr < 6; ctr++) {
3787 /* Even part */
3788
3789 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*3];
3790 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*2];
3791 tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*1];
3792 tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*0];
3793 tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*7];
3794 tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*6];
3795
3796 tmp10 = tmp0 + tmp5;
3797 tmp13 = tmp0 - tmp5;
3798 tmp11 = tmp1 + tmp4;
3799 tmp14 = tmp1 - tmp4;
3800 tmp12 = tmp2 + tmp3;
3801 tmp15 = tmp2 - tmp3;
3802
3803 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*3];
3804 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*2];
3805 tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*1];
3806 tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*0];
3807 tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*7];
3808 tmp5 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*6];
3809
3810 dataptr[DCTSIZE*0] = (DCTELEM)
3811 DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(0.888888889)), /* 8/9 */
3812 CONST_BITS+PASS1_BITS);
3813 dataptr[DCTSIZE*6] = (DCTELEM)
3814 DESCALE(MULTIPLY(tmp13 - tmp14 - tmp15, FIX(0.888888889)), /* 8/9 */
3815 CONST_BITS+PASS1_BITS);
3816 dataptr[DCTSIZE*4] = (DCTELEM)
3817 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.088662108)), /* c4 */
3818 CONST_BITS+PASS1_BITS);
3819 dataptr[DCTSIZE*2] = (DCTELEM)
3820 DESCALE(MULTIPLY(tmp14 - tmp15, FIX(0.888888889)) + /* 8/9 */
3821 MULTIPLY(tmp13 + tmp15, FIX(1.214244803)), /* c2 */
3822 CONST_BITS+PASS1_BITS);
3823
3824 /* Odd part */
3825
3826 tmp10 = MULTIPLY(tmp1 + tmp4, FIX(0.481063200)); /* c9 */
3827 tmp14 = tmp10 + MULTIPLY(tmp1, FIX(0.680326102)); /* c3-c9 */
3828 tmp15 = tmp10 - MULTIPLY(tmp4, FIX(1.642452502)); /* c3+c9 */
3829 tmp12 = MULTIPLY(tmp0 + tmp2, FIX(0.997307603)); /* c5 */
3830 tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.765261039)); /* c7 */
3831 tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.516244403)) /* c5+c7-c1 */
3832 + MULTIPLY(tmp5, FIX(0.164081699)); /* c11 */
3833 tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.164081699)); /* -c11 */
3834 tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.079550144)) /* c1+c5-c11 */
3835 + MULTIPLY(tmp5, FIX(0.765261039)); /* c7 */
3836 tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.645144899)) /* c1+c11-c7 */
3837 - MULTIPLY(tmp5, FIX(0.997307603)); /* c5 */
3838 tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.161389302)) /* c3 */
3839 - MULTIPLY(tmp2 + tmp5, FIX(0.481063200)); /* c9 */
3840
3841 dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS);
3842 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS);
3843 dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS);
3844 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS);
3845
3846 dataptr++; /* advance pointer to next column */
3847 wsptr++; /* advance pointer to next column */
3848 }
3849}
3850
3851
3852/*
3853 * Perform the forward DCT on a 5x10 sample block.
3854 *
3855 * 5-point FDCT in pass 1 (rows), 10-point in pass 2 (columns).
3856 */
3857
3858GLOBAL(void)
3859jpeg_fdct_5x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
3860{
3861 INT32 tmp0, tmp1, tmp2, tmp3, tmp4;
3862 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
3863 DCTELEM workspace[8*2];
3864 DCTELEM *dataptr;
3865 DCTELEM *wsptr;
3866 JSAMPROW elemptr;
3867 int ctr;
3868 SHIFT_TEMPS
3869
3870 /* Pre-zero output coefficient block. */
3871 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
3872
3873 /* Pass 1: process rows. */
3874 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
3875 /* furthermore, we scale the results by 2**PASS1_BITS. */
3876 /* 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10). */
3877
3878 dataptr = data;
3879 ctr = 0;
3880 for (;;) {
3881 elemptr = sample_data[ctr] + start_col;
3882
3883 /* Even part */
3884
3885 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[4]);
3886 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[3]);
3887 tmp2 = GETJSAMPLE(elemptr[2]);
3888
3889 tmp10 = tmp0 + tmp1;
3890 tmp11 = tmp0 - tmp1;
3891
3892 tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);
3893 tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);
3894
3895 /* Apply unsigned->signed conversion */
3896 dataptr[0] = (DCTELEM)
3897 ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS);
3898 tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */
3899 tmp10 -= tmp2 << 2;
3900 tmp10 = MULTIPLY(tmp10, FIX(0.353553391)); /* (c2-c4)/2 */
3901 dataptr[2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS-PASS1_BITS);
3902 dataptr[4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS-PASS1_BITS);
3903
3904 /* Odd part */
3905
3906 tmp10 = MULTIPLY(tmp0 + tmp1, FIX(0.831253876)); /* c3 */
3907
3908 dataptr[1] = (DCTELEM)
3909 DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.513743148)), /* c1-c3 */
3910 CONST_BITS-PASS1_BITS);
3911 dataptr[3] = (DCTELEM)
3912 DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.176250899)), /* c1+c3 */
3913 CONST_BITS-PASS1_BITS);
3914
3915 ctr++;
3916
3917 if (ctr != DCTSIZE) {
3918 if (ctr == 10)
3919 break; /* Done. */
3920 dataptr += DCTSIZE; /* advance pointer to next row */
3921 } else
3922 dataptr = workspace; /* switch pointer to extended workspace */
3923 }
3924
3925 /* Pass 2: process columns.
3926 * We remove the PASS1_BITS scaling, but leave the results scaled up
3927 * by an overall factor of 8.
3928 * We must also scale the output by (8/5)*(8/10) = 32/25, which we
3929 * fold into the constant multipliers:
3930 * 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20) * 32/25.
3931 */
3932
3933 dataptr = data;
3934 wsptr = workspace;
3935 for (ctr = 0; ctr < 5; ctr++) {
3936 /* Even part */
3937
3938 tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*1];
3939 tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*0];
3940 tmp12 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*7];
3941 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*6];
3942 tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];
3943
3944 tmp10 = tmp0 + tmp4;
3945 tmp13 = tmp0 - tmp4;
3946 tmp11 = tmp1 + tmp3;
3947 tmp14 = tmp1 - tmp3;
3948
3949 tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*1];
3950 tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*0];
3951 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*7];
3952 tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*6];
3953 tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
3954
3955 dataptr[DCTSIZE*0] = (DCTELEM)
3956 DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(1.28)), /* 32/25 */
3957 CONST_BITS+PASS1_BITS);
3958 tmp12 += tmp12;
3959 dataptr[DCTSIZE*4] = (DCTELEM)
3960 DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.464477191)) - /* c4 */
3961 MULTIPLY(tmp11 - tmp12, FIX(0.559380511)), /* c8 */
3962 CONST_BITS+PASS1_BITS);
3963 tmp10 = MULTIPLY(tmp13 + tmp14, FIX(1.064004961)); /* c6 */
3964 dataptr[DCTSIZE*2] = (DCTELEM)
3965 DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.657591230)), /* c2-c6 */
3966 CONST_BITS+PASS1_BITS);
3967 dataptr[DCTSIZE*6] = (DCTELEM)
3968 DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.785601151)), /* c2+c6 */
3969 CONST_BITS+PASS1_BITS);
3970
3971 /* Odd part */
3972
3973 tmp10 = tmp0 + tmp4;
3974 tmp11 = tmp1 - tmp3;
3975 dataptr[DCTSIZE*5] = (DCTELEM)
3976 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp2, FIX(1.28)), /* 32/25 */
3977 CONST_BITS+PASS1_BITS);
3978 tmp2 = MULTIPLY(tmp2, FIX(1.28)); /* 32/25 */
3979 dataptr[DCTSIZE*1] = (DCTELEM)
3980 DESCALE(MULTIPLY(tmp0, FIX(1.787906876)) + /* c1 */
3981 MULTIPLY(tmp1, FIX(1.612894094)) + tmp2 + /* c3 */
3982 MULTIPLY(tmp3, FIX(0.821810588)) + /* c7 */
3983 MULTIPLY(tmp4, FIX(0.283176630)), /* c9 */
3984 CONST_BITS+PASS1_BITS);
3985 tmp12 = MULTIPLY(tmp0 - tmp4, FIX(1.217352341)) - /* (c3+c7)/2 */
3986 MULTIPLY(tmp1 + tmp3, FIX(0.752365123)); /* (c1-c9)/2 */
3987 tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.395541753)) + /* (c3-c7)/2 */
3988 MULTIPLY(tmp11, FIX(0.64)) - tmp2; /* 16/25 */
3989 dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS+PASS1_BITS);
3990 dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS+PASS1_BITS);
3991
3992 dataptr++; /* advance pointer to next column */
3993 wsptr++; /* advance pointer to next column */
3994 }
3995}
3996
3997
3998/*
3999 * Perform the forward DCT on a 4x8 sample block.
4000 *
4001 * 4-point FDCT in pass 1 (rows), 8-point in pass 2 (columns).
4002 */
4003
4004GLOBAL(void)
4005jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
4006{
4007 INT32 tmp0, tmp1, tmp2, tmp3;
4008 INT32 tmp10, tmp11, tmp12, tmp13;
4009 INT32 z1;
4010 DCTELEM *dataptr;
4011 JSAMPROW elemptr;
4012 int ctr;
4013 SHIFT_TEMPS
4014
4015 /* Pre-zero output coefficient block. */
4016 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
4017
4018 /* Pass 1: process rows. */
4019 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
4020 /* furthermore, we scale the results by 2**PASS1_BITS. */
4021 /* We must also scale the output by 8/4 = 2, which we add here. */
4022 /* 4-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). */
4023
4024 dataptr = data;
4025 for (ctr = 0; ctr < DCTSIZE; ctr++) {
4026 elemptr = sample_data[ctr] + start_col;
4027
4028 /* Even part */
4029
4030 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
4031 tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
4032
4033 tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
4034 tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
4035
4036 /* Apply unsigned->signed conversion */
4037 dataptr[0] = (DCTELEM)
4038 ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1));
4039 dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1));
4040
4041 /* Odd part */
4042
4043 tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
4044 /* Add fudge factor here for final descale. */
4045 tmp0 += ONE << (CONST_BITS-PASS1_BITS-2);
4046
4047 dataptr[1] = (DCTELEM)
4048 RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
4049 CONST_BITS-PASS1_BITS-1);
4050 dataptr[3] = (DCTELEM)
4051 RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
4052 CONST_BITS-PASS1_BITS-1);
4053
4054 dataptr += DCTSIZE; /* advance pointer to next row */
4055 }
4056
4057 /* Pass 2: process columns.
4058 * We remove the PASS1_BITS scaling, but leave the results scaled up
4059 * by an overall factor of 8.
4060 */
4061
4062 dataptr = data;
4063 for (ctr = 0; ctr < 4; ctr++) {
4064 /* Even part per LL&M figure 1 --- note that published figure is faulty;
4065 * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
4066 */
4067
4068 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
4069 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
4070 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
4071 tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
4072
4073 /* Add fudge factor here for final descale. */
4074 tmp10 = tmp0 + tmp3 + (ONE << (PASS1_BITS-1));
4075 tmp12 = tmp0 - tmp3;
4076 tmp11 = tmp1 + tmp2;
4077 tmp13 = tmp1 - tmp2;
4078
4079 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
4080 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
4081 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
4082 tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
4083
4084 dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS);
4085 dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS);
4086
4087 z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
4088 /* Add fudge factor here for final descale. */
4089 z1 += ONE << (CONST_BITS+PASS1_BITS-1);
4090 dataptr[DCTSIZE*2] = (DCTELEM)
4091 RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), CONST_BITS+PASS1_BITS);
4092 dataptr[DCTSIZE*6] = (DCTELEM)
4093 RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), CONST_BITS+PASS1_BITS);
4094
4095 /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
4096 * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
4097 * i0..i3 in the paper are tmp0..tmp3 here.
4098 */
4099
4100 tmp10 = tmp0 + tmp3;
4101 tmp11 = tmp1 + tmp2;
4102 tmp12 = tmp0 + tmp2;
4103 tmp13 = tmp1 + tmp3;
4104 z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */
4105 /* Add fudge factor here for final descale. */
4106 z1 += ONE << (CONST_BITS+PASS1_BITS-1);
4107
4108 tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */
4109 tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */
4110 tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */
4111 tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */
4112 tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */
4113 tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */
4114 tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */
4115 tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */
4116
4117 tmp12 += z1;
4118 tmp13 += z1;
4119
4120 dataptr[DCTSIZE*1] = (DCTELEM)
4121 RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS+PASS1_BITS);
4122 dataptr[DCTSIZE*3] = (DCTELEM)
4123 RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS+PASS1_BITS);
4124 dataptr[DCTSIZE*5] = (DCTELEM)
4125 RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS+PASS1_BITS);
4126 dataptr[DCTSIZE*7] = (DCTELEM)
4127 RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS+PASS1_BITS);
4128
4129 dataptr++; /* advance pointer to next column */
4130 }
4131}
4132
4133
4134/*
4135 * Perform the forward DCT on a 3x6 sample block.
4136 *
4137 * 3-point FDCT in pass 1 (rows), 6-point in pass 2 (columns).
4138 */
4139
4140GLOBAL(void)
4141jpeg_fdct_3x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
4142{
4143 INT32 tmp0, tmp1, tmp2;
4144 INT32 tmp10, tmp11, tmp12;
4145 DCTELEM *dataptr;
4146 JSAMPROW elemptr;
4147 int ctr;
4148 SHIFT_TEMPS
4149
4150 /* Pre-zero output coefficient block. */
4151 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
4152
4153 /* Pass 1: process rows. */
4154 /* Note results are scaled up by sqrt(8) compared to a true DCT; */
4155 /* furthermore, we scale the results by 2**PASS1_BITS. */
4156 /* We scale the results further by 2 as part of output adaption */
4157 /* scaling for different DCT size. */
4158 /* 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6). */
4159
4160 dataptr = data;
4161 for (ctr = 0; ctr < 6; ctr++) {
4162 elemptr = sample_data[ctr] + start_col;
4163
4164 /* Even part */
4165
4166 tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[2]);
4167 tmp1 = GETJSAMPLE(elemptr[1]);
4168
4169 tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);
4170
4171 /* Apply unsigned->signed conversion */
4172 dataptr[0] = (DCTELEM)
4173 ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1));
4174 dataptr[2] = (DCTELEM)
4175 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(0.707106781)), /* c2 */
4176 CONST_BITS-PASS1_BITS-1);
4177
4178 /* Odd part */
4179
4180 dataptr[1] = (DCTELEM)
4181 DESCALE(MULTIPLY(tmp2, FIX(1.224744871)), /* c1 */
4182 CONST_BITS-PASS1_BITS-1);
4183
4184 dataptr += DCTSIZE; /* advance pointer to next row */
4185 }
4186
4187 /* Pass 2: process columns.
4188 * We remove the PASS1_BITS scaling, but leave the results scaled up
4189 * by an overall factor of 8.
4190 * We must also scale the output by (8/6)*(8/3) = 32/9, which we partially
4191 * fold into the constant multipliers (other part was done in pass 1):
4192 * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12) * 16/9.
4193 */
4194
4195 dataptr = data;
4196 for (ctr = 0; ctr < 3; ctr++) {
4197 /* Even part */
4198
4199 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5];
4200 tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4];
4201 tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
4202
4203 tmp10 = tmp0 + tmp2;
4204 tmp12 = tmp0 - tmp2;
4205
4206 tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5];
4207 tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4];
4208 tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
4209
4210 dataptr[DCTSIZE*0] = (DCTELEM)
4211 DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)), /* 16/9 */
4212 CONST_BITS+PASS1_BITS);
4213 dataptr[DCTSIZE*2] = (DCTELEM)
4214 DESCALE(MULTIPLY(tmp12, FIX(2.177324216)), /* c2 */
4215 CONST_BITS+PASS1_BITS);
4216 dataptr[DCTSIZE*4] = (DCTELEM)
4217 DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */
4218 CONST_BITS+PASS1_BITS);
4219
4220 /* Odd part */
4221
4222 tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829)); /* c5 */
4223
4224 dataptr[DCTSIZE*1] = (DCTELEM)
4225 DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */
4226 CONST_BITS+PASS1_BITS);
4227 dataptr[DCTSIZE*3] = (DCTELEM)
4228 DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)), /* 16/9 */
4229 CONST_BITS+PASS1_BITS);
4230 dataptr[DCTSIZE*5] = (DCTELEM)
4231 DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)), /* 16/9 */
4232 CONST_BITS+PASS1_BITS);
4233
4234 dataptr++; /* advance pointer to next column */
4235 }
4236}
4237
4238
4239/*
4240 * Perform the forward DCT on a 2x4 sample block.
4241 *
4242 * 2-point FDCT in pass 1 (rows), 4-point in pass 2 (columns).
4243 */
4244
4245GLOBAL(void)
4246jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
4247{
4248 INT32 tmp0, tmp1;
4249 INT32 tmp10, tmp11;
4250 DCTELEM *dataptr;
4251 JSAMPROW elemptr;
4252 int ctr;
4253 SHIFT_TEMPS
4254
4255 /* Pre-zero output coefficient block. */
4256 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
4257
4258 /* Pass 1: process rows. */
4259 /* Note results are scaled up by sqrt(8) compared to a true DCT. */
4260 /* We must also scale the output by (8/2)*(8/4) = 2**3, which we add here. */
4261
4262 dataptr = data;
4263 for (ctr = 0; ctr < 4; ctr++) {
4264 elemptr = sample_data[ctr] + start_col;
4265
4266 /* Even part */
4267
4268 tmp0 = GETJSAMPLE(elemptr[0]);
4269 tmp1 = GETJSAMPLE(elemptr[1]);
4270
4271 /* Apply unsigned->signed conversion */
4272 dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3);
4273
4274 /* Odd part */
4275
4276 dataptr[1] = (DCTELEM) ((tmp0 - tmp1) << 3);
4277
4278 dataptr += DCTSIZE; /* advance pointer to next row */
4279 }
4280
4281 /* Pass 2: process columns.
4282 * We leave the results scaled up by an overall factor of 8.
4283 * 4-point FDCT kernel,
4284 * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
4285 */
4286
4287 dataptr = data;
4288 for (ctr = 0; ctr < 2; ctr++) {
4289 /* Even part */
4290
4291 tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3];
4292 tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2];
4293
4294 tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
4295 tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
4296
4297 dataptr[DCTSIZE*0] = (DCTELEM) (tmp0 + tmp1);
4298 dataptr[DCTSIZE*2] = (DCTELEM) (tmp0 - tmp1);
4299
4300 /* Odd part */
4301
4302 tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
4303 /* Add fudge factor here for final descale. */
4304 tmp0 += ONE << (CONST_BITS-1);
4305
4306 dataptr[DCTSIZE*1] = (DCTELEM)
4307 RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
4308 CONST_BITS);
4309 dataptr[DCTSIZE*3] = (DCTELEM)
4310 RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
4311 CONST_BITS);
4312
4313 dataptr++; /* advance pointer to next column */
4314 }
4315}
4316
4317
4318/*
4319 * Perform the forward DCT on a 1x2 sample block.
4320 *
4321 * 1-point FDCT in pass 1 (rows), 2-point in pass 2 (columns).
4322 */
4323
4324GLOBAL(void)
4325jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
4326{
4327 INT32 tmp0, tmp1;
4328
4329 /* Pre-zero output coefficient block. */
4330 MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
4331
4332 tmp0 = GETJSAMPLE(sample_data[0][start_col]);
4333 tmp1 = GETJSAMPLE(sample_data[1][start_col]);
4334
4335 /* We leave the results scaled up by an overall factor of 8.
4336 * We must also scale the output by (8/1)*(8/2) = 2**5.
4337 */
4338
4339 /* Even part */
4340 /* Apply unsigned->signed conversion */
4341 data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5);
4342
4343 /* Odd part */
4344 data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5);
4345}
4346
4347#endif /* DCT_SCALING_SUPPORTED */
4348#endif /* DCT_ISLOW_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctflt.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctflt.c
new file mode 100644
index 0000000..f399600
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctflt.c
@@ -0,0 +1,235 @@
1/*
2 * jidctflt.c
3 *
4 * Copyright (C) 1994-1998, Thomas G. Lane.
5 * Modified 2010 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a floating-point implementation of the
10 * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
11 * must also perform dequantization of the input coefficients.
12 *
13 * This implementation should be more accurate than either of the integer
14 * IDCT implementations. However, it may not give the same results on all
15 * machines because of differences in roundoff behavior. Speed will depend
16 * on the hardware's floating point capacity.
17 *
18 * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
19 * on each row (or vice versa, but it's more convenient to emit a row at
20 * a time). Direct algorithms are also available, but they are much more
21 * complex and seem not to be any faster when reduced to code.
22 *
23 * This implementation is based on Arai, Agui, and Nakajima's algorithm for
24 * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
25 * Japanese, but the algorithm is described in the Pennebaker & Mitchell
26 * JPEG textbook (see REFERENCES section in file README). The following code
27 * is based directly on figure 4-8 in P&M.
28 * While an 8-point DCT cannot be done in less than 11 multiplies, it is
29 * possible to arrange the computation so that many of the multiplies are
30 * simple scalings of the final outputs. These multiplies can then be
31 * folded into the multiplications or divisions by the JPEG quantization
32 * table entries. The AA&N method leaves only 5 multiplies and 29 adds
33 * to be done in the DCT itself.
34 * The primary disadvantage of this method is that with a fixed-point
35 * implementation, accuracy is lost due to imprecise representation of the
36 * scaled quantization values. However, that problem does not arise if
37 * we use floating point arithmetic.
38 */
39
40#define JPEG_INTERNALS
41#include "jinclude.h"
42#include "jpeglib.h"
43#include "jdct.h" /* Private declarations for DCT subsystem */
44
45#ifdef DCT_FLOAT_SUPPORTED
46
47
48/*
49 * This module is specialized to the case DCTSIZE = 8.
50 */
51
52#if DCTSIZE != 8
53 Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
54#endif
55
56
57/* Dequantize a coefficient by multiplying it by the multiplier-table
58 * entry; produce a float result.
59 */
60
61#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval))
62
63
64/*
65 * Perform dequantization and inverse DCT on one block of coefficients.
66 */
67
68GLOBAL(void)
69jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
70 JCOEFPTR coef_block,
71 JSAMPARRAY output_buf, JDIMENSION output_col)
72{
73 FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
74 FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
75 FAST_FLOAT z5, z10, z11, z12, z13;
76 JCOEFPTR inptr;
77 FLOAT_MULT_TYPE * quantptr;
78 FAST_FLOAT * wsptr;
79 JSAMPROW outptr;
80 JSAMPLE *range_limit = cinfo->sample_range_limit;
81 int ctr;
82 FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
83
84 /* Pass 1: process columns from input, store into work array. */
85
86 inptr = coef_block;
87 quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table;
88 wsptr = workspace;
89 for (ctr = DCTSIZE; ctr > 0; ctr--) {
90 /* Due to quantization, we will usually find that many of the input
91 * coefficients are zero, especially the AC terms. We can exploit this
92 * by short-circuiting the IDCT calculation for any column in which all
93 * the AC terms are zero. In that case each output is equal to the
94 * DC coefficient (with scale factor as needed).
95 * With typical images and quantization tables, half or more of the
96 * column DCT calculations can be simplified this way.
97 */
98
99 if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
100 inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
101 inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
102 inptr[DCTSIZE*7] == 0) {
103 /* AC terms all zero */
104 FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
105
106 wsptr[DCTSIZE*0] = dcval;
107 wsptr[DCTSIZE*1] = dcval;
108 wsptr[DCTSIZE*2] = dcval;
109 wsptr[DCTSIZE*3] = dcval;
110 wsptr[DCTSIZE*4] = dcval;
111 wsptr[DCTSIZE*5] = dcval;
112 wsptr[DCTSIZE*6] = dcval;
113 wsptr[DCTSIZE*7] = dcval;
114
115 inptr++; /* advance pointers to next column */
116 quantptr++;
117 wsptr++;
118 continue;
119 }
120
121 /* Even part */
122
123 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
124 tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
125 tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
126 tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
127
128 tmp10 = tmp0 + tmp2; /* phase 3 */
129 tmp11 = tmp0 - tmp2;
130
131 tmp13 = tmp1 + tmp3; /* phases 5-3 */
132 tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
133
134 tmp0 = tmp10 + tmp13; /* phase 2 */
135 tmp3 = tmp10 - tmp13;
136 tmp1 = tmp11 + tmp12;
137 tmp2 = tmp11 - tmp12;
138
139 /* Odd part */
140
141 tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
142 tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
143 tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
144 tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
145
146 z13 = tmp6 + tmp5; /* phase 6 */
147 z10 = tmp6 - tmp5;
148 z11 = tmp4 + tmp7;
149 z12 = tmp4 - tmp7;
150
151 tmp7 = z11 + z13; /* phase 5 */
152 tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
153
154 z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
155 tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
156 tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
157
158 tmp6 = tmp12 - tmp7; /* phase 2 */
159 tmp5 = tmp11 - tmp6;
160 tmp4 = tmp10 - tmp5;
161
162 wsptr[DCTSIZE*0] = tmp0 + tmp7;
163 wsptr[DCTSIZE*7] = tmp0 - tmp7;
164 wsptr[DCTSIZE*1] = tmp1 + tmp6;
165 wsptr[DCTSIZE*6] = tmp1 - tmp6;
166 wsptr[DCTSIZE*2] = tmp2 + tmp5;
167 wsptr[DCTSIZE*5] = tmp2 - tmp5;
168 wsptr[DCTSIZE*3] = tmp3 + tmp4;
169 wsptr[DCTSIZE*4] = tmp3 - tmp4;
170
171 inptr++; /* advance pointers to next column */
172 quantptr++;
173 wsptr++;
174 }
175
176 /* Pass 2: process rows from work array, store into output array. */
177
178 wsptr = workspace;
179 for (ctr = 0; ctr < DCTSIZE; ctr++) {
180 outptr = output_buf[ctr] + output_col;
181 /* Rows of zeroes can be exploited in the same way as we did with columns.
182 * However, the column calculation has created many nonzero AC terms, so
183 * the simplification applies less often (typically 5% to 10% of the time).
184 * And testing floats for zero is relatively expensive, so we don't bother.
185 */
186
187 /* Even part */
188
189 /* Apply signed->unsigned and prepare float->int conversion */
190 z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5);
191 tmp10 = z5 + wsptr[4];
192 tmp11 = z5 - wsptr[4];
193
194 tmp13 = wsptr[2] + wsptr[6];
195 tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
196
197 tmp0 = tmp10 + tmp13;
198 tmp3 = tmp10 - tmp13;
199 tmp1 = tmp11 + tmp12;
200 tmp2 = tmp11 - tmp12;
201
202 /* Odd part */
203
204 z13 = wsptr[5] + wsptr[3];
205 z10 = wsptr[5] - wsptr[3];
206 z11 = wsptr[1] + wsptr[7];
207 z12 = wsptr[1] - wsptr[7];
208
209 tmp7 = z11 + z13;
210 tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
211
212 z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
213 tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
214 tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
215
216 tmp6 = tmp12 - tmp7;
217 tmp5 = tmp11 - tmp6;
218 tmp4 = tmp10 - tmp5;
219
220 /* Final output stage: float->int conversion and range-limit */
221
222 outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK];
223 outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK];
224 outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK];
225 outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK];
226 outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK];
227 outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];
228 outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];
229 outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];
230
231 wsptr += DCTSIZE; /* advance pointer to next row */
232 }
233}
234
235#endif /* DCT_FLOAT_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctfst.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctfst.c
new file mode 100644
index 0000000..078b8c4
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctfst.c
@@ -0,0 +1,368 @@
1/*
2 * jidctfst.c
3 *
4 * Copyright (C) 1994-1998, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains a fast, not so accurate integer implementation of the
9 * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
10 * must also perform dequantization of the input coefficients.
11 *
12 * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
13 * on each row (or vice versa, but it's more convenient to emit a row at
14 * a time). Direct algorithms are also available, but they are much more
15 * complex and seem not to be any faster when reduced to code.
16 *
17 * This implementation is based on Arai, Agui, and Nakajima's algorithm for
18 * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
19 * Japanese, but the algorithm is described in the Pennebaker & Mitchell
20 * JPEG textbook (see REFERENCES section in file README). The following code
21 * is based directly on figure 4-8 in P&M.
22 * While an 8-point DCT cannot be done in less than 11 multiplies, it is
23 * possible to arrange the computation so that many of the multiplies are
24 * simple scalings of the final outputs. These multiplies can then be
25 * folded into the multiplications or divisions by the JPEG quantization
26 * table entries. The AA&N method leaves only 5 multiplies and 29 adds
27 * to be done in the DCT itself.
28 * The primary disadvantage of this method is that with fixed-point math,
29 * accuracy is lost due to imprecise representation of the scaled
30 * quantization values. The smaller the quantization table entry, the less
31 * precise the scaled value, so this implementation does worse with high-
32 * quality-setting files than with low-quality ones.
33 */
34
35#define JPEG_INTERNALS
36#include "jinclude.h"
37#include "jpeglib.h"
38#include "jdct.h" /* Private declarations for DCT subsystem */
39
40#ifdef DCT_IFAST_SUPPORTED
41
42
43/*
44 * This module is specialized to the case DCTSIZE = 8.
45 */
46
47#if DCTSIZE != 8
48 Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
49#endif
50
51
52/* Scaling decisions are generally the same as in the LL&M algorithm;
53 * see jidctint.c for more details. However, we choose to descale
54 * (right shift) multiplication products as soon as they are formed,
55 * rather than carrying additional fractional bits into subsequent additions.
56 * This compromises accuracy slightly, but it lets us save a few shifts.
57 * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
58 * everywhere except in the multiplications proper; this saves a good deal
59 * of work on 16-bit-int machines.
60 *
61 * The dequantized coefficients are not integers because the AA&N scaling
62 * factors have been incorporated. We represent them scaled up by PASS1_BITS,
63 * so that the first and second IDCT rounds have the same input scaling.
64 * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to
65 * avoid a descaling shift; this compromises accuracy rather drastically
66 * for small quantization table entries, but it saves a lot of shifts.
67 * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,
68 * so we use a much larger scaling factor to preserve accuracy.
69 *
70 * A final compromise is to represent the multiplicative constants to only
71 * 8 fractional bits, rather than 13. This saves some shifting work on some
72 * machines, and may also reduce the cost of multiplication (since there
73 * are fewer one-bits in the constants).
74 */
75
76#if BITS_IN_JSAMPLE == 8
77#define CONST_BITS 8
78#define PASS1_BITS 2
79#else
80#define CONST_BITS 8
81#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
82#endif
83
84/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
85 * causing a lot of useless floating-point operations at run time.
86 * To get around this we use the following pre-calculated constants.
87 * If you change CONST_BITS you may want to add appropriate values.
88 * (With a reasonable C compiler, you can just rely on the FIX() macro...)
89 */
90
91#if CONST_BITS == 8
92#define FIX_1_082392200 ((INT32) 277) /* FIX(1.082392200) */
93#define FIX_1_414213562 ((INT32) 362) /* FIX(1.414213562) */
94#define FIX_1_847759065 ((INT32) 473) /* FIX(1.847759065) */
95#define FIX_2_613125930 ((INT32) 669) /* FIX(2.613125930) */
96#else
97#define FIX_1_082392200 FIX(1.082392200)
98#define FIX_1_414213562 FIX(1.414213562)
99#define FIX_1_847759065 FIX(1.847759065)
100#define FIX_2_613125930 FIX(2.613125930)
101#endif
102
103
104/* We can gain a little more speed, with a further compromise in accuracy,
105 * by omitting the addition in a descaling shift. This yields an incorrectly
106 * rounded result half the time...
107 */
108
109#ifndef USE_ACCURATE_ROUNDING
110#undef DESCALE
111#define DESCALE(x,n) RIGHT_SHIFT(x, n)
112#endif
113
114
115/* Multiply a DCTELEM variable by an INT32 constant, and immediately
116 * descale to yield a DCTELEM result.
117 */
118
119#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
120
121
122/* Dequantize a coefficient by multiplying it by the multiplier-table
123 * entry; produce a DCTELEM result. For 8-bit data a 16x16->16
124 * multiplication will do. For 12-bit data, the multiplier table is
125 * declared INT32, so a 32-bit multiply will be used.
126 */
127
128#if BITS_IN_JSAMPLE == 8
129#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval))
130#else
131#define DEQUANTIZE(coef,quantval) \
132 DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)
133#endif
134
135
136/* Like DESCALE, but applies to a DCTELEM and produces an int.
137 * We assume that int right shift is unsigned if INT32 right shift is.
138 */
139
140#ifdef RIGHT_SHIFT_IS_UNSIGNED
141#define ISHIFT_TEMPS DCTELEM ishift_temp;
142#if BITS_IN_JSAMPLE == 8
143#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
144#else
145#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
146#endif
147#define IRIGHT_SHIFT(x,shft) \
148 ((ishift_temp = (x)) < 0 ? \
149 (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
150 (ishift_temp >> (shft)))
151#else
152#define ISHIFT_TEMPS
153#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
154#endif
155
156#ifdef USE_ACCURATE_ROUNDING
157#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
158#else
159#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n))
160#endif
161
162
163/*
164 * Perform dequantization and inverse DCT on one block of coefficients.
165 */
166
167GLOBAL(void)
168jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
169 JCOEFPTR coef_block,
170 JSAMPARRAY output_buf, JDIMENSION output_col)
171{
172 DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
173 DCTELEM tmp10, tmp11, tmp12, tmp13;
174 DCTELEM z5, z10, z11, z12, z13;
175 JCOEFPTR inptr;
176 IFAST_MULT_TYPE * quantptr;
177 int * wsptr;
178 JSAMPROW outptr;
179 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
180 int ctr;
181 int workspace[DCTSIZE2]; /* buffers data between passes */
182 SHIFT_TEMPS /* for DESCALE */
183 ISHIFT_TEMPS /* for IDESCALE */
184
185 /* Pass 1: process columns from input, store into work array. */
186
187 inptr = coef_block;
188 quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;
189 wsptr = workspace;
190 for (ctr = DCTSIZE; ctr > 0; ctr--) {
191 /* Due to quantization, we will usually find that many of the input
192 * coefficients are zero, especially the AC terms. We can exploit this
193 * by short-circuiting the IDCT calculation for any column in which all
194 * the AC terms are zero. In that case each output is equal to the
195 * DC coefficient (with scale factor as needed).
196 * With typical images and quantization tables, half or more of the
197 * column DCT calculations can be simplified this way.
198 */
199
200 if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
201 inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
202 inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
203 inptr[DCTSIZE*7] == 0) {
204 /* AC terms all zero */
205 int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
206
207 wsptr[DCTSIZE*0] = dcval;
208 wsptr[DCTSIZE*1] = dcval;
209 wsptr[DCTSIZE*2] = dcval;
210 wsptr[DCTSIZE*3] = dcval;
211 wsptr[DCTSIZE*4] = dcval;
212 wsptr[DCTSIZE*5] = dcval;
213 wsptr[DCTSIZE*6] = dcval;
214 wsptr[DCTSIZE*7] = dcval;
215
216 inptr++; /* advance pointers to next column */
217 quantptr++;
218 wsptr++;
219 continue;
220 }
221
222 /* Even part */
223
224 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
225 tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
226 tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
227 tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
228
229 tmp10 = tmp0 + tmp2; /* phase 3 */
230 tmp11 = tmp0 - tmp2;
231
232 tmp13 = tmp1 + tmp3; /* phases 5-3 */
233 tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
234
235 tmp0 = tmp10 + tmp13; /* phase 2 */
236 tmp3 = tmp10 - tmp13;
237 tmp1 = tmp11 + tmp12;
238 tmp2 = tmp11 - tmp12;
239
240 /* Odd part */
241
242 tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
243 tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
244 tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
245 tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
246
247 z13 = tmp6 + tmp5; /* phase 6 */
248 z10 = tmp6 - tmp5;
249 z11 = tmp4 + tmp7;
250 z12 = tmp4 - tmp7;
251
252 tmp7 = z11 + z13; /* phase 5 */
253 tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
254
255 z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
256 tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
257 tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
258
259 tmp6 = tmp12 - tmp7; /* phase 2 */
260 tmp5 = tmp11 - tmp6;
261 tmp4 = tmp10 + tmp5;
262
263 wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
264 wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
265 wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
266 wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
267 wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
268 wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
269 wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
270 wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
271
272 inptr++; /* advance pointers to next column */
273 quantptr++;
274 wsptr++;
275 }
276
277 /* Pass 2: process rows from work array, store into output array. */
278 /* Note that we must descale the results by a factor of 8 == 2**3, */
279 /* and also undo the PASS1_BITS scaling. */
280
281 wsptr = workspace;
282 for (ctr = 0; ctr < DCTSIZE; ctr++) {
283 outptr = output_buf[ctr] + output_col;
284 /* Rows of zeroes can be exploited in the same way as we did with columns.
285 * However, the column calculation has created many nonzero AC terms, so
286 * the simplification applies less often (typically 5% to 10% of the time).
287 * On machines with very fast multiplication, it's possible that the
288 * test takes more time than it's worth. In that case this section
289 * may be commented out.
290 */
291
292#ifndef NO_ZERO_ROW_TEST
293 if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
294 wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
295 /* AC terms all zero */
296 JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
297 & RANGE_MASK];
298
299 outptr[0] = dcval;
300 outptr[1] = dcval;
301 outptr[2] = dcval;
302 outptr[3] = dcval;
303 outptr[4] = dcval;
304 outptr[5] = dcval;
305 outptr[6] = dcval;
306 outptr[7] = dcval;
307
308 wsptr += DCTSIZE; /* advance pointer to next row */
309 continue;
310 }
311#endif
312
313 /* Even part */
314
315 tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
316 tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
317
318 tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
319 tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
320 - tmp13;
321
322 tmp0 = tmp10 + tmp13;
323 tmp3 = tmp10 - tmp13;
324 tmp1 = tmp11 + tmp12;
325 tmp2 = tmp11 - tmp12;
326
327 /* Odd part */
328
329 z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
330 z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
331 z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
332 z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
333
334 tmp7 = z11 + z13; /* phase 5 */
335 tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
336
337 z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
338 tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
339 tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
340
341 tmp6 = tmp12 - tmp7; /* phase 2 */
342 tmp5 = tmp11 - tmp6;
343 tmp4 = tmp10 + tmp5;
344
345 /* Final output stage: scale down by a factor of 8 and range-limit */
346
347 outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
348 & RANGE_MASK];
349 outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
350 & RANGE_MASK];
351 outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
352 & RANGE_MASK];
353 outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
354 & RANGE_MASK];
355 outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
356 & RANGE_MASK];
357 outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
358 & RANGE_MASK];
359 outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
360 & RANGE_MASK];
361 outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
362 & RANGE_MASK];
363
364 wsptr += DCTSIZE; /* advance pointer to next row */
365 }
366}
367
368#endif /* DCT_IFAST_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctint.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctint.c
new file mode 100644
index 0000000..49ef79f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jidctint.c
@@ -0,0 +1,5137 @@
1/*
2 * jidctint.c
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * Modification developed 2002-2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a slow-but-accurate integer implementation of the
10 * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
11 * must also perform dequantization of the input coefficients.
12 *
13 * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
14 * on each row (or vice versa, but it's more convenient to emit a row at
15 * a time). Direct algorithms are also available, but they are much more
16 * complex and seem not to be any faster when reduced to code.
17 *
18 * This implementation is based on an algorithm described in
19 * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
20 * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
21 * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
22 * The primary algorithm described there uses 11 multiplies and 29 adds.
23 * We use their alternate method with 12 multiplies and 32 adds.
24 * The advantage of this method is that no data path contains more than one
25 * multiplication; this allows a very simple and accurate implementation in
26 * scaled fixed-point arithmetic, with a minimal number of shifts.
27 *
28 * We also provide IDCT routines with various output sample block sizes for
29 * direct resolution reduction or enlargement and for direct resolving the
30 * common 2x1 and 1x2 subsampling cases without additional resampling: NxN
31 * (N=1...16), 2NxN, and Nx2N (N=1...8) pixels for one 8x8 input DCT block.
32 *
33 * For N<8 we simply take the corresponding low-frequency coefficients of
34 * the 8x8 input DCT block and apply an NxN point IDCT on the sub-block
35 * to yield the downscaled outputs.
36 * This can be seen as direct low-pass downsampling from the DCT domain
37 * point of view rather than the usual spatial domain point of view,
38 * yielding significant computational savings and results at least
39 * as good as common bilinear (averaging) spatial downsampling.
40 *
41 * For N>8 we apply a partial NxN IDCT on the 8 input coefficients as
42 * lower frequencies and higher frequencies assumed to be zero.
43 * It turns out that the computational effort is similar to the 8x8 IDCT
44 * regarding the output size.
45 * Furthermore, the scaling and descaling is the same for all IDCT sizes.
46 *
47 * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases
48 * since there would be too many additional constants to pre-calculate.
49 */
50
51#define JPEG_INTERNALS
52#include "jinclude.h"
53#include "jpeglib.h"
54#include "jdct.h" /* Private declarations for DCT subsystem */
55
56#ifdef DCT_ISLOW_SUPPORTED
57
58
59/*
60 * This module is specialized to the case DCTSIZE = 8.
61 */
62
63#if DCTSIZE != 8
64 Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
65#endif
66
67
68/*
69 * The poop on this scaling stuff is as follows:
70 *
71 * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
72 * larger than the true IDCT outputs. The final outputs are therefore
73 * a factor of N larger than desired; since N=8 this can be cured by
74 * a simple right shift at the end of the algorithm. The advantage of
75 * this arrangement is that we save two multiplications per 1-D IDCT,
76 * because the y0 and y4 inputs need not be divided by sqrt(N).
77 *
78 * We have to do addition and subtraction of the integer inputs, which
79 * is no problem, and multiplication by fractional constants, which is
80 * a problem to do in integer arithmetic. We multiply all the constants
81 * by CONST_SCALE and convert them to integer constants (thus retaining
82 * CONST_BITS bits of precision in the constants). After doing a
83 * multiplication we have to divide the product by CONST_SCALE, with proper
84 * rounding, to produce the correct output. This division can be done
85 * cheaply as a right shift of CONST_BITS bits. We postpone shifting
86 * as long as possible so that partial sums can be added together with
87 * full fractional precision.
88 *
89 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
90 * they are represented to better-than-integral precision. These outputs
91 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
92 * with the recommended scaling. (To scale up 12-bit sample data further, an
93 * intermediate INT32 array would be needed.)
94 *
95 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
96 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
97 * shows that the values given below are the most effective.
98 */
99
100#if BITS_IN_JSAMPLE == 8
101#define CONST_BITS 13
102#define PASS1_BITS 2
103#else
104#define CONST_BITS 13
105#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
106#endif
107
108/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
109 * causing a lot of useless floating-point operations at run time.
110 * To get around this we use the following pre-calculated constants.
111 * If you change CONST_BITS you may want to add appropriate values.
112 * (With a reasonable C compiler, you can just rely on the FIX() macro...)
113 */
114
115#if CONST_BITS == 13
116#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
117#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
118#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
119#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
120#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
121#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
122#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
123#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
124#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
125#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
126#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
127#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
128#else
129#define FIX_0_298631336 FIX(0.298631336)
130#define FIX_0_390180644 FIX(0.390180644)
131#define FIX_0_541196100 FIX(0.541196100)
132#define FIX_0_765366865 FIX(0.765366865)
133#define FIX_0_899976223 FIX(0.899976223)
134#define FIX_1_175875602 FIX(1.175875602)
135#define FIX_1_501321110 FIX(1.501321110)
136#define FIX_1_847759065 FIX(1.847759065)
137#define FIX_1_961570560 FIX(1.961570560)
138#define FIX_2_053119869 FIX(2.053119869)
139#define FIX_2_562915447 FIX(2.562915447)
140#define FIX_3_072711026 FIX(3.072711026)
141#endif
142
143
144/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
145 * For 8-bit samples with the recommended scaling, all the variable
146 * and constant values involved are no more than 16 bits wide, so a
147 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
148 * For 12-bit samples, a full 32-bit multiplication will be needed.
149 */
150
151#if BITS_IN_JSAMPLE == 8
152#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
153#else
154#define MULTIPLY(var,const) ((var) * (const))
155#endif
156
157
158/* Dequantize a coefficient by multiplying it by the multiplier-table
159 * entry; produce an int result. In this module, both inputs and result
160 * are 16 bits or less, so either int or short multiply will work.
161 */
162
163#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval))
164
165
166/*
167 * Perform dequantization and inverse DCT on one block of coefficients.
168 */
169
170GLOBAL(void)
171jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
172 JCOEFPTR coef_block,
173 JSAMPARRAY output_buf, JDIMENSION output_col)
174{
175 INT32 tmp0, tmp1, tmp2, tmp3;
176 INT32 tmp10, tmp11, tmp12, tmp13;
177 INT32 z1, z2, z3;
178 JCOEFPTR inptr;
179 ISLOW_MULT_TYPE * quantptr;
180 int * wsptr;
181 JSAMPROW outptr;
182 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
183 int ctr;
184 int workspace[DCTSIZE2]; /* buffers data between passes */
185 SHIFT_TEMPS
186
187 /* Pass 1: process columns from input, store into work array. */
188 /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
189 /* furthermore, we scale the results by 2**PASS1_BITS. */
190
191 inptr = coef_block;
192 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
193 wsptr = workspace;
194 for (ctr = DCTSIZE; ctr > 0; ctr--) {
195 /* Due to quantization, we will usually find that many of the input
196 * coefficients are zero, especially the AC terms. We can exploit this
197 * by short-circuiting the IDCT calculation for any column in which all
198 * the AC terms are zero. In that case each output is equal to the
199 * DC coefficient (with scale factor as needed).
200 * With typical images and quantization tables, half or more of the
201 * column DCT calculations can be simplified this way.
202 */
203
204 if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
205 inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
206 inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
207 inptr[DCTSIZE*7] == 0) {
208 /* AC terms all zero */
209 int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
210
211 wsptr[DCTSIZE*0] = dcval;
212 wsptr[DCTSIZE*1] = dcval;
213 wsptr[DCTSIZE*2] = dcval;
214 wsptr[DCTSIZE*3] = dcval;
215 wsptr[DCTSIZE*4] = dcval;
216 wsptr[DCTSIZE*5] = dcval;
217 wsptr[DCTSIZE*6] = dcval;
218 wsptr[DCTSIZE*7] = dcval;
219
220 inptr++; /* advance pointers to next column */
221 quantptr++;
222 wsptr++;
223 continue;
224 }
225
226 /* Even part: reverse the even part of the forward DCT. */
227 /* The rotator is sqrt(2)*c(-6). */
228
229 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
230 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
231
232 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
233 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
234 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
235
236 z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
237 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
238 z2 <<= CONST_BITS;
239 z3 <<= CONST_BITS;
240 /* Add fudge factor here for final descale. */
241 z2 += ONE << (CONST_BITS-PASS1_BITS-1);
242
243 tmp0 = z2 + z3;
244 tmp1 = z2 - z3;
245
246 tmp10 = tmp0 + tmp2;
247 tmp13 = tmp0 - tmp2;
248 tmp11 = tmp1 + tmp3;
249 tmp12 = tmp1 - tmp3;
250
251 /* Odd part per figure 8; the matrix is unitary and hence its
252 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
253 */
254
255 tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
256 tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
257 tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
258 tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
259
260 z2 = tmp0 + tmp2;
261 z3 = tmp1 + tmp3;
262
263 z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */
264 z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
265 z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
266 z2 += z1;
267 z3 += z1;
268
269 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
270 tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
271 tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
272 tmp0 += z1 + z2;
273 tmp3 += z1 + z3;
274
275 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
276 tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
277 tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
278 tmp1 += z1 + z3;
279 tmp2 += z1 + z2;
280
281 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
282
283 wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
284 wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
285 wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
286 wsptr[DCTSIZE*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
287 wsptr[DCTSIZE*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
288 wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
289 wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
290 wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
291
292 inptr++; /* advance pointers to next column */
293 quantptr++;
294 wsptr++;
295 }
296
297 /* Pass 2: process rows from work array, store into output array. */
298 /* Note that we must descale the results by a factor of 8 == 2**3, */
299 /* and also undo the PASS1_BITS scaling. */
300
301 wsptr = workspace;
302 for (ctr = 0; ctr < DCTSIZE; ctr++) {
303 outptr = output_buf[ctr] + output_col;
304 /* Rows of zeroes can be exploited in the same way as we did with columns.
305 * However, the column calculation has created many nonzero AC terms, so
306 * the simplification applies less often (typically 5% to 10% of the time).
307 * On machines with very fast multiplication, it's possible that the
308 * test takes more time than it's worth. In that case this section
309 * may be commented out.
310 */
311
312#ifndef NO_ZERO_ROW_TEST
313 if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
314 wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
315 /* AC terms all zero */
316 JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
317 & RANGE_MASK];
318
319 outptr[0] = dcval;
320 outptr[1] = dcval;
321 outptr[2] = dcval;
322 outptr[3] = dcval;
323 outptr[4] = dcval;
324 outptr[5] = dcval;
325 outptr[6] = dcval;
326 outptr[7] = dcval;
327
328 wsptr += DCTSIZE; /* advance pointer to next row */
329 continue;
330 }
331#endif
332
333 /* Even part: reverse the even part of the forward DCT. */
334 /* The rotator is sqrt(2)*c(-6). */
335
336 z2 = (INT32) wsptr[2];
337 z3 = (INT32) wsptr[6];
338
339 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
340 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
341 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
342
343 /* Add fudge factor here for final descale. */
344 z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
345 z3 = (INT32) wsptr[4];
346
347 tmp0 = (z2 + z3) << CONST_BITS;
348 tmp1 = (z2 - z3) << CONST_BITS;
349
350 tmp10 = tmp0 + tmp2;
351 tmp13 = tmp0 - tmp2;
352 tmp11 = tmp1 + tmp3;
353 tmp12 = tmp1 - tmp3;
354
355 /* Odd part per figure 8; the matrix is unitary and hence its
356 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
357 */
358
359 tmp0 = (INT32) wsptr[7];
360 tmp1 = (INT32) wsptr[5];
361 tmp2 = (INT32) wsptr[3];
362 tmp3 = (INT32) wsptr[1];
363
364 z2 = tmp0 + tmp2;
365 z3 = tmp1 + tmp3;
366
367 z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */
368 z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
369 z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
370 z2 += z1;
371 z3 += z1;
372
373 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
374 tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
375 tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
376 tmp0 += z1 + z2;
377 tmp3 += z1 + z3;
378
379 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
380 tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
381 tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
382 tmp1 += z1 + z3;
383 tmp2 += z1 + z2;
384
385 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
386
387 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,
388 CONST_BITS+PASS1_BITS+3)
389 & RANGE_MASK];
390 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3,
391 CONST_BITS+PASS1_BITS+3)
392 & RANGE_MASK];
393 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2,
394 CONST_BITS+PASS1_BITS+3)
395 & RANGE_MASK];
396 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2,
397 CONST_BITS+PASS1_BITS+3)
398 & RANGE_MASK];
399 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1,
400 CONST_BITS+PASS1_BITS+3)
401 & RANGE_MASK];
402 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1,
403 CONST_BITS+PASS1_BITS+3)
404 & RANGE_MASK];
405 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0,
406 CONST_BITS+PASS1_BITS+3)
407 & RANGE_MASK];
408 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,
409 CONST_BITS+PASS1_BITS+3)
410 & RANGE_MASK];
411
412 wsptr += DCTSIZE; /* advance pointer to next row */
413 }
414}
415
416#ifdef IDCT_SCALING_SUPPORTED
417
418
419/*
420 * Perform dequantization and inverse DCT on one block of coefficients,
421 * producing a 7x7 output block.
422 *
423 * Optimized algorithm with 12 multiplications in the 1-D kernel.
424 * cK represents sqrt(2) * cos(K*pi/14).
425 */
426
427GLOBAL(void)
428jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
429 JCOEFPTR coef_block,
430 JSAMPARRAY output_buf, JDIMENSION output_col)
431{
432 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;
433 INT32 z1, z2, z3;
434 JCOEFPTR inptr;
435 ISLOW_MULT_TYPE * quantptr;
436 int * wsptr;
437 JSAMPROW outptr;
438 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
439 int ctr;
440 int workspace[7*7]; /* buffers data between passes */
441 SHIFT_TEMPS
442
443 /* Pass 1: process columns from input, store into work array. */
444
445 inptr = coef_block;
446 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
447 wsptr = workspace;
448 for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {
449 /* Even part */
450
451 tmp13 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
452 tmp13 <<= CONST_BITS;
453 /* Add fudge factor here for final descale. */
454 tmp13 += ONE << (CONST_BITS-PASS1_BITS-1);
455
456 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
457 z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
458 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
459
460 tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */
461 tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */
462 tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */
463 tmp0 = z1 + z3;
464 z2 -= tmp0;
465 tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */
466 tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */
467 tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */
468 tmp13 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */
469
470 /* Odd part */
471
472 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
473 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
474 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
475
476 tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */
477 tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */
478 tmp0 = tmp1 - tmp2;
479 tmp1 += tmp2;
480 tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */
481 tmp1 += tmp2;
482 z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */
483 tmp0 += z2;
484 tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */
485
486 /* Final output stage */
487
488 wsptr[7*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
489 wsptr[7*6] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
490 wsptr[7*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);
491 wsptr[7*5] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);
492 wsptr[7*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
493 wsptr[7*4] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
494 wsptr[7*3] = (int) RIGHT_SHIFT(tmp13, CONST_BITS-PASS1_BITS);
495 }
496
497 /* Pass 2: process 7 rows from work array, store into output array. */
498
499 wsptr = workspace;
500 for (ctr = 0; ctr < 7; ctr++) {
501 outptr = output_buf[ctr] + output_col;
502
503 /* Even part */
504
505 /* Add fudge factor here for final descale. */
506 tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
507 tmp13 <<= CONST_BITS;
508
509 z1 = (INT32) wsptr[2];
510 z2 = (INT32) wsptr[4];
511 z3 = (INT32) wsptr[6];
512
513 tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */
514 tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */
515 tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */
516 tmp0 = z1 + z3;
517 z2 -= tmp0;
518 tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */
519 tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */
520 tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */
521 tmp13 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */
522
523 /* Odd part */
524
525 z1 = (INT32) wsptr[1];
526 z2 = (INT32) wsptr[3];
527 z3 = (INT32) wsptr[5];
528
529 tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */
530 tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */
531 tmp0 = tmp1 - tmp2;
532 tmp1 += tmp2;
533 tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */
534 tmp1 += tmp2;
535 z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */
536 tmp0 += z2;
537 tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */
538
539 /* Final output stage */
540
541 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
542 CONST_BITS+PASS1_BITS+3)
543 & RANGE_MASK];
544 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
545 CONST_BITS+PASS1_BITS+3)
546 & RANGE_MASK];
547 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,
548 CONST_BITS+PASS1_BITS+3)
549 & RANGE_MASK];
550 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,
551 CONST_BITS+PASS1_BITS+3)
552 & RANGE_MASK];
553 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
554 CONST_BITS+PASS1_BITS+3)
555 & RANGE_MASK];
556 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
557 CONST_BITS+PASS1_BITS+3)
558 & RANGE_MASK];
559 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13,
560 CONST_BITS+PASS1_BITS+3)
561 & RANGE_MASK];
562
563 wsptr += 7; /* advance pointer to next row */
564 }
565}
566
567
568/*
569 * Perform dequantization and inverse DCT on one block of coefficients,
570 * producing a reduced-size 6x6 output block.
571 *
572 * Optimized algorithm with 3 multiplications in the 1-D kernel.
573 * cK represents sqrt(2) * cos(K*pi/12).
574 */
575
576GLOBAL(void)
577jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
578 JCOEFPTR coef_block,
579 JSAMPARRAY output_buf, JDIMENSION output_col)
580{
581 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
582 INT32 z1, z2, z3;
583 JCOEFPTR inptr;
584 ISLOW_MULT_TYPE * quantptr;
585 int * wsptr;
586 JSAMPROW outptr;
587 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
588 int ctr;
589 int workspace[6*6]; /* buffers data between passes */
590 SHIFT_TEMPS
591
592 /* Pass 1: process columns from input, store into work array. */
593
594 inptr = coef_block;
595 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
596 wsptr = workspace;
597 for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
598 /* Even part */
599
600 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
601 tmp0 <<= CONST_BITS;
602 /* Add fudge factor here for final descale. */
603 tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
604 tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
605 tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
606 tmp1 = tmp0 + tmp10;
607 tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);
608 tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
609 tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */
610 tmp10 = tmp1 + tmp0;
611 tmp12 = tmp1 - tmp0;
612
613 /* Odd part */
614
615 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
616 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
617 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
618 tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
619 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
620 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
621 tmp1 = (z1 - z2 - z3) << PASS1_BITS;
622
623 /* Final output stage */
624
625 wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
626 wsptr[6*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
627 wsptr[6*1] = (int) (tmp11 + tmp1);
628 wsptr[6*4] = (int) (tmp11 - tmp1);
629 wsptr[6*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
630 wsptr[6*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
631 }
632
633 /* Pass 2: process 6 rows from work array, store into output array. */
634
635 wsptr = workspace;
636 for (ctr = 0; ctr < 6; ctr++) {
637 outptr = output_buf[ctr] + output_col;
638
639 /* Even part */
640
641 /* Add fudge factor here for final descale. */
642 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
643 tmp0 <<= CONST_BITS;
644 tmp2 = (INT32) wsptr[4];
645 tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
646 tmp1 = tmp0 + tmp10;
647 tmp11 = tmp0 - tmp10 - tmp10;
648 tmp10 = (INT32) wsptr[2];
649 tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */
650 tmp10 = tmp1 + tmp0;
651 tmp12 = tmp1 - tmp0;
652
653 /* Odd part */
654
655 z1 = (INT32) wsptr[1];
656 z2 = (INT32) wsptr[3];
657 z3 = (INT32) wsptr[5];
658 tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
659 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
660 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
661 tmp1 = (z1 - z2 - z3) << CONST_BITS;
662
663 /* Final output stage */
664
665 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
666 CONST_BITS+PASS1_BITS+3)
667 & RANGE_MASK];
668 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
669 CONST_BITS+PASS1_BITS+3)
670 & RANGE_MASK];
671 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,
672 CONST_BITS+PASS1_BITS+3)
673 & RANGE_MASK];
674 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,
675 CONST_BITS+PASS1_BITS+3)
676 & RANGE_MASK];
677 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
678 CONST_BITS+PASS1_BITS+3)
679 & RANGE_MASK];
680 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
681 CONST_BITS+PASS1_BITS+3)
682 & RANGE_MASK];
683
684 wsptr += 6; /* advance pointer to next row */
685 }
686}
687
688
689/*
690 * Perform dequantization and inverse DCT on one block of coefficients,
691 * producing a reduced-size 5x5 output block.
692 *
693 * Optimized algorithm with 5 multiplications in the 1-D kernel.
694 * cK represents sqrt(2) * cos(K*pi/10).
695 */
696
697GLOBAL(void)
698jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
699 JCOEFPTR coef_block,
700 JSAMPARRAY output_buf, JDIMENSION output_col)
701{
702 INT32 tmp0, tmp1, tmp10, tmp11, tmp12;
703 INT32 z1, z2, z3;
704 JCOEFPTR inptr;
705 ISLOW_MULT_TYPE * quantptr;
706 int * wsptr;
707 JSAMPROW outptr;
708 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
709 int ctr;
710 int workspace[5*5]; /* buffers data between passes */
711 SHIFT_TEMPS
712
713 /* Pass 1: process columns from input, store into work array. */
714
715 inptr = coef_block;
716 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
717 wsptr = workspace;
718 for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {
719 /* Even part */
720
721 tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
722 tmp12 <<= CONST_BITS;
723 /* Add fudge factor here for final descale. */
724 tmp12 += ONE << (CONST_BITS-PASS1_BITS-1);
725 tmp0 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
726 tmp1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
727 z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */
728 z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */
729 z3 = tmp12 + z2;
730 tmp10 = z3 + z1;
731 tmp11 = z3 - z1;
732 tmp12 -= z2 << 2;
733
734 /* Odd part */
735
736 z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
737 z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
738
739 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */
740 tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */
741 tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */
742
743 /* Final output stage */
744
745 wsptr[5*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
746 wsptr[5*4] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
747 wsptr[5*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);
748 wsptr[5*3] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);
749 wsptr[5*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS);
750 }
751
752 /* Pass 2: process 5 rows from work array, store into output array. */
753
754 wsptr = workspace;
755 for (ctr = 0; ctr < 5; ctr++) {
756 outptr = output_buf[ctr] + output_col;
757
758 /* Even part */
759
760 /* Add fudge factor here for final descale. */
761 tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
762 tmp12 <<= CONST_BITS;
763 tmp0 = (INT32) wsptr[2];
764 tmp1 = (INT32) wsptr[4];
765 z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */
766 z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */
767 z3 = tmp12 + z2;
768 tmp10 = z3 + z1;
769 tmp11 = z3 - z1;
770 tmp12 -= z2 << 2;
771
772 /* Odd part */
773
774 z2 = (INT32) wsptr[1];
775 z3 = (INT32) wsptr[3];
776
777 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */
778 tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */
779 tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */
780
781 /* Final output stage */
782
783 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
784 CONST_BITS+PASS1_BITS+3)
785 & RANGE_MASK];
786 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
787 CONST_BITS+PASS1_BITS+3)
788 & RANGE_MASK];
789 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,
790 CONST_BITS+PASS1_BITS+3)
791 & RANGE_MASK];
792 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,
793 CONST_BITS+PASS1_BITS+3)
794 & RANGE_MASK];
795 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12,
796 CONST_BITS+PASS1_BITS+3)
797 & RANGE_MASK];
798
799 wsptr += 5; /* advance pointer to next row */
800 }
801}
802
803
804/*
805 * Perform dequantization and inverse DCT on one block of coefficients,
806 * producing a reduced-size 4x4 output block.
807 *
808 * Optimized algorithm with 3 multiplications in the 1-D kernel.
809 * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].
810 */
811
812GLOBAL(void)
813jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
814 JCOEFPTR coef_block,
815 JSAMPARRAY output_buf, JDIMENSION output_col)
816{
817 INT32 tmp0, tmp2, tmp10, tmp12;
818 INT32 z1, z2, z3;
819 JCOEFPTR inptr;
820 ISLOW_MULT_TYPE * quantptr;
821 int * wsptr;
822 JSAMPROW outptr;
823 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
824 int ctr;
825 int workspace[4*4]; /* buffers data between passes */
826 SHIFT_TEMPS
827
828 /* Pass 1: process columns from input, store into work array. */
829
830 inptr = coef_block;
831 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
832 wsptr = workspace;
833 for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) {
834 /* Even part */
835
836 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
837 tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
838
839 tmp10 = (tmp0 + tmp2) << PASS1_BITS;
840 tmp12 = (tmp0 - tmp2) << PASS1_BITS;
841
842 /* Odd part */
843 /* Same rotation as in the even part of the 8x8 LL&M IDCT */
844
845 z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
846 z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
847
848 z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
849 /* Add fudge factor here for final descale. */
850 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
851 tmp0 = RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865), /* c2-c6 */
852 CONST_BITS-PASS1_BITS);
853 tmp2 = RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065), /* c2+c6 */
854 CONST_BITS-PASS1_BITS);
855
856 /* Final output stage */
857
858 wsptr[4*0] = (int) (tmp10 + tmp0);
859 wsptr[4*3] = (int) (tmp10 - tmp0);
860 wsptr[4*1] = (int) (tmp12 + tmp2);
861 wsptr[4*2] = (int) (tmp12 - tmp2);
862 }
863
864 /* Pass 2: process 4 rows from work array, store into output array. */
865
866 wsptr = workspace;
867 for (ctr = 0; ctr < 4; ctr++) {
868 outptr = output_buf[ctr] + output_col;
869
870 /* Even part */
871
872 /* Add fudge factor here for final descale. */
873 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
874 tmp2 = (INT32) wsptr[2];
875
876 tmp10 = (tmp0 + tmp2) << CONST_BITS;
877 tmp12 = (tmp0 - tmp2) << CONST_BITS;
878
879 /* Odd part */
880 /* Same rotation as in the even part of the 8x8 LL&M IDCT */
881
882 z2 = (INT32) wsptr[1];
883 z3 = (INT32) wsptr[3];
884
885 z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
886 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
887 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
888
889 /* Final output stage */
890
891 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
892 CONST_BITS+PASS1_BITS+3)
893 & RANGE_MASK];
894 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
895 CONST_BITS+PASS1_BITS+3)
896 & RANGE_MASK];
897 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
898 CONST_BITS+PASS1_BITS+3)
899 & RANGE_MASK];
900 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
901 CONST_BITS+PASS1_BITS+3)
902 & RANGE_MASK];
903
904 wsptr += 4; /* advance pointer to next row */
905 }
906}
907
908
909/*
910 * Perform dequantization and inverse DCT on one block of coefficients,
911 * producing a reduced-size 3x3 output block.
912 *
913 * Optimized algorithm with 2 multiplications in the 1-D kernel.
914 * cK represents sqrt(2) * cos(K*pi/6).
915 */
916
917GLOBAL(void)
918jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
919 JCOEFPTR coef_block,
920 JSAMPARRAY output_buf, JDIMENSION output_col)
921{
922 INT32 tmp0, tmp2, tmp10, tmp12;
923 JCOEFPTR inptr;
924 ISLOW_MULT_TYPE * quantptr;
925 int * wsptr;
926 JSAMPROW outptr;
927 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
928 int ctr;
929 int workspace[3*3]; /* buffers data between passes */
930 SHIFT_TEMPS
931
932 /* Pass 1: process columns from input, store into work array. */
933
934 inptr = coef_block;
935 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
936 wsptr = workspace;
937 for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {
938 /* Even part */
939
940 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
941 tmp0 <<= CONST_BITS;
942 /* Add fudge factor here for final descale. */
943 tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
944 tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
945 tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
946 tmp10 = tmp0 + tmp12;
947 tmp2 = tmp0 - tmp12 - tmp12;
948
949 /* Odd part */
950
951 tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
952 tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */
953
954 /* Final output stage */
955
956 wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
957 wsptr[3*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
958 wsptr[3*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);
959 }
960
961 /* Pass 2: process 3 rows from work array, store into output array. */
962
963 wsptr = workspace;
964 for (ctr = 0; ctr < 3; ctr++) {
965 outptr = output_buf[ctr] + output_col;
966
967 /* Even part */
968
969 /* Add fudge factor here for final descale. */
970 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
971 tmp0 <<= CONST_BITS;
972 tmp2 = (INT32) wsptr[2];
973 tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
974 tmp10 = tmp0 + tmp12;
975 tmp2 = tmp0 - tmp12 - tmp12;
976
977 /* Odd part */
978
979 tmp12 = (INT32) wsptr[1];
980 tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */
981
982 /* Final output stage */
983
984 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
985 CONST_BITS+PASS1_BITS+3)
986 & RANGE_MASK];
987 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
988 CONST_BITS+PASS1_BITS+3)
989 & RANGE_MASK];
990 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2,
991 CONST_BITS+PASS1_BITS+3)
992 & RANGE_MASK];
993
994 wsptr += 3; /* advance pointer to next row */
995 }
996}
997
998
999/*
1000 * Perform dequantization and inverse DCT on one block of coefficients,
1001 * producing a reduced-size 2x2 output block.
1002 *
1003 * Multiplication-less algorithm.
1004 */
1005
1006GLOBAL(void)
1007jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1008 JCOEFPTR coef_block,
1009 JSAMPARRAY output_buf, JDIMENSION output_col)
1010{
1011 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
1012 ISLOW_MULT_TYPE * quantptr;
1013 JSAMPROW outptr;
1014 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1015 SHIFT_TEMPS
1016
1017 /* Pass 1: process columns from input. */
1018
1019 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1020
1021 /* Column 0 */
1022 tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
1023 tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);
1024 /* Add fudge factor here for final descale. */
1025 tmp4 += ONE << 2;
1026
1027 tmp0 = tmp4 + tmp5;
1028 tmp2 = tmp4 - tmp5;
1029
1030 /* Column 1 */
1031 tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0+1], quantptr[DCTSIZE*0+1]);
1032 tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1+1], quantptr[DCTSIZE*1+1]);
1033
1034 tmp1 = tmp4 + tmp5;
1035 tmp3 = tmp4 - tmp5;
1036
1037 /* Pass 2: process 2 rows, store into output array. */
1038
1039 /* Row 0 */
1040 outptr = output_buf[0] + output_col;
1041
1042 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
1043 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
1044
1045 /* Row 1 */
1046 outptr = output_buf[1] + output_col;
1047
1048 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK];
1049 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK];
1050}
1051
1052
1053/*
1054 * Perform dequantization and inverse DCT on one block of coefficients,
1055 * producing a reduced-size 1x1 output block.
1056 *
1057 * We hardly need an inverse DCT routine for this: just take the
1058 * average pixel value, which is one-eighth of the DC coefficient.
1059 */
1060
1061GLOBAL(void)
1062jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1063 JCOEFPTR coef_block,
1064 JSAMPARRAY output_buf, JDIMENSION output_col)
1065{
1066 int dcval;
1067 ISLOW_MULT_TYPE * quantptr;
1068 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1069 SHIFT_TEMPS
1070
1071 /* 1x1 is trivial: just take the DC coefficient divided by 8. */
1072 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1073 dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
1074 dcval = (int) DESCALE((INT32) dcval, 3);
1075
1076 output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
1077}
1078
1079
1080/*
1081 * Perform dequantization and inverse DCT on one block of coefficients,
1082 * producing a 9x9 output block.
1083 *
1084 * Optimized algorithm with 10 multiplications in the 1-D kernel.
1085 * cK represents sqrt(2) * cos(K*pi/18).
1086 */
1087
1088GLOBAL(void)
1089jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1090 JCOEFPTR coef_block,
1091 JSAMPARRAY output_buf, JDIMENSION output_col)
1092{
1093 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;
1094 INT32 z1, z2, z3, z4;
1095 JCOEFPTR inptr;
1096 ISLOW_MULT_TYPE * quantptr;
1097 int * wsptr;
1098 JSAMPROW outptr;
1099 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1100 int ctr;
1101 int workspace[8*9]; /* buffers data between passes */
1102 SHIFT_TEMPS
1103
1104 /* Pass 1: process columns from input, store into work array. */
1105
1106 inptr = coef_block;
1107 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1108 wsptr = workspace;
1109 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1110 /* Even part */
1111
1112 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
1113 tmp0 <<= CONST_BITS;
1114 /* Add fudge factor here for final descale. */
1115 tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
1116
1117 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
1118 z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
1119 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
1120
1121 tmp3 = MULTIPLY(z3, FIX(0.707106781)); /* c6 */
1122 tmp1 = tmp0 + tmp3;
1123 tmp2 = tmp0 - tmp3 - tmp3;
1124
1125 tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */
1126 tmp11 = tmp2 + tmp0;
1127 tmp14 = tmp2 - tmp0 - tmp0;
1128
1129 tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */
1130 tmp2 = MULTIPLY(z1, FIX(1.083350441)); /* c4 */
1131 tmp3 = MULTIPLY(z2, FIX(0.245575608)); /* c8 */
1132
1133 tmp10 = tmp1 + tmp0 - tmp3;
1134 tmp12 = tmp1 - tmp0 + tmp2;
1135 tmp13 = tmp1 - tmp2 + tmp3;
1136
1137 /* Odd part */
1138
1139 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
1140 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
1141 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
1142 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
1143
1144 z2 = MULTIPLY(z2, - FIX(1.224744871)); /* -c3 */
1145
1146 tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955)); /* c5 */
1147 tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525)); /* c7 */
1148 tmp0 = tmp2 + tmp3 - z2;
1149 tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481)); /* c1 */
1150 tmp2 += z2 - tmp1;
1151 tmp3 += z2 + tmp1;
1152 tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */
1153
1154 /* Final output stage */
1155
1156 wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
1157 wsptr[8*8] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
1158 wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);
1159 wsptr[8*7] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);
1160 wsptr[8*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
1161 wsptr[8*6] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
1162 wsptr[8*3] = (int) RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS-PASS1_BITS);
1163 wsptr[8*5] = (int) RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS-PASS1_BITS);
1164 wsptr[8*4] = (int) RIGHT_SHIFT(tmp14, CONST_BITS-PASS1_BITS);
1165 }
1166
1167 /* Pass 2: process 9 rows from work array, store into output array. */
1168
1169 wsptr = workspace;
1170 for (ctr = 0; ctr < 9; ctr++) {
1171 outptr = output_buf[ctr] + output_col;
1172
1173 /* Even part */
1174
1175 /* Add fudge factor here for final descale. */
1176 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
1177 tmp0 <<= CONST_BITS;
1178
1179 z1 = (INT32) wsptr[2];
1180 z2 = (INT32) wsptr[4];
1181 z3 = (INT32) wsptr[6];
1182
1183 tmp3 = MULTIPLY(z3, FIX(0.707106781)); /* c6 */
1184 tmp1 = tmp0 + tmp3;
1185 tmp2 = tmp0 - tmp3 - tmp3;
1186
1187 tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */
1188 tmp11 = tmp2 + tmp0;
1189 tmp14 = tmp2 - tmp0 - tmp0;
1190
1191 tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */
1192 tmp2 = MULTIPLY(z1, FIX(1.083350441)); /* c4 */
1193 tmp3 = MULTIPLY(z2, FIX(0.245575608)); /* c8 */
1194
1195 tmp10 = tmp1 + tmp0 - tmp3;
1196 tmp12 = tmp1 - tmp0 + tmp2;
1197 tmp13 = tmp1 - tmp2 + tmp3;
1198
1199 /* Odd part */
1200
1201 z1 = (INT32) wsptr[1];
1202 z2 = (INT32) wsptr[3];
1203 z3 = (INT32) wsptr[5];
1204 z4 = (INT32) wsptr[7];
1205
1206 z2 = MULTIPLY(z2, - FIX(1.224744871)); /* -c3 */
1207
1208 tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955)); /* c5 */
1209 tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525)); /* c7 */
1210 tmp0 = tmp2 + tmp3 - z2;
1211 tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481)); /* c1 */
1212 tmp2 += z2 - tmp1;
1213 tmp3 += z2 + tmp1;
1214 tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */
1215
1216 /* Final output stage */
1217
1218 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
1219 CONST_BITS+PASS1_BITS+3)
1220 & RANGE_MASK];
1221 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
1222 CONST_BITS+PASS1_BITS+3)
1223 & RANGE_MASK];
1224 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,
1225 CONST_BITS+PASS1_BITS+3)
1226 & RANGE_MASK];
1227 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,
1228 CONST_BITS+PASS1_BITS+3)
1229 & RANGE_MASK];
1230 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
1231 CONST_BITS+PASS1_BITS+3)
1232 & RANGE_MASK];
1233 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
1234 CONST_BITS+PASS1_BITS+3)
1235 & RANGE_MASK];
1236 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp3,
1237 CONST_BITS+PASS1_BITS+3)
1238 & RANGE_MASK];
1239 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp3,
1240 CONST_BITS+PASS1_BITS+3)
1241 & RANGE_MASK];
1242 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp14,
1243 CONST_BITS+PASS1_BITS+3)
1244 & RANGE_MASK];
1245
1246 wsptr += 8; /* advance pointer to next row */
1247 }
1248}
1249
1250
1251/*
1252 * Perform dequantization and inverse DCT on one block of coefficients,
1253 * producing a 10x10 output block.
1254 *
1255 * Optimized algorithm with 12 multiplications in the 1-D kernel.
1256 * cK represents sqrt(2) * cos(K*pi/20).
1257 */
1258
1259GLOBAL(void)
1260jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1261 JCOEFPTR coef_block,
1262 JSAMPARRAY output_buf, JDIMENSION output_col)
1263{
1264 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
1265 INT32 tmp20, tmp21, tmp22, tmp23, tmp24;
1266 INT32 z1, z2, z3, z4, z5;
1267 JCOEFPTR inptr;
1268 ISLOW_MULT_TYPE * quantptr;
1269 int * wsptr;
1270 JSAMPROW outptr;
1271 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1272 int ctr;
1273 int workspace[8*10]; /* buffers data between passes */
1274 SHIFT_TEMPS
1275
1276 /* Pass 1: process columns from input, store into work array. */
1277
1278 inptr = coef_block;
1279 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1280 wsptr = workspace;
1281 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1282 /* Even part */
1283
1284 z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
1285 z3 <<= CONST_BITS;
1286 /* Add fudge factor here for final descale. */
1287 z3 += ONE << (CONST_BITS-PASS1_BITS-1);
1288 z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
1289 z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
1290 z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */
1291 tmp10 = z3 + z1;
1292 tmp11 = z3 - z2;
1293
1294 tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1), /* c0 = (c4-c8)*2 */
1295 CONST_BITS-PASS1_BITS);
1296
1297 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
1298 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
1299
1300 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */
1301 tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
1302 tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
1303
1304 tmp20 = tmp10 + tmp12;
1305 tmp24 = tmp10 - tmp12;
1306 tmp21 = tmp11 + tmp13;
1307 tmp23 = tmp11 - tmp13;
1308
1309 /* Odd part */
1310
1311 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
1312 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
1313 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
1314 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
1315
1316 tmp11 = z2 + z4;
1317 tmp13 = z2 - z4;
1318
1319 tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */
1320 z5 = z3 << CONST_BITS;
1321
1322 z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */
1323 z4 = z5 + tmp12;
1324
1325 tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
1326 tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
1327
1328 z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */
1329 z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));
1330
1331 tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;
1332
1333 tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
1334 tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
1335
1336 /* Final output stage */
1337
1338 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1339 wsptr[8*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1340 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1341 wsptr[8*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1342 wsptr[8*2] = (int) (tmp22 + tmp12);
1343 wsptr[8*7] = (int) (tmp22 - tmp12);
1344 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1345 wsptr[8*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1346 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1347 wsptr[8*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1348 }
1349
1350 /* Pass 2: process 10 rows from work array, store into output array. */
1351
1352 wsptr = workspace;
1353 for (ctr = 0; ctr < 10; ctr++) {
1354 outptr = output_buf[ctr] + output_col;
1355
1356 /* Even part */
1357
1358 /* Add fudge factor here for final descale. */
1359 z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
1360 z3 <<= CONST_BITS;
1361 z4 = (INT32) wsptr[4];
1362 z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
1363 z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */
1364 tmp10 = z3 + z1;
1365 tmp11 = z3 - z2;
1366
1367 tmp22 = z3 - ((z1 - z2) << 1); /* c0 = (c4-c8)*2 */
1368
1369 z2 = (INT32) wsptr[2];
1370 z3 = (INT32) wsptr[6];
1371
1372 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */
1373 tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
1374 tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
1375
1376 tmp20 = tmp10 + tmp12;
1377 tmp24 = tmp10 - tmp12;
1378 tmp21 = tmp11 + tmp13;
1379 tmp23 = tmp11 - tmp13;
1380
1381 /* Odd part */
1382
1383 z1 = (INT32) wsptr[1];
1384 z2 = (INT32) wsptr[3];
1385 z3 = (INT32) wsptr[5];
1386 z3 <<= CONST_BITS;
1387 z4 = (INT32) wsptr[7];
1388
1389 tmp11 = z2 + z4;
1390 tmp13 = z2 - z4;
1391
1392 tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */
1393
1394 z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */
1395 z4 = z3 + tmp12;
1396
1397 tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
1398 tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
1399
1400 z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */
1401 z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));
1402
1403 tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;
1404
1405 tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
1406 tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
1407
1408 /* Final output stage */
1409
1410 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
1411 CONST_BITS+PASS1_BITS+3)
1412 & RANGE_MASK];
1413 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
1414 CONST_BITS+PASS1_BITS+3)
1415 & RANGE_MASK];
1416 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
1417 CONST_BITS+PASS1_BITS+3)
1418 & RANGE_MASK];
1419 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
1420 CONST_BITS+PASS1_BITS+3)
1421 & RANGE_MASK];
1422 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
1423 CONST_BITS+PASS1_BITS+3)
1424 & RANGE_MASK];
1425 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
1426 CONST_BITS+PASS1_BITS+3)
1427 & RANGE_MASK];
1428 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
1429 CONST_BITS+PASS1_BITS+3)
1430 & RANGE_MASK];
1431 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
1432 CONST_BITS+PASS1_BITS+3)
1433 & RANGE_MASK];
1434 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
1435 CONST_BITS+PASS1_BITS+3)
1436 & RANGE_MASK];
1437 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
1438 CONST_BITS+PASS1_BITS+3)
1439 & RANGE_MASK];
1440
1441 wsptr += 8; /* advance pointer to next row */
1442 }
1443}
1444
1445
1446/*
1447 * Perform dequantization and inverse DCT on one block of coefficients,
1448 * producing a 11x11 output block.
1449 *
1450 * Optimized algorithm with 24 multiplications in the 1-D kernel.
1451 * cK represents sqrt(2) * cos(K*pi/22).
1452 */
1453
1454GLOBAL(void)
1455jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1456 JCOEFPTR coef_block,
1457 JSAMPARRAY output_buf, JDIMENSION output_col)
1458{
1459 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
1460 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
1461 INT32 z1, z2, z3, z4;
1462 JCOEFPTR inptr;
1463 ISLOW_MULT_TYPE * quantptr;
1464 int * wsptr;
1465 JSAMPROW outptr;
1466 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1467 int ctr;
1468 int workspace[8*11]; /* buffers data between passes */
1469 SHIFT_TEMPS
1470
1471 /* Pass 1: process columns from input, store into work array. */
1472
1473 inptr = coef_block;
1474 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1475 wsptr = workspace;
1476 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1477 /* Even part */
1478
1479 tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
1480 tmp10 <<= CONST_BITS;
1481 /* Add fudge factor here for final descale. */
1482 tmp10 += ONE << (CONST_BITS-PASS1_BITS-1);
1483
1484 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
1485 z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
1486 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
1487
1488 tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132)); /* c2+c4 */
1489 tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045)); /* c2-c6 */
1490 z4 = z1 + z3;
1491 tmp24 = MULTIPLY(z4, - FIX(1.155664402)); /* -(c2-c10) */
1492 z4 -= z2;
1493 tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976)); /* c2 */
1494 tmp21 = tmp20 + tmp23 + tmp25 -
1495 MULTIPLY(z2, FIX(1.821790775)); /* c2+c4+c10-c6 */
1496 tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */
1497 tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */
1498 tmp24 += tmp25;
1499 tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120)); /* c8+c10 */
1500 tmp24 += MULTIPLY(z2, FIX(1.944413522)) - /* c2+c8 */
1501 MULTIPLY(z1, FIX(1.390975730)); /* c4+c10 */
1502 tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562)); /* c0 */
1503
1504 /* Odd part */
1505
1506 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
1507 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
1508 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
1509 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
1510
1511 tmp11 = z1 + z2;
1512 tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */
1513 tmp11 = MULTIPLY(tmp11, FIX(0.887983902)); /* c3-c9 */
1514 tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295)); /* c5-c9 */
1515 tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */
1516 tmp10 = tmp11 + tmp12 + tmp13 -
1517 MULTIPLY(z1, FIX(0.923107866)); /* c7+c5+c3-c1-2*c9 */
1518 z1 = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */
1519 tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588)); /* c1+c7+3*c9-c3 */
1520 tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623)); /* c3+c5-c7-c9 */
1521 z1 = MULTIPLY(z2 + z4, - FIX(1.798248910)); /* -(c1+c9) */
1522 tmp11 += z1;
1523 tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632)); /* c1+c5+c9-c7 */
1524 tmp14 += MULTIPLY(z2, - FIX(1.467221301)) + /* -(c5+c9) */
1525 MULTIPLY(z3, FIX(1.001388905)) - /* c1-c9 */
1526 MULTIPLY(z4, FIX(1.684843907)); /* c3+c9 */
1527
1528 /* Final output stage */
1529
1530 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1531 wsptr[8*10] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1532 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1533 wsptr[8*9] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1534 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
1535 wsptr[8*8] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
1536 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1537 wsptr[8*7] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1538 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1539 wsptr[8*6] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1540 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25, CONST_BITS-PASS1_BITS);
1541 }
1542
1543 /* Pass 2: process 11 rows from work array, store into output array. */
1544
1545 wsptr = workspace;
1546 for (ctr = 0; ctr < 11; ctr++) {
1547 outptr = output_buf[ctr] + output_col;
1548
1549 /* Even part */
1550
1551 /* Add fudge factor here for final descale. */
1552 tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
1553 tmp10 <<= CONST_BITS;
1554
1555 z1 = (INT32) wsptr[2];
1556 z2 = (INT32) wsptr[4];
1557 z3 = (INT32) wsptr[6];
1558
1559 tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132)); /* c2+c4 */
1560 tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045)); /* c2-c6 */
1561 z4 = z1 + z3;
1562 tmp24 = MULTIPLY(z4, - FIX(1.155664402)); /* -(c2-c10) */
1563 z4 -= z2;
1564 tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976)); /* c2 */
1565 tmp21 = tmp20 + tmp23 + tmp25 -
1566 MULTIPLY(z2, FIX(1.821790775)); /* c2+c4+c10-c6 */
1567 tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */
1568 tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */
1569 tmp24 += tmp25;
1570 tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120)); /* c8+c10 */
1571 tmp24 += MULTIPLY(z2, FIX(1.944413522)) - /* c2+c8 */
1572 MULTIPLY(z1, FIX(1.390975730)); /* c4+c10 */
1573 tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562)); /* c0 */
1574
1575 /* Odd part */
1576
1577 z1 = (INT32) wsptr[1];
1578 z2 = (INT32) wsptr[3];
1579 z3 = (INT32) wsptr[5];
1580 z4 = (INT32) wsptr[7];
1581
1582 tmp11 = z1 + z2;
1583 tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */
1584 tmp11 = MULTIPLY(tmp11, FIX(0.887983902)); /* c3-c9 */
1585 tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295)); /* c5-c9 */
1586 tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */
1587 tmp10 = tmp11 + tmp12 + tmp13 -
1588 MULTIPLY(z1, FIX(0.923107866)); /* c7+c5+c3-c1-2*c9 */
1589 z1 = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */
1590 tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588)); /* c1+c7+3*c9-c3 */
1591 tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623)); /* c3+c5-c7-c9 */
1592 z1 = MULTIPLY(z2 + z4, - FIX(1.798248910)); /* -(c1+c9) */
1593 tmp11 += z1;
1594 tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632)); /* c1+c5+c9-c7 */
1595 tmp14 += MULTIPLY(z2, - FIX(1.467221301)) + /* -(c5+c9) */
1596 MULTIPLY(z3, FIX(1.001388905)) - /* c1-c9 */
1597 MULTIPLY(z4, FIX(1.684843907)); /* c3+c9 */
1598
1599 /* Final output stage */
1600
1601 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
1602 CONST_BITS+PASS1_BITS+3)
1603 & RANGE_MASK];
1604 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
1605 CONST_BITS+PASS1_BITS+3)
1606 & RANGE_MASK];
1607 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
1608 CONST_BITS+PASS1_BITS+3)
1609 & RANGE_MASK];
1610 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
1611 CONST_BITS+PASS1_BITS+3)
1612 & RANGE_MASK];
1613 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
1614 CONST_BITS+PASS1_BITS+3)
1615 & RANGE_MASK];
1616 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
1617 CONST_BITS+PASS1_BITS+3)
1618 & RANGE_MASK];
1619 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
1620 CONST_BITS+PASS1_BITS+3)
1621 & RANGE_MASK];
1622 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
1623 CONST_BITS+PASS1_BITS+3)
1624 & RANGE_MASK];
1625 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
1626 CONST_BITS+PASS1_BITS+3)
1627 & RANGE_MASK];
1628 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
1629 CONST_BITS+PASS1_BITS+3)
1630 & RANGE_MASK];
1631 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25,
1632 CONST_BITS+PASS1_BITS+3)
1633 & RANGE_MASK];
1634
1635 wsptr += 8; /* advance pointer to next row */
1636 }
1637}
1638
1639
1640/*
1641 * Perform dequantization and inverse DCT on one block of coefficients,
1642 * producing a 12x12 output block.
1643 *
1644 * Optimized algorithm with 15 multiplications in the 1-D kernel.
1645 * cK represents sqrt(2) * cos(K*pi/24).
1646 */
1647
1648GLOBAL(void)
1649jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1650 JCOEFPTR coef_block,
1651 JSAMPARRAY output_buf, JDIMENSION output_col)
1652{
1653 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1654 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
1655 INT32 z1, z2, z3, z4;
1656 JCOEFPTR inptr;
1657 ISLOW_MULT_TYPE * quantptr;
1658 int * wsptr;
1659 JSAMPROW outptr;
1660 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1661 int ctr;
1662 int workspace[8*12]; /* buffers data between passes */
1663 SHIFT_TEMPS
1664
1665 /* Pass 1: process columns from input, store into work array. */
1666
1667 inptr = coef_block;
1668 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1669 wsptr = workspace;
1670 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1671 /* Even part */
1672
1673 z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
1674 z3 <<= CONST_BITS;
1675 /* Add fudge factor here for final descale. */
1676 z3 += ONE << (CONST_BITS-PASS1_BITS-1);
1677
1678 z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
1679 z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */
1680
1681 tmp10 = z3 + z4;
1682 tmp11 = z3 - z4;
1683
1684 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
1685 z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */
1686 z1 <<= CONST_BITS;
1687 z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
1688 z2 <<= CONST_BITS;
1689
1690 tmp12 = z1 - z2;
1691
1692 tmp21 = z3 + tmp12;
1693 tmp24 = z3 - tmp12;
1694
1695 tmp12 = z4 + z2;
1696
1697 tmp20 = tmp10 + tmp12;
1698 tmp25 = tmp10 - tmp12;
1699
1700 tmp12 = z4 - z1 - z2;
1701
1702 tmp22 = tmp11 + tmp12;
1703 tmp23 = tmp11 - tmp12;
1704
1705 /* Odd part */
1706
1707 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
1708 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
1709 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
1710 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
1711
1712 tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */
1713 tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */
1714
1715 tmp10 = z1 + z3;
1716 tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */
1717 tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */
1718 tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */
1719 tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */
1720 tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */
1721 tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */
1722 tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */
1723 MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */
1724
1725 z1 -= z4;
1726 z2 -= z3;
1727 z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */
1728 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */
1729 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */
1730
1731 /* Final output stage */
1732
1733 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1734 wsptr[8*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1735 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1736 wsptr[8*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1737 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
1738 wsptr[8*9] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
1739 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1740 wsptr[8*8] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1741 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1742 wsptr[8*7] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1743 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
1744 wsptr[8*6] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
1745 }
1746
1747 /* Pass 2: process 12 rows from work array, store into output array. */
1748
1749 wsptr = workspace;
1750 for (ctr = 0; ctr < 12; ctr++) {
1751 outptr = output_buf[ctr] + output_col;
1752
1753 /* Even part */
1754
1755 /* Add fudge factor here for final descale. */
1756 z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
1757 z3 <<= CONST_BITS;
1758
1759 z4 = (INT32) wsptr[4];
1760 z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */
1761
1762 tmp10 = z3 + z4;
1763 tmp11 = z3 - z4;
1764
1765 z1 = (INT32) wsptr[2];
1766 z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */
1767 z1 <<= CONST_BITS;
1768 z2 = (INT32) wsptr[6];
1769 z2 <<= CONST_BITS;
1770
1771 tmp12 = z1 - z2;
1772
1773 tmp21 = z3 + tmp12;
1774 tmp24 = z3 - tmp12;
1775
1776 tmp12 = z4 + z2;
1777
1778 tmp20 = tmp10 + tmp12;
1779 tmp25 = tmp10 - tmp12;
1780
1781 tmp12 = z4 - z1 - z2;
1782
1783 tmp22 = tmp11 + tmp12;
1784 tmp23 = tmp11 - tmp12;
1785
1786 /* Odd part */
1787
1788 z1 = (INT32) wsptr[1];
1789 z2 = (INT32) wsptr[3];
1790 z3 = (INT32) wsptr[5];
1791 z4 = (INT32) wsptr[7];
1792
1793 tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */
1794 tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */
1795
1796 tmp10 = z1 + z3;
1797 tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */
1798 tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */
1799 tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */
1800 tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */
1801 tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */
1802 tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */
1803 tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */
1804 MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */
1805
1806 z1 -= z4;
1807 z2 -= z3;
1808 z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */
1809 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */
1810 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */
1811
1812 /* Final output stage */
1813
1814 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
1815 CONST_BITS+PASS1_BITS+3)
1816 & RANGE_MASK];
1817 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
1818 CONST_BITS+PASS1_BITS+3)
1819 & RANGE_MASK];
1820 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
1821 CONST_BITS+PASS1_BITS+3)
1822 & RANGE_MASK];
1823 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
1824 CONST_BITS+PASS1_BITS+3)
1825 & RANGE_MASK];
1826 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
1827 CONST_BITS+PASS1_BITS+3)
1828 & RANGE_MASK];
1829 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
1830 CONST_BITS+PASS1_BITS+3)
1831 & RANGE_MASK];
1832 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
1833 CONST_BITS+PASS1_BITS+3)
1834 & RANGE_MASK];
1835 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
1836 CONST_BITS+PASS1_BITS+3)
1837 & RANGE_MASK];
1838 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
1839 CONST_BITS+PASS1_BITS+3)
1840 & RANGE_MASK];
1841 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
1842 CONST_BITS+PASS1_BITS+3)
1843 & RANGE_MASK];
1844 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,
1845 CONST_BITS+PASS1_BITS+3)
1846 & RANGE_MASK];
1847 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,
1848 CONST_BITS+PASS1_BITS+3)
1849 & RANGE_MASK];
1850
1851 wsptr += 8; /* advance pointer to next row */
1852 }
1853}
1854
1855
1856/*
1857 * Perform dequantization and inverse DCT on one block of coefficients,
1858 * producing a 13x13 output block.
1859 *
1860 * Optimized algorithm with 29 multiplications in the 1-D kernel.
1861 * cK represents sqrt(2) * cos(K*pi/26).
1862 */
1863
1864GLOBAL(void)
1865jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
1866 JCOEFPTR coef_block,
1867 JSAMPARRAY output_buf, JDIMENSION output_col)
1868{
1869 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1870 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
1871 INT32 z1, z2, z3, z4;
1872 JCOEFPTR inptr;
1873 ISLOW_MULT_TYPE * quantptr;
1874 int * wsptr;
1875 JSAMPROW outptr;
1876 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
1877 int ctr;
1878 int workspace[8*13]; /* buffers data between passes */
1879 SHIFT_TEMPS
1880
1881 /* Pass 1: process columns from input, store into work array. */
1882
1883 inptr = coef_block;
1884 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
1885 wsptr = workspace;
1886 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1887 /* Even part */
1888
1889 z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
1890 z1 <<= CONST_BITS;
1891 /* Add fudge factor here for final descale. */
1892 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
1893
1894 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
1895 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
1896 z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
1897
1898 tmp10 = z3 + z4;
1899 tmp11 = z3 - z4;
1900
1901 tmp12 = MULTIPLY(tmp10, FIX(1.155388986)); /* (c4+c6)/2 */
1902 tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1; /* (c4-c6)/2 */
1903
1904 tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13; /* c2 */
1905 tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13; /* c10 */
1906
1907 tmp12 = MULTIPLY(tmp10, FIX(0.316450131)); /* (c8-c12)/2 */
1908 tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1; /* (c8+c12)/2 */
1909
1910 tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13; /* c6 */
1911 tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */
1912
1913 tmp12 = MULTIPLY(tmp10, FIX(0.435816023)); /* (c2-c10)/2 */
1914 tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1; /* (c2+c10)/2 */
1915
1916 tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */
1917 tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */
1918
1919 tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1; /* c0 */
1920
1921 /* Odd part */
1922
1923 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
1924 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
1925 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
1926 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
1927
1928 tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651)); /* c3 */
1929 tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945)); /* c5 */
1930 tmp15 = z1 + z4;
1931 tmp13 = MULTIPLY(tmp15, FIX(0.937797057)); /* c7 */
1932 tmp10 = tmp11 + tmp12 + tmp13 -
1933 MULTIPLY(z1, FIX(2.020082300)); /* c7+c5+c3-c1 */
1934 tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458)); /* -c11 */
1935 tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */
1936 tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */
1937 tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945)); /* -c5 */
1938 tmp11 += tmp14;
1939 tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */
1940 tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813)); /* -c9 */
1941 tmp12 += tmp14;
1942 tmp13 += tmp14;
1943 tmp15 = MULTIPLY(tmp15, FIX(0.338443458)); /* c11 */
1944 tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */
1945 MULTIPLY(z2, FIX(0.466105296)); /* c1-c7 */
1946 z1 = MULTIPLY(z3 - z2, FIX(0.937797057)); /* c7 */
1947 tmp14 += z1;
1948 tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) - /* c3-c7 */
1949 MULTIPLY(z4, FIX(1.742345811)); /* c1+c11 */
1950
1951 /* Final output stage */
1952
1953 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1954 wsptr[8*12] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1955 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1956 wsptr[8*11] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1957 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
1958 wsptr[8*10] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
1959 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1960 wsptr[8*9] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1961 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1962 wsptr[8*8] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1963 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
1964 wsptr[8*7] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
1965 wsptr[8*6] = (int) RIGHT_SHIFT(tmp26, CONST_BITS-PASS1_BITS);
1966 }
1967
1968 /* Pass 2: process 13 rows from work array, store into output array. */
1969
1970 wsptr = workspace;
1971 for (ctr = 0; ctr < 13; ctr++) {
1972 outptr = output_buf[ctr] + output_col;
1973
1974 /* Even part */
1975
1976 /* Add fudge factor here for final descale. */
1977 z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
1978 z1 <<= CONST_BITS;
1979
1980 z2 = (INT32) wsptr[2];
1981 z3 = (INT32) wsptr[4];
1982 z4 = (INT32) wsptr[6];
1983
1984 tmp10 = z3 + z4;
1985 tmp11 = z3 - z4;
1986
1987 tmp12 = MULTIPLY(tmp10, FIX(1.155388986)); /* (c4+c6)/2 */
1988 tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1; /* (c4-c6)/2 */
1989
1990 tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13; /* c2 */
1991 tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13; /* c10 */
1992
1993 tmp12 = MULTIPLY(tmp10, FIX(0.316450131)); /* (c8-c12)/2 */
1994 tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1; /* (c8+c12)/2 */
1995
1996 tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13; /* c6 */
1997 tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */
1998
1999 tmp12 = MULTIPLY(tmp10, FIX(0.435816023)); /* (c2-c10)/2 */
2000 tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1; /* (c2+c10)/2 */
2001
2002 tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */
2003 tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */
2004
2005 tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1; /* c0 */
2006
2007 /* Odd part */
2008
2009 z1 = (INT32) wsptr[1];
2010 z2 = (INT32) wsptr[3];
2011 z3 = (INT32) wsptr[5];
2012 z4 = (INT32) wsptr[7];
2013
2014 tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651)); /* c3 */
2015 tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945)); /* c5 */
2016 tmp15 = z1 + z4;
2017 tmp13 = MULTIPLY(tmp15, FIX(0.937797057)); /* c7 */
2018 tmp10 = tmp11 + tmp12 + tmp13 -
2019 MULTIPLY(z1, FIX(2.020082300)); /* c7+c5+c3-c1 */
2020 tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458)); /* -c11 */
2021 tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */
2022 tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */
2023 tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945)); /* -c5 */
2024 tmp11 += tmp14;
2025 tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */
2026 tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813)); /* -c9 */
2027 tmp12 += tmp14;
2028 tmp13 += tmp14;
2029 tmp15 = MULTIPLY(tmp15, FIX(0.338443458)); /* c11 */
2030 tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */
2031 MULTIPLY(z2, FIX(0.466105296)); /* c1-c7 */
2032 z1 = MULTIPLY(z3 - z2, FIX(0.937797057)); /* c7 */
2033 tmp14 += z1;
2034 tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) - /* c3-c7 */
2035 MULTIPLY(z4, FIX(1.742345811)); /* c1+c11 */
2036
2037 /* Final output stage */
2038
2039 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
2040 CONST_BITS+PASS1_BITS+3)
2041 & RANGE_MASK];
2042 outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
2043 CONST_BITS+PASS1_BITS+3)
2044 & RANGE_MASK];
2045 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
2046 CONST_BITS+PASS1_BITS+3)
2047 & RANGE_MASK];
2048 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
2049 CONST_BITS+PASS1_BITS+3)
2050 & RANGE_MASK];
2051 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
2052 CONST_BITS+PASS1_BITS+3)
2053 & RANGE_MASK];
2054 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
2055 CONST_BITS+PASS1_BITS+3)
2056 & RANGE_MASK];
2057 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
2058 CONST_BITS+PASS1_BITS+3)
2059 & RANGE_MASK];
2060 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
2061 CONST_BITS+PASS1_BITS+3)
2062 & RANGE_MASK];
2063 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
2064 CONST_BITS+PASS1_BITS+3)
2065 & RANGE_MASK];
2066 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
2067 CONST_BITS+PASS1_BITS+3)
2068 & RANGE_MASK];
2069 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,
2070 CONST_BITS+PASS1_BITS+3)
2071 & RANGE_MASK];
2072 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,
2073 CONST_BITS+PASS1_BITS+3)
2074 & RANGE_MASK];
2075 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26,
2076 CONST_BITS+PASS1_BITS+3)
2077 & RANGE_MASK];
2078
2079 wsptr += 8; /* advance pointer to next row */
2080 }
2081}
2082
2083
2084/*
2085 * Perform dequantization and inverse DCT on one block of coefficients,
2086 * producing a 14x14 output block.
2087 *
2088 * Optimized algorithm with 20 multiplications in the 1-D kernel.
2089 * cK represents sqrt(2) * cos(K*pi/28).
2090 */
2091
2092GLOBAL(void)
2093jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
2094 JCOEFPTR coef_block,
2095 JSAMPARRAY output_buf, JDIMENSION output_col)
2096{
2097 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
2098 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
2099 INT32 z1, z2, z3, z4;
2100 JCOEFPTR inptr;
2101 ISLOW_MULT_TYPE * quantptr;
2102 int * wsptr;
2103 JSAMPROW outptr;
2104 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
2105 int ctr;
2106 int workspace[8*14]; /* buffers data between passes */
2107 SHIFT_TEMPS
2108
2109 /* Pass 1: process columns from input, store into work array. */
2110
2111 inptr = coef_block;
2112 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
2113 wsptr = workspace;
2114 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2115 /* Even part */
2116
2117 z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
2118 z1 <<= CONST_BITS;
2119 /* Add fudge factor here for final descale. */
2120 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
2121 z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
2122 z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
2123 z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */
2124 z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */
2125
2126 tmp10 = z1 + z2;
2127 tmp11 = z1 + z3;
2128 tmp12 = z1 - z4;
2129
2130 tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */
2131 CONST_BITS-PASS1_BITS);
2132
2133 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
2134 z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
2135
2136 z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */
2137
2138 tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */
2139 tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */
2140 tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */
2141 MULTIPLY(z2, FIX(1.378756276)); /* c2 */
2142
2143 tmp20 = tmp10 + tmp13;
2144 tmp26 = tmp10 - tmp13;
2145 tmp21 = tmp11 + tmp14;
2146 tmp25 = tmp11 - tmp14;
2147 tmp22 = tmp12 + tmp15;
2148 tmp24 = tmp12 - tmp15;
2149
2150 /* Odd part */
2151
2152 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
2153 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
2154 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
2155 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
2156 tmp13 = z4 << CONST_BITS;
2157
2158 tmp14 = z1 + z3;
2159 tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */
2160 tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */
2161 tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */
2162 tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */
2163 tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */
2164 z1 -= z2;
2165 tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13; /* c11 */
2166 tmp16 += tmp15;
2167 z1 += z4;
2168 z4 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */
2169 tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */
2170 tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */
2171 z4 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */
2172 tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */
2173 tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */
2174
2175 tmp13 = (z1 - z3) << PASS1_BITS;
2176
2177 /* Final output stage */
2178
2179 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
2180 wsptr[8*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
2181 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
2182 wsptr[8*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
2183 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
2184 wsptr[8*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
2185 wsptr[8*3] = (int) (tmp23 + tmp13);
2186 wsptr[8*10] = (int) (tmp23 - tmp13);
2187 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
2188 wsptr[8*9] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
2189 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
2190 wsptr[8*8] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
2191 wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);
2192 wsptr[8*7] = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);
2193 }
2194
2195 /* Pass 2: process 14 rows from work array, store into output array. */
2196
2197 wsptr = workspace;
2198 for (ctr = 0; ctr < 14; ctr++) {
2199 outptr = output_buf[ctr] + output_col;
2200
2201 /* Even part */
2202
2203 /* Add fudge factor here for final descale. */
2204 z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
2205 z1 <<= CONST_BITS;
2206 z4 = (INT32) wsptr[4];
2207 z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
2208 z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */
2209 z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */
2210
2211 tmp10 = z1 + z2;
2212 tmp11 = z1 + z3;
2213 tmp12 = z1 - z4;
2214
2215 tmp23 = z1 - ((z2 + z3 - z4) << 1); /* c0 = (c4+c12-c8)*2 */
2216
2217 z1 = (INT32) wsptr[2];
2218 z2 = (INT32) wsptr[6];
2219
2220 z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */
2221
2222 tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */
2223 tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */
2224 tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */
2225 MULTIPLY(z2, FIX(1.378756276)); /* c2 */
2226
2227 tmp20 = tmp10 + tmp13;
2228 tmp26 = tmp10 - tmp13;
2229 tmp21 = tmp11 + tmp14;
2230 tmp25 = tmp11 - tmp14;
2231 tmp22 = tmp12 + tmp15;
2232 tmp24 = tmp12 - tmp15;
2233
2234 /* Odd part */
2235
2236 z1 = (INT32) wsptr[1];
2237 z2 = (INT32) wsptr[3];
2238 z3 = (INT32) wsptr[5];
2239 z4 = (INT32) wsptr[7];
2240 z4 <<= CONST_BITS;
2241
2242 tmp14 = z1 + z3;
2243 tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */
2244 tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */
2245 tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */
2246 tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */
2247 tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */
2248 z1 -= z2;
2249 tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4; /* c11 */
2250 tmp16 += tmp15;
2251 tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4; /* -c13 */
2252 tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */
2253 tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */
2254 tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */
2255 tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */
2256 tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */
2257
2258 tmp13 = ((z1 - z3) << CONST_BITS) + z4;
2259
2260 /* Final output stage */
2261
2262 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
2263 CONST_BITS+PASS1_BITS+3)
2264 & RANGE_MASK];
2265 outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
2266 CONST_BITS+PASS1_BITS+3)
2267 & RANGE_MASK];
2268 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
2269 CONST_BITS+PASS1_BITS+3)
2270 & RANGE_MASK];
2271 outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
2272 CONST_BITS+PASS1_BITS+3)
2273 & RANGE_MASK];
2274 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
2275 CONST_BITS+PASS1_BITS+3)
2276 & RANGE_MASK];
2277 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
2278 CONST_BITS+PASS1_BITS+3)
2279 & RANGE_MASK];
2280 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
2281 CONST_BITS+PASS1_BITS+3)
2282 & RANGE_MASK];
2283 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
2284 CONST_BITS+PASS1_BITS+3)
2285 & RANGE_MASK];
2286 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
2287 CONST_BITS+PASS1_BITS+3)
2288 & RANGE_MASK];
2289 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
2290 CONST_BITS+PASS1_BITS+3)
2291 & RANGE_MASK];
2292 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,
2293 CONST_BITS+PASS1_BITS+3)
2294 & RANGE_MASK];
2295 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,
2296 CONST_BITS+PASS1_BITS+3)
2297 & RANGE_MASK];
2298 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,
2299 CONST_BITS+PASS1_BITS+3)
2300 & RANGE_MASK];
2301 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,
2302 CONST_BITS+PASS1_BITS+3)
2303 & RANGE_MASK];
2304
2305 wsptr += 8; /* advance pointer to next row */
2306 }
2307}
2308
2309
2310/*
2311 * Perform dequantization and inverse DCT on one block of coefficients,
2312 * producing a 15x15 output block.
2313 *
2314 * Optimized algorithm with 22 multiplications in the 1-D kernel.
2315 * cK represents sqrt(2) * cos(K*pi/30).
2316 */
2317
2318GLOBAL(void)
2319jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
2320 JCOEFPTR coef_block,
2321 JSAMPARRAY output_buf, JDIMENSION output_col)
2322{
2323 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
2324 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2325 INT32 z1, z2, z3, z4;
2326 JCOEFPTR inptr;
2327 ISLOW_MULT_TYPE * quantptr;
2328 int * wsptr;
2329 JSAMPROW outptr;
2330 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
2331 int ctr;
2332 int workspace[8*15]; /* buffers data between passes */
2333 SHIFT_TEMPS
2334
2335 /* Pass 1: process columns from input, store into work array. */
2336
2337 inptr = coef_block;
2338 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
2339 wsptr = workspace;
2340 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2341 /* Even part */
2342
2343 z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
2344 z1 <<= CONST_BITS;
2345 /* Add fudge factor here for final descale. */
2346 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
2347
2348 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
2349 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
2350 z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
2351
2352 tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */
2353 tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */
2354
2355 tmp12 = z1 - tmp10;
2356 tmp13 = z1 + tmp11;
2357 z1 -= (tmp11 - tmp10) << 1; /* c0 = (c6-c12)*2 */
2358
2359 z4 = z2 - z3;
2360 z3 += z2;
2361 tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */
2362 tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */
2363 z2 = MULTIPLY(z2, FIX(1.439773946)); /* c4+c14 */
2364
2365 tmp20 = tmp13 + tmp10 + tmp11;
2366 tmp23 = tmp12 - tmp10 + tmp11 + z2;
2367
2368 tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */
2369 tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */
2370
2371 tmp25 = tmp13 - tmp10 - tmp11;
2372 tmp26 = tmp12 + tmp10 - tmp11 - z2;
2373
2374 tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */
2375 tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */
2376
2377 tmp21 = tmp12 + tmp10 + tmp11;
2378 tmp24 = tmp13 - tmp10 + tmp11;
2379 tmp11 += tmp11;
2380 tmp22 = z1 + tmp11; /* c10 = c6-c12 */
2381 tmp27 = z1 - tmp11 - tmp11; /* c0 = (c6-c12)*2 */
2382
2383 /* Odd part */
2384
2385 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
2386 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
2387 z4 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
2388 z3 = MULTIPLY(z4, FIX(1.224744871)); /* c5 */
2389 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
2390
2391 tmp13 = z2 - z4;
2392 tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876)); /* c9 */
2393 tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148)); /* c3-c9 */
2394 tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899)); /* c3+c9 */
2395
2396 tmp13 = MULTIPLY(z2, - FIX(0.831253876)); /* -c9 */
2397 tmp15 = MULTIPLY(z2, - FIX(1.344997024)); /* -c3 */
2398 z2 = z1 - z4;
2399 tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353)); /* c1 */
2400
2401 tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */
2402 tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */
2403 tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3; /* c5 */
2404 z2 = MULTIPLY(z1 + z4, FIX(0.575212477)); /* c11 */
2405 tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3; /* c7-c11 */
2406 tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3; /* c11+c13 */
2407
2408 /* Final output stage */
2409
2410 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
2411 wsptr[8*14] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
2412 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
2413 wsptr[8*13] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
2414 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
2415 wsptr[8*12] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
2416 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
2417 wsptr[8*11] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
2418 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
2419 wsptr[8*10] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
2420 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
2421 wsptr[8*9] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
2422 wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);
2423 wsptr[8*8] = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);
2424 wsptr[8*7] = (int) RIGHT_SHIFT(tmp27, CONST_BITS-PASS1_BITS);
2425 }
2426
2427 /* Pass 2: process 15 rows from work array, store into output array. */
2428
2429 wsptr = workspace;
2430 for (ctr = 0; ctr < 15; ctr++) {
2431 outptr = output_buf[ctr] + output_col;
2432
2433 /* Even part */
2434
2435 /* Add fudge factor here for final descale. */
2436 z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
2437 z1 <<= CONST_BITS;
2438
2439 z2 = (INT32) wsptr[2];
2440 z3 = (INT32) wsptr[4];
2441 z4 = (INT32) wsptr[6];
2442
2443 tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */
2444 tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */
2445
2446 tmp12 = z1 - tmp10;
2447 tmp13 = z1 + tmp11;
2448 z1 -= (tmp11 - tmp10) << 1; /* c0 = (c6-c12)*2 */
2449
2450 z4 = z2 - z3;
2451 z3 += z2;
2452 tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */
2453 tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */
2454 z2 = MULTIPLY(z2, FIX(1.439773946)); /* c4+c14 */
2455
2456 tmp20 = tmp13 + tmp10 + tmp11;
2457 tmp23 = tmp12 - tmp10 + tmp11 + z2;
2458
2459 tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */
2460 tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */
2461
2462 tmp25 = tmp13 - tmp10 - tmp11;
2463 tmp26 = tmp12 + tmp10 - tmp11 - z2;
2464
2465 tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */
2466 tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */
2467
2468 tmp21 = tmp12 + tmp10 + tmp11;
2469 tmp24 = tmp13 - tmp10 + tmp11;
2470 tmp11 += tmp11;
2471 tmp22 = z1 + tmp11; /* c10 = c6-c12 */
2472 tmp27 = z1 - tmp11 - tmp11; /* c0 = (c6-c12)*2 */
2473
2474 /* Odd part */
2475
2476 z1 = (INT32) wsptr[1];
2477 z2 = (INT32) wsptr[3];
2478 z4 = (INT32) wsptr[5];
2479 z3 = MULTIPLY(z4, FIX(1.224744871)); /* c5 */
2480 z4 = (INT32) wsptr[7];
2481
2482 tmp13 = z2 - z4;
2483 tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876)); /* c9 */
2484 tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148)); /* c3-c9 */
2485 tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899)); /* c3+c9 */
2486
2487 tmp13 = MULTIPLY(z2, - FIX(0.831253876)); /* -c9 */
2488 tmp15 = MULTIPLY(z2, - FIX(1.344997024)); /* -c3 */
2489 z2 = z1 - z4;
2490 tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353)); /* c1 */
2491
2492 tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */
2493 tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */
2494 tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3; /* c5 */
2495 z2 = MULTIPLY(z1 + z4, FIX(0.575212477)); /* c11 */
2496 tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3; /* c7-c11 */
2497 tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3; /* c11+c13 */
2498
2499 /* Final output stage */
2500
2501 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
2502 CONST_BITS+PASS1_BITS+3)
2503 & RANGE_MASK];
2504 outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
2505 CONST_BITS+PASS1_BITS+3)
2506 & RANGE_MASK];
2507 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
2508 CONST_BITS+PASS1_BITS+3)
2509 & RANGE_MASK];
2510 outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
2511 CONST_BITS+PASS1_BITS+3)
2512 & RANGE_MASK];
2513 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
2514 CONST_BITS+PASS1_BITS+3)
2515 & RANGE_MASK];
2516 outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
2517 CONST_BITS+PASS1_BITS+3)
2518 & RANGE_MASK];
2519 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
2520 CONST_BITS+PASS1_BITS+3)
2521 & RANGE_MASK];
2522 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
2523 CONST_BITS+PASS1_BITS+3)
2524 & RANGE_MASK];
2525 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
2526 CONST_BITS+PASS1_BITS+3)
2527 & RANGE_MASK];
2528 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
2529 CONST_BITS+PASS1_BITS+3)
2530 & RANGE_MASK];
2531 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,
2532 CONST_BITS+PASS1_BITS+3)
2533 & RANGE_MASK];
2534 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,
2535 CONST_BITS+PASS1_BITS+3)
2536 & RANGE_MASK];
2537 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,
2538 CONST_BITS+PASS1_BITS+3)
2539 & RANGE_MASK];
2540 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,
2541 CONST_BITS+PASS1_BITS+3)
2542 & RANGE_MASK];
2543 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp27,
2544 CONST_BITS+PASS1_BITS+3)
2545 & RANGE_MASK];
2546
2547 wsptr += 8; /* advance pointer to next row */
2548 }
2549}
2550
2551
2552/*
2553 * Perform dequantization and inverse DCT on one block of coefficients,
2554 * producing a 16x16 output block.
2555 *
2556 * Optimized algorithm with 28 multiplications in the 1-D kernel.
2557 * cK represents sqrt(2) * cos(K*pi/32).
2558 */
2559
2560GLOBAL(void)
2561jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
2562 JCOEFPTR coef_block,
2563 JSAMPARRAY output_buf, JDIMENSION output_col)
2564{
2565 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
2566 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2567 INT32 z1, z2, z3, z4;
2568 JCOEFPTR inptr;
2569 ISLOW_MULT_TYPE * quantptr;
2570 int * wsptr;
2571 JSAMPROW outptr;
2572 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
2573 int ctr;
2574 int workspace[8*16]; /* buffers data between passes */
2575 SHIFT_TEMPS
2576
2577 /* Pass 1: process columns from input, store into work array. */
2578
2579 inptr = coef_block;
2580 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
2581 wsptr = workspace;
2582 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2583 /* Even part */
2584
2585 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
2586 tmp0 <<= CONST_BITS;
2587 /* Add fudge factor here for final descale. */
2588 tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);
2589
2590 z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
2591 tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
2592 tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */
2593
2594 tmp10 = tmp0 + tmp1;
2595 tmp11 = tmp0 - tmp1;
2596 tmp12 = tmp0 + tmp2;
2597 tmp13 = tmp0 - tmp2;
2598
2599 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
2600 z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
2601 z3 = z1 - z2;
2602 z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */
2603 z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */
2604
2605 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */
2606 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */
2607 tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */
2608 tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */
2609
2610 tmp20 = tmp10 + tmp0;
2611 tmp27 = tmp10 - tmp0;
2612 tmp21 = tmp12 + tmp1;
2613 tmp26 = tmp12 - tmp1;
2614 tmp22 = tmp13 + tmp2;
2615 tmp25 = tmp13 - tmp2;
2616 tmp23 = tmp11 + tmp3;
2617 tmp24 = tmp11 - tmp3;
2618
2619 /* Odd part */
2620
2621 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
2622 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
2623 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
2624 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
2625
2626 tmp11 = z1 + z3;
2627
2628 tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */
2629 tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */
2630 tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */
2631 tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */
2632 tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */
2633 tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */
2634 tmp0 = tmp1 + tmp2 + tmp3 -
2635 MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */
2636 tmp13 = tmp10 + tmp11 + tmp12 -
2637 MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */
2638 z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */
2639 tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */
2640 tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */
2641 z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */
2642 tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */
2643 tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */
2644 z2 += z4;
2645 z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */
2646 tmp1 += z1;
2647 tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */
2648 z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */
2649 tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */
2650 tmp12 += z2;
2651 z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */
2652 tmp2 += z2;
2653 tmp3 += z2;
2654 z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */
2655 tmp10 += z2;
2656 tmp11 += z2;
2657
2658 /* Final output stage */
2659
2660 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp0, CONST_BITS-PASS1_BITS);
2661 wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0, CONST_BITS-PASS1_BITS);
2662 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp1, CONST_BITS-PASS1_BITS);
2663 wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1, CONST_BITS-PASS1_BITS);
2664 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp2, CONST_BITS-PASS1_BITS);
2665 wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2, CONST_BITS-PASS1_BITS);
2666 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp3, CONST_BITS-PASS1_BITS);
2667 wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3, CONST_BITS-PASS1_BITS);
2668 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);
2669 wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);
2670 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);
2671 wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);
2672 wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);
2673 wsptr[8*9] = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);
2674 wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);
2675 wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);
2676 }
2677
2678 /* Pass 2: process 16 rows from work array, store into output array. */
2679
2680 wsptr = workspace;
2681 for (ctr = 0; ctr < 16; ctr++) {
2682 outptr = output_buf[ctr] + output_col;
2683
2684 /* Even part */
2685
2686 /* Add fudge factor here for final descale. */
2687 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
2688 tmp0 <<= CONST_BITS;
2689
2690 z1 = (INT32) wsptr[4];
2691 tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
2692 tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */
2693
2694 tmp10 = tmp0 + tmp1;
2695 tmp11 = tmp0 - tmp1;
2696 tmp12 = tmp0 + tmp2;
2697 tmp13 = tmp0 - tmp2;
2698
2699 z1 = (INT32) wsptr[2];
2700 z2 = (INT32) wsptr[6];
2701 z3 = z1 - z2;
2702 z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */
2703 z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */
2704
2705 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */
2706 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */
2707 tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */
2708 tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */
2709
2710 tmp20 = tmp10 + tmp0;
2711 tmp27 = tmp10 - tmp0;
2712 tmp21 = tmp12 + tmp1;
2713 tmp26 = tmp12 - tmp1;
2714 tmp22 = tmp13 + tmp2;
2715 tmp25 = tmp13 - tmp2;
2716 tmp23 = tmp11 + tmp3;
2717 tmp24 = tmp11 - tmp3;
2718
2719 /* Odd part */
2720
2721 z1 = (INT32) wsptr[1];
2722 z2 = (INT32) wsptr[3];
2723 z3 = (INT32) wsptr[5];
2724 z4 = (INT32) wsptr[7];
2725
2726 tmp11 = z1 + z3;
2727
2728 tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */
2729 tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */
2730 tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */
2731 tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */
2732 tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */
2733 tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */
2734 tmp0 = tmp1 + tmp2 + tmp3 -
2735 MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */
2736 tmp13 = tmp10 + tmp11 + tmp12 -
2737 MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */
2738 z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */
2739 tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */
2740 tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */
2741 z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */
2742 tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */
2743 tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */
2744 z2 += z4;
2745 z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */
2746 tmp1 += z1;
2747 tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */
2748 z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */
2749 tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */
2750 tmp12 += z2;
2751 z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */
2752 tmp2 += z2;
2753 tmp3 += z2;
2754 z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */
2755 tmp10 += z2;
2756 tmp11 += z2;
2757
2758 /* Final output stage */
2759
2760 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0,
2761 CONST_BITS+PASS1_BITS+3)
2762 & RANGE_MASK];
2763 outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0,
2764 CONST_BITS+PASS1_BITS+3)
2765 & RANGE_MASK];
2766 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1,
2767 CONST_BITS+PASS1_BITS+3)
2768 & RANGE_MASK];
2769 outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1,
2770 CONST_BITS+PASS1_BITS+3)
2771 & RANGE_MASK];
2772 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2,
2773 CONST_BITS+PASS1_BITS+3)
2774 & RANGE_MASK];
2775 outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2,
2776 CONST_BITS+PASS1_BITS+3)
2777 & RANGE_MASK];
2778 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3,
2779 CONST_BITS+PASS1_BITS+3)
2780 & RANGE_MASK];
2781 outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3,
2782 CONST_BITS+PASS1_BITS+3)
2783 & RANGE_MASK];
2784 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10,
2785 CONST_BITS+PASS1_BITS+3)
2786 & RANGE_MASK];
2787 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10,
2788 CONST_BITS+PASS1_BITS+3)
2789 & RANGE_MASK];
2790 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11,
2791 CONST_BITS+PASS1_BITS+3)
2792 & RANGE_MASK];
2793 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11,
2794 CONST_BITS+PASS1_BITS+3)
2795 & RANGE_MASK];
2796 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12,
2797 CONST_BITS+PASS1_BITS+3)
2798 & RANGE_MASK];
2799 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12,
2800 CONST_BITS+PASS1_BITS+3)
2801 & RANGE_MASK];
2802 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13,
2803 CONST_BITS+PASS1_BITS+3)
2804 & RANGE_MASK];
2805 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13,
2806 CONST_BITS+PASS1_BITS+3)
2807 & RANGE_MASK];
2808
2809 wsptr += 8; /* advance pointer to next row */
2810 }
2811}
2812
2813
2814/*
2815 * Perform dequantization and inverse DCT on one block of coefficients,
2816 * producing a 16x8 output block.
2817 *
2818 * 8-point IDCT in pass 1 (columns), 16-point in pass 2 (rows).
2819 */
2820
2821GLOBAL(void)
2822jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
2823 JCOEFPTR coef_block,
2824 JSAMPARRAY output_buf, JDIMENSION output_col)
2825{
2826 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
2827 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2828 INT32 z1, z2, z3, z4;
2829 JCOEFPTR inptr;
2830 ISLOW_MULT_TYPE * quantptr;
2831 int * wsptr;
2832 JSAMPROW outptr;
2833 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
2834 int ctr;
2835 int workspace[8*8]; /* buffers data between passes */
2836 SHIFT_TEMPS
2837
2838 /* Pass 1: process columns from input, store into work array. */
2839 /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
2840 /* furthermore, we scale the results by 2**PASS1_BITS. */
2841
2842 inptr = coef_block;
2843 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
2844 wsptr = workspace;
2845 for (ctr = DCTSIZE; ctr > 0; ctr--) {
2846 /* Due to quantization, we will usually find that many of the input
2847 * coefficients are zero, especially the AC terms. We can exploit this
2848 * by short-circuiting the IDCT calculation for any column in which all
2849 * the AC terms are zero. In that case each output is equal to the
2850 * DC coefficient (with scale factor as needed).
2851 * With typical images and quantization tables, half or more of the
2852 * column DCT calculations can be simplified this way.
2853 */
2854
2855 if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
2856 inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
2857 inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
2858 inptr[DCTSIZE*7] == 0) {
2859 /* AC terms all zero */
2860 int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
2861
2862 wsptr[DCTSIZE*0] = dcval;
2863 wsptr[DCTSIZE*1] = dcval;
2864 wsptr[DCTSIZE*2] = dcval;
2865 wsptr[DCTSIZE*3] = dcval;
2866 wsptr[DCTSIZE*4] = dcval;
2867 wsptr[DCTSIZE*5] = dcval;
2868 wsptr[DCTSIZE*6] = dcval;
2869 wsptr[DCTSIZE*7] = dcval;
2870
2871 inptr++; /* advance pointers to next column */
2872 quantptr++;
2873 wsptr++;
2874 continue;
2875 }
2876
2877 /* Even part: reverse the even part of the forward DCT. */
2878 /* The rotator is sqrt(2)*c(-6). */
2879
2880 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
2881 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
2882
2883 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
2884 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
2885 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
2886
2887 z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
2888 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
2889 z2 <<= CONST_BITS;
2890 z3 <<= CONST_BITS;
2891 /* Add fudge factor here for final descale. */
2892 z2 += ONE << (CONST_BITS-PASS1_BITS-1);
2893
2894 tmp0 = z2 + z3;
2895 tmp1 = z2 - z3;
2896
2897 tmp10 = tmp0 + tmp2;
2898 tmp13 = tmp0 - tmp2;
2899 tmp11 = tmp1 + tmp3;
2900 tmp12 = tmp1 - tmp3;
2901
2902 /* Odd part per figure 8; the matrix is unitary and hence its
2903 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
2904 */
2905
2906 tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
2907 tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
2908 tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
2909 tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
2910
2911 z2 = tmp0 + tmp2;
2912 z3 = tmp1 + tmp3;
2913
2914 z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */
2915 z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
2916 z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
2917 z2 += z1;
2918 z3 += z1;
2919
2920 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
2921 tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
2922 tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
2923 tmp0 += z1 + z2;
2924 tmp3 += z1 + z3;
2925
2926 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
2927 tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
2928 tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
2929 tmp1 += z1 + z3;
2930 tmp2 += z1 + z2;
2931
2932 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
2933
2934 wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
2935 wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
2936 wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
2937 wsptr[DCTSIZE*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
2938 wsptr[DCTSIZE*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
2939 wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
2940 wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
2941 wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
2942
2943 inptr++; /* advance pointers to next column */
2944 quantptr++;
2945 wsptr++;
2946 }
2947
2948 /* Pass 2: process 8 rows from work array, store into output array.
2949 * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32).
2950 */
2951 wsptr = workspace;
2952 for (ctr = 0; ctr < 8; ctr++) {
2953 outptr = output_buf[ctr] + output_col;
2954
2955 /* Even part */
2956
2957 /* Add fudge factor here for final descale. */
2958 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
2959 tmp0 <<= CONST_BITS;
2960
2961 z1 = (INT32) wsptr[4];
2962 tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
2963 tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */
2964
2965 tmp10 = tmp0 + tmp1;
2966 tmp11 = tmp0 - tmp1;
2967 tmp12 = tmp0 + tmp2;
2968 tmp13 = tmp0 - tmp2;
2969
2970 z1 = (INT32) wsptr[2];
2971 z2 = (INT32) wsptr[6];
2972 z3 = z1 - z2;
2973 z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */
2974 z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */
2975
2976 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */
2977 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */
2978 tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */
2979 tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */
2980
2981 tmp20 = tmp10 + tmp0;
2982 tmp27 = tmp10 - tmp0;
2983 tmp21 = tmp12 + tmp1;
2984 tmp26 = tmp12 - tmp1;
2985 tmp22 = tmp13 + tmp2;
2986 tmp25 = tmp13 - tmp2;
2987 tmp23 = tmp11 + tmp3;
2988 tmp24 = tmp11 - tmp3;
2989
2990 /* Odd part */
2991
2992 z1 = (INT32) wsptr[1];
2993 z2 = (INT32) wsptr[3];
2994 z3 = (INT32) wsptr[5];
2995 z4 = (INT32) wsptr[7];
2996
2997 tmp11 = z1 + z3;
2998
2999 tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */
3000 tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */
3001 tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */
3002 tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */
3003 tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */
3004 tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */
3005 tmp0 = tmp1 + tmp2 + tmp3 -
3006 MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */
3007 tmp13 = tmp10 + tmp11 + tmp12 -
3008 MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */
3009 z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */
3010 tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */
3011 tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */
3012 z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */
3013 tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */
3014 tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */
3015 z2 += z4;
3016 z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */
3017 tmp1 += z1;
3018 tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */
3019 z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */
3020 tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */
3021 tmp12 += z2;
3022 z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */
3023 tmp2 += z2;
3024 tmp3 += z2;
3025 z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */
3026 tmp10 += z2;
3027 tmp11 += z2;
3028
3029 /* Final output stage */
3030
3031 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0,
3032 CONST_BITS+PASS1_BITS+3)
3033 & RANGE_MASK];
3034 outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0,
3035 CONST_BITS+PASS1_BITS+3)
3036 & RANGE_MASK];
3037 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1,
3038 CONST_BITS+PASS1_BITS+3)
3039 & RANGE_MASK];
3040 outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1,
3041 CONST_BITS+PASS1_BITS+3)
3042 & RANGE_MASK];
3043 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2,
3044 CONST_BITS+PASS1_BITS+3)
3045 & RANGE_MASK];
3046 outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2,
3047 CONST_BITS+PASS1_BITS+3)
3048 & RANGE_MASK];
3049 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3,
3050 CONST_BITS+PASS1_BITS+3)
3051 & RANGE_MASK];
3052 outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3,
3053 CONST_BITS+PASS1_BITS+3)
3054 & RANGE_MASK];
3055 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10,
3056 CONST_BITS+PASS1_BITS+3)
3057 & RANGE_MASK];
3058 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10,
3059 CONST_BITS+PASS1_BITS+3)
3060 & RANGE_MASK];
3061 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11,
3062 CONST_BITS+PASS1_BITS+3)
3063 & RANGE_MASK];
3064 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11,
3065 CONST_BITS+PASS1_BITS+3)
3066 & RANGE_MASK];
3067 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12,
3068 CONST_BITS+PASS1_BITS+3)
3069 & RANGE_MASK];
3070 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12,
3071 CONST_BITS+PASS1_BITS+3)
3072 & RANGE_MASK];
3073 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13,
3074 CONST_BITS+PASS1_BITS+3)
3075 & RANGE_MASK];
3076 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13,
3077 CONST_BITS+PASS1_BITS+3)
3078 & RANGE_MASK];
3079
3080 wsptr += 8; /* advance pointer to next row */
3081 }
3082}
3083
3084
3085/*
3086 * Perform dequantization and inverse DCT on one block of coefficients,
3087 * producing a 14x7 output block.
3088 *
3089 * 7-point IDCT in pass 1 (columns), 14-point in pass 2 (rows).
3090 */
3091
3092GLOBAL(void)
3093jpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3094 JCOEFPTR coef_block,
3095 JSAMPARRAY output_buf, JDIMENSION output_col)
3096{
3097 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
3098 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
3099 INT32 z1, z2, z3, z4;
3100 JCOEFPTR inptr;
3101 ISLOW_MULT_TYPE * quantptr;
3102 int * wsptr;
3103 JSAMPROW outptr;
3104 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3105 int ctr;
3106 int workspace[8*7]; /* buffers data between passes */
3107 SHIFT_TEMPS
3108
3109 /* Pass 1: process columns from input, store into work array.
3110 * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14).
3111 */
3112 inptr = coef_block;
3113 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3114 wsptr = workspace;
3115 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3116 /* Even part */
3117
3118 tmp23 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
3119 tmp23 <<= CONST_BITS;
3120 /* Add fudge factor here for final descale. */
3121 tmp23 += ONE << (CONST_BITS-PASS1_BITS-1);
3122
3123 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
3124 z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
3125 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
3126
3127 tmp20 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */
3128 tmp22 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */
3129 tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */
3130 tmp10 = z1 + z3;
3131 z2 -= tmp10;
3132 tmp10 = MULTIPLY(tmp10, FIX(1.274162392)) + tmp23; /* c2 */
3133 tmp20 += tmp10 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */
3134 tmp22 += tmp10 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */
3135 tmp23 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */
3136
3137 /* Odd part */
3138
3139 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
3140 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
3141 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
3142
3143 tmp11 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */
3144 tmp12 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */
3145 tmp10 = tmp11 - tmp12;
3146 tmp11 += tmp12;
3147 tmp12 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */
3148 tmp11 += tmp12;
3149 z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */
3150 tmp10 += z2;
3151 tmp12 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */
3152
3153 /* Final output stage */
3154
3155 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
3156 wsptr[8*6] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
3157 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
3158 wsptr[8*5] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
3159 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
3160 wsptr[8*4] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
3161 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23, CONST_BITS-PASS1_BITS);
3162 }
3163
3164 /* Pass 2: process 7 rows from work array, store into output array.
3165 * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28).
3166 */
3167 wsptr = workspace;
3168 for (ctr = 0; ctr < 7; ctr++) {
3169 outptr = output_buf[ctr] + output_col;
3170
3171 /* Even part */
3172
3173 /* Add fudge factor here for final descale. */
3174 z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
3175 z1 <<= CONST_BITS;
3176 z4 = (INT32) wsptr[4];
3177 z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
3178 z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */
3179 z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */
3180
3181 tmp10 = z1 + z2;
3182 tmp11 = z1 + z3;
3183 tmp12 = z1 - z4;
3184
3185 tmp23 = z1 - ((z2 + z3 - z4) << 1); /* c0 = (c4+c12-c8)*2 */
3186
3187 z1 = (INT32) wsptr[2];
3188 z2 = (INT32) wsptr[6];
3189
3190 z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */
3191
3192 tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */
3193 tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */
3194 tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */
3195 MULTIPLY(z2, FIX(1.378756276)); /* c2 */
3196
3197 tmp20 = tmp10 + tmp13;
3198 tmp26 = tmp10 - tmp13;
3199 tmp21 = tmp11 + tmp14;
3200 tmp25 = tmp11 - tmp14;
3201 tmp22 = tmp12 + tmp15;
3202 tmp24 = tmp12 - tmp15;
3203
3204 /* Odd part */
3205
3206 z1 = (INT32) wsptr[1];
3207 z2 = (INT32) wsptr[3];
3208 z3 = (INT32) wsptr[5];
3209 z4 = (INT32) wsptr[7];
3210 z4 <<= CONST_BITS;
3211
3212 tmp14 = z1 + z3;
3213 tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */
3214 tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */
3215 tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */
3216 tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */
3217 tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */
3218 z1 -= z2;
3219 tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4; /* c11 */
3220 tmp16 += tmp15;
3221 tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4; /* -c13 */
3222 tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */
3223 tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */
3224 tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */
3225 tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */
3226 tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */
3227
3228 tmp13 = ((z1 - z3) << CONST_BITS) + z4;
3229
3230 /* Final output stage */
3231
3232 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
3233 CONST_BITS+PASS1_BITS+3)
3234 & RANGE_MASK];
3235 outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
3236 CONST_BITS+PASS1_BITS+3)
3237 & RANGE_MASK];
3238 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
3239 CONST_BITS+PASS1_BITS+3)
3240 & RANGE_MASK];
3241 outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
3242 CONST_BITS+PASS1_BITS+3)
3243 & RANGE_MASK];
3244 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
3245 CONST_BITS+PASS1_BITS+3)
3246 & RANGE_MASK];
3247 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
3248 CONST_BITS+PASS1_BITS+3)
3249 & RANGE_MASK];
3250 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
3251 CONST_BITS+PASS1_BITS+3)
3252 & RANGE_MASK];
3253 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
3254 CONST_BITS+PASS1_BITS+3)
3255 & RANGE_MASK];
3256 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
3257 CONST_BITS+PASS1_BITS+3)
3258 & RANGE_MASK];
3259 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
3260 CONST_BITS+PASS1_BITS+3)
3261 & RANGE_MASK];
3262 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,
3263 CONST_BITS+PASS1_BITS+3)
3264 & RANGE_MASK];
3265 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,
3266 CONST_BITS+PASS1_BITS+3)
3267 & RANGE_MASK];
3268 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,
3269 CONST_BITS+PASS1_BITS+3)
3270 & RANGE_MASK];
3271 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,
3272 CONST_BITS+PASS1_BITS+3)
3273 & RANGE_MASK];
3274
3275 wsptr += 8; /* advance pointer to next row */
3276 }
3277}
3278
3279
3280/*
3281 * Perform dequantization and inverse DCT on one block of coefficients,
3282 * producing a 12x6 output block.
3283 *
3284 * 6-point IDCT in pass 1 (columns), 12-point in pass 2 (rows).
3285 */
3286
3287GLOBAL(void)
3288jpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3289 JCOEFPTR coef_block,
3290 JSAMPARRAY output_buf, JDIMENSION output_col)
3291{
3292 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
3293 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
3294 INT32 z1, z2, z3, z4;
3295 JCOEFPTR inptr;
3296 ISLOW_MULT_TYPE * quantptr;
3297 int * wsptr;
3298 JSAMPROW outptr;
3299 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3300 int ctr;
3301 int workspace[8*6]; /* buffers data between passes */
3302 SHIFT_TEMPS
3303
3304 /* Pass 1: process columns from input, store into work array.
3305 * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).
3306 */
3307 inptr = coef_block;
3308 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3309 wsptr = workspace;
3310 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3311 /* Even part */
3312
3313 tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
3314 tmp10 <<= CONST_BITS;
3315 /* Add fudge factor here for final descale. */
3316 tmp10 += ONE << (CONST_BITS-PASS1_BITS-1);
3317 tmp12 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
3318 tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */
3319 tmp11 = tmp10 + tmp20;
3320 tmp21 = RIGHT_SHIFT(tmp10 - tmp20 - tmp20, CONST_BITS-PASS1_BITS);
3321 tmp20 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
3322 tmp10 = MULTIPLY(tmp20, FIX(1.224744871)); /* c2 */
3323 tmp20 = tmp11 + tmp10;
3324 tmp22 = tmp11 - tmp10;
3325
3326 /* Odd part */
3327
3328 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
3329 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
3330 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
3331 tmp11 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
3332 tmp10 = tmp11 + ((z1 + z2) << CONST_BITS);
3333 tmp12 = tmp11 + ((z3 - z2) << CONST_BITS);
3334 tmp11 = (z1 - z2 - z3) << PASS1_BITS;
3335
3336 /* Final output stage */
3337
3338 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
3339 wsptr[8*5] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
3340 wsptr[8*1] = (int) (tmp21 + tmp11);
3341 wsptr[8*4] = (int) (tmp21 - tmp11);
3342 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
3343 wsptr[8*3] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
3344 }
3345
3346 /* Pass 2: process 6 rows from work array, store into output array.
3347 * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24).
3348 */
3349 wsptr = workspace;
3350 for (ctr = 0; ctr < 6; ctr++) {
3351 outptr = output_buf[ctr] + output_col;
3352
3353 /* Even part */
3354
3355 /* Add fudge factor here for final descale. */
3356 z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
3357 z3 <<= CONST_BITS;
3358
3359 z4 = (INT32) wsptr[4];
3360 z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */
3361
3362 tmp10 = z3 + z4;
3363 tmp11 = z3 - z4;
3364
3365 z1 = (INT32) wsptr[2];
3366 z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */
3367 z1 <<= CONST_BITS;
3368 z2 = (INT32) wsptr[6];
3369 z2 <<= CONST_BITS;
3370
3371 tmp12 = z1 - z2;
3372
3373 tmp21 = z3 + tmp12;
3374 tmp24 = z3 - tmp12;
3375
3376 tmp12 = z4 + z2;
3377
3378 tmp20 = tmp10 + tmp12;
3379 tmp25 = tmp10 - tmp12;
3380
3381 tmp12 = z4 - z1 - z2;
3382
3383 tmp22 = tmp11 + tmp12;
3384 tmp23 = tmp11 - tmp12;
3385
3386 /* Odd part */
3387
3388 z1 = (INT32) wsptr[1];
3389 z2 = (INT32) wsptr[3];
3390 z3 = (INT32) wsptr[5];
3391 z4 = (INT32) wsptr[7];
3392
3393 tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */
3394 tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */
3395
3396 tmp10 = z1 + z3;
3397 tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */
3398 tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */
3399 tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */
3400 tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */
3401 tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */
3402 tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */
3403 tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */
3404 MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */
3405
3406 z1 -= z4;
3407 z2 -= z3;
3408 z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */
3409 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */
3410 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */
3411
3412 /* Final output stage */
3413
3414 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
3415 CONST_BITS+PASS1_BITS+3)
3416 & RANGE_MASK];
3417 outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
3418 CONST_BITS+PASS1_BITS+3)
3419 & RANGE_MASK];
3420 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
3421 CONST_BITS+PASS1_BITS+3)
3422 & RANGE_MASK];
3423 outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
3424 CONST_BITS+PASS1_BITS+3)
3425 & RANGE_MASK];
3426 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
3427 CONST_BITS+PASS1_BITS+3)
3428 & RANGE_MASK];
3429 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
3430 CONST_BITS+PASS1_BITS+3)
3431 & RANGE_MASK];
3432 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
3433 CONST_BITS+PASS1_BITS+3)
3434 & RANGE_MASK];
3435 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
3436 CONST_BITS+PASS1_BITS+3)
3437 & RANGE_MASK];
3438 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
3439 CONST_BITS+PASS1_BITS+3)
3440 & RANGE_MASK];
3441 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
3442 CONST_BITS+PASS1_BITS+3)
3443 & RANGE_MASK];
3444 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,
3445 CONST_BITS+PASS1_BITS+3)
3446 & RANGE_MASK];
3447 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,
3448 CONST_BITS+PASS1_BITS+3)
3449 & RANGE_MASK];
3450
3451 wsptr += 8; /* advance pointer to next row */
3452 }
3453}
3454
3455
3456/*
3457 * Perform dequantization and inverse DCT on one block of coefficients,
3458 * producing a 10x5 output block.
3459 *
3460 * 5-point IDCT in pass 1 (columns), 10-point in pass 2 (rows).
3461 */
3462
3463GLOBAL(void)
3464jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3465 JCOEFPTR coef_block,
3466 JSAMPARRAY output_buf, JDIMENSION output_col)
3467{
3468 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
3469 INT32 tmp20, tmp21, tmp22, tmp23, tmp24;
3470 INT32 z1, z2, z3, z4;
3471 JCOEFPTR inptr;
3472 ISLOW_MULT_TYPE * quantptr;
3473 int * wsptr;
3474 JSAMPROW outptr;
3475 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3476 int ctr;
3477 int workspace[8*5]; /* buffers data between passes */
3478 SHIFT_TEMPS
3479
3480 /* Pass 1: process columns from input, store into work array.
3481 * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10).
3482 */
3483 inptr = coef_block;
3484 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3485 wsptr = workspace;
3486 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3487 /* Even part */
3488
3489 tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
3490 tmp12 <<= CONST_BITS;
3491 /* Add fudge factor here for final descale. */
3492 tmp12 += ONE << (CONST_BITS-PASS1_BITS-1);
3493 tmp13 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
3494 tmp14 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
3495 z1 = MULTIPLY(tmp13 + tmp14, FIX(0.790569415)); /* (c2+c4)/2 */
3496 z2 = MULTIPLY(tmp13 - tmp14, FIX(0.353553391)); /* (c2-c4)/2 */
3497 z3 = tmp12 + z2;
3498 tmp10 = z3 + z1;
3499 tmp11 = z3 - z1;
3500 tmp12 -= z2 << 2;
3501
3502 /* Odd part */
3503
3504 z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
3505 z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
3506
3507 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */
3508 tmp13 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */
3509 tmp14 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */
3510
3511 /* Final output stage */
3512
3513 wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp13, CONST_BITS-PASS1_BITS);
3514 wsptr[8*4] = (int) RIGHT_SHIFT(tmp10 - tmp13, CONST_BITS-PASS1_BITS);
3515 wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp14, CONST_BITS-PASS1_BITS);
3516 wsptr[8*3] = (int) RIGHT_SHIFT(tmp11 - tmp14, CONST_BITS-PASS1_BITS);
3517 wsptr[8*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS);
3518 }
3519
3520 /* Pass 2: process 5 rows from work array, store into output array.
3521 * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20).
3522 */
3523 wsptr = workspace;
3524 for (ctr = 0; ctr < 5; ctr++) {
3525 outptr = output_buf[ctr] + output_col;
3526
3527 /* Even part */
3528
3529 /* Add fudge factor here for final descale. */
3530 z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
3531 z3 <<= CONST_BITS;
3532 z4 = (INT32) wsptr[4];
3533 z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
3534 z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */
3535 tmp10 = z3 + z1;
3536 tmp11 = z3 - z2;
3537
3538 tmp22 = z3 - ((z1 - z2) << 1); /* c0 = (c4-c8)*2 */
3539
3540 z2 = (INT32) wsptr[2];
3541 z3 = (INT32) wsptr[6];
3542
3543 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */
3544 tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
3545 tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
3546
3547 tmp20 = tmp10 + tmp12;
3548 tmp24 = tmp10 - tmp12;
3549 tmp21 = tmp11 + tmp13;
3550 tmp23 = tmp11 - tmp13;
3551
3552 /* Odd part */
3553
3554 z1 = (INT32) wsptr[1];
3555 z2 = (INT32) wsptr[3];
3556 z3 = (INT32) wsptr[5];
3557 z3 <<= CONST_BITS;
3558 z4 = (INT32) wsptr[7];
3559
3560 tmp11 = z2 + z4;
3561 tmp13 = z2 - z4;
3562
3563 tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */
3564
3565 z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */
3566 z4 = z3 + tmp12;
3567
3568 tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
3569 tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
3570
3571 z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */
3572 z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));
3573
3574 tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;
3575
3576 tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
3577 tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
3578
3579 /* Final output stage */
3580
3581 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
3582 CONST_BITS+PASS1_BITS+3)
3583 & RANGE_MASK];
3584 outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
3585 CONST_BITS+PASS1_BITS+3)
3586 & RANGE_MASK];
3587 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
3588 CONST_BITS+PASS1_BITS+3)
3589 & RANGE_MASK];
3590 outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
3591 CONST_BITS+PASS1_BITS+3)
3592 & RANGE_MASK];
3593 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
3594 CONST_BITS+PASS1_BITS+3)
3595 & RANGE_MASK];
3596 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
3597 CONST_BITS+PASS1_BITS+3)
3598 & RANGE_MASK];
3599 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,
3600 CONST_BITS+PASS1_BITS+3)
3601 & RANGE_MASK];
3602 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,
3603 CONST_BITS+PASS1_BITS+3)
3604 & RANGE_MASK];
3605 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,
3606 CONST_BITS+PASS1_BITS+3)
3607 & RANGE_MASK];
3608 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,
3609 CONST_BITS+PASS1_BITS+3)
3610 & RANGE_MASK];
3611
3612 wsptr += 8; /* advance pointer to next row */
3613 }
3614}
3615
3616
3617/*
3618 * Perform dequantization and inverse DCT on one block of coefficients,
3619 * producing a 8x4 output block.
3620 *
3621 * 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
3622 */
3623
3624GLOBAL(void)
3625jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3626 JCOEFPTR coef_block,
3627 JSAMPARRAY output_buf, JDIMENSION output_col)
3628{
3629 INT32 tmp0, tmp1, tmp2, tmp3;
3630 INT32 tmp10, tmp11, tmp12, tmp13;
3631 INT32 z1, z2, z3;
3632 JCOEFPTR inptr;
3633 ISLOW_MULT_TYPE * quantptr;
3634 int * wsptr;
3635 JSAMPROW outptr;
3636 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3637 int ctr;
3638 int workspace[8*4]; /* buffers data between passes */
3639 SHIFT_TEMPS
3640
3641 /* Pass 1: process columns from input, store into work array.
3642 * 4-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
3643 */
3644 inptr = coef_block;
3645 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3646 wsptr = workspace;
3647 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3648 /* Even part */
3649
3650 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
3651 tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
3652
3653 tmp10 = (tmp0 + tmp2) << PASS1_BITS;
3654 tmp12 = (tmp0 - tmp2) << PASS1_BITS;
3655
3656 /* Odd part */
3657 /* Same rotation as in the even part of the 8x8 LL&M IDCT */
3658
3659 z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
3660 z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
3661
3662 z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
3663 /* Add fudge factor here for final descale. */
3664 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
3665 tmp0 = RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865), /* c2-c6 */
3666 CONST_BITS-PASS1_BITS);
3667 tmp2 = RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065), /* c2+c6 */
3668 CONST_BITS-PASS1_BITS);
3669
3670 /* Final output stage */
3671
3672 wsptr[8*0] = (int) (tmp10 + tmp0);
3673 wsptr[8*3] = (int) (tmp10 - tmp0);
3674 wsptr[8*1] = (int) (tmp12 + tmp2);
3675 wsptr[8*2] = (int) (tmp12 - tmp2);
3676 }
3677
3678 /* Pass 2: process rows from work array, store into output array. */
3679 /* Note that we must descale the results by a factor of 8 == 2**3, */
3680 /* and also undo the PASS1_BITS scaling. */
3681
3682 wsptr = workspace;
3683 for (ctr = 0; ctr < 4; ctr++) {
3684 outptr = output_buf[ctr] + output_col;
3685
3686 /* Even part: reverse the even part of the forward DCT. */
3687 /* The rotator is sqrt(2)*c(-6). */
3688
3689 z2 = (INT32) wsptr[2];
3690 z3 = (INT32) wsptr[6];
3691
3692 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
3693 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
3694 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
3695
3696 /* Add fudge factor here for final descale. */
3697 z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
3698 z3 = (INT32) wsptr[4];
3699
3700 tmp0 = (z2 + z3) << CONST_BITS;
3701 tmp1 = (z2 - z3) << CONST_BITS;
3702
3703 tmp10 = tmp0 + tmp2;
3704 tmp13 = tmp0 - tmp2;
3705 tmp11 = tmp1 + tmp3;
3706 tmp12 = tmp1 - tmp3;
3707
3708 /* Odd part per figure 8; the matrix is unitary and hence its
3709 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
3710 */
3711
3712 tmp0 = (INT32) wsptr[7];
3713 tmp1 = (INT32) wsptr[5];
3714 tmp2 = (INT32) wsptr[3];
3715 tmp3 = (INT32) wsptr[1];
3716
3717 z2 = tmp0 + tmp2;
3718 z3 = tmp1 + tmp3;
3719
3720 z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */
3721 z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
3722 z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
3723 z2 += z1;
3724 z3 += z1;
3725
3726 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
3727 tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
3728 tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
3729 tmp0 += z1 + z2;
3730 tmp3 += z1 + z3;
3731
3732 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
3733 tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
3734 tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
3735 tmp1 += z1 + z3;
3736 tmp2 += z1 + z2;
3737
3738 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
3739
3740 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,
3741 CONST_BITS+PASS1_BITS+3)
3742 & RANGE_MASK];
3743 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3,
3744 CONST_BITS+PASS1_BITS+3)
3745 & RANGE_MASK];
3746 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2,
3747 CONST_BITS+PASS1_BITS+3)
3748 & RANGE_MASK];
3749 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2,
3750 CONST_BITS+PASS1_BITS+3)
3751 & RANGE_MASK];
3752 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1,
3753 CONST_BITS+PASS1_BITS+3)
3754 & RANGE_MASK];
3755 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1,
3756 CONST_BITS+PASS1_BITS+3)
3757 & RANGE_MASK];
3758 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0,
3759 CONST_BITS+PASS1_BITS+3)
3760 & RANGE_MASK];
3761 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,
3762 CONST_BITS+PASS1_BITS+3)
3763 & RANGE_MASK];
3764
3765 wsptr += DCTSIZE; /* advance pointer to next row */
3766 }
3767}
3768
3769
3770/*
3771 * Perform dequantization and inverse DCT on one block of coefficients,
3772 * producing a reduced-size 6x3 output block.
3773 *
3774 * 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).
3775 */
3776
3777GLOBAL(void)
3778jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3779 JCOEFPTR coef_block,
3780 JSAMPARRAY output_buf, JDIMENSION output_col)
3781{
3782 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
3783 INT32 z1, z2, z3;
3784 JCOEFPTR inptr;
3785 ISLOW_MULT_TYPE * quantptr;
3786 int * wsptr;
3787 JSAMPROW outptr;
3788 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3789 int ctr;
3790 int workspace[6*3]; /* buffers data between passes */
3791 SHIFT_TEMPS
3792
3793 /* Pass 1: process columns from input, store into work array.
3794 * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6).
3795 */
3796 inptr = coef_block;
3797 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3798 wsptr = workspace;
3799 for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
3800 /* Even part */
3801
3802 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
3803 tmp0 <<= CONST_BITS;
3804 /* Add fudge factor here for final descale. */
3805 tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
3806 tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
3807 tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
3808 tmp10 = tmp0 + tmp12;
3809 tmp2 = tmp0 - tmp12 - tmp12;
3810
3811 /* Odd part */
3812
3813 tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
3814 tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */
3815
3816 /* Final output stage */
3817
3818 wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
3819 wsptr[6*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
3820 wsptr[6*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);
3821 }
3822
3823 /* Pass 2: process 3 rows from work array, store into output array.
3824 * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).
3825 */
3826 wsptr = workspace;
3827 for (ctr = 0; ctr < 3; ctr++) {
3828 outptr = output_buf[ctr] + output_col;
3829
3830 /* Even part */
3831
3832 /* Add fudge factor here for final descale. */
3833 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
3834 tmp0 <<= CONST_BITS;
3835 tmp2 = (INT32) wsptr[4];
3836 tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
3837 tmp1 = tmp0 + tmp10;
3838 tmp11 = tmp0 - tmp10 - tmp10;
3839 tmp10 = (INT32) wsptr[2];
3840 tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */
3841 tmp10 = tmp1 + tmp0;
3842 tmp12 = tmp1 - tmp0;
3843
3844 /* Odd part */
3845
3846 z1 = (INT32) wsptr[1];
3847 z2 = (INT32) wsptr[3];
3848 z3 = (INT32) wsptr[5];
3849 tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
3850 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
3851 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
3852 tmp1 = (z1 - z2 - z3) << CONST_BITS;
3853
3854 /* Final output stage */
3855
3856 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
3857 CONST_BITS+PASS1_BITS+3)
3858 & RANGE_MASK];
3859 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
3860 CONST_BITS+PASS1_BITS+3)
3861 & RANGE_MASK];
3862 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,
3863 CONST_BITS+PASS1_BITS+3)
3864 & RANGE_MASK];
3865 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,
3866 CONST_BITS+PASS1_BITS+3)
3867 & RANGE_MASK];
3868 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
3869 CONST_BITS+PASS1_BITS+3)
3870 & RANGE_MASK];
3871 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
3872 CONST_BITS+PASS1_BITS+3)
3873 & RANGE_MASK];
3874
3875 wsptr += 6; /* advance pointer to next row */
3876 }
3877}
3878
3879
3880/*
3881 * Perform dequantization and inverse DCT on one block of coefficients,
3882 * producing a 4x2 output block.
3883 *
3884 * 2-point IDCT in pass 1 (columns), 4-point in pass 2 (rows).
3885 */
3886
3887GLOBAL(void)
3888jpeg_idct_4x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3889 JCOEFPTR coef_block,
3890 JSAMPARRAY output_buf, JDIMENSION output_col)
3891{
3892 INT32 tmp0, tmp2, tmp10, tmp12;
3893 INT32 z1, z2, z3;
3894 JCOEFPTR inptr;
3895 ISLOW_MULT_TYPE * quantptr;
3896 INT32 * wsptr;
3897 JSAMPROW outptr;
3898 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3899 int ctr;
3900 INT32 workspace[4*2]; /* buffers data between passes */
3901 SHIFT_TEMPS
3902
3903 /* Pass 1: process columns from input, store into work array. */
3904
3905 inptr = coef_block;
3906 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3907 wsptr = workspace;
3908 for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) {
3909 /* Even part */
3910
3911 tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
3912
3913 /* Odd part */
3914
3915 tmp0 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
3916
3917 /* Final output stage */
3918
3919 wsptr[4*0] = tmp10 + tmp0;
3920 wsptr[4*1] = tmp10 - tmp0;
3921 }
3922
3923 /* Pass 2: process 2 rows from work array, store into output array.
3924 * 4-point IDCT kernel,
3925 * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].
3926 */
3927 wsptr = workspace;
3928 for (ctr = 0; ctr < 2; ctr++) {
3929 outptr = output_buf[ctr] + output_col;
3930
3931 /* Even part */
3932
3933 /* Add fudge factor here for final descale. */
3934 tmp0 = wsptr[0] + (ONE << 2);
3935 tmp2 = wsptr[2];
3936
3937 tmp10 = (tmp0 + tmp2) << CONST_BITS;
3938 tmp12 = (tmp0 - tmp2) << CONST_BITS;
3939
3940 /* Odd part */
3941 /* Same rotation as in the even part of the 8x8 LL&M IDCT */
3942
3943 z2 = wsptr[1];
3944 z3 = wsptr[3];
3945
3946 z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
3947 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
3948 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
3949
3950 /* Final output stage */
3951
3952 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
3953 CONST_BITS+3)
3954 & RANGE_MASK];
3955 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
3956 CONST_BITS+3)
3957 & RANGE_MASK];
3958 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
3959 CONST_BITS+3)
3960 & RANGE_MASK];
3961 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
3962 CONST_BITS+3)
3963 & RANGE_MASK];
3964
3965 wsptr += 4; /* advance pointer to next row */
3966 }
3967}
3968
3969
3970/*
3971 * Perform dequantization and inverse DCT on one block of coefficients,
3972 * producing a 2x1 output block.
3973 *
3974 * 1-point IDCT in pass 1 (columns), 2-point in pass 2 (rows).
3975 */
3976
3977GLOBAL(void)
3978jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
3979 JCOEFPTR coef_block,
3980 JSAMPARRAY output_buf, JDIMENSION output_col)
3981{
3982 INT32 tmp0, tmp10;
3983 ISLOW_MULT_TYPE * quantptr;
3984 JSAMPROW outptr;
3985 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
3986 SHIFT_TEMPS
3987
3988 /* Pass 1: empty. */
3989
3990 /* Pass 2: process 1 row from input, store into output array. */
3991
3992 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
3993 outptr = output_buf[0] + output_col;
3994
3995 /* Even part */
3996
3997 tmp10 = DEQUANTIZE(coef_block[0], quantptr[0]);
3998 /* Add fudge factor here for final descale. */
3999 tmp10 += ONE << 2;
4000
4001 /* Odd part */
4002
4003 tmp0 = DEQUANTIZE(coef_block[1], quantptr[1]);
4004
4005 /* Final output stage */
4006
4007 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, 3) & RANGE_MASK];
4008 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, 3) & RANGE_MASK];
4009}
4010
4011
4012/*
4013 * Perform dequantization and inverse DCT on one block of coefficients,
4014 * producing a 8x16 output block.
4015 *
4016 * 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
4017 */
4018
4019GLOBAL(void)
4020jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
4021 JCOEFPTR coef_block,
4022 JSAMPARRAY output_buf, JDIMENSION output_col)
4023{
4024 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
4025 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
4026 INT32 z1, z2, z3, z4;
4027 JCOEFPTR inptr;
4028 ISLOW_MULT_TYPE * quantptr;
4029 int * wsptr;
4030 JSAMPROW outptr;
4031 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
4032 int ctr;
4033 int workspace[8*16]; /* buffers data between passes */
4034 SHIFT_TEMPS
4035
4036 /* Pass 1: process columns from input, store into work array.
4037 * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32).
4038 */
4039 inptr = coef_block;
4040 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
4041 wsptr = workspace;
4042 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
4043 /* Even part */
4044
4045 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
4046 tmp0 <<= CONST_BITS;
4047 /* Add fudge factor here for final descale. */
4048 tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
4049
4050 z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
4051 tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
4052 tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */
4053
4054 tmp10 = tmp0 + tmp1;
4055 tmp11 = tmp0 - tmp1;
4056 tmp12 = tmp0 + tmp2;
4057 tmp13 = tmp0 - tmp2;
4058
4059 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
4060 z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
4061 z3 = z1 - z2;
4062 z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */
4063 z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */
4064
4065 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */
4066 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */
4067 tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */
4068 tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */
4069
4070 tmp20 = tmp10 + tmp0;
4071 tmp27 = tmp10 - tmp0;
4072 tmp21 = tmp12 + tmp1;
4073 tmp26 = tmp12 - tmp1;
4074 tmp22 = tmp13 + tmp2;
4075 tmp25 = tmp13 - tmp2;
4076 tmp23 = tmp11 + tmp3;
4077 tmp24 = tmp11 - tmp3;
4078
4079 /* Odd part */
4080
4081 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
4082 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
4083 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
4084 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
4085
4086 tmp11 = z1 + z3;
4087
4088 tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */
4089 tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */
4090 tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */
4091 tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */
4092 tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */
4093 tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */
4094 tmp0 = tmp1 + tmp2 + tmp3 -
4095 MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */
4096 tmp13 = tmp10 + tmp11 + tmp12 -
4097 MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */
4098 z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */
4099 tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */
4100 tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */
4101 z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */
4102 tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */
4103 tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */
4104 z2 += z4;
4105 z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */
4106 tmp1 += z1;
4107 tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */
4108 z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */
4109 tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */
4110 tmp12 += z2;
4111 z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */
4112 tmp2 += z2;
4113 tmp3 += z2;
4114 z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */
4115 tmp10 += z2;
4116 tmp11 += z2;
4117
4118 /* Final output stage */
4119
4120 wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp0, CONST_BITS-PASS1_BITS);
4121 wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0, CONST_BITS-PASS1_BITS);
4122 wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp1, CONST_BITS-PASS1_BITS);
4123 wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1, CONST_BITS-PASS1_BITS);
4124 wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp2, CONST_BITS-PASS1_BITS);
4125 wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2, CONST_BITS-PASS1_BITS);
4126 wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp3, CONST_BITS-PASS1_BITS);
4127 wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3, CONST_BITS-PASS1_BITS);
4128 wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);
4129 wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);
4130 wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);
4131 wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);
4132 wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);
4133 wsptr[8*9] = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);
4134 wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);
4135 wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);
4136 }
4137
4138 /* Pass 2: process rows from work array, store into output array. */
4139 /* Note that we must descale the results by a factor of 8 == 2**3, */
4140 /* and also undo the PASS1_BITS scaling. */
4141
4142 wsptr = workspace;
4143 for (ctr = 0; ctr < 16; ctr++) {
4144 outptr = output_buf[ctr] + output_col;
4145
4146 /* Even part: reverse the even part of the forward DCT. */
4147 /* The rotator is sqrt(2)*c(-6). */
4148
4149 z2 = (INT32) wsptr[2];
4150 z3 = (INT32) wsptr[6];
4151
4152 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
4153 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
4154 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
4155
4156 /* Add fudge factor here for final descale. */
4157 z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
4158 z3 = (INT32) wsptr[4];
4159
4160 tmp0 = (z2 + z3) << CONST_BITS;
4161 tmp1 = (z2 - z3) << CONST_BITS;
4162
4163 tmp10 = tmp0 + tmp2;
4164 tmp13 = tmp0 - tmp2;
4165 tmp11 = tmp1 + tmp3;
4166 tmp12 = tmp1 - tmp3;
4167
4168 /* Odd part per figure 8; the matrix is unitary and hence its
4169 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
4170 */
4171
4172 tmp0 = (INT32) wsptr[7];
4173 tmp1 = (INT32) wsptr[5];
4174 tmp2 = (INT32) wsptr[3];
4175 tmp3 = (INT32) wsptr[1];
4176
4177 z2 = tmp0 + tmp2;
4178 z3 = tmp1 + tmp3;
4179
4180 z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */
4181 z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
4182 z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
4183 z2 += z1;
4184 z3 += z1;
4185
4186 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
4187 tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
4188 tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
4189 tmp0 += z1 + z2;
4190 tmp3 += z1 + z3;
4191
4192 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
4193 tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
4194 tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
4195 tmp1 += z1 + z3;
4196 tmp2 += z1 + z2;
4197
4198 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
4199
4200 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,
4201 CONST_BITS+PASS1_BITS+3)
4202 & RANGE_MASK];
4203 outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3,
4204 CONST_BITS+PASS1_BITS+3)
4205 & RANGE_MASK];
4206 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2,
4207 CONST_BITS+PASS1_BITS+3)
4208 & RANGE_MASK];
4209 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2,
4210 CONST_BITS+PASS1_BITS+3)
4211 & RANGE_MASK];
4212 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1,
4213 CONST_BITS+PASS1_BITS+3)
4214 & RANGE_MASK];
4215 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1,
4216 CONST_BITS+PASS1_BITS+3)
4217 & RANGE_MASK];
4218 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0,
4219 CONST_BITS+PASS1_BITS+3)
4220 & RANGE_MASK];
4221 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,
4222 CONST_BITS+PASS1_BITS+3)
4223 & RANGE_MASK];
4224
4225 wsptr += DCTSIZE; /* advance pointer to next row */
4226 }
4227}
4228
4229
4230/*
4231 * Perform dequantization and inverse DCT on one block of coefficients,
4232 * producing a 7x14 output block.
4233 *
4234 * 14-point IDCT in pass 1 (columns), 7-point in pass 2 (rows).
4235 */
4236
4237GLOBAL(void)
4238jpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
4239 JCOEFPTR coef_block,
4240 JSAMPARRAY output_buf, JDIMENSION output_col)
4241{
4242 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
4243 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
4244 INT32 z1, z2, z3, z4;
4245 JCOEFPTR inptr;
4246 ISLOW_MULT_TYPE * quantptr;
4247 int * wsptr;
4248 JSAMPROW outptr;
4249 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
4250 int ctr;
4251 int workspace[7*14]; /* buffers data between passes */
4252 SHIFT_TEMPS
4253
4254 /* Pass 1: process columns from input, store into work array.
4255 * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28).
4256 */
4257 inptr = coef_block;
4258 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
4259 wsptr = workspace;
4260 for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {
4261 /* Even part */
4262
4263 z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
4264 z1 <<= CONST_BITS;
4265 /* Add fudge factor here for final descale. */
4266 z1 += ONE << (CONST_BITS-PASS1_BITS-1);
4267 z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
4268 z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
4269 z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */
4270 z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */
4271
4272 tmp10 = z1 + z2;
4273 tmp11 = z1 + z3;
4274 tmp12 = z1 - z4;
4275
4276 tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */
4277 CONST_BITS-PASS1_BITS);
4278
4279 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
4280 z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
4281
4282 z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */
4283
4284 tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */
4285 tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */
4286 tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */
4287 MULTIPLY(z2, FIX(1.378756276)); /* c2 */
4288
4289 tmp20 = tmp10 + tmp13;
4290 tmp26 = tmp10 - tmp13;
4291 tmp21 = tmp11 + tmp14;
4292 tmp25 = tmp11 - tmp14;
4293 tmp22 = tmp12 + tmp15;
4294 tmp24 = tmp12 - tmp15;
4295
4296 /* Odd part */
4297
4298 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
4299 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
4300 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
4301 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
4302 tmp13 = z4 << CONST_BITS;
4303
4304 tmp14 = z1 + z3;
4305 tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */
4306 tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */
4307 tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */
4308 tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */
4309 tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */
4310 z1 -= z2;
4311 tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13; /* c11 */
4312 tmp16 += tmp15;
4313 z1 += z4;
4314 z4 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */
4315 tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */
4316 tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */
4317 z4 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */
4318 tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */
4319 tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */
4320
4321 tmp13 = (z1 - z3) << PASS1_BITS;
4322
4323 /* Final output stage */
4324
4325 wsptr[7*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
4326 wsptr[7*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
4327 wsptr[7*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
4328 wsptr[7*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
4329 wsptr[7*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
4330 wsptr[7*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
4331 wsptr[7*3] = (int) (tmp23 + tmp13);
4332 wsptr[7*10] = (int) (tmp23 - tmp13);
4333 wsptr[7*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
4334 wsptr[7*9] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
4335 wsptr[7*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
4336 wsptr[7*8] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
4337 wsptr[7*6] = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);
4338 wsptr[7*7] = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);
4339 }
4340
4341 /* Pass 2: process 14 rows from work array, store into output array.
4342 * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14).
4343 */
4344 wsptr = workspace;
4345 for (ctr = 0; ctr < 14; ctr++) {
4346 outptr = output_buf[ctr] + output_col;
4347
4348 /* Even part */
4349
4350 /* Add fudge factor here for final descale. */
4351 tmp23 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
4352 tmp23 <<= CONST_BITS;
4353
4354 z1 = (INT32) wsptr[2];
4355 z2 = (INT32) wsptr[4];
4356 z3 = (INT32) wsptr[6];
4357
4358 tmp20 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */
4359 tmp22 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */
4360 tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */
4361 tmp10 = z1 + z3;
4362 z2 -= tmp10;
4363 tmp10 = MULTIPLY(tmp10, FIX(1.274162392)) + tmp23; /* c2 */
4364 tmp20 += tmp10 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */
4365 tmp22 += tmp10 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */
4366 tmp23 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */
4367
4368 /* Odd part */
4369
4370 z1 = (INT32) wsptr[1];
4371 z2 = (INT32) wsptr[3];
4372 z3 = (INT32) wsptr[5];
4373
4374 tmp11 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */
4375 tmp12 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */
4376 tmp10 = tmp11 - tmp12;
4377 tmp11 += tmp12;
4378 tmp12 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */
4379 tmp11 += tmp12;
4380 z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */
4381 tmp10 += z2;
4382 tmp12 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */
4383
4384 /* Final output stage */
4385
4386 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
4387 CONST_BITS+PASS1_BITS+3)
4388 & RANGE_MASK];
4389 outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
4390 CONST_BITS+PASS1_BITS+3)
4391 & RANGE_MASK];
4392 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
4393 CONST_BITS+PASS1_BITS+3)
4394 & RANGE_MASK];
4395 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
4396 CONST_BITS+PASS1_BITS+3)
4397 & RANGE_MASK];
4398 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
4399 CONST_BITS+PASS1_BITS+3)
4400 & RANGE_MASK];
4401 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
4402 CONST_BITS+PASS1_BITS+3)
4403 & RANGE_MASK];
4404 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23,
4405 CONST_BITS+PASS1_BITS+3)
4406 & RANGE_MASK];
4407
4408 wsptr += 7; /* advance pointer to next row */
4409 }
4410}
4411
4412
4413/*
4414 * Perform dequantization and inverse DCT on one block of coefficients,
4415 * producing a 6x12 output block.
4416 *
4417 * 12-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).
4418 */
4419
4420GLOBAL(void)
4421jpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
4422 JCOEFPTR coef_block,
4423 JSAMPARRAY output_buf, JDIMENSION output_col)
4424{
4425 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
4426 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
4427 INT32 z1, z2, z3, z4;
4428 JCOEFPTR inptr;
4429 ISLOW_MULT_TYPE * quantptr;
4430 int * wsptr;
4431 JSAMPROW outptr;
4432 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
4433 int ctr;
4434 int workspace[6*12]; /* buffers data between passes */
4435 SHIFT_TEMPS
4436
4437 /* Pass 1: process columns from input, store into work array.
4438 * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24).
4439 */
4440 inptr = coef_block;
4441 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
4442 wsptr = workspace;
4443 for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
4444 /* Even part */
4445
4446 z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
4447 z3 <<= CONST_BITS;
4448 /* Add fudge factor here for final descale. */
4449 z3 += ONE << (CONST_BITS-PASS1_BITS-1);
4450
4451 z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
4452 z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */
4453
4454 tmp10 = z3 + z4;
4455 tmp11 = z3 - z4;
4456
4457 z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
4458 z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */
4459 z1 <<= CONST_BITS;
4460 z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
4461 z2 <<= CONST_BITS;
4462
4463 tmp12 = z1 - z2;
4464
4465 tmp21 = z3 + tmp12;
4466 tmp24 = z3 - tmp12;
4467
4468 tmp12 = z4 + z2;
4469
4470 tmp20 = tmp10 + tmp12;
4471 tmp25 = tmp10 - tmp12;
4472
4473 tmp12 = z4 - z1 - z2;
4474
4475 tmp22 = tmp11 + tmp12;
4476 tmp23 = tmp11 - tmp12;
4477
4478 /* Odd part */
4479
4480 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
4481 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
4482 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
4483 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
4484
4485 tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */
4486 tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */
4487
4488 tmp10 = z1 + z3;
4489 tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */
4490 tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */
4491 tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */
4492 tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */
4493 tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */
4494 tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */
4495 tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */
4496 MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */
4497
4498 z1 -= z4;
4499 z2 -= z3;
4500 z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */
4501 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */
4502 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */
4503
4504 /* Final output stage */
4505
4506 wsptr[6*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
4507 wsptr[6*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
4508 wsptr[6*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
4509 wsptr[6*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
4510 wsptr[6*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
4511 wsptr[6*9] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
4512 wsptr[6*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
4513 wsptr[6*8] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
4514 wsptr[6*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
4515 wsptr[6*7] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
4516 wsptr[6*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
4517 wsptr[6*6] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
4518 }
4519
4520 /* Pass 2: process 12 rows from work array, store into output array.
4521 * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).
4522 */
4523 wsptr = workspace;
4524 for (ctr = 0; ctr < 12; ctr++) {
4525 outptr = output_buf[ctr] + output_col;
4526
4527 /* Even part */
4528
4529 /* Add fudge factor here for final descale. */
4530 tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
4531 tmp10 <<= CONST_BITS;
4532 tmp12 = (INT32) wsptr[4];
4533 tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */
4534 tmp11 = tmp10 + tmp20;
4535 tmp21 = tmp10 - tmp20 - tmp20;
4536 tmp20 = (INT32) wsptr[2];
4537 tmp10 = MULTIPLY(tmp20, FIX(1.224744871)); /* c2 */
4538 tmp20 = tmp11 + tmp10;
4539 tmp22 = tmp11 - tmp10;
4540
4541 /* Odd part */
4542
4543 z1 = (INT32) wsptr[1];
4544 z2 = (INT32) wsptr[3];
4545 z3 = (INT32) wsptr[5];
4546 tmp11 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
4547 tmp10 = tmp11 + ((z1 + z2) << CONST_BITS);
4548 tmp12 = tmp11 + ((z3 - z2) << CONST_BITS);
4549 tmp11 = (z1 - z2 - z3) << CONST_BITS;
4550
4551 /* Final output stage */
4552
4553 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,
4554 CONST_BITS+PASS1_BITS+3)
4555 & RANGE_MASK];
4556 outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,
4557 CONST_BITS+PASS1_BITS+3)
4558 & RANGE_MASK];
4559 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,
4560 CONST_BITS+PASS1_BITS+3)
4561 & RANGE_MASK];
4562 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,
4563 CONST_BITS+PASS1_BITS+3)
4564 & RANGE_MASK];
4565 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,
4566 CONST_BITS+PASS1_BITS+3)
4567 & RANGE_MASK];
4568 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,
4569 CONST_BITS+PASS1_BITS+3)
4570 & RANGE_MASK];
4571
4572 wsptr += 6; /* advance pointer to next row */
4573 }
4574}
4575
4576
4577/*
4578 * Perform dequantization and inverse DCT on one block of coefficients,
4579 * producing a 5x10 output block.
4580 *
4581 * 10-point IDCT in pass 1 (columns), 5-point in pass 2 (rows).
4582 */
4583
4584GLOBAL(void)
4585jpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
4586 JCOEFPTR coef_block,
4587 JSAMPARRAY output_buf, JDIMENSION output_col)
4588{
4589 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
4590 INT32 tmp20, tmp21, tmp22, tmp23, tmp24;
4591 INT32 z1, z2, z3, z4, z5;
4592 JCOEFPTR inptr;
4593 ISLOW_MULT_TYPE * quantptr;
4594 int * wsptr;
4595 JSAMPROW outptr;
4596 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
4597 int ctr;
4598 int workspace[5*10]; /* buffers data between passes */
4599 SHIFT_TEMPS
4600
4601 /* Pass 1: process columns from input, store into work array.
4602 * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20).
4603 */
4604 inptr = coef_block;
4605 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
4606 wsptr = workspace;
4607 for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {
4608 /* Even part */
4609
4610 z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
4611 z3 <<= CONST_BITS;
4612 /* Add fudge factor here for final descale. */
4613 z3 += ONE << (CONST_BITS-PASS1_BITS-1);
4614 z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
4615 z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
4616 z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */
4617 tmp10 = z3 + z1;
4618 tmp11 = z3 - z2;
4619
4620 tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1), /* c0 = (c4-c8)*2 */
4621 CONST_BITS-PASS1_BITS);
4622
4623 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
4624 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
4625
4626 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */
4627 tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
4628 tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
4629
4630 tmp20 = tmp10 + tmp12;
4631 tmp24 = tmp10 - tmp12;
4632 tmp21 = tmp11 + tmp13;
4633 tmp23 = tmp11 - tmp13;
4634
4635 /* Odd part */
4636
4637 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
4638 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
4639 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
4640 z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
4641
4642 tmp11 = z2 + z4;
4643 tmp13 = z2 - z4;
4644
4645 tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */
4646 z5 = z3 << CONST_BITS;
4647
4648 z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */
4649 z4 = z5 + tmp12;
4650
4651 tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
4652 tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
4653
4654 z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */
4655 z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));
4656
4657 tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;
4658
4659 tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
4660 tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
4661
4662 /* Final output stage */
4663
4664 wsptr[5*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
4665 wsptr[5*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
4666 wsptr[5*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
4667 wsptr[5*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
4668 wsptr[5*2] = (int) (tmp22 + tmp12);
4669 wsptr[5*7] = (int) (tmp22 - tmp12);
4670 wsptr[5*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
4671 wsptr[5*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
4672 wsptr[5*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
4673 wsptr[5*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
4674 }
4675
4676 /* Pass 2: process 10 rows from work array, store into output array.
4677 * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10).
4678 */
4679 wsptr = workspace;
4680 for (ctr = 0; ctr < 10; ctr++) {
4681 outptr = output_buf[ctr] + output_col;
4682
4683 /* Even part */
4684
4685 /* Add fudge factor here for final descale. */
4686 tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
4687 tmp12 <<= CONST_BITS;
4688 tmp13 = (INT32) wsptr[2];
4689 tmp14 = (INT32) wsptr[4];
4690 z1 = MULTIPLY(tmp13 + tmp14, FIX(0.790569415)); /* (c2+c4)/2 */
4691 z2 = MULTIPLY(tmp13 - tmp14, FIX(0.353553391)); /* (c2-c4)/2 */
4692 z3 = tmp12 + z2;
4693 tmp10 = z3 + z1;
4694 tmp11 = z3 - z1;
4695 tmp12 -= z2 << 2;
4696
4697 /* Odd part */
4698
4699 z2 = (INT32) wsptr[1];
4700 z3 = (INT32) wsptr[3];
4701
4702 z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */
4703 tmp13 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */
4704 tmp14 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */
4705
4706 /* Final output stage */
4707
4708 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp13,
4709 CONST_BITS+PASS1_BITS+3)
4710 & RANGE_MASK];
4711 outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp13,
4712 CONST_BITS+PASS1_BITS+3)
4713 & RANGE_MASK];
4714 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp14,
4715 CONST_BITS+PASS1_BITS+3)
4716 & RANGE_MASK];
4717 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp14,
4718 CONST_BITS+PASS1_BITS+3)
4719 & RANGE_MASK];
4720 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12,
4721 CONST_BITS+PASS1_BITS+3)
4722 & RANGE_MASK];
4723
4724 wsptr += 5; /* advance pointer to next row */
4725 }
4726}
4727
4728
4729/*
4730 * Perform dequantization and inverse DCT on one block of coefficients,
4731 * producing a 4x8 output block.
4732 *
4733 * 8-point IDCT in pass 1 (columns), 4-point in pass 2 (rows).
4734 */
4735
4736GLOBAL(void)
4737jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
4738 JCOEFPTR coef_block,
4739 JSAMPARRAY output_buf, JDIMENSION output_col)
4740{
4741 INT32 tmp0, tmp1, tmp2, tmp3;
4742 INT32 tmp10, tmp11, tmp12, tmp13;
4743 INT32 z1, z2, z3;
4744 JCOEFPTR inptr;
4745 ISLOW_MULT_TYPE * quantptr;
4746 int * wsptr;
4747 JSAMPROW outptr;
4748 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
4749 int ctr;
4750 int workspace[4*8]; /* buffers data between passes */
4751 SHIFT_TEMPS
4752
4753 /* Pass 1: process columns from input, store into work array. */
4754 /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
4755 /* furthermore, we scale the results by 2**PASS1_BITS. */
4756
4757 inptr = coef_block;
4758 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
4759 wsptr = workspace;
4760 for (ctr = 4; ctr > 0; ctr--) {
4761 /* Due to quantization, we will usually find that many of the input
4762 * coefficients are zero, especially the AC terms. We can exploit this
4763 * by short-circuiting the IDCT calculation for any column in which all
4764 * the AC terms are zero. In that case each output is equal to the
4765 * DC coefficient (with scale factor as needed).
4766 * With typical images and quantization tables, half or more of the
4767 * column DCT calculations can be simplified this way.
4768 */
4769
4770 if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
4771 inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
4772 inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
4773 inptr[DCTSIZE*7] == 0) {
4774 /* AC terms all zero */
4775 int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
4776
4777 wsptr[4*0] = dcval;
4778 wsptr[4*1] = dcval;
4779 wsptr[4*2] = dcval;
4780 wsptr[4*3] = dcval;
4781 wsptr[4*4] = dcval;
4782 wsptr[4*5] = dcval;
4783 wsptr[4*6] = dcval;
4784 wsptr[4*7] = dcval;
4785
4786 inptr++; /* advance pointers to next column */
4787 quantptr++;
4788 wsptr++;
4789 continue;
4790 }
4791
4792 /* Even part: reverse the even part of the forward DCT. */
4793 /* The rotator is sqrt(2)*c(-6). */
4794
4795 z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
4796 z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
4797
4798 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
4799 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
4800 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
4801
4802 z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
4803 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
4804 z2 <<= CONST_BITS;
4805 z3 <<= CONST_BITS;
4806 /* Add fudge factor here for final descale. */
4807 z2 += ONE << (CONST_BITS-PASS1_BITS-1);
4808
4809 tmp0 = z2 + z3;
4810 tmp1 = z2 - z3;
4811
4812 tmp10 = tmp0 + tmp2;
4813 tmp13 = tmp0 - tmp2;
4814 tmp11 = tmp1 + tmp3;
4815 tmp12 = tmp1 - tmp3;
4816
4817 /* Odd part per figure 8; the matrix is unitary and hence its
4818 * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
4819 */
4820
4821 tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
4822 tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
4823 tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
4824 tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
4825
4826 z2 = tmp0 + tmp2;
4827 z3 = tmp1 + tmp3;
4828
4829 z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */
4830 z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
4831 z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
4832 z2 += z1;
4833 z3 += z1;
4834
4835 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
4836 tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
4837 tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
4838 tmp0 += z1 + z2;
4839 tmp3 += z1 + z3;
4840
4841 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
4842 tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
4843 tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
4844 tmp1 += z1 + z3;
4845 tmp2 += z1 + z2;
4846
4847 /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
4848
4849 wsptr[4*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
4850 wsptr[4*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
4851 wsptr[4*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
4852 wsptr[4*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
4853 wsptr[4*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
4854 wsptr[4*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
4855 wsptr[4*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
4856 wsptr[4*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
4857
4858 inptr++; /* advance pointers to next column */
4859 quantptr++;
4860 wsptr++;
4861 }
4862
4863 /* Pass 2: process 8 rows from work array, store into output array.
4864 * 4-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16).
4865 */
4866 wsptr = workspace;
4867 for (ctr = 0; ctr < 8; ctr++) {
4868 outptr = output_buf[ctr] + output_col;
4869
4870 /* Even part */
4871
4872 /* Add fudge factor here for final descale. */
4873 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
4874 tmp2 = (INT32) wsptr[2];
4875
4876 tmp10 = (tmp0 + tmp2) << CONST_BITS;
4877 tmp12 = (tmp0 - tmp2) << CONST_BITS;
4878
4879 /* Odd part */
4880 /* Same rotation as in the even part of the 8x8 LL&M IDCT */
4881
4882 z2 = (INT32) wsptr[1];
4883 z3 = (INT32) wsptr[3];
4884
4885 z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
4886 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
4887 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
4888
4889 /* Final output stage */
4890
4891 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
4892 CONST_BITS+PASS1_BITS+3)
4893 & RANGE_MASK];
4894 outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
4895 CONST_BITS+PASS1_BITS+3)
4896 & RANGE_MASK];
4897 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,
4898 CONST_BITS+PASS1_BITS+3)
4899 & RANGE_MASK];
4900 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
4901 CONST_BITS+PASS1_BITS+3)
4902 & RANGE_MASK];
4903
4904 wsptr += 4; /* advance pointer to next row */
4905 }
4906}
4907
4908
4909/*
4910 * Perform dequantization and inverse DCT on one block of coefficients,
4911 * producing a reduced-size 3x6 output block.
4912 *
4913 * 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows).
4914 */
4915
4916GLOBAL(void)
4917jpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
4918 JCOEFPTR coef_block,
4919 JSAMPARRAY output_buf, JDIMENSION output_col)
4920{
4921 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
4922 INT32 z1, z2, z3;
4923 JCOEFPTR inptr;
4924 ISLOW_MULT_TYPE * quantptr;
4925 int * wsptr;
4926 JSAMPROW outptr;
4927 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
4928 int ctr;
4929 int workspace[3*6]; /* buffers data between passes */
4930 SHIFT_TEMPS
4931
4932 /* Pass 1: process columns from input, store into work array.
4933 * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).
4934 */
4935 inptr = coef_block;
4936 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
4937 wsptr = workspace;
4938 for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {
4939 /* Even part */
4940
4941 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
4942 tmp0 <<= CONST_BITS;
4943 /* Add fudge factor here for final descale. */
4944 tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
4945 tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
4946 tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
4947 tmp1 = tmp0 + tmp10;
4948 tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);
4949 tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
4950 tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */
4951 tmp10 = tmp1 + tmp0;
4952 tmp12 = tmp1 - tmp0;
4953
4954 /* Odd part */
4955
4956 z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
4957 z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
4958 z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
4959 tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */
4960 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
4961 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
4962 tmp1 = (z1 - z2 - z3) << PASS1_BITS;
4963
4964 /* Final output stage */
4965
4966 wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
4967 wsptr[3*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
4968 wsptr[3*1] = (int) (tmp11 + tmp1);
4969 wsptr[3*4] = (int) (tmp11 - tmp1);
4970 wsptr[3*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
4971 wsptr[3*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
4972 }
4973
4974 /* Pass 2: process 6 rows from work array, store into output array.
4975 * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6).
4976 */
4977 wsptr = workspace;
4978 for (ctr = 0; ctr < 6; ctr++) {
4979 outptr = output_buf[ctr] + output_col;
4980
4981 /* Even part */
4982
4983 /* Add fudge factor here for final descale. */
4984 tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
4985 tmp0 <<= CONST_BITS;
4986 tmp2 = (INT32) wsptr[2];
4987 tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
4988 tmp10 = tmp0 + tmp12;
4989 tmp2 = tmp0 - tmp12 - tmp12;
4990
4991 /* Odd part */
4992
4993 tmp12 = (INT32) wsptr[1];
4994 tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */
4995
4996 /* Final output stage */
4997
4998 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,
4999 CONST_BITS+PASS1_BITS+3)
5000 & RANGE_MASK];
5001 outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,
5002 CONST_BITS+PASS1_BITS+3)
5003 & RANGE_MASK];
5004 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2,
5005 CONST_BITS+PASS1_BITS+3)
5006 & RANGE_MASK];
5007
5008 wsptr += 3; /* advance pointer to next row */
5009 }
5010}
5011
5012
5013/*
5014 * Perform dequantization and inverse DCT on one block of coefficients,
5015 * producing a 2x4 output block.
5016 *
5017 * 4-point IDCT in pass 1 (columns), 2-point in pass 2 (rows).
5018 */
5019
5020GLOBAL(void)
5021jpeg_idct_2x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
5022 JCOEFPTR coef_block,
5023 JSAMPARRAY output_buf, JDIMENSION output_col)
5024{
5025 INT32 tmp0, tmp2, tmp10, tmp12;
5026 INT32 z1, z2, z3;
5027 JCOEFPTR inptr;
5028 ISLOW_MULT_TYPE * quantptr;
5029 INT32 * wsptr;
5030 JSAMPROW outptr;
5031 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
5032 int ctr;
5033 INT32 workspace[2*4]; /* buffers data between passes */
5034 SHIFT_TEMPS
5035
5036 /* Pass 1: process columns from input, store into work array.
5037 * 4-point IDCT kernel,
5038 * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT].
5039 */
5040 inptr = coef_block;
5041 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
5042 wsptr = workspace;
5043 for (ctr = 0; ctr < 2; ctr++, inptr++, quantptr++, wsptr++) {
5044 /* Even part */
5045
5046 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
5047 tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
5048
5049 tmp10 = (tmp0 + tmp2) << CONST_BITS;
5050 tmp12 = (tmp0 - tmp2) << CONST_BITS;
5051
5052 /* Odd part */
5053 /* Same rotation as in the even part of the 8x8 LL&M IDCT */
5054
5055 z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
5056 z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
5057
5058 z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
5059 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
5060 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
5061
5062 /* Final output stage */
5063
5064 wsptr[2*0] = tmp10 + tmp0;
5065 wsptr[2*3] = tmp10 - tmp0;
5066 wsptr[2*1] = tmp12 + tmp2;
5067 wsptr[2*2] = tmp12 - tmp2;
5068 }
5069
5070 /* Pass 2: process 4 rows from work array, store into output array. */
5071
5072 wsptr = workspace;
5073 for (ctr = 0; ctr < 4; ctr++) {
5074 outptr = output_buf[ctr] + output_col;
5075
5076 /* Even part */
5077
5078 /* Add fudge factor here for final descale. */
5079 tmp10 = wsptr[0] + (ONE << (CONST_BITS+2));
5080
5081 /* Odd part */
5082
5083 tmp0 = wsptr[1];
5084
5085 /* Final output stage */
5086
5087 outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS+3)
5088 & RANGE_MASK];
5089 outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS+3)
5090 & RANGE_MASK];
5091
5092 wsptr += 2; /* advance pointer to next row */
5093 }
5094}
5095
5096
5097/*
5098 * Perform dequantization and inverse DCT on one block of coefficients,
5099 * producing a 1x2 output block.
5100 *
5101 * 2-point IDCT in pass 1 (columns), 1-point in pass 2 (rows).
5102 */
5103
5104GLOBAL(void)
5105jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
5106 JCOEFPTR coef_block,
5107 JSAMPARRAY output_buf, JDIMENSION output_col)
5108{
5109 INT32 tmp0, tmp10;
5110 ISLOW_MULT_TYPE * quantptr;
5111 JSAMPLE *range_limit = IDCT_range_limit(cinfo);
5112 SHIFT_TEMPS
5113
5114 /* Process 1 column from input, store into output array. */
5115
5116 quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
5117
5118 /* Even part */
5119
5120 tmp10 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
5121 /* Add fudge factor here for final descale. */
5122 tmp10 += ONE << 2;
5123
5124 /* Odd part */
5125
5126 tmp0 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);
5127
5128 /* Final output stage */
5129
5130 output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, 3)
5131 & RANGE_MASK];
5132 output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, 3)
5133 & RANGE_MASK];
5134}
5135
5136#endif /* IDCT_SCALING_SUPPORTED */
5137#endif /* DCT_ISLOW_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jinclude.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jinclude.h
new file mode 100644
index 0000000..5ff60fe
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jinclude.h
@@ -0,0 +1,91 @@
1/*
2 * jinclude.h
3 *
4 * Copyright (C) 1991-1994, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file exists to provide a single place to fix any problems with
9 * including the wrong system include files. (Common problems are taken
10 * care of by the standard jconfig symbols, but on really weird systems
11 * you may have to edit this file.)
12 *
13 * NOTE: this file is NOT intended to be included by applications using the
14 * JPEG library. Most applications need only include jpeglib.h.
15 */
16
17
18/* Include auto-config file to find out which system include files we need. */
19
20#include "jconfig.h" /* auto configuration options */
21#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
22
23/*
24 * We need the NULL macro and size_t typedef.
25 * On an ANSI-conforming system it is sufficient to include <stddef.h>.
26 * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
27 * pull in <sys/types.h> as well.
28 * Note that the core JPEG library does not require <stdio.h>;
29 * only the default error handler and data source/destination modules do.
30 * But we must pull it in because of the references to FILE in jpeglib.h.
31 * You can remove those references if you want to compile without <stdio.h>.
32 */
33
34#ifdef HAVE_STDDEF_H
35#include <stddef.h>
36#endif
37
38#ifdef HAVE_STDLIB_H
39#include <stdlib.h>
40#endif
41
42#ifdef NEED_SYS_TYPES_H
43#include <sys/types.h>
44#endif
45
46#include <stdio.h>
47
48/*
49 * We need memory copying and zeroing functions, plus strncpy().
50 * ANSI and System V implementations declare these in <string.h>.
51 * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
52 * Some systems may declare memset and memcpy in <memory.h>.
53 *
54 * NOTE: we assume the size parameters to these functions are of type size_t.
55 * Change the casts in these macros if not!
56 */
57
58#ifdef NEED_BSD_STRINGS
59
60#include <strings.h>
61#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
62#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
63
64#else /* not BSD, assume ANSI/SysV string lib */
65
66#include <string.h>
67#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
68#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
69
70#endif
71
72/*
73 * In ANSI C, and indeed any rational implementation, size_t is also the
74 * type returned by sizeof(). However, it seems there are some irrational
75 * implementations out there, in which sizeof() returns an int even though
76 * size_t is defined as long or unsigned long. To ensure consistent results
77 * we always use this SIZEOF() macro in place of using sizeof() directly.
78 */
79
80#define SIZEOF(object) ((size_t) sizeof(object))
81
82/*
83 * The modules that use fread() and fwrite() always invoke them through
84 * these macros. On some systems you may need to twiddle the argument casts.
85 * CAUTION: argument order is different from underlying functions!
86 */
87
88#define JFREAD(file,buf,sizeofbuf) \
89 ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
90#define JFWRITE(file,buf,sizeofbuf) \
91 ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemansi.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemansi.c
new file mode 100644
index 0000000..b5da474
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemansi.c
@@ -0,0 +1,167 @@
1/*
2 * jmemansi.c
3 *
4 * Copyright (C) 1992-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file provides a simple generic implementation of the system-
9 * dependent portion of the JPEG memory manager. This implementation
10 * assumes that you have the ANSI-standard library routine tmpfile().
11 * Also, the problem of determining the amount of memory available
12 * is shoved onto the user.
13 */
14
15#define JPEG_INTERNALS
16#include "jinclude.h"
17#include "jpeglib.h"
18#include "jmemsys.h" /* import the system-dependent declarations */
19
20#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
21extern void * malloc JPP((size_t size));
22extern void free JPP((void *ptr));
23#endif
24
25#ifndef SEEK_SET /* pre-ANSI systems may not define this; */
26#define SEEK_SET 0 /* if not, assume 0 is correct */
27#endif
28
29
30/*
31 * Memory allocation and freeing are controlled by the regular library
32 * routines malloc() and free().
33 */
34
35GLOBAL(void *)
36jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
37{
38 return (void *) malloc(sizeofobject);
39}
40
41GLOBAL(void)
42jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
43{
44 free(object);
45}
46
47
48/*
49 * "Large" objects are treated the same as "small" ones.
50 * NB: although we include FAR keywords in the routine declarations,
51 * this file won't actually work in 80x86 small/medium model; at least,
52 * you probably won't be able to process useful-size images in only 64KB.
53 */
54
55GLOBAL(void FAR *)
56jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
57{
58 return (void FAR *) malloc(sizeofobject);
59}
60
61GLOBAL(void)
62jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
63{
64 free(object);
65}
66
67
68/*
69 * This routine computes the total memory space available for allocation.
70 * It's impossible to do this in a portable way; our current solution is
71 * to make the user tell us (with a default value set at compile time).
72 * If you can actually get the available space, it's a good idea to subtract
73 * a slop factor of 5% or so.
74 */
75
76#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
77#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */
78#endif
79
80GLOBAL(long)
81jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
82 long max_bytes_needed, long already_allocated)
83{
84 return cinfo->mem->max_memory_to_use - already_allocated;
85}
86
87
88/*
89 * Backing store (temporary file) management.
90 * Backing store objects are only used when the value returned by
91 * jpeg_mem_available is less than the total space needed. You can dispense
92 * with these routines if you have plenty of virtual memory; see jmemnobs.c.
93 */
94
95
96METHODDEF(void)
97read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
98 void FAR * buffer_address,
99 long file_offset, long byte_count)
100{
101 if (fseek(info->temp_file, file_offset, SEEK_SET))
102 ERREXIT(cinfo, JERR_TFILE_SEEK);
103 if (JFREAD(info->temp_file, buffer_address, byte_count)
104 != (size_t) byte_count)
105 ERREXIT(cinfo, JERR_TFILE_READ);
106}
107
108
109METHODDEF(void)
110write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
111 void FAR * buffer_address,
112 long file_offset, long byte_count)
113{
114 if (fseek(info->temp_file, file_offset, SEEK_SET))
115 ERREXIT(cinfo, JERR_TFILE_SEEK);
116 if (JFWRITE(info->temp_file, buffer_address, byte_count)
117 != (size_t) byte_count)
118 ERREXIT(cinfo, JERR_TFILE_WRITE);
119}
120
121
122METHODDEF(void)
123close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
124{
125 fclose(info->temp_file);
126 /* Since this implementation uses tmpfile() to create the file,
127 * no explicit file deletion is needed.
128 */
129}
130
131
132/*
133 * Initial opening of a backing-store object.
134 *
135 * This version uses tmpfile(), which constructs a suitable file name
136 * behind the scenes. We don't have to use info->temp_name[] at all;
137 * indeed, we can't even find out the actual name of the temp file.
138 */
139
140GLOBAL(void)
141jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
142 long total_bytes_needed)
143{
144 if ((info->temp_file = tmpfile()) == NULL)
145 ERREXITS(cinfo, JERR_TFILE_CREATE, "");
146 info->read_backing_store = read_backing_store;
147 info->write_backing_store = write_backing_store;
148 info->close_backing_store = close_backing_store;
149}
150
151
152/*
153 * These routines take care of any system-dependent initialization and
154 * cleanup required.
155 */
156
157GLOBAL(long)
158jpeg_mem_init (j_common_ptr cinfo)
159{
160 return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
161}
162
163GLOBAL(void)
164jpeg_mem_term (j_common_ptr cinfo)
165{
166 /* no work */
167}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdos.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdos.c
new file mode 100644
index 0000000..0955047
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdos.c
@@ -0,0 +1,638 @@
1/*
2 * jmemdos.c
3 *
4 * Copyright (C) 1992-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file provides an MS-DOS-compatible implementation of the system-
9 * dependent portion of the JPEG memory manager. Temporary data can be
10 * stored in extended or expanded memory as well as in regular DOS files.
11 *
12 * If you use this file, you must be sure that NEED_FAR_POINTERS is defined
13 * if you compile in a small-data memory model; it should NOT be defined if
14 * you use a large-data memory model. This file is not recommended if you
15 * are using a flat-memory-space 386 environment such as DJGCC or Watcom C.
16 * Also, this code will NOT work if struct fields are aligned on greater than
17 * 2-byte boundaries.
18 *
19 * Based on code contributed by Ge' Weijers.
20 */
21
22/*
23 * If you have both extended and expanded memory, you may want to change the
24 * order in which they are tried in jopen_backing_store. On a 286 machine
25 * expanded memory is usually faster, since extended memory access involves
26 * an expensive protected-mode-and-back switch. On 386 and better, extended
27 * memory is usually faster. As distributed, the code tries extended memory
28 * first (what? not everyone has a 386? :-).
29 *
30 * You can disable use of extended/expanded memory entirely by altering these
31 * definitions or overriding them from the Makefile (eg, -DEMS_SUPPORTED=0).
32 */
33
34#ifndef XMS_SUPPORTED
35#define XMS_SUPPORTED 1
36#endif
37#ifndef EMS_SUPPORTED
38#define EMS_SUPPORTED 1
39#endif
40
41
42#define JPEG_INTERNALS
43#include "jinclude.h"
44#include "jpeglib.h"
45#include "jmemsys.h" /* import the system-dependent declarations */
46
47#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare these */
48extern void * malloc JPP((size_t size));
49extern void free JPP((void *ptr));
50extern char * getenv JPP((const char * name));
51#endif
52
53#ifdef NEED_FAR_POINTERS
54
55#ifdef __TURBOC__
56/* These definitions work for Borland C (Turbo C) */
57#include <alloc.h> /* need farmalloc(), farfree() */
58#define far_malloc(x) farmalloc(x)
59#define far_free(x) farfree(x)
60#else
61/* These definitions work for Microsoft C and compatible compilers */
62#include <malloc.h> /* need _fmalloc(), _ffree() */
63#define far_malloc(x) _fmalloc(x)
64#define far_free(x) _ffree(x)
65#endif
66
67#else /* not NEED_FAR_POINTERS */
68
69#define far_malloc(x) malloc(x)
70#define far_free(x) free(x)
71
72#endif /* NEED_FAR_POINTERS */
73
74#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
75#define READ_BINARY "r"
76#else
77#define READ_BINARY "rb"
78#endif
79
80#ifndef USE_MSDOS_MEMMGR /* make sure user got configuration right */
81 You forgot to define USE_MSDOS_MEMMGR in jconfig.h. /* deliberate syntax error */
82#endif
83
84#if MAX_ALLOC_CHUNK >= 65535L /* make sure jconfig.h got this right */
85 MAX_ALLOC_CHUNK should be less than 64K. /* deliberate syntax error */
86#endif
87
88
89/*
90 * Declarations for assembly-language support routines (see jmemdosa.asm).
91 *
92 * The functions are declared "far" as are all their pointer arguments;
93 * this ensures the assembly source code will work regardless of the
94 * compiler memory model. We assume "short" is 16 bits, "long" is 32.
95 */
96
97typedef void far * XMSDRIVER; /* actually a pointer to code */
98typedef struct { /* registers for calling XMS driver */
99 unsigned short ax, dx, bx;
100 void far * ds_si;
101 } XMScontext;
102typedef struct { /* registers for calling EMS driver */
103 unsigned short ax, dx, bx;
104 void far * ds_si;
105 } EMScontext;
106
107extern short far jdos_open JPP((short far * handle, char far * filename));
108extern short far jdos_close JPP((short handle));
109extern short far jdos_seek JPP((short handle, long offset));
110extern short far jdos_read JPP((short handle, void far * buffer,
111 unsigned short count));
112extern short far jdos_write JPP((short handle, void far * buffer,
113 unsigned short count));
114extern void far jxms_getdriver JPP((XMSDRIVER far *));
115extern void far jxms_calldriver JPP((XMSDRIVER, XMScontext far *));
116extern short far jems_available JPP((void));
117extern void far jems_calldriver JPP((EMScontext far *));
118
119
120/*
121 * Selection of a file name for a temporary file.
122 * This is highly system-dependent, and you may want to customize it.
123 */
124
125static int next_file_num; /* to distinguish among several temp files */
126
127LOCAL(void)
128select_file_name (char * fname)
129{
130 const char * env;
131 char * ptr;
132 FILE * tfile;
133
134 /* Keep generating file names till we find one that's not in use */
135 for (;;) {
136 /* Get temp directory name from environment TMP or TEMP variable;
137 * if none, use "."
138 */
139 if ((env = (const char *) getenv("TMP")) == NULL)
140 if ((env = (const char *) getenv("TEMP")) == NULL)
141 env = ".";
142 if (*env == '\0') /* null string means "." */
143 env = ".";
144 ptr = fname; /* copy name to fname */
145 while (*env != '\0')
146 *ptr++ = *env++;
147 if (ptr[-1] != '\\' && ptr[-1] != '/')
148 *ptr++ = '\\'; /* append backslash if not in env variable */
149 /* Append a suitable file name */
150 next_file_num++; /* advance counter */
151 sprintf(ptr, "JPG%03d.TMP", next_file_num);
152 /* Probe to see if file name is already in use */
153 if ((tfile = fopen(fname, READ_BINARY)) == NULL)
154 break;
155 fclose(tfile); /* oops, it's there; close tfile & try again */
156 }
157}
158
159
160/*
161 * Near-memory allocation and freeing are controlled by the regular library
162 * routines malloc() and free().
163 */
164
165GLOBAL(void *)
166jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
167{
168 return (void *) malloc(sizeofobject);
169}
170
171GLOBAL(void)
172jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
173{
174 free(object);
175}
176
177
178/*
179 * "Large" objects are allocated in far memory, if possible
180 */
181
182GLOBAL(void FAR *)
183jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
184{
185 return (void FAR *) far_malloc(sizeofobject);
186}
187
188GLOBAL(void)
189jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
190{
191 far_free(object);
192}
193
194
195/*
196 * This routine computes the total memory space available for allocation.
197 * It's impossible to do this in a portable way; our current solution is
198 * to make the user tell us (with a default value set at compile time).
199 * If you can actually get the available space, it's a good idea to subtract
200 * a slop factor of 5% or so.
201 */
202
203#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
204#define DEFAULT_MAX_MEM 300000L /* for total usage about 450K */
205#endif
206
207GLOBAL(long)
208jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
209 long max_bytes_needed, long already_allocated)
210{
211 return cinfo->mem->max_memory_to_use - already_allocated;
212}
213
214
215/*
216 * Backing store (temporary file) management.
217 * Backing store objects are only used when the value returned by
218 * jpeg_mem_available is less than the total space needed. You can dispense
219 * with these routines if you have plenty of virtual memory; see jmemnobs.c.
220 */
221
222/*
223 * For MS-DOS we support three types of backing storage:
224 * 1. Conventional DOS files. We access these by direct DOS calls rather
225 * than via the stdio package. This provides a bit better performance,
226 * but the real reason is that the buffers to be read or written are FAR.
227 * The stdio library for small-data memory models can't cope with that.
228 * 2. Extended memory, accessed per the XMS V2.0 specification.
229 * 3. Expanded memory, accessed per the LIM/EMS 4.0 specification.
230 * You'll need copies of those specs to make sense of the related code.
231 * The specs are available by Internet FTP from the SIMTEL archives
232 * (oak.oakland.edu and its various mirror sites). See files
233 * pub/msdos/microsoft/xms20.arc and pub/msdos/info/limems41.zip.
234 */
235
236
237/*
238 * Access methods for a DOS file.
239 */
240
241
242METHODDEF(void)
243read_file_store (j_common_ptr cinfo, backing_store_ptr info,
244 void FAR * buffer_address,
245 long file_offset, long byte_count)
246{
247 if (jdos_seek(info->handle.file_handle, file_offset))
248 ERREXIT(cinfo, JERR_TFILE_SEEK);
249 /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
250 if (byte_count > 65535L) /* safety check */
251 ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
252 if (jdos_read(info->handle.file_handle, buffer_address,
253 (unsigned short) byte_count))
254 ERREXIT(cinfo, JERR_TFILE_READ);
255}
256
257
258METHODDEF(void)
259write_file_store (j_common_ptr cinfo, backing_store_ptr info,
260 void FAR * buffer_address,
261 long file_offset, long byte_count)
262{
263 if (jdos_seek(info->handle.file_handle, file_offset))
264 ERREXIT(cinfo, JERR_TFILE_SEEK);
265 /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
266 if (byte_count > 65535L) /* safety check */
267 ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
268 if (jdos_write(info->handle.file_handle, buffer_address,
269 (unsigned short) byte_count))
270 ERREXIT(cinfo, JERR_TFILE_WRITE);
271}
272
273
274METHODDEF(void)
275close_file_store (j_common_ptr cinfo, backing_store_ptr info)
276{
277 jdos_close(info->handle.file_handle); /* close the file */
278 remove(info->temp_name); /* delete the file */
279/* If your system doesn't have remove(), try unlink() instead.
280 * remove() is the ANSI-standard name for this function, but
281 * unlink() was more common in pre-ANSI systems.
282 */
283 TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
284}
285
286
287LOCAL(boolean)
288open_file_store (j_common_ptr cinfo, backing_store_ptr info,
289 long total_bytes_needed)
290{
291 short handle;
292
293 select_file_name(info->temp_name);
294 if (jdos_open((short far *) & handle, (char far *) info->temp_name)) {
295 /* might as well exit since jpeg_open_backing_store will fail anyway */
296 ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
297 return FALSE;
298 }
299 info->handle.file_handle = handle;
300 info->read_backing_store = read_file_store;
301 info->write_backing_store = write_file_store;
302 info->close_backing_store = close_file_store;
303 TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
304 return TRUE; /* succeeded */
305}
306
307
308/*
309 * Access methods for extended memory.
310 */
311
312#if XMS_SUPPORTED
313
314static XMSDRIVER xms_driver; /* saved address of XMS driver */
315
316typedef union { /* either long offset or real-mode pointer */
317 long offset;
318 void far * ptr;
319 } XMSPTR;
320
321typedef struct { /* XMS move specification structure */
322 long length;
323 XMSH src_handle;
324 XMSPTR src;
325 XMSH dst_handle;
326 XMSPTR dst;
327 } XMSspec;
328
329#define ODD(X) (((X) & 1L) != 0)
330
331
332METHODDEF(void)
333read_xms_store (j_common_ptr cinfo, backing_store_ptr info,
334 void FAR * buffer_address,
335 long file_offset, long byte_count)
336{
337 XMScontext ctx;
338 XMSspec spec;
339 char endbuffer[2];
340
341 /* The XMS driver can't cope with an odd length, so handle the last byte
342 * specially if byte_count is odd. We don't expect this to be common.
343 */
344
345 spec.length = byte_count & (~ 1L);
346 spec.src_handle = info->handle.xms_handle;
347 spec.src.offset = file_offset;
348 spec.dst_handle = 0;
349 spec.dst.ptr = buffer_address;
350
351 ctx.ds_si = (void far *) & spec;
352 ctx.ax = 0x0b00; /* EMB move */
353 jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
354 if (ctx.ax != 1)
355 ERREXIT(cinfo, JERR_XMS_READ);
356
357 if (ODD(byte_count)) {
358 read_xms_store(cinfo, info, (void FAR *) endbuffer,
359 file_offset + byte_count - 1L, 2L);
360 ((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0];
361 }
362}
363
364
365METHODDEF(void)
366write_xms_store (j_common_ptr cinfo, backing_store_ptr info,
367 void FAR * buffer_address,
368 long file_offset, long byte_count)
369{
370 XMScontext ctx;
371 XMSspec spec;
372 char endbuffer[2];
373
374 /* The XMS driver can't cope with an odd length, so handle the last byte
375 * specially if byte_count is odd. We don't expect this to be common.
376 */
377
378 spec.length = byte_count & (~ 1L);
379 spec.src_handle = 0;
380 spec.src.ptr = buffer_address;
381 spec.dst_handle = info->handle.xms_handle;
382 spec.dst.offset = file_offset;
383
384 ctx.ds_si = (void far *) & spec;
385 ctx.ax = 0x0b00; /* EMB move */
386 jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
387 if (ctx.ax != 1)
388 ERREXIT(cinfo, JERR_XMS_WRITE);
389
390 if (ODD(byte_count)) {
391 read_xms_store(cinfo, info, (void FAR *) endbuffer,
392 file_offset + byte_count - 1L, 2L);
393 endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L];
394 write_xms_store(cinfo, info, (void FAR *) endbuffer,
395 file_offset + byte_count - 1L, 2L);
396 }
397}
398
399
400METHODDEF(void)
401close_xms_store (j_common_ptr cinfo, backing_store_ptr info)
402{
403 XMScontext ctx;
404
405 ctx.dx = info->handle.xms_handle;
406 ctx.ax = 0x0a00;
407 jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
408 TRACEMS1(cinfo, 1, JTRC_XMS_CLOSE, info->handle.xms_handle);
409 /* we ignore any error return from the driver */
410}
411
412
413LOCAL(boolean)
414open_xms_store (j_common_ptr cinfo, backing_store_ptr info,
415 long total_bytes_needed)
416{
417 XMScontext ctx;
418
419 /* Get address of XMS driver */
420 jxms_getdriver((XMSDRIVER far *) & xms_driver);
421 if (xms_driver == NULL)
422 return FALSE; /* no driver to be had */
423
424 /* Get version number, must be >= 2.00 */
425 ctx.ax = 0x0000;
426 jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
427 if (ctx.ax < (unsigned short) 0x0200)
428 return FALSE;
429
430 /* Try to get space (expressed in kilobytes) */
431 ctx.dx = (unsigned short) ((total_bytes_needed + 1023L) >> 10);
432 ctx.ax = 0x0900;
433 jxms_calldriver(xms_driver, (XMScontext far *) & ctx);
434 if (ctx.ax != 1)
435 return FALSE;
436
437 /* Succeeded, save the handle and away we go */
438 info->handle.xms_handle = ctx.dx;
439 info->read_backing_store = read_xms_store;
440 info->write_backing_store = write_xms_store;
441 info->close_backing_store = close_xms_store;
442 TRACEMS1(cinfo, 1, JTRC_XMS_OPEN, ctx.dx);
443 return TRUE; /* succeeded */
444}
445
446#endif /* XMS_SUPPORTED */
447
448
449/*
450 * Access methods for expanded memory.
451 */
452
453#if EMS_SUPPORTED
454
455/* The EMS move specification structure requires word and long fields aligned
456 * at odd byte boundaries. Some compilers will align struct fields at even
457 * byte boundaries. While it's usually possible to force byte alignment,
458 * that causes an overall performance penalty and may pose problems in merging
459 * JPEG into a larger application. Instead we accept some rather dirty code
460 * here. Note this code would fail if the hardware did not allow odd-byte
461 * word & long accesses, but all 80x86 CPUs do.
462 */
463
464typedef void far * EMSPTR;
465
466typedef union { /* EMS move specification structure */
467 long length; /* It's easy to access first 4 bytes */
468 char bytes[18]; /* Misaligned fields in here! */
469 } EMSspec;
470
471/* Macros for accessing misaligned fields */
472#define FIELD_AT(spec,offset,type) (*((type *) &(spec.bytes[offset])))
473#define SRC_TYPE(spec) FIELD_AT(spec,4,char)
474#define SRC_HANDLE(spec) FIELD_AT(spec,5,EMSH)
475#define SRC_OFFSET(spec) FIELD_AT(spec,7,unsigned short)
476#define SRC_PAGE(spec) FIELD_AT(spec,9,unsigned short)
477#define SRC_PTR(spec) FIELD_AT(spec,7,EMSPTR)
478#define DST_TYPE(spec) FIELD_AT(spec,11,char)
479#define DST_HANDLE(spec) FIELD_AT(spec,12,EMSH)
480#define DST_OFFSET(spec) FIELD_AT(spec,14,unsigned short)
481#define DST_PAGE(spec) FIELD_AT(spec,16,unsigned short)
482#define DST_PTR(spec) FIELD_AT(spec,14,EMSPTR)
483
484#define EMSPAGESIZE 16384L /* gospel, see the EMS specs */
485
486#define HIBYTE(W) (((W) >> 8) & 0xFF)
487#define LOBYTE(W) ((W) & 0xFF)
488
489
490METHODDEF(void)
491read_ems_store (j_common_ptr cinfo, backing_store_ptr info,
492 void FAR * buffer_address,
493 long file_offset, long byte_count)
494{
495 EMScontext ctx;
496 EMSspec spec;
497
498 spec.length = byte_count;
499 SRC_TYPE(spec) = 1;
500 SRC_HANDLE(spec) = info->handle.ems_handle;
501 SRC_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE);
502 SRC_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE);
503 DST_TYPE(spec) = 0;
504 DST_HANDLE(spec) = 0;
505 DST_PTR(spec) = buffer_address;
506
507 ctx.ds_si = (void far *) & spec;
508 ctx.ax = 0x5700; /* move memory region */
509 jems_calldriver((EMScontext far *) & ctx);
510 if (HIBYTE(ctx.ax) != 0)
511 ERREXIT(cinfo, JERR_EMS_READ);
512}
513
514
515METHODDEF(void)
516write_ems_store (j_common_ptr cinfo, backing_store_ptr info,
517 void FAR * buffer_address,
518 long file_offset, long byte_count)
519{
520 EMScontext ctx;
521 EMSspec spec;
522
523 spec.length = byte_count;
524 SRC_TYPE(spec) = 0;
525 SRC_HANDLE(spec) = 0;
526 SRC_PTR(spec) = buffer_address;
527 DST_TYPE(spec) = 1;
528 DST_HANDLE(spec) = info->handle.ems_handle;
529 DST_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE);
530 DST_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE);
531
532 ctx.ds_si = (void far *) & spec;
533 ctx.ax = 0x5700; /* move memory region */
534 jems_calldriver((EMScontext far *) & ctx);
535 if (HIBYTE(ctx.ax) != 0)
536 ERREXIT(cinfo, JERR_EMS_WRITE);
537}
538
539
540METHODDEF(void)
541close_ems_store (j_common_ptr cinfo, backing_store_ptr info)
542{
543 EMScontext ctx;
544
545 ctx.ax = 0x4500;
546 ctx.dx = info->handle.ems_handle;
547 jems_calldriver((EMScontext far *) & ctx);
548 TRACEMS1(cinfo, 1, JTRC_EMS_CLOSE, info->handle.ems_handle);
549 /* we ignore any error return from the driver */
550}
551
552
553LOCAL(boolean)
554open_ems_store (j_common_ptr cinfo, backing_store_ptr info,
555 long total_bytes_needed)
556{
557 EMScontext ctx;
558
559 /* Is EMS driver there? */
560 if (! jems_available())
561 return FALSE;
562
563 /* Get status, make sure EMS is OK */
564 ctx.ax = 0x4000;
565 jems_calldriver((EMScontext far *) & ctx);
566 if (HIBYTE(ctx.ax) != 0)
567 return FALSE;
568
569 /* Get version, must be >= 4.0 */
570 ctx.ax = 0x4600;
571 jems_calldriver((EMScontext far *) & ctx);
572 if (HIBYTE(ctx.ax) != 0 || LOBYTE(ctx.ax) < 0x40)
573 return FALSE;
574
575 /* Try to allocate requested space */
576 ctx.ax = 0x4300;
577 ctx.bx = (unsigned short) ((total_bytes_needed + EMSPAGESIZE-1L) / EMSPAGESIZE);
578 jems_calldriver((EMScontext far *) & ctx);
579 if (HIBYTE(ctx.ax) != 0)
580 return FALSE;
581
582 /* Succeeded, save the handle and away we go */
583 info->handle.ems_handle = ctx.dx;
584 info->read_backing_store = read_ems_store;
585 info->write_backing_store = write_ems_store;
586 info->close_backing_store = close_ems_store;
587 TRACEMS1(cinfo, 1, JTRC_EMS_OPEN, ctx.dx);
588 return TRUE; /* succeeded */
589}
590
591#endif /* EMS_SUPPORTED */
592
593
594/*
595 * Initial opening of a backing-store object.
596 */
597
598GLOBAL(void)
599jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
600 long total_bytes_needed)
601{
602 /* Try extended memory, then expanded memory, then regular file. */
603#if XMS_SUPPORTED
604 if (open_xms_store(cinfo, info, total_bytes_needed))
605 return;
606#endif
607#if EMS_SUPPORTED
608 if (open_ems_store(cinfo, info, total_bytes_needed))
609 return;
610#endif
611 if (open_file_store(cinfo, info, total_bytes_needed))
612 return;
613 ERREXITS(cinfo, JERR_TFILE_CREATE, "");
614}
615
616
617/*
618 * These routines take care of any system-dependent initialization and
619 * cleanup required.
620 */
621
622GLOBAL(long)
623jpeg_mem_init (j_common_ptr cinfo)
624{
625 next_file_num = 0; /* initialize temp file name generator */
626 return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
627}
628
629GLOBAL(void)
630jpeg_mem_term (j_common_ptr cinfo)
631{
632 /* Microsoft C, at least in v6.00A, will not successfully reclaim freed
633 * blocks of size > 32Kbytes unless we give it a kick in the rear, like so:
634 */
635#ifdef NEED_FHEAPMIN
636 _fheapmin();
637#endif
638}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdosa.asm b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdosa.asm
new file mode 100644
index 0000000..c6ec48b
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemdosa.asm
@@ -0,0 +1,379 @@
1;
2; jmemdosa.asm
3;
4; Copyright (C) 1992, Thomas G. Lane.
5; This file is part of the Independent JPEG Group's software.
6; For conditions of distribution and use, see the accompanying README file.
7;
8; This file contains low-level interface routines to support the MS-DOS
9; backing store manager (jmemdos.c). Routines are provided to access disk
10; files through direct DOS calls, and to access XMS and EMS drivers.
11;
12; This file should assemble with Microsoft's MASM or any compatible
13; assembler (including Borland's Turbo Assembler). If you haven't got
14; a compatible assembler, better fall back to jmemansi.c or jmemname.c.
15;
16; To minimize dependence on the C compiler's register usage conventions,
17; we save and restore all 8086 registers, even though most compilers only
18; require SI,DI,DS to be preserved. Also, we use only 16-bit-wide return
19; values, which everybody returns in AX.
20;
21; Based on code contributed by Ge' Weijers.
22;
23
24JMEMDOSA_TXT segment byte public 'CODE'
25
26 assume cs:JMEMDOSA_TXT
27
28 public _jdos_open
29 public _jdos_close
30 public _jdos_seek
31 public _jdos_read
32 public _jdos_write
33 public _jxms_getdriver
34 public _jxms_calldriver
35 public _jems_available
36 public _jems_calldriver
37
38;
39; short far jdos_open (short far * handle, char far * filename)
40;
41; Create and open a temporary file
42;
43_jdos_open proc far
44 push bp ; linkage
45 mov bp,sp
46 push si ; save all registers for safety
47 push di
48 push bx
49 push cx
50 push dx
51 push es
52 push ds
53 mov cx,0 ; normal file attributes
54 lds dx,dword ptr [bp+10] ; get filename pointer
55 mov ah,3ch ; create file
56 int 21h
57 jc open_err ; if failed, return error code
58 lds bx,dword ptr [bp+6] ; get handle pointer
59 mov word ptr [bx],ax ; save the handle
60 xor ax,ax ; return zero for OK
61open_err: pop ds ; restore registers and exit
62 pop es
63 pop dx
64 pop cx
65 pop bx
66 pop di
67 pop si
68 pop bp
69 ret
70_jdos_open endp
71
72
73;
74; short far jdos_close (short handle)
75;
76; Close the file handle
77;
78_jdos_close proc far
79 push bp ; linkage
80 mov bp,sp
81 push si ; save all registers for safety
82 push di
83 push bx
84 push cx
85 push dx
86 push es
87 push ds
88 mov bx,word ptr [bp+6] ; file handle
89 mov ah,3eh ; close file
90 int 21h
91 jc close_err ; if failed, return error code
92 xor ax,ax ; return zero for OK
93close_err: pop ds ; restore registers and exit
94 pop es
95 pop dx
96 pop cx
97 pop bx
98 pop di
99 pop si
100 pop bp
101 ret
102_jdos_close endp
103
104
105;
106; short far jdos_seek (short handle, long offset)
107;
108; Set file position
109;
110_jdos_seek proc far
111 push bp ; linkage
112 mov bp,sp
113 push si ; save all registers for safety
114 push di
115 push bx
116 push cx
117 push dx
118 push es
119 push ds
120 mov bx,word ptr [bp+6] ; file handle
121 mov dx,word ptr [bp+8] ; LS offset
122 mov cx,word ptr [bp+10] ; MS offset
123 mov ax,4200h ; absolute seek
124 int 21h
125 jc seek_err ; if failed, return error code
126 xor ax,ax ; return zero for OK
127seek_err: pop ds ; restore registers and exit
128 pop es
129 pop dx
130 pop cx
131 pop bx
132 pop di
133 pop si
134 pop bp
135 ret
136_jdos_seek endp
137
138
139;
140; short far jdos_read (short handle, void far * buffer, unsigned short count)
141;
142; Read from file
143;
144_jdos_read proc far
145 push bp ; linkage
146 mov bp,sp
147 push si ; save all registers for safety
148 push di
149 push bx
150 push cx
151 push dx
152 push es
153 push ds
154 mov bx,word ptr [bp+6] ; file handle
155 lds dx,dword ptr [bp+8] ; buffer address
156 mov cx,word ptr [bp+12] ; number of bytes
157 mov ah,3fh ; read file
158 int 21h
159 jc read_err ; if failed, return error code
160 cmp ax,word ptr [bp+12] ; make sure all bytes were read
161 je read_ok
162 mov ax,1 ; else return 1 for not OK
163 jmp short read_err
164read_ok: xor ax,ax ; return zero for OK
165read_err: pop ds ; restore registers and exit
166 pop es
167 pop dx
168 pop cx
169 pop bx
170 pop di
171 pop si
172 pop bp
173 ret
174_jdos_read endp
175
176
177;
178; short far jdos_write (short handle, void far * buffer, unsigned short count)
179;
180; Write to file
181;
182_jdos_write proc far
183 push bp ; linkage
184 mov bp,sp
185 push si ; save all registers for safety
186 push di
187 push bx
188 push cx
189 push dx
190 push es
191 push ds
192 mov bx,word ptr [bp+6] ; file handle
193 lds dx,dword ptr [bp+8] ; buffer address
194 mov cx,word ptr [bp+12] ; number of bytes
195 mov ah,40h ; write file
196 int 21h
197 jc write_err ; if failed, return error code
198 cmp ax,word ptr [bp+12] ; make sure all bytes written
199 je write_ok
200 mov ax,1 ; else return 1 for not OK
201 jmp short write_err
202write_ok: xor ax,ax ; return zero for OK
203write_err: pop ds ; restore registers and exit
204 pop es
205 pop dx
206 pop cx
207 pop bx
208 pop di
209 pop si
210 pop bp
211 ret
212_jdos_write endp
213
214
215;
216; void far jxms_getdriver (XMSDRIVER far *)
217;
218; Get the address of the XMS driver, or NULL if not available
219;
220_jxms_getdriver proc far
221 push bp ; linkage
222 mov bp,sp
223 push si ; save all registers for safety
224 push di
225 push bx
226 push cx
227 push dx
228 push es
229 push ds
230 mov ax,4300h ; call multiplex interrupt with
231 int 2fh ; a magic cookie, hex 4300
232 cmp al,80h ; AL should contain hex 80
233 je xmsavail
234 xor dx,dx ; no XMS driver available
235 xor ax,ax ; return a nil pointer
236 jmp short xmsavail_done
237xmsavail: mov ax,4310h ; fetch driver address with
238 int 2fh ; another magic cookie
239 mov dx,es ; copy address to dx:ax
240 mov ax,bx
241xmsavail_done: les bx,dword ptr [bp+6] ; get pointer to return value
242 mov word ptr es:[bx],ax
243 mov word ptr es:[bx+2],dx
244 pop ds ; restore registers and exit
245 pop es
246 pop dx
247 pop cx
248 pop bx
249 pop di
250 pop si
251 pop bp
252 ret
253_jxms_getdriver endp
254
255
256;
257; void far jxms_calldriver (XMSDRIVER, XMScontext far *)
258;
259; The XMScontext structure contains values for the AX,DX,BX,SI,DS registers.
260; These are loaded, the XMS call is performed, and the new values of the
261; AX,DX,BX registers are written back to the context structure.
262;
263_jxms_calldriver proc far
264 push bp ; linkage
265 mov bp,sp
266 push si ; save all registers for safety
267 push di
268 push bx
269 push cx
270 push dx
271 push es
272 push ds
273 les bx,dword ptr [bp+10] ; get XMScontext pointer
274 mov ax,word ptr es:[bx] ; load registers
275 mov dx,word ptr es:[bx+2]
276 mov si,word ptr es:[bx+6]
277 mov ds,word ptr es:[bx+8]
278 mov bx,word ptr es:[bx+4]
279 call dword ptr [bp+6] ; call the driver
280 mov cx,bx ; save returned BX for a sec
281 les bx,dword ptr [bp+10] ; get XMScontext pointer
282 mov word ptr es:[bx],ax ; put back ax,dx,bx
283 mov word ptr es:[bx+2],dx
284 mov word ptr es:[bx+4],cx
285 pop ds ; restore registers and exit
286 pop es
287 pop dx
288 pop cx
289 pop bx
290 pop di
291 pop si
292 pop bp
293 ret
294_jxms_calldriver endp
295
296
297;
298; short far jems_available (void)
299;
300; Have we got an EMS driver? (this comes straight from the EMS 4.0 specs)
301;
302_jems_available proc far
303 push si ; save all registers for safety
304 push di
305 push bx
306 push cx
307 push dx
308 push es
309 push ds
310 mov ax,3567h ; get interrupt vector 67h
311 int 21h
312 push cs
313 pop ds
314 mov di,000ah ; check offs 10 in returned seg
315 lea si,ASCII_device_name ; against literal string
316 mov cx,8
317 cld
318 repe cmpsb
319 jne no_ems
320 mov ax,1 ; match, it's there
321 jmp short avail_done
322no_ems: xor ax,ax ; it's not there
323avail_done: pop ds ; restore registers and exit
324 pop es
325 pop dx
326 pop cx
327 pop bx
328 pop di
329 pop si
330 ret
331
332ASCII_device_name db "EMMXXXX0"
333
334_jems_available endp
335
336
337;
338; void far jems_calldriver (EMScontext far *)
339;
340; The EMScontext structure contains values for the AX,DX,BX,SI,DS registers.
341; These are loaded, the EMS trap is performed, and the new values of the
342; AX,DX,BX registers are written back to the context structure.
343;
344_jems_calldriver proc far
345 push bp ; linkage
346 mov bp,sp
347 push si ; save all registers for safety
348 push di
349 push bx
350 push cx
351 push dx
352 push es
353 push ds
354 les bx,dword ptr [bp+6] ; get EMScontext pointer
355 mov ax,word ptr es:[bx] ; load registers
356 mov dx,word ptr es:[bx+2]
357 mov si,word ptr es:[bx+6]
358 mov ds,word ptr es:[bx+8]
359 mov bx,word ptr es:[bx+4]
360 int 67h ; call the EMS driver
361 mov cx,bx ; save returned BX for a sec
362 les bx,dword ptr [bp+6] ; get EMScontext pointer
363 mov word ptr es:[bx],ax ; put back ax,dx,bx
364 mov word ptr es:[bx+2],dx
365 mov word ptr es:[bx+4],cx
366 pop ds ; restore registers and exit
367 pop es
368 pop dx
369 pop cx
370 pop bx
371 pop di
372 pop si
373 pop bp
374 ret
375_jems_calldriver endp
376
377JMEMDOSA_TXT ends
378
379 end
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmac.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmac.c
new file mode 100644
index 0000000..a6f043e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmac.c
@@ -0,0 +1,289 @@
1/*
2 * jmemmac.c
3 *
4 * Copyright (C) 1992-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * jmemmac.c provides an Apple Macintosh implementation of the system-
9 * dependent portion of the JPEG memory manager.
10 *
11 * If you use jmemmac.c, then you must define USE_MAC_MEMMGR in the
12 * JPEG_INTERNALS part of jconfig.h.
13 *
14 * jmemmac.c uses the Macintosh toolbox routines NewPtr and DisposePtr
15 * instead of malloc and free. It accurately determines the amount of
16 * memory available by using CompactMem. Notice that if left to its
17 * own devices, this code can chew up all available space in the
18 * application's zone, with the exception of the rather small "slop"
19 * factor computed in jpeg_mem_available(). The application can ensure
20 * that more space is left over by reducing max_memory_to_use.
21 *
22 * Large images are swapped to disk using temporary files and System 7.0+'s
23 * temporary folder functionality.
24 *
25 * Note that jmemmac.c depends on two features of MacOS that were first
26 * introduced in System 7: FindFolder and the FSSpec-based calls.
27 * If your application uses jmemmac.c and is run under System 6 or earlier,
28 * and the jpeg library decides it needs a temporary file, it will abort,
29 * printing error messages about requiring System 7. (If no temporary files
30 * are created, it will run fine.)
31 *
32 * If you want to use jmemmac.c in an application that might be used with
33 * System 6 or earlier, then you should remove dependencies on FindFolder
34 * and the FSSpec calls. You will need to replace FindFolder with some
35 * other mechanism for finding a place to put temporary files, and you
36 * should replace the FSSpec calls with their HFS equivalents:
37 *
38 * FSpDelete -> HDelete
39 * FSpGetFInfo -> HGetFInfo
40 * FSpCreate -> HCreate
41 * FSpOpenDF -> HOpen *** Note: not HOpenDF ***
42 * FSMakeFSSpec -> (fill in spec by hand.)
43 *
44 * (Use HOpen instead of HOpenDF. HOpen is just a glue-interface to PBHOpen,
45 * which is on all HFS macs. HOpenDF is a System 7 addition which avoids the
46 * ages-old problem of names starting with a period.)
47 *
48 * Contributed by Sam Bushell (jsam@iagu.on.net) and
49 * Dan Gildor (gyld@in-touch.com).
50 */
51
52#define JPEG_INTERNALS
53#include "jinclude.h"
54#include "jpeglib.h"
55#include "jmemsys.h" /* import the system-dependent declarations */
56
57#ifndef USE_MAC_MEMMGR /* make sure user got configuration right */
58 You forgot to define USE_MAC_MEMMGR in jconfig.h. /* deliberate syntax error */
59#endif
60
61#include <Memory.h> /* we use the MacOS memory manager */
62#include <Files.h> /* we use the MacOS File stuff */
63#include <Folders.h> /* we use the MacOS HFS stuff */
64#include <Script.h> /* for smSystemScript */
65#include <Gestalt.h> /* we use Gestalt to test for specific functionality */
66
67#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */
68#define TEMP_FILE_NAME "JPG%03d.TMP"
69#endif
70
71static int next_file_num; /* to distinguish among several temp files */
72
73
74/*
75 * Memory allocation and freeing are controlled by the MacOS library
76 * routines NewPtr() and DisposePtr(), which allocate fixed-address
77 * storage. Unfortunately, the IJG library isn't smart enough to cope
78 * with relocatable storage.
79 */
80
81GLOBAL(void *)
82jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
83{
84 return (void *) NewPtr(sizeofobject);
85}
86
87GLOBAL(void)
88jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
89{
90 DisposePtr((Ptr) object);
91}
92
93
94/*
95 * "Large" objects are treated the same as "small" ones.
96 * NB: we include FAR keywords in the routine declarations simply for
97 * consistency with the rest of the IJG code; FAR should expand to empty
98 * on rational architectures like the Mac.
99 */
100
101GLOBAL(void FAR *)
102jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
103{
104 return (void FAR *) NewPtr(sizeofobject);
105}
106
107GLOBAL(void)
108jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
109{
110 DisposePtr((Ptr) object);
111}
112
113
114/*
115 * This routine computes the total memory space available for allocation.
116 */
117
118GLOBAL(long)
119jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
120 long max_bytes_needed, long already_allocated)
121{
122 long limit = cinfo->mem->max_memory_to_use - already_allocated;
123 long slop, mem;
124
125 /* Don't ask for more than what application has told us we may use */
126 if (max_bytes_needed > limit && limit > 0)
127 max_bytes_needed = limit;
128 /* Find whether there's a big enough free block in the heap.
129 * CompactMem tries to create a contiguous block of the requested size,
130 * and then returns the size of the largest free block (which could be
131 * much more or much less than we asked for).
132 * We add some slop to ensure we don't use up all available memory.
133 */
134 slop = max_bytes_needed / 16 + 32768L;
135 mem = CompactMem(max_bytes_needed + slop) - slop;
136 if (mem < 0)
137 mem = 0; /* sigh, couldn't even get the slop */
138 /* Don't take more than the application says we can have */
139 if (mem > limit && limit > 0)
140 mem = limit;
141 return mem;
142}
143
144
145/*
146 * Backing store (temporary file) management.
147 * Backing store objects are only used when the value returned by
148 * jpeg_mem_available is less than the total space needed. You can dispense
149 * with these routines if you have plenty of virtual memory; see jmemnobs.c.
150 */
151
152
153METHODDEF(void)
154read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
155 void FAR * buffer_address,
156 long file_offset, long byte_count)
157{
158 long bytes = byte_count;
159 long retVal;
160
161 if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )
162 ERREXIT(cinfo, JERR_TFILE_SEEK);
163
164 retVal = FSRead ( info->temp_file, &bytes,
165 (unsigned char *) buffer_address );
166 if ( retVal != noErr || bytes != byte_count )
167 ERREXIT(cinfo, JERR_TFILE_READ);
168}
169
170
171METHODDEF(void)
172write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
173 void FAR * buffer_address,
174 long file_offset, long byte_count)
175{
176 long bytes = byte_count;
177 long retVal;
178
179 if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )
180 ERREXIT(cinfo, JERR_TFILE_SEEK);
181
182 retVal = FSWrite ( info->temp_file, &bytes,
183 (unsigned char *) buffer_address );
184 if ( retVal != noErr || bytes != byte_count )
185 ERREXIT(cinfo, JERR_TFILE_WRITE);
186}
187
188
189METHODDEF(void)
190close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
191{
192 FSClose ( info->temp_file );
193 FSpDelete ( &(info->tempSpec) );
194}
195
196
197/*
198 * Initial opening of a backing-store object.
199 *
200 * This version uses FindFolder to find the Temporary Items folder,
201 * and puts the temporary file in there.
202 */
203
204GLOBAL(void)
205jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
206 long total_bytes_needed)
207{
208 short tmpRef, vRefNum;
209 long dirID;
210 FInfo finderInfo;
211 FSSpec theSpec;
212 Str255 fName;
213 OSErr osErr;
214 long gestaltResponse = 0;
215
216 /* Check that FSSpec calls are available. */
217 osErr = Gestalt( gestaltFSAttr, &gestaltResponse );
218 if ( ( osErr != noErr )
219 || !( gestaltResponse & (1<<gestaltHasFSSpecCalls) ) )
220 ERREXITS(cinfo, JERR_TFILE_CREATE, "- System 7.0 or later required");
221 /* TO DO: add a proper error message to jerror.h. */
222
223 /* Check that FindFolder is available. */
224 osErr = Gestalt( gestaltFindFolderAttr, &gestaltResponse );
225 if ( ( osErr != noErr )
226 || !( gestaltResponse & (1<<gestaltFindFolderPresent) ) )
227 ERREXITS(cinfo, JERR_TFILE_CREATE, "- System 7.0 or later required.");
228 /* TO DO: add a proper error message to jerror.h. */
229
230 osErr = FindFolder ( kOnSystemDisk, kTemporaryFolderType, kCreateFolder,
231 &vRefNum, &dirID );
232 if ( osErr != noErr )
233 ERREXITS(cinfo, JERR_TFILE_CREATE, "- temporary items folder unavailable");
234 /* TO DO: Try putting the temp files somewhere else. */
235
236 /* Keep generating file names till we find one that's not in use */
237 for (;;) {
238 next_file_num++; /* advance counter */
239
240 sprintf(info->temp_name, TEMP_FILE_NAME, next_file_num);
241 strcpy ( (Ptr)fName+1, info->temp_name );
242 *fName = strlen (info->temp_name);
243 osErr = FSMakeFSSpec ( vRefNum, dirID, fName, &theSpec );
244
245 if ( (osErr = FSpGetFInfo ( &theSpec, &finderInfo ) ) != noErr )
246 break;
247 }
248
249 osErr = FSpCreate ( &theSpec, '????', '????', smSystemScript );
250 if ( osErr != noErr )
251 ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
252
253 osErr = FSpOpenDF ( &theSpec, fsRdWrPerm, &(info->temp_file) );
254 if ( osErr != noErr )
255 ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
256
257 info->tempSpec = theSpec;
258
259 info->read_backing_store = read_backing_store;
260 info->write_backing_store = write_backing_store;
261 info->close_backing_store = close_backing_store;
262 TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
263}
264
265
266/*
267 * These routines take care of any system-dependent initialization and
268 * cleanup required.
269 */
270
271GLOBAL(long)
272jpeg_mem_init (j_common_ptr cinfo)
273{
274 next_file_num = 0;
275
276 /* max_memory_to_use will be initialized to FreeMem()'s result;
277 * the calling application might later reduce it, for example
278 * to leave room to invoke multiple JPEG objects.
279 * Note that FreeMem returns the total number of free bytes;
280 * it may not be possible to allocate a single block of this size.
281 */
282 return FreeMem();
283}
284
285GLOBAL(void)
286jpeg_mem_term (j_common_ptr cinfo)
287{
288 /* no work */
289}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmgr.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmgr.c
new file mode 100644
index 0000000..92ee3ac
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemmgr.c
@@ -0,0 +1,1119 @@
1/*
2 * jmemmgr.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains the JPEG system-independent memory management
10 * routines. This code is usable across a wide variety of machines; most
11 * of the system dependencies have been isolated in a separate file.
12 * The major functions provided here are:
13 * * pool-based allocation and freeing of memory;
14 * * policy decisions about how to divide available memory among the
15 * virtual arrays;
16 * * control logic for swapping virtual arrays between main memory and
17 * backing storage.
18 * The separate system-dependent file provides the actual backing-storage
19 * access code, and it contains the policy decision about how much total
20 * main memory to use.
21 * This file is system-dependent in the sense that some of its functions
22 * are unnecessary in some systems. For example, if there is enough virtual
23 * memory so that backing storage will never be used, much of the virtual
24 * array control logic could be removed. (Of course, if you have that much
25 * memory then you shouldn't care about a little bit of unused code...)
26 */
27
28#define JPEG_INTERNALS
29#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */
30#include "jinclude.h"
31#include "jpeglib.h"
32#include "jmemsys.h" /* import the system-dependent declarations */
33
34#ifndef NO_GETENV
35#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare getenv() */
36extern char * getenv JPP((const char * name));
37#endif
38#endif
39
40
41/*
42 * Some important notes:
43 * The allocation routines provided here must never return NULL.
44 * They should exit to error_exit if unsuccessful.
45 *
46 * It's not a good idea to try to merge the sarray and barray routines,
47 * even though they are textually almost the same, because samples are
48 * usually stored as bytes while coefficients are shorts or ints. Thus,
49 * in machines where byte pointers have a different representation from
50 * word pointers, the resulting machine code could not be the same.
51 */
52
53
54/*
55 * Many machines require storage alignment: longs must start on 4-byte
56 * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc()
57 * always returns pointers that are multiples of the worst-case alignment
58 * requirement, and we had better do so too.
59 * There isn't any really portable way to determine the worst-case alignment
60 * requirement. This module assumes that the alignment requirement is
61 * multiples of sizeof(ALIGN_TYPE).
62 * By default, we define ALIGN_TYPE as double. This is necessary on some
63 * workstations (where doubles really do need 8-byte alignment) and will work
64 * fine on nearly everything. If your machine has lesser alignment needs,
65 * you can save a few bytes by making ALIGN_TYPE smaller.
66 * The only place I know of where this will NOT work is certain Macintosh
67 * 680x0 compilers that define double as a 10-byte IEEE extended float.
68 * Doing 10-byte alignment is counterproductive because longwords won't be
69 * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have
70 * such a compiler.
71 */
72
73#ifndef ALIGN_TYPE /* so can override from jconfig.h */
74#define ALIGN_TYPE double
75#endif
76
77
78/*
79 * We allocate objects from "pools", where each pool is gotten with a single
80 * request to jpeg_get_small() or jpeg_get_large(). There is no per-object
81 * overhead within a pool, except for alignment padding. Each pool has a
82 * header with a link to the next pool of the same class.
83 * Small and large pool headers are identical except that the latter's
84 * link pointer must be FAR on 80x86 machines.
85 * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE
86 * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple
87 * of the alignment requirement of ALIGN_TYPE.
88 */
89
90typedef union small_pool_struct * small_pool_ptr;
91
92typedef union small_pool_struct {
93 struct {
94 small_pool_ptr next; /* next in list of pools */
95 size_t bytes_used; /* how many bytes already used within pool */
96 size_t bytes_left; /* bytes still available in this pool */
97 } hdr;
98 ALIGN_TYPE dummy; /* included in union to ensure alignment */
99} small_pool_hdr;
100
101typedef union large_pool_struct FAR * large_pool_ptr;
102
103typedef union large_pool_struct {
104 struct {
105 large_pool_ptr next; /* next in list of pools */
106 size_t bytes_used; /* how many bytes already used within pool */
107 size_t bytes_left; /* bytes still available in this pool */
108 } hdr;
109 ALIGN_TYPE dummy; /* included in union to ensure alignment */
110} large_pool_hdr;
111
112
113/*
114 * Here is the full definition of a memory manager object.
115 */
116
117typedef struct {
118 struct jpeg_memory_mgr pub; /* public fields */
119
120 /* Each pool identifier (lifetime class) names a linked list of pools. */
121 small_pool_ptr small_list[JPOOL_NUMPOOLS];
122 large_pool_ptr large_list[JPOOL_NUMPOOLS];
123
124 /* Since we only have one lifetime class of virtual arrays, only one
125 * linked list is necessary (for each datatype). Note that the virtual
126 * array control blocks being linked together are actually stored somewhere
127 * in the small-pool list.
128 */
129 jvirt_sarray_ptr virt_sarray_list;
130 jvirt_barray_ptr virt_barray_list;
131
132 /* This counts total space obtained from jpeg_get_small/large */
133 long total_space_allocated;
134
135 /* alloc_sarray and alloc_barray set this value for use by virtual
136 * array routines.
137 */
138 JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */
139} my_memory_mgr;
140
141typedef my_memory_mgr * my_mem_ptr;
142
143
144/*
145 * The control blocks for virtual arrays.
146 * Note that these blocks are allocated in the "small" pool area.
147 * System-dependent info for the associated backing store (if any) is hidden
148 * inside the backing_store_info struct.
149 */
150
151struct jvirt_sarray_control {
152 JSAMPARRAY mem_buffer; /* => the in-memory buffer */
153 JDIMENSION rows_in_array; /* total virtual array height */
154 JDIMENSION samplesperrow; /* width of array (and of memory buffer) */
155 JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */
156 JDIMENSION rows_in_mem; /* height of memory buffer */
157 JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
158 JDIMENSION cur_start_row; /* first logical row # in the buffer */
159 JDIMENSION first_undef_row; /* row # of first uninitialized row */
160 boolean pre_zero; /* pre-zero mode requested? */
161 boolean dirty; /* do current buffer contents need written? */
162 boolean b_s_open; /* is backing-store data valid? */
163 jvirt_sarray_ptr next; /* link to next virtual sarray control block */
164 backing_store_info b_s_info; /* System-dependent control info */
165};
166
167struct jvirt_barray_control {
168 JBLOCKARRAY mem_buffer; /* => the in-memory buffer */
169 JDIMENSION rows_in_array; /* total virtual array height */
170 JDIMENSION blocksperrow; /* width of array (and of memory buffer) */
171 JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */
172 JDIMENSION rows_in_mem; /* height of memory buffer */
173 JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
174 JDIMENSION cur_start_row; /* first logical row # in the buffer */
175 JDIMENSION first_undef_row; /* row # of first uninitialized row */
176 boolean pre_zero; /* pre-zero mode requested? */
177 boolean dirty; /* do current buffer contents need written? */
178 boolean b_s_open; /* is backing-store data valid? */
179 jvirt_barray_ptr next; /* link to next virtual barray control block */
180 backing_store_info b_s_info; /* System-dependent control info */
181};
182
183
184#ifdef MEM_STATS /* optional extra stuff for statistics */
185
186LOCAL(void)
187print_mem_stats (j_common_ptr cinfo, int pool_id)
188{
189 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
190 small_pool_ptr shdr_ptr;
191 large_pool_ptr lhdr_ptr;
192
193 /* Since this is only a debugging stub, we can cheat a little by using
194 * fprintf directly rather than going through the trace message code.
195 * This is helpful because message parm array can't handle longs.
196 */
197 fprintf(stderr, "Freeing pool %d, total space = %ld\n",
198 pool_id, mem->total_space_allocated);
199
200 for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
201 lhdr_ptr = lhdr_ptr->hdr.next) {
202 fprintf(stderr, " Large chunk used %ld\n",
203 (long) lhdr_ptr->hdr.bytes_used);
204 }
205
206 for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
207 shdr_ptr = shdr_ptr->hdr.next) {
208 fprintf(stderr, " Small chunk used %ld free %ld\n",
209 (long) shdr_ptr->hdr.bytes_used,
210 (long) shdr_ptr->hdr.bytes_left);
211 }
212}
213
214#endif /* MEM_STATS */
215
216
217LOCAL(void)
218out_of_memory (j_common_ptr cinfo, int which)
219/* Report an out-of-memory error and stop execution */
220/* If we compiled MEM_STATS support, report alloc requests before dying */
221{
222#ifdef MEM_STATS
223 cinfo->err->trace_level = 2; /* force self_destruct to report stats */
224#endif
225 ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);
226}
227
228
229/*
230 * Allocation of "small" objects.
231 *
232 * For these, we use pooled storage. When a new pool must be created,
233 * we try to get enough space for the current request plus a "slop" factor,
234 * where the slop will be the amount of leftover space in the new pool.
235 * The speed vs. space tradeoff is largely determined by the slop values.
236 * A different slop value is provided for each pool class (lifetime),
237 * and we also distinguish the first pool of a class from later ones.
238 * NOTE: the values given work fairly well on both 16- and 32-bit-int
239 * machines, but may be too small if longs are 64 bits or more.
240 */
241
242static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
243{
244 1600, /* first PERMANENT pool */
245 16000 /* first IMAGE pool */
246};
247
248static const size_t extra_pool_slop[JPOOL_NUMPOOLS] =
249{
250 0, /* additional PERMANENT pools */
251 5000 /* additional IMAGE pools */
252};
253
254#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */
255
256
257METHODDEF(void *)
258alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
259/* Allocate a "small" object */
260{
261 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
262 small_pool_ptr hdr_ptr, prev_hdr_ptr;
263 char * data_ptr;
264 size_t odd_bytes, min_request, slop;
265
266 /* Check for unsatisfiable request (do now to ensure no overflow below) */
267 if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
268 out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
269
270 /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
271 odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
272 if (odd_bytes > 0)
273 sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
274
275 /* See if space is available in any existing pool */
276 if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
277 ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
278 prev_hdr_ptr = NULL;
279 hdr_ptr = mem->small_list[pool_id];
280 while (hdr_ptr != NULL) {
281 if (hdr_ptr->hdr.bytes_left >= sizeofobject)
282 break; /* found pool with enough space */
283 prev_hdr_ptr = hdr_ptr;
284 hdr_ptr = hdr_ptr->hdr.next;
285 }
286
287 /* Time to make a new pool? */
288 if (hdr_ptr == NULL) {
289 /* min_request is what we need now, slop is what will be leftover */
290 min_request = sizeofobject + SIZEOF(small_pool_hdr);
291 if (prev_hdr_ptr == NULL) /* first pool in class? */
292 slop = first_pool_slop[pool_id];
293 else
294 slop = extra_pool_slop[pool_id];
295 /* Don't ask for more than MAX_ALLOC_CHUNK */
296 if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
297 slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
298 /* Try to get space, if fail reduce slop and try again */
299 for (;;) {
300 hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
301 if (hdr_ptr != NULL)
302 break;
303 slop /= 2;
304 if (slop < MIN_SLOP) /* give up when it gets real small */
305 out_of_memory(cinfo, 2); /* jpeg_get_small failed */
306 }
307 mem->total_space_allocated += min_request + slop;
308 /* Success, initialize the new pool header and add to end of list */
309 hdr_ptr->hdr.next = NULL;
310 hdr_ptr->hdr.bytes_used = 0;
311 hdr_ptr->hdr.bytes_left = sizeofobject + slop;
312 if (prev_hdr_ptr == NULL) /* first pool in class? */
313 mem->small_list[pool_id] = hdr_ptr;
314 else
315 prev_hdr_ptr->hdr.next = hdr_ptr;
316 }
317
318 /* OK, allocate the object from the current pool */
319 data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */
320 data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */
321 hdr_ptr->hdr.bytes_used += sizeofobject;
322 hdr_ptr->hdr.bytes_left -= sizeofobject;
323
324 return (void *) data_ptr;
325}
326
327
328/*
329 * Allocation of "large" objects.
330 *
331 * The external semantics of these are the same as "small" objects,
332 * except that FAR pointers are used on 80x86. However the pool
333 * management heuristics are quite different. We assume that each
334 * request is large enough that it may as well be passed directly to
335 * jpeg_get_large; the pool management just links everything together
336 * so that we can free it all on demand.
337 * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY
338 * structures. The routines that create these structures (see below)
339 * deliberately bunch rows together to ensure a large request size.
340 */
341
342METHODDEF(void FAR *)
343alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
344/* Allocate a "large" object */
345{
346 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
347 large_pool_ptr hdr_ptr;
348 size_t odd_bytes;
349
350 /* Check for unsatisfiable request (do now to ensure no overflow below) */
351 if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
352 out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
353
354 /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
355 odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
356 if (odd_bytes > 0)
357 sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
358
359 /* Always make a new pool */
360 if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
361 ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
362
363 hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
364 SIZEOF(large_pool_hdr));
365 if (hdr_ptr == NULL)
366 out_of_memory(cinfo, 4); /* jpeg_get_large failed */
367 mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
368
369 /* Success, initialize the new pool header and add to list */
370 hdr_ptr->hdr.next = mem->large_list[pool_id];
371 /* We maintain space counts in each pool header for statistical purposes,
372 * even though they are not needed for allocation.
373 */
374 hdr_ptr->hdr.bytes_used = sizeofobject;
375 hdr_ptr->hdr.bytes_left = 0;
376 mem->large_list[pool_id] = hdr_ptr;
377
378 return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
379}
380
381
382/*
383 * Creation of 2-D sample arrays.
384 * The pointers are in near heap, the samples themselves in FAR heap.
385 *
386 * To minimize allocation overhead and to allow I/O of large contiguous
387 * blocks, we allocate the sample rows in groups of as many rows as possible
388 * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.
389 * NB: the virtual array control routines, later in this file, know about
390 * this chunking of rows. The rowsperchunk value is left in the mem manager
391 * object so that it can be saved away if this sarray is the workspace for
392 * a virtual array.
393 */
394
395METHODDEF(JSAMPARRAY)
396alloc_sarray (j_common_ptr cinfo, int pool_id,
397 JDIMENSION samplesperrow, JDIMENSION numrows)
398/* Allocate a 2-D sample array */
399{
400 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
401 JSAMPARRAY result;
402 JSAMPROW workspace;
403 JDIMENSION rowsperchunk, currow, i;
404 long ltemp;
405
406 /* Calculate max # of rows allowed in one allocation chunk */
407 ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
408 ((long) samplesperrow * SIZEOF(JSAMPLE));
409 if (ltemp <= 0)
410 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
411 if (ltemp < (long) numrows)
412 rowsperchunk = (JDIMENSION) ltemp;
413 else
414 rowsperchunk = numrows;
415 mem->last_rowsperchunk = rowsperchunk;
416
417 /* Get space for row pointers (small object) */
418 result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
419 (size_t) (numrows * SIZEOF(JSAMPROW)));
420
421 /* Get the rows themselves (large objects) */
422 currow = 0;
423 while (currow < numrows) {
424 rowsperchunk = MIN(rowsperchunk, numrows - currow);
425 workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
426 (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
427 * SIZEOF(JSAMPLE)));
428 for (i = rowsperchunk; i > 0; i--) {
429 result[currow++] = workspace;
430 workspace += samplesperrow;
431 }
432 }
433
434 return result;
435}
436
437
438/*
439 * Creation of 2-D coefficient-block arrays.
440 * This is essentially the same as the code for sample arrays, above.
441 */
442
443METHODDEF(JBLOCKARRAY)
444alloc_barray (j_common_ptr cinfo, int pool_id,
445 JDIMENSION blocksperrow, JDIMENSION numrows)
446/* Allocate a 2-D coefficient-block array */
447{
448 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
449 JBLOCKARRAY result;
450 JBLOCKROW workspace;
451 JDIMENSION rowsperchunk, currow, i;
452 long ltemp;
453
454 /* Calculate max # of rows allowed in one allocation chunk */
455 ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
456 ((long) blocksperrow * SIZEOF(JBLOCK));
457 if (ltemp <= 0)
458 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
459 if (ltemp < (long) numrows)
460 rowsperchunk = (JDIMENSION) ltemp;
461 else
462 rowsperchunk = numrows;
463 mem->last_rowsperchunk = rowsperchunk;
464
465 /* Get space for row pointers (small object) */
466 result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
467 (size_t) (numrows * SIZEOF(JBLOCKROW)));
468
469 /* Get the rows themselves (large objects) */
470 currow = 0;
471 while (currow < numrows) {
472 rowsperchunk = MIN(rowsperchunk, numrows - currow);
473 workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
474 (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
475 * SIZEOF(JBLOCK)));
476 for (i = rowsperchunk; i > 0; i--) {
477 result[currow++] = workspace;
478 workspace += blocksperrow;
479 }
480 }
481
482 return result;
483}
484
485
486/*
487 * About virtual array management:
488 *
489 * The above "normal" array routines are only used to allocate strip buffers
490 * (as wide as the image, but just a few rows high). Full-image-sized buffers
491 * are handled as "virtual" arrays. The array is still accessed a strip at a
492 * time, but the memory manager must save the whole array for repeated
493 * accesses. The intended implementation is that there is a strip buffer in
494 * memory (as high as is possible given the desired memory limit), plus a
495 * backing file that holds the rest of the array.
496 *
497 * The request_virt_array routines are told the total size of the image and
498 * the maximum number of rows that will be accessed at once. The in-memory
499 * buffer must be at least as large as the maxaccess value.
500 *
501 * The request routines create control blocks but not the in-memory buffers.
502 * That is postponed until realize_virt_arrays is called. At that time the
503 * total amount of space needed is known (approximately, anyway), so free
504 * memory can be divided up fairly.
505 *
506 * The access_virt_array routines are responsible for making a specific strip
507 * area accessible (after reading or writing the backing file, if necessary).
508 * Note that the access routines are told whether the caller intends to modify
509 * the accessed strip; during a read-only pass this saves having to rewrite
510 * data to disk. The access routines are also responsible for pre-zeroing
511 * any newly accessed rows, if pre-zeroing was requested.
512 *
513 * In current usage, the access requests are usually for nonoverlapping
514 * strips; that is, successive access start_row numbers differ by exactly
515 * num_rows = maxaccess. This means we can get good performance with simple
516 * buffer dump/reload logic, by making the in-memory buffer be a multiple
517 * of the access height; then there will never be accesses across bufferload
518 * boundaries. The code will still work with overlapping access requests,
519 * but it doesn't handle bufferload overlaps very efficiently.
520 */
521
522
523METHODDEF(jvirt_sarray_ptr)
524request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
525 JDIMENSION samplesperrow, JDIMENSION numrows,
526 JDIMENSION maxaccess)
527/* Request a virtual 2-D sample array */
528{
529 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
530 jvirt_sarray_ptr result;
531
532 /* Only IMAGE-lifetime virtual arrays are currently supported */
533 if (pool_id != JPOOL_IMAGE)
534 ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
535
536 /* get control block */
537 result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
538 SIZEOF(struct jvirt_sarray_control));
539
540 result->mem_buffer = NULL; /* marks array not yet realized */
541 result->rows_in_array = numrows;
542 result->samplesperrow = samplesperrow;
543 result->maxaccess = maxaccess;
544 result->pre_zero = pre_zero;
545 result->b_s_open = FALSE; /* no associated backing-store object */
546 result->next = mem->virt_sarray_list; /* add to list of virtual arrays */
547 mem->virt_sarray_list = result;
548
549 return result;
550}
551
552
553METHODDEF(jvirt_barray_ptr)
554request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
555 JDIMENSION blocksperrow, JDIMENSION numrows,
556 JDIMENSION maxaccess)
557/* Request a virtual 2-D coefficient-block array */
558{
559 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
560 jvirt_barray_ptr result;
561
562 /* Only IMAGE-lifetime virtual arrays are currently supported */
563 if (pool_id != JPOOL_IMAGE)
564 ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
565
566 /* get control block */
567 result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,
568 SIZEOF(struct jvirt_barray_control));
569
570 result->mem_buffer = NULL; /* marks array not yet realized */
571 result->rows_in_array = numrows;
572 result->blocksperrow = blocksperrow;
573 result->maxaccess = maxaccess;
574 result->pre_zero = pre_zero;
575 result->b_s_open = FALSE; /* no associated backing-store object */
576 result->next = mem->virt_barray_list; /* add to list of virtual arrays */
577 mem->virt_barray_list = result;
578
579 return result;
580}
581
582
583METHODDEF(void)
584realize_virt_arrays (j_common_ptr cinfo)
585/* Allocate the in-memory buffers for any unrealized virtual arrays */
586{
587 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
588 long space_per_minheight, maximum_space, avail_mem;
589 long minheights, max_minheights;
590 jvirt_sarray_ptr sptr;
591 jvirt_barray_ptr bptr;
592
593 /* Compute the minimum space needed (maxaccess rows in each buffer)
594 * and the maximum space needed (full image height in each buffer).
595 * These may be of use to the system-dependent jpeg_mem_available routine.
596 */
597 space_per_minheight = 0;
598 maximum_space = 0;
599 for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
600 if (sptr->mem_buffer == NULL) { /* if not realized yet */
601 space_per_minheight += (long) sptr->maxaccess *
602 (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
603 maximum_space += (long) sptr->rows_in_array *
604 (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
605 }
606 }
607 for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
608 if (bptr->mem_buffer == NULL) { /* if not realized yet */
609 space_per_minheight += (long) bptr->maxaccess *
610 (long) bptr->blocksperrow * SIZEOF(JBLOCK);
611 maximum_space += (long) bptr->rows_in_array *
612 (long) bptr->blocksperrow * SIZEOF(JBLOCK);
613 }
614 }
615
616 if (space_per_minheight <= 0)
617 return; /* no unrealized arrays, no work */
618
619 /* Determine amount of memory to actually use; this is system-dependent. */
620 avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
621 mem->total_space_allocated);
622
623 /* If the maximum space needed is available, make all the buffers full
624 * height; otherwise parcel it out with the same number of minheights
625 * in each buffer.
626 */
627 if (avail_mem >= maximum_space)
628 max_minheights = 1000000000L;
629 else {
630 max_minheights = avail_mem / space_per_minheight;
631 /* If there doesn't seem to be enough space, try to get the minimum
632 * anyway. This allows a "stub" implementation of jpeg_mem_available().
633 */
634 if (max_minheights <= 0)
635 max_minheights = 1;
636 }
637
638 /* Allocate the in-memory buffers and initialize backing store as needed. */
639
640 for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
641 if (sptr->mem_buffer == NULL) { /* if not realized yet */
642 minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
643 if (minheights <= max_minheights) {
644 /* This buffer fits in memory */
645 sptr->rows_in_mem = sptr->rows_in_array;
646 } else {
647 /* It doesn't fit in memory, create backing store. */
648 sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);
649 jpeg_open_backing_store(cinfo, & sptr->b_s_info,
650 (long) sptr->rows_in_array *
651 (long) sptr->samplesperrow *
652 (long) SIZEOF(JSAMPLE));
653 sptr->b_s_open = TRUE;
654 }
655 sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,
656 sptr->samplesperrow, sptr->rows_in_mem);
657 sptr->rowsperchunk = mem->last_rowsperchunk;
658 sptr->cur_start_row = 0;
659 sptr->first_undef_row = 0;
660 sptr->dirty = FALSE;
661 }
662 }
663
664 for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
665 if (bptr->mem_buffer == NULL) { /* if not realized yet */
666 minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
667 if (minheights <= max_minheights) {
668 /* This buffer fits in memory */
669 bptr->rows_in_mem = bptr->rows_in_array;
670 } else {
671 /* It doesn't fit in memory, create backing store. */
672 bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);
673 jpeg_open_backing_store(cinfo, & bptr->b_s_info,
674 (long) bptr->rows_in_array *
675 (long) bptr->blocksperrow *
676 (long) SIZEOF(JBLOCK));
677 bptr->b_s_open = TRUE;
678 }
679 bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,
680 bptr->blocksperrow, bptr->rows_in_mem);
681 bptr->rowsperchunk = mem->last_rowsperchunk;
682 bptr->cur_start_row = 0;
683 bptr->first_undef_row = 0;
684 bptr->dirty = FALSE;
685 }
686 }
687}
688
689
690LOCAL(void)
691do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
692/* Do backing store read or write of a virtual sample array */
693{
694 long bytesperrow, file_offset, byte_count, rows, thisrow, i;
695
696 bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
697 file_offset = ptr->cur_start_row * bytesperrow;
698 /* Loop to read or write each allocation chunk in mem_buffer */
699 for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
700 /* One chunk, but check for short chunk at end of buffer */
701 rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
702 /* Transfer no more than is currently defined */
703 thisrow = (long) ptr->cur_start_row + i;
704 rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
705 /* Transfer no more than fits in file */
706 rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
707 if (rows <= 0) /* this chunk might be past end of file! */
708 break;
709 byte_count = rows * bytesperrow;
710 if (writing)
711 (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
712 (void FAR *) ptr->mem_buffer[i],
713 file_offset, byte_count);
714 else
715 (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
716 (void FAR *) ptr->mem_buffer[i],
717 file_offset, byte_count);
718 file_offset += byte_count;
719 }
720}
721
722
723LOCAL(void)
724do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
725/* Do backing store read or write of a virtual coefficient-block array */
726{
727 long bytesperrow, file_offset, byte_count, rows, thisrow, i;
728
729 bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
730 file_offset = ptr->cur_start_row * bytesperrow;
731 /* Loop to read or write each allocation chunk in mem_buffer */
732 for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
733 /* One chunk, but check for short chunk at end of buffer */
734 rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
735 /* Transfer no more than is currently defined */
736 thisrow = (long) ptr->cur_start_row + i;
737 rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
738 /* Transfer no more than fits in file */
739 rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
740 if (rows <= 0) /* this chunk might be past end of file! */
741 break;
742 byte_count = rows * bytesperrow;
743 if (writing)
744 (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
745 (void FAR *) ptr->mem_buffer[i],
746 file_offset, byte_count);
747 else
748 (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
749 (void FAR *) ptr->mem_buffer[i],
750 file_offset, byte_count);
751 file_offset += byte_count;
752 }
753}
754
755
756METHODDEF(JSAMPARRAY)
757access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
758 JDIMENSION start_row, JDIMENSION num_rows,
759 boolean writable)
760/* Access the part of a virtual sample array starting at start_row */
761/* and extending for num_rows rows. writable is true if */
762/* caller intends to modify the accessed area. */
763{
764 JDIMENSION end_row = start_row + num_rows;
765 JDIMENSION undef_row;
766
767 /* debugging check */
768 if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
769 ptr->mem_buffer == NULL)
770 ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
771
772 /* Make the desired part of the virtual array accessible */
773 if (start_row < ptr->cur_start_row ||
774 end_row > ptr->cur_start_row+ptr->rows_in_mem) {
775 if (! ptr->b_s_open)
776 ERREXIT(cinfo, JERR_VIRTUAL_BUG);
777 /* Flush old buffer contents if necessary */
778 if (ptr->dirty) {
779 do_sarray_io(cinfo, ptr, TRUE);
780 ptr->dirty = FALSE;
781 }
782 /* Decide what part of virtual array to access.
783 * Algorithm: if target address > current window, assume forward scan,
784 * load starting at target address. If target address < current window,
785 * assume backward scan, load so that target area is top of window.
786 * Note that when switching from forward write to forward read, will have
787 * start_row = 0, so the limiting case applies and we load from 0 anyway.
788 */
789 if (start_row > ptr->cur_start_row) {
790 ptr->cur_start_row = start_row;
791 } else {
792 /* use long arithmetic here to avoid overflow & unsigned problems */
793 long ltemp;
794
795 ltemp = (long) end_row - (long) ptr->rows_in_mem;
796 if (ltemp < 0)
797 ltemp = 0; /* don't fall off front end of file */
798 ptr->cur_start_row = (JDIMENSION) ltemp;
799 }
800 /* Read in the selected part of the array.
801 * During the initial write pass, we will do no actual read
802 * because the selected part is all undefined.
803 */
804 do_sarray_io(cinfo, ptr, FALSE);
805 }
806 /* Ensure the accessed part of the array is defined; prezero if needed.
807 * To improve locality of access, we only prezero the part of the array
808 * that the caller is about to access, not the entire in-memory array.
809 */
810 if (ptr->first_undef_row < end_row) {
811 if (ptr->first_undef_row < start_row) {
812 if (writable) /* writer skipped over a section of array */
813 ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
814 undef_row = start_row; /* but reader is allowed to read ahead */
815 } else {
816 undef_row = ptr->first_undef_row;
817 }
818 if (writable)
819 ptr->first_undef_row = end_row;
820 if (ptr->pre_zero) {
821 size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);
822 undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
823 end_row -= ptr->cur_start_row;
824 while (undef_row < end_row) {
825 FMEMZERO((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
826 undef_row++;
827 }
828 } else {
829 if (! writable) /* reader looking at undefined data */
830 ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
831 }
832 }
833 /* Flag the buffer dirty if caller will write in it */
834 if (writable)
835 ptr->dirty = TRUE;
836 /* Return address of proper part of the buffer */
837 return ptr->mem_buffer + (start_row - ptr->cur_start_row);
838}
839
840
841METHODDEF(JBLOCKARRAY)
842access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
843 JDIMENSION start_row, JDIMENSION num_rows,
844 boolean writable)
845/* Access the part of a virtual block array starting at start_row */
846/* and extending for num_rows rows. writable is true if */
847/* caller intends to modify the accessed area. */
848{
849 JDIMENSION end_row = start_row + num_rows;
850 JDIMENSION undef_row;
851
852 /* debugging check */
853 if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
854 ptr->mem_buffer == NULL)
855 ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
856
857 /* Make the desired part of the virtual array accessible */
858 if (start_row < ptr->cur_start_row ||
859 end_row > ptr->cur_start_row+ptr->rows_in_mem) {
860 if (! ptr->b_s_open)
861 ERREXIT(cinfo, JERR_VIRTUAL_BUG);
862 /* Flush old buffer contents if necessary */
863 if (ptr->dirty) {
864 do_barray_io(cinfo, ptr, TRUE);
865 ptr->dirty = FALSE;
866 }
867 /* Decide what part of virtual array to access.
868 * Algorithm: if target address > current window, assume forward scan,
869 * load starting at target address. If target address < current window,
870 * assume backward scan, load so that target area is top of window.
871 * Note that when switching from forward write to forward read, will have
872 * start_row = 0, so the limiting case applies and we load from 0 anyway.
873 */
874 if (start_row > ptr->cur_start_row) {
875 ptr->cur_start_row = start_row;
876 } else {
877 /* use long arithmetic here to avoid overflow & unsigned problems */
878 long ltemp;
879
880 ltemp = (long) end_row - (long) ptr->rows_in_mem;
881 if (ltemp < 0)
882 ltemp = 0; /* don't fall off front end of file */
883 ptr->cur_start_row = (JDIMENSION) ltemp;
884 }
885 /* Read in the selected part of the array.
886 * During the initial write pass, we will do no actual read
887 * because the selected part is all undefined.
888 */
889 do_barray_io(cinfo, ptr, FALSE);
890 }
891 /* Ensure the accessed part of the array is defined; prezero if needed.
892 * To improve locality of access, we only prezero the part of the array
893 * that the caller is about to access, not the entire in-memory array.
894 */
895 if (ptr->first_undef_row < end_row) {
896 if (ptr->first_undef_row < start_row) {
897 if (writable) /* writer skipped over a section of array */
898 ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
899 undef_row = start_row; /* but reader is allowed to read ahead */
900 } else {
901 undef_row = ptr->first_undef_row;
902 }
903 if (writable)
904 ptr->first_undef_row = end_row;
905 if (ptr->pre_zero) {
906 size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);
907 undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
908 end_row -= ptr->cur_start_row;
909 while (undef_row < end_row) {
910 FMEMZERO((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
911 undef_row++;
912 }
913 } else {
914 if (! writable) /* reader looking at undefined data */
915 ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
916 }
917 }
918 /* Flag the buffer dirty if caller will write in it */
919 if (writable)
920 ptr->dirty = TRUE;
921 /* Return address of proper part of the buffer */
922 return ptr->mem_buffer + (start_row - ptr->cur_start_row);
923}
924
925
926/*
927 * Release all objects belonging to a specified pool.
928 */
929
930METHODDEF(void)
931free_pool (j_common_ptr cinfo, int pool_id)
932{
933 my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
934 small_pool_ptr shdr_ptr;
935 large_pool_ptr lhdr_ptr;
936 size_t space_freed;
937
938 if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
939 ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
940
941#ifdef MEM_STATS
942 if (cinfo->err->trace_level > 1)
943 print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */
944#endif
945
946 /* If freeing IMAGE pool, close any virtual arrays first */
947 if (pool_id == JPOOL_IMAGE) {
948 jvirt_sarray_ptr sptr;
949 jvirt_barray_ptr bptr;
950
951 for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
952 if (sptr->b_s_open) { /* there may be no backing store */
953 sptr->b_s_open = FALSE; /* prevent recursive close if error */
954 (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);
955 }
956 }
957 mem->virt_sarray_list = NULL;
958 for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
959 if (bptr->b_s_open) { /* there may be no backing store */
960 bptr->b_s_open = FALSE; /* prevent recursive close if error */
961 (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);
962 }
963 }
964 mem->virt_barray_list = NULL;
965 }
966
967 /* Release large objects */
968 lhdr_ptr = mem->large_list[pool_id];
969 mem->large_list[pool_id] = NULL;
970
971 while (lhdr_ptr != NULL) {
972 large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;
973 space_freed = lhdr_ptr->hdr.bytes_used +
974 lhdr_ptr->hdr.bytes_left +
975 SIZEOF(large_pool_hdr);
976 jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
977 mem->total_space_allocated -= space_freed;
978 lhdr_ptr = next_lhdr_ptr;
979 }
980
981 /* Release small objects */
982 shdr_ptr = mem->small_list[pool_id];
983 mem->small_list[pool_id] = NULL;
984
985 while (shdr_ptr != NULL) {
986 small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;
987 space_freed = shdr_ptr->hdr.bytes_used +
988 shdr_ptr->hdr.bytes_left +
989 SIZEOF(small_pool_hdr);
990 jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
991 mem->total_space_allocated -= space_freed;
992 shdr_ptr = next_shdr_ptr;
993 }
994}
995
996
997/*
998 * Close up shop entirely.
999 * Note that this cannot be called unless cinfo->mem is non-NULL.
1000 */
1001
1002METHODDEF(void)
1003self_destruct (j_common_ptr cinfo)
1004{
1005 int pool;
1006
1007 /* Close all backing store, release all memory.
1008 * Releasing pools in reverse order might help avoid fragmentation
1009 * with some (brain-damaged) malloc libraries.
1010 */
1011 for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
1012 free_pool(cinfo, pool);
1013 }
1014
1015 /* Release the memory manager control block too. */
1016 jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));
1017 cinfo->mem = NULL; /* ensures I will be called only once */
1018
1019 jpeg_mem_term(cinfo); /* system-dependent cleanup */
1020}
1021
1022
1023/*
1024 * Memory manager initialization.
1025 * When this is called, only the error manager pointer is valid in cinfo!
1026 */
1027
1028GLOBAL(void)
1029jinit_memory_mgr (j_common_ptr cinfo)
1030{
1031 my_mem_ptr mem;
1032 long max_to_use;
1033 int pool;
1034 size_t test_mac;
1035
1036 cinfo->mem = NULL; /* for safety if init fails */
1037
1038 /* Check for configuration errors.
1039 * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably
1040 * doesn't reflect any real hardware alignment requirement.
1041 * The test is a little tricky: for X>0, X and X-1 have no one-bits
1042 * in common if and only if X is a power of 2, ie has only one one-bit.
1043 * Some compilers may give an "unreachable code" warning here; ignore it.
1044 */
1045 if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)
1046 ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
1047 /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
1048 * a multiple of SIZEOF(ALIGN_TYPE).
1049 * Again, an "unreachable code" warning may be ignored here.
1050 * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
1051 */
1052 test_mac = (size_t) MAX_ALLOC_CHUNK;
1053 if ((long) test_mac != MAX_ALLOC_CHUNK ||
1054 (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)
1055 ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
1056
1057 max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
1058
1059 /* Attempt to allocate memory manager's control block */
1060 mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));
1061
1062 if (mem == NULL) {
1063 jpeg_mem_term(cinfo); /* system-dependent cleanup */
1064 ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);
1065 }
1066
1067 /* OK, fill in the method pointers */
1068 mem->pub.alloc_small = alloc_small;
1069 mem->pub.alloc_large = alloc_large;
1070 mem->pub.alloc_sarray = alloc_sarray;
1071 mem->pub.alloc_barray = alloc_barray;
1072 mem->pub.request_virt_sarray = request_virt_sarray;
1073 mem->pub.request_virt_barray = request_virt_barray;
1074 mem->pub.realize_virt_arrays = realize_virt_arrays;
1075 mem->pub.access_virt_sarray = access_virt_sarray;
1076 mem->pub.access_virt_barray = access_virt_barray;
1077 mem->pub.free_pool = free_pool;
1078 mem->pub.self_destruct = self_destruct;
1079
1080 /* Make MAX_ALLOC_CHUNK accessible to other modules */
1081 mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;
1082
1083 /* Initialize working state */
1084 mem->pub.max_memory_to_use = max_to_use;
1085
1086 for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
1087 mem->small_list[pool] = NULL;
1088 mem->large_list[pool] = NULL;
1089 }
1090 mem->virt_sarray_list = NULL;
1091 mem->virt_barray_list = NULL;
1092
1093 mem->total_space_allocated = SIZEOF(my_memory_mgr);
1094
1095 /* Declare ourselves open for business */
1096 cinfo->mem = & mem->pub;
1097
1098 /* Check for an environment variable JPEGMEM; if found, override the
1099 * default max_memory setting from jpeg_mem_init. Note that the
1100 * surrounding application may again override this value.
1101 * If your system doesn't support getenv(), define NO_GETENV to disable
1102 * this feature.
1103 */
1104#ifndef NO_GETENV
1105 { char * memenv;
1106
1107 if ((memenv = getenv("JPEGMEM")) != NULL) {
1108 char ch = 'x';
1109
1110 if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) {
1111 if (ch == 'm' || ch == 'M')
1112 max_to_use *= 1000L;
1113 mem->pub.max_memory_to_use = max_to_use * 1000L;
1114 }
1115 }
1116 }
1117#endif
1118
1119}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemname.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemname.c
new file mode 100644
index 0000000..e28b212
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemname.c
@@ -0,0 +1,276 @@
1/*
2 * jmemname.c
3 *
4 * Copyright (C) 1992-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file provides a generic implementation of the system-dependent
9 * portion of the JPEG memory manager. This implementation assumes that
10 * you must explicitly construct a name for each temp file.
11 * Also, the problem of determining the amount of memory available
12 * is shoved onto the user.
13 */
14
15#define JPEG_INTERNALS
16#include "jinclude.h"
17#include "jpeglib.h"
18#include "jmemsys.h" /* import the system-dependent declarations */
19
20#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
21extern void * malloc JPP((size_t size));
22extern void free JPP((void *ptr));
23#endif
24
25#ifndef SEEK_SET /* pre-ANSI systems may not define this; */
26#define SEEK_SET 0 /* if not, assume 0 is correct */
27#endif
28
29#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
30#define READ_BINARY "r"
31#define RW_BINARY "w+"
32#else
33#ifdef VMS /* VMS is very nonstandard */
34#define READ_BINARY "rb", "ctx=stm"
35#define RW_BINARY "w+b", "ctx=stm"
36#else /* standard ANSI-compliant case */
37#define READ_BINARY "rb"
38#define RW_BINARY "w+b"
39#endif
40#endif
41
42
43/*
44 * Selection of a file name for a temporary file.
45 * This is system-dependent!
46 *
47 * The code as given is suitable for most Unix systems, and it is easily
48 * modified for most non-Unix systems. Some notes:
49 * 1. The temp file is created in the directory named by TEMP_DIRECTORY.
50 * The default value is /usr/tmp, which is the conventional place for
51 * creating large temp files on Unix. On other systems you'll probably
52 * want to change the file location. You can do this by editing the
53 * #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h.
54 *
55 * 2. If you need to change the file name as well as its location,
56 * you can override the TEMP_FILE_NAME macro. (Note that this is
57 * actually a printf format string; it must contain %s and %d.)
58 * Few people should need to do this.
59 *
60 * 3. mktemp() is used to ensure that multiple processes running
61 * simultaneously won't select the same file names. If your system
62 * doesn't have mktemp(), define NO_MKTEMP to do it the hard way.
63 * (If you don't have <errno.h>, also define NO_ERRNO_H.)
64 *
65 * 4. You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c
66 * will cause the temp files to be removed if you stop the program early.
67 */
68
69#ifndef TEMP_DIRECTORY /* can override from jconfig.h or Makefile */
70#define TEMP_DIRECTORY "/usr/tmp/" /* recommended setting for Unix */
71#endif
72
73static int next_file_num; /* to distinguish among several temp files */
74
75#ifdef NO_MKTEMP
76
77#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */
78#define TEMP_FILE_NAME "%sJPG%03d.TMP"
79#endif
80
81#ifndef NO_ERRNO_H
82#include <errno.h> /* to define ENOENT */
83#endif
84
85/* ANSI C specifies that errno is a macro, but on older systems it's more
86 * likely to be a plain int variable. And not all versions of errno.h
87 * bother to declare it, so we have to in order to be most portable. Thus:
88 */
89#ifndef errno
90extern int errno;
91#endif
92
93
94LOCAL(void)
95select_file_name (char * fname)
96{
97 FILE * tfile;
98
99 /* Keep generating file names till we find one that's not in use */
100 for (;;) {
101 next_file_num++; /* advance counter */
102 sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
103 if ((tfile = fopen(fname, READ_BINARY)) == NULL) {
104 /* fopen could have failed for a reason other than the file not
105 * being there; for example, file there but unreadable.
106 * If <errno.h> isn't available, then we cannot test the cause.
107 */
108#ifdef ENOENT
109 if (errno != ENOENT)
110 continue;
111#endif
112 break;
113 }
114 fclose(tfile); /* oops, it's there; close tfile & try again */
115 }
116}
117
118#else /* ! NO_MKTEMP */
119
120/* Note that mktemp() requires the initial filename to end in six X's */
121#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */
122#define TEMP_FILE_NAME "%sJPG%dXXXXXX"
123#endif
124
125LOCAL(void)
126select_file_name (char * fname)
127{
128 next_file_num++; /* advance counter */
129 sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
130 mktemp(fname); /* make sure file name is unique */
131 /* mktemp replaces the trailing XXXXXX with a unique string of characters */
132}
133
134#endif /* NO_MKTEMP */
135
136
137/*
138 * Memory allocation and freeing are controlled by the regular library
139 * routines malloc() and free().
140 */
141
142GLOBAL(void *)
143jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
144{
145 return (void *) malloc(sizeofobject);
146}
147
148GLOBAL(void)
149jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
150{
151 free(object);
152}
153
154
155/*
156 * "Large" objects are treated the same as "small" ones.
157 * NB: although we include FAR keywords in the routine declarations,
158 * this file won't actually work in 80x86 small/medium model; at least,
159 * you probably won't be able to process useful-size images in only 64KB.
160 */
161
162GLOBAL(void FAR *)
163jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
164{
165 return (void FAR *) malloc(sizeofobject);
166}
167
168GLOBAL(void)
169jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
170{
171 free(object);
172}
173
174
175/*
176 * This routine computes the total memory space available for allocation.
177 * It's impossible to do this in a portable way; our current solution is
178 * to make the user tell us (with a default value set at compile time).
179 * If you can actually get the available space, it's a good idea to subtract
180 * a slop factor of 5% or so.
181 */
182
183#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
184#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */
185#endif
186
187GLOBAL(long)
188jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
189 long max_bytes_needed, long already_allocated)
190{
191 return cinfo->mem->max_memory_to_use - already_allocated;
192}
193
194
195/*
196 * Backing store (temporary file) management.
197 * Backing store objects are only used when the value returned by
198 * jpeg_mem_available is less than the total space needed. You can dispense
199 * with these routines if you have plenty of virtual memory; see jmemnobs.c.
200 */
201
202
203METHODDEF(void)
204read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
205 void FAR * buffer_address,
206 long file_offset, long byte_count)
207{
208 if (fseek(info->temp_file, file_offset, SEEK_SET))
209 ERREXIT(cinfo, JERR_TFILE_SEEK);
210 if (JFREAD(info->temp_file, buffer_address, byte_count)
211 != (size_t) byte_count)
212 ERREXIT(cinfo, JERR_TFILE_READ);
213}
214
215
216METHODDEF(void)
217write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
218 void FAR * buffer_address,
219 long file_offset, long byte_count)
220{
221 if (fseek(info->temp_file, file_offset, SEEK_SET))
222 ERREXIT(cinfo, JERR_TFILE_SEEK);
223 if (JFWRITE(info->temp_file, buffer_address, byte_count)
224 != (size_t) byte_count)
225 ERREXIT(cinfo, JERR_TFILE_WRITE);
226}
227
228
229METHODDEF(void)
230close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
231{
232 fclose(info->temp_file); /* close the file */
233 unlink(info->temp_name); /* delete the file */
234/* If your system doesn't have unlink(), use remove() instead.
235 * remove() is the ANSI-standard name for this function, but if
236 * your system was ANSI you'd be using jmemansi.c, right?
237 */
238 TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
239}
240
241
242/*
243 * Initial opening of a backing-store object.
244 */
245
246GLOBAL(void)
247jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
248 long total_bytes_needed)
249{
250 select_file_name(info->temp_name);
251 if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)
252 ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
253 info->read_backing_store = read_backing_store;
254 info->write_backing_store = write_backing_store;
255 info->close_backing_store = close_backing_store;
256 TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
257}
258
259
260/*
261 * These routines take care of any system-dependent initialization and
262 * cleanup required.
263 */
264
265GLOBAL(long)
266jpeg_mem_init (j_common_ptr cinfo)
267{
268 next_file_num = 0; /* initialize temp file name generator */
269 return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
270}
271
272GLOBAL(void)
273jpeg_mem_term (j_common_ptr cinfo)
274{
275 /* no work */
276}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemnobs.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemnobs.c
new file mode 100644
index 0000000..6aa1e92
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemnobs.c
@@ -0,0 +1,109 @@
1/*
2 * jmemnobs.c
3 *
4 * Copyright (C) 1992-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file provides a really simple implementation of the system-
9 * dependent portion of the JPEG memory manager. This implementation
10 * assumes that no backing-store files are needed: all required space
11 * can be obtained from malloc().
12 * This is very portable in the sense that it'll compile on almost anything,
13 * but you'd better have lots of main memory (or virtual memory) if you want
14 * to process big images.
15 * Note that the max_memory_to_use option is ignored by this implementation.
16 */
17
18#define JPEG_INTERNALS
19#include "jinclude.h"
20#include "jpeglib.h"
21#include "jmemsys.h" /* import the system-dependent declarations */
22
23#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
24extern void * malloc JPP((size_t size));
25extern void free JPP((void *ptr));
26#endif
27
28
29/*
30 * Memory allocation and freeing are controlled by the regular library
31 * routines malloc() and free().
32 */
33
34GLOBAL(void *)
35jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
36{
37 return (void *) malloc(sizeofobject);
38}
39
40GLOBAL(void)
41jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
42{
43 free(object);
44}
45
46
47/*
48 * "Large" objects are treated the same as "small" ones.
49 * NB: although we include FAR keywords in the routine declarations,
50 * this file won't actually work in 80x86 small/medium model; at least,
51 * you probably won't be able to process useful-size images in only 64KB.
52 */
53
54GLOBAL(void FAR *)
55jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
56{
57 return (void FAR *) malloc(sizeofobject);
58}
59
60GLOBAL(void)
61jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
62{
63 free(object);
64}
65
66
67/*
68 * This routine computes the total memory space available for allocation.
69 * Here we always say, "we got all you want bud!"
70 */
71
72GLOBAL(long)
73jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
74 long max_bytes_needed, long already_allocated)
75{
76 return max_bytes_needed;
77}
78
79
80/*
81 * Backing store (temporary file) management.
82 * Since jpeg_mem_available always promised the moon,
83 * this should never be called and we can just error out.
84 */
85
86GLOBAL(void)
87jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
88 long total_bytes_needed)
89{
90 ERREXIT(cinfo, JERR_NO_BACKING_STORE);
91}
92
93
94/*
95 * These routines take care of any system-dependent initialization and
96 * cleanup required. Here, there isn't any.
97 */
98
99GLOBAL(long)
100jpeg_mem_init (j_common_ptr cinfo)
101{
102 return 0; /* just set max_memory_to_use to 0 */
103}
104
105GLOBAL(void)
106jpeg_mem_term (j_common_ptr cinfo)
107{
108 /* no work */
109}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemsys.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemsys.h
new file mode 100644
index 0000000..2a87961
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmemsys.h
@@ -0,0 +1,198 @@
1/*
2 * jmemsys.h
3 *
4 * Copyright (C) 1992-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This include file defines the interface between the system-independent
9 * and system-dependent portions of the JPEG memory manager. No other
10 * modules need include it. (The system-independent portion is jmemmgr.c;
11 * there are several different versions of the system-dependent portion.)
12 *
13 * This file works as-is for the system-dependent memory managers supplied
14 * in the IJG distribution. You may need to modify it if you write a
15 * custom memory manager. If system-dependent changes are needed in
16 * this file, the best method is to #ifdef them based on a configuration
17 * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR
18 * and USE_MAC_MEMMGR.
19 */
20
21
22/* Short forms of external names for systems with brain-damaged linkers. */
23
24#ifdef NEED_SHORT_EXTERNAL_NAMES
25#define jpeg_get_small jGetSmall
26#define jpeg_free_small jFreeSmall
27#define jpeg_get_large jGetLarge
28#define jpeg_free_large jFreeLarge
29#define jpeg_mem_available jMemAvail
30#define jpeg_open_backing_store jOpenBackStore
31#define jpeg_mem_init jMemInit
32#define jpeg_mem_term jMemTerm
33#endif /* NEED_SHORT_EXTERNAL_NAMES */
34
35
36/*
37 * These two functions are used to allocate and release small chunks of
38 * memory. (Typically the total amount requested through jpeg_get_small is
39 * no more than 20K or so; this will be requested in chunks of a few K each.)
40 * Behavior should be the same as for the standard library functions malloc
41 * and free; in particular, jpeg_get_small must return NULL on failure.
42 * On most systems, these ARE malloc and free. jpeg_free_small is passed the
43 * size of the object being freed, just in case it's needed.
44 * On an 80x86 machine using small-data memory model, these manage near heap.
45 */
46
47EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));
48EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,
49 size_t sizeofobject));
50
51/*
52 * These two functions are used to allocate and release large chunks of
53 * memory (up to the total free space designated by jpeg_mem_available).
54 * The interface is the same as above, except that on an 80x86 machine,
55 * far pointers are used. On most other machines these are identical to
56 * the jpeg_get/free_small routines; but we keep them separate anyway,
57 * in case a different allocation strategy is desirable for large chunks.
58 */
59
60EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,
61 size_t sizeofobject));
62EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
63 size_t sizeofobject));
64
65/*
66 * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may
67 * be requested in a single call to jpeg_get_large (and jpeg_get_small for that
68 * matter, but that case should never come into play). This macro is needed
69 * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.
70 * On those machines, we expect that jconfig.h will provide a proper value.
71 * On machines with 32-bit flat address spaces, any large constant may be used.
72 *
73 * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type
74 * size_t and will be a multiple of sizeof(align_type).
75 */
76
77#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */
78#define MAX_ALLOC_CHUNK 1000000000L
79#endif
80
81/*
82 * This routine computes the total space still available for allocation by
83 * jpeg_get_large. If more space than this is needed, backing store will be
84 * used. NOTE: any memory already allocated must not be counted.
85 *
86 * There is a minimum space requirement, corresponding to the minimum
87 * feasible buffer sizes; jmemmgr.c will request that much space even if
88 * jpeg_mem_available returns zero. The maximum space needed, enough to hold
89 * all working storage in memory, is also passed in case it is useful.
90 * Finally, the total space already allocated is passed. If no better
91 * method is available, cinfo->mem->max_memory_to_use - already_allocated
92 * is often a suitable calculation.
93 *
94 * It is OK for jpeg_mem_available to underestimate the space available
95 * (that'll just lead to more backing-store access than is really necessary).
96 * However, an overestimate will lead to failure. Hence it's wise to subtract
97 * a slop factor from the true available space. 5% should be enough.
98 *
99 * On machines with lots of virtual memory, any large constant may be returned.
100 * Conversely, zero may be returned to always use the minimum amount of memory.
101 */
102
103EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
104 long min_bytes_needed,
105 long max_bytes_needed,
106 long already_allocated));
107
108
109/*
110 * This structure holds whatever state is needed to access a single
111 * backing-store object. The read/write/close method pointers are called
112 * by jmemmgr.c to manipulate the backing-store object; all other fields
113 * are private to the system-dependent backing store routines.
114 */
115
116#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */
117
118
119#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */
120
121typedef unsigned short XMSH; /* type of extended-memory handles */
122typedef unsigned short EMSH; /* type of expanded-memory handles */
123
124typedef union {
125 short file_handle; /* DOS file handle if it's a temp file */
126 XMSH xms_handle; /* handle if it's a chunk of XMS */
127 EMSH ems_handle; /* handle if it's a chunk of EMS */
128} handle_union;
129
130#endif /* USE_MSDOS_MEMMGR */
131
132#ifdef USE_MAC_MEMMGR /* Mac-specific junk */
133#include <Files.h>
134#endif /* USE_MAC_MEMMGR */
135
136
137typedef struct backing_store_struct * backing_store_ptr;
138
139typedef struct backing_store_struct {
140 /* Methods for reading/writing/closing this backing-store object */
141 JMETHOD(void, read_backing_store, (j_common_ptr cinfo,
142 backing_store_ptr info,
143 void FAR * buffer_address,
144 long file_offset, long byte_count));
145 JMETHOD(void, write_backing_store, (j_common_ptr cinfo,
146 backing_store_ptr info,
147 void FAR * buffer_address,
148 long file_offset, long byte_count));
149 JMETHOD(void, close_backing_store, (j_common_ptr cinfo,
150 backing_store_ptr info));
151
152 /* Private fields for system-dependent backing-store management */
153#ifdef USE_MSDOS_MEMMGR
154 /* For the MS-DOS manager (jmemdos.c), we need: */
155 handle_union handle; /* reference to backing-store storage object */
156 char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
157#else
158#ifdef USE_MAC_MEMMGR
159 /* For the Mac manager (jmemmac.c), we need: */
160 short temp_file; /* file reference number to temp file */
161 FSSpec tempSpec; /* the FSSpec for the temp file */
162 char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
163#else
164 /* For a typical implementation with temp files, we need: */
165 FILE * temp_file; /* stdio reference to temp file */
166 char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
167#endif
168#endif
169} backing_store_info;
170
171
172/*
173 * Initial opening of a backing-store object. This must fill in the
174 * read/write/close pointers in the object. The read/write routines
175 * may take an error exit if the specified maximum file size is exceeded.
176 * (If jpeg_mem_available always returns a large value, this routine can
177 * just take an error exit.)
178 */
179
180EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
181 backing_store_ptr info,
182 long total_bytes_needed));
183
184
185/*
186 * These routines take care of any system-dependent initialization and
187 * cleanup required. jpeg_mem_init will be called before anything is
188 * allocated (and, therefore, nothing in cinfo is of use except the error
189 * manager pointer). It should return a suitable default value for
190 * max_memory_to_use; this may subsequently be overridden by the surrounding
191 * application. (Note that max_memory_to_use is only important if
192 * jpeg_mem_available chooses to consult it ... no one else will.)
193 * jpeg_mem_term may assume that all requested memory has been freed and that
194 * all opened backing-store objects have been closed.
195 */
196
197EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
198EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmorecfg.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmorecfg.h
new file mode 100644
index 0000000..0a44db4
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jmorecfg.h
@@ -0,0 +1,369 @@
1/*
2 * jmorecfg.h
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 1997-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains additional configuration options that customize the
10 * JPEG software for special applications or support machine-dependent
11 * optimizations. Most users will not need to touch this file.
12 */
13
14
15/*
16 * Define BITS_IN_JSAMPLE as either
17 * 8 for 8-bit sample values (the usual setting)
18 * 12 for 12-bit sample values
19 * Only 8 and 12 are legal data precisions for lossy JPEG according to the
20 * JPEG standard, and the IJG code does not support anything else!
21 * We do not support run-time selection of data precision, sorry.
22 */
23
24#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
25
26
27/*
28 * Maximum number of components (color channels) allowed in JPEG image.
29 * To meet the letter of the JPEG spec, set this to 255. However, darn
30 * few applications need more than 4 channels (maybe 5 for CMYK + alpha
31 * mask). We recommend 10 as a reasonable compromise; use 4 if you are
32 * really short on memory. (Each allowed component costs a hundred or so
33 * bytes of storage, whether actually used in an image or not.)
34 */
35
36#define MAX_COMPONENTS 10 /* maximum number of image components */
37
38
39/*
40 * Basic data types.
41 * You may need to change these if you have a machine with unusual data
42 * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
43 * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
44 * but it had better be at least 16.
45 */
46
47/* Representation of a single sample (pixel element value).
48 * We frequently allocate large arrays of these, so it's important to keep
49 * them small. But if you have memory to burn and access to char or short
50 * arrays is very slow on your hardware, you might want to change these.
51 */
52
53#if BITS_IN_JSAMPLE == 8
54/* JSAMPLE should be the smallest type that will hold the values 0..255.
55 * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
56 */
57
58#ifdef HAVE_UNSIGNED_CHAR
59
60typedef unsigned char JSAMPLE;
61#define GETJSAMPLE(value) ((int) (value))
62
63#else /* not HAVE_UNSIGNED_CHAR */
64
65typedef char JSAMPLE;
66#ifdef CHAR_IS_UNSIGNED
67#define GETJSAMPLE(value) ((int) (value))
68#else
69#define GETJSAMPLE(value) ((int) (value) & 0xFF)
70#endif /* CHAR_IS_UNSIGNED */
71
72#endif /* HAVE_UNSIGNED_CHAR */
73
74#define MAXJSAMPLE 255
75#define CENTERJSAMPLE 128
76
77#endif /* BITS_IN_JSAMPLE == 8 */
78
79
80#if BITS_IN_JSAMPLE == 12
81/* JSAMPLE should be the smallest type that will hold the values 0..4095.
82 * On nearly all machines "short" will do nicely.
83 */
84
85typedef short JSAMPLE;
86#define GETJSAMPLE(value) ((int) (value))
87
88#define MAXJSAMPLE 4095
89#define CENTERJSAMPLE 2048
90
91#endif /* BITS_IN_JSAMPLE == 12 */
92
93
94/* Representation of a DCT frequency coefficient.
95 * This should be a signed value of at least 16 bits; "short" is usually OK.
96 * Again, we allocate large arrays of these, but you can change to int
97 * if you have memory to burn and "short" is really slow.
98 */
99
100typedef short JCOEF;
101
102
103/* Compressed datastreams are represented as arrays of JOCTET.
104 * These must be EXACTLY 8 bits wide, at least once they are written to
105 * external storage. Note that when using the stdio data source/destination
106 * managers, this is also the data type passed to fread/fwrite.
107 */
108
109#ifdef HAVE_UNSIGNED_CHAR
110
111typedef unsigned char JOCTET;
112#define GETJOCTET(value) (value)
113
114#else /* not HAVE_UNSIGNED_CHAR */
115
116typedef char JOCTET;
117#ifdef CHAR_IS_UNSIGNED
118#define GETJOCTET(value) (value)
119#else
120#define GETJOCTET(value) ((value) & 0xFF)
121#endif /* CHAR_IS_UNSIGNED */
122
123#endif /* HAVE_UNSIGNED_CHAR */
124
125
126/* These typedefs are used for various table entries and so forth.
127 * They must be at least as wide as specified; but making them too big
128 * won't cost a huge amount of memory, so we don't provide special
129 * extraction code like we did for JSAMPLE. (In other words, these
130 * typedefs live at a different point on the speed/space tradeoff curve.)
131 */
132
133/* UINT8 must hold at least the values 0..255. */
134
135#ifdef HAVE_UNSIGNED_CHAR
136typedef unsigned char UINT8;
137#else /* not HAVE_UNSIGNED_CHAR */
138#ifdef CHAR_IS_UNSIGNED
139typedef char UINT8;
140#else /* not CHAR_IS_UNSIGNED */
141typedef short UINT8;
142#endif /* CHAR_IS_UNSIGNED */
143#endif /* HAVE_UNSIGNED_CHAR */
144
145/* UINT16 must hold at least the values 0..65535. */
146
147#ifdef HAVE_UNSIGNED_SHORT
148typedef unsigned short UINT16;
149#else /* not HAVE_UNSIGNED_SHORT */
150typedef unsigned int UINT16;
151#endif /* HAVE_UNSIGNED_SHORT */
152
153/* INT16 must hold at least the values -32768..32767. */
154
155#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
156typedef short INT16;
157#endif
158
159/* INT32 must hold at least signed 32-bit values. */
160
161#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
162#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
163#ifndef _BASETSD_H /* MinGW is slightly different */
164#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
165typedef int INT32;
166#endif
167#endif
168#endif
169#endif
170
171/* Datatype used for image dimensions. The JPEG standard only supports
172 * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
173 * "unsigned int" is sufficient on all machines. However, if you need to
174 * handle larger images and you don't mind deviating from the spec, you
175 * can change this datatype.
176 */
177
178typedef unsigned int JDIMENSION;
179
180#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
181
182
183/* These macros are used in all function definitions and extern declarations.
184 * You could modify them if you need to change function linkage conventions;
185 * in particular, you'll need to do that to make the library a Windows DLL.
186 * Another application is to make all functions global for use with debuggers
187 * or code profilers that require it.
188 */
189
190/* a function called through method pointers: */
191#define METHODDEF(type) static type
192/* a function used only in its module: */
193#define LOCAL(type) static type
194/* a function referenced thru EXTERNs: */
195#define GLOBAL(type) type
196/* a reference to a GLOBAL function: */
197#define EXTERN(type) extern type
198
199
200/* This macro is used to declare a "method", that is, a function pointer.
201 * We want to supply prototype parameters if the compiler can cope.
202 * Note that the arglist parameter must be parenthesized!
203 * Again, you can customize this if you need special linkage keywords.
204 */
205
206#ifdef HAVE_PROTOTYPES
207#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
208#else
209#define JMETHOD(type,methodname,arglist) type (*methodname) ()
210#endif
211
212
213/* Here is the pseudo-keyword for declaring pointers that must be "far"
214 * on 80x86 machines. Most of the specialized coding for 80x86 is handled
215 * by just saying "FAR *" where such a pointer is needed. In a few places
216 * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
217 */
218
219#ifndef FAR
220#ifdef NEED_FAR_POINTERS
221#define FAR far
222#else
223#define FAR
224#endif
225#endif
226
227
228/*
229 * On a few systems, type boolean and/or its values FALSE, TRUE may appear
230 * in standard header files. Or you may have conflicts with application-
231 * specific header files that you want to include together with these files.
232 * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
233 */
234
235#ifndef HAVE_BOOLEAN
236typedef int boolean;
237#endif
238#ifndef FALSE /* in case these macros already exist */
239#define FALSE 0 /* values of boolean */
240#endif
241#ifndef TRUE
242#define TRUE 1
243#endif
244
245
246/*
247 * The remaining options affect code selection within the JPEG library,
248 * but they don't need to be visible to most applications using the library.
249 * To minimize application namespace pollution, the symbols won't be
250 * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
251 */
252
253#ifdef JPEG_INTERNALS
254#define JPEG_INTERNAL_OPTIONS
255#endif
256
257#ifdef JPEG_INTERNAL_OPTIONS
258
259
260/*
261 * These defines indicate whether to include various optional functions.
262 * Undefining some of these symbols will produce a smaller but less capable
263 * library. Note that you can leave certain source files out of the
264 * compilation/linking process if you've #undef'd the corresponding symbols.
265 * (You may HAVE to do that if your compiler doesn't like null source files.)
266 */
267
268/* Capability options common to encoder and decoder: */
269
270#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
271#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
272#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
273
274/* Encoder capability options: */
275
276#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
277#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
278#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
279#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
280#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
281/* Note: if you selected 12-bit data precision, it is dangerous to turn off
282 * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
283 * precision, so jchuff.c normally uses entropy optimization to compute
284 * usable tables for higher precision. If you don't want to do optimization,
285 * you'll have to supply different default Huffman tables.
286 * The exact same statements apply for progressive JPEG: the default tables
287 * don't work for progressive mode. (This may get fixed, however.)
288 */
289#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
290
291/* Decoder capability options: */
292
293#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
294#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
295#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
296#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
297#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
298#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
299#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
300#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
301#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
302#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
303
304/* more capability options later, no doubt */
305
306
307/*
308 * Ordering of RGB data in scanlines passed to or from the application.
309 * If your application wants to deal with data in the order B,G,R, just
310 * change these macros. You can also deal with formats such as R,G,B,X
311 * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
312 * the offsets will also change the order in which colormap data is organized.
313 * RESTRICTIONS:
314 * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
315 * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
316 * is not 3 (they don't understand about dummy color components!). So you
317 * can't use color quantization if you change that value.
318 */
319
320#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
321#define RGB_GREEN 1 /* Offset of Green */
322#define RGB_BLUE 2 /* Offset of Blue */
323#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
324
325
326/* Definitions for speed-related optimizations. */
327
328
329/* If your compiler supports inline functions, define INLINE
330 * as the inline keyword; otherwise define it as empty.
331 */
332
333#ifndef INLINE
334#ifdef __GNUC__ /* for instance, GNU C knows about inline */
335#define INLINE __inline__
336#endif
337#ifndef INLINE
338#define INLINE /* default is to define it as empty */
339#endif
340#endif
341
342
343/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
344 * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
345 * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
346 */
347
348#ifndef MULTIPLIER
349#define MULTIPLIER int /* type for fastest integer multiply */
350#endif
351
352
353/* FAST_FLOAT should be either float or double, whichever is done faster
354 * by your compiler. (Note that this type is only used in the floating point
355 * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
356 * Typically, float is faster in ANSI C compilers, while double is faster in
357 * pre-ANSI compilers (because they insist on converting to double anyway).
358 * The code below therefore chooses float if we have ANSI-style prototypes.
359 */
360
361#ifndef FAST_FLOAT
362#ifdef HAVE_PROTOTYPES
363#define FAST_FLOAT float
364#else
365#define FAST_FLOAT double
366#endif
367#endif
368
369#endif /* JPEG_INTERNAL_OPTIONS */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegint.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegint.h
new file mode 100644
index 0000000..18404ef
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegint.h
@@ -0,0 +1,426 @@
1/*
2 * jpegint.h
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 1997-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file provides common declarations for the various JPEG modules.
10 * These declarations are considered internal to the JPEG library; most
11 * applications using the library shouldn't need to include this file.
12 */
13
14
15/* Declarations for both compression & decompression */
16
17typedef enum { /* Operating modes for buffer controllers */
18 JBUF_PASS_THRU, /* Plain stripwise operation */
19 /* Remaining modes require a full-image buffer to have been created */
20 JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
21 JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
22 JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
23} J_BUF_MODE;
24
25/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
26#define CSTATE_START 100 /* after create_compress */
27#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
28#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
29#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
30#define DSTATE_START 200 /* after create_decompress */
31#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
32#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
33#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
34#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
35#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
36#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
37#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
38#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
39#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
40#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
41
42
43/* Declarations for compression modules */
44
45/* Master control module */
46struct jpeg_comp_master {
47 JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
48 JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
49 JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
50
51 /* State variables made visible to other modules */
52 boolean call_pass_startup; /* True if pass_startup must be called */
53 boolean is_last_pass; /* True during last pass */
54};
55
56/* Main buffer control (downsampled-data buffer) */
57struct jpeg_c_main_controller {
58 JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
59 JMETHOD(void, process_data, (j_compress_ptr cinfo,
60 JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
61 JDIMENSION in_rows_avail));
62};
63
64/* Compression preprocessing (downsampling input buffer control) */
65struct jpeg_c_prep_controller {
66 JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
67 JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
68 JSAMPARRAY input_buf,
69 JDIMENSION *in_row_ctr,
70 JDIMENSION in_rows_avail,
71 JSAMPIMAGE output_buf,
72 JDIMENSION *out_row_group_ctr,
73 JDIMENSION out_row_groups_avail));
74};
75
76/* Coefficient buffer control */
77struct jpeg_c_coef_controller {
78 JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
79 JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
80 JSAMPIMAGE input_buf));
81};
82
83/* Colorspace conversion */
84struct jpeg_color_converter {
85 JMETHOD(void, start_pass, (j_compress_ptr cinfo));
86 JMETHOD(void, color_convert, (j_compress_ptr cinfo,
87 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
88 JDIMENSION output_row, int num_rows));
89};
90
91/* Downsampling */
92struct jpeg_downsampler {
93 JMETHOD(void, start_pass, (j_compress_ptr cinfo));
94 JMETHOD(void, downsample, (j_compress_ptr cinfo,
95 JSAMPIMAGE input_buf, JDIMENSION in_row_index,
96 JSAMPIMAGE output_buf,
97 JDIMENSION out_row_group_index));
98
99 boolean need_context_rows; /* TRUE if need rows above & below */
100};
101
102/* Forward DCT (also controls coefficient quantization) */
103typedef JMETHOD(void, forward_DCT_ptr,
104 (j_compress_ptr cinfo, jpeg_component_info * compptr,
105 JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
106 JDIMENSION start_row, JDIMENSION start_col,
107 JDIMENSION num_blocks));
108
109struct jpeg_forward_dct {
110 JMETHOD(void, start_pass, (j_compress_ptr cinfo));
111 /* It is useful to allow each component to have a separate FDCT method. */
112 forward_DCT_ptr forward_DCT[MAX_COMPONENTS];
113};
114
115/* Entropy encoding */
116struct jpeg_entropy_encoder {
117 JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
118 JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
119 JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
120};
121
122/* Marker writing */
123struct jpeg_marker_writer {
124 JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
125 JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
126 JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
127 JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
128 JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
129 /* These routines are exported to allow insertion of extra markers */
130 /* Probably only COM and APPn markers should be written this way */
131 JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
132 unsigned int datalen));
133 JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
134};
135
136
137/* Declarations for decompression modules */
138
139/* Master control module */
140struct jpeg_decomp_master {
141 JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
142 JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
143
144 /* State variables made visible to other modules */
145 boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
146};
147
148/* Input control module */
149struct jpeg_input_controller {
150 JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
151 JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
152 JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
153 JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
154
155 /* State variables made visible to other modules */
156 boolean has_multiple_scans; /* True if file has multiple scans */
157 boolean eoi_reached; /* True when EOI has been consumed */
158};
159
160/* Main buffer control (downsampled-data buffer) */
161struct jpeg_d_main_controller {
162 JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
163 JMETHOD(void, process_data, (j_decompress_ptr cinfo,
164 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
165 JDIMENSION out_rows_avail));
166};
167
168/* Coefficient buffer control */
169struct jpeg_d_coef_controller {
170 JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
171 JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
172 JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
173 JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
174 JSAMPIMAGE output_buf));
175 /* Pointer to array of coefficient virtual arrays, or NULL if none */
176 jvirt_barray_ptr *coef_arrays;
177};
178
179/* Decompression postprocessing (color quantization buffer control) */
180struct jpeg_d_post_controller {
181 JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
182 JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
183 JSAMPIMAGE input_buf,
184 JDIMENSION *in_row_group_ctr,
185 JDIMENSION in_row_groups_avail,
186 JSAMPARRAY output_buf,
187 JDIMENSION *out_row_ctr,
188 JDIMENSION out_rows_avail));
189};
190
191/* Marker reading & parsing */
192struct jpeg_marker_reader {
193 JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
194 /* Read markers until SOS or EOI.
195 * Returns same codes as are defined for jpeg_consume_input:
196 * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
197 */
198 JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
199 /* Read a restart marker --- exported for use by entropy decoder only */
200 jpeg_marker_parser_method read_restart_marker;
201
202 /* State of marker reader --- nominally internal, but applications
203 * supplying COM or APPn handlers might like to know the state.
204 */
205 boolean saw_SOI; /* found SOI? */
206 boolean saw_SOF; /* found SOF? */
207 int next_restart_num; /* next restart number expected (0-7) */
208 unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
209};
210
211/* Entropy decoding */
212struct jpeg_entropy_decoder {
213 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
214 JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
215 JBLOCKROW *MCU_data));
216};
217
218/* Inverse DCT (also performs dequantization) */
219typedef JMETHOD(void, inverse_DCT_method_ptr,
220 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
221 JCOEFPTR coef_block,
222 JSAMPARRAY output_buf, JDIMENSION output_col));
223
224struct jpeg_inverse_dct {
225 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
226 /* It is useful to allow each component to have a separate IDCT method. */
227 inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
228};
229
230/* Upsampling (note that upsampler must also call color converter) */
231struct jpeg_upsampler {
232 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
233 JMETHOD(void, upsample, (j_decompress_ptr cinfo,
234 JSAMPIMAGE input_buf,
235 JDIMENSION *in_row_group_ctr,
236 JDIMENSION in_row_groups_avail,
237 JSAMPARRAY output_buf,
238 JDIMENSION *out_row_ctr,
239 JDIMENSION out_rows_avail));
240
241 boolean need_context_rows; /* TRUE if need rows above & below */
242};
243
244/* Colorspace conversion */
245struct jpeg_color_deconverter {
246 JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
247 JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
248 JSAMPIMAGE input_buf, JDIMENSION input_row,
249 JSAMPARRAY output_buf, int num_rows));
250};
251
252/* Color quantization or color precision reduction */
253struct jpeg_color_quantizer {
254 JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
255 JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
256 JSAMPARRAY input_buf, JSAMPARRAY output_buf,
257 int num_rows));
258 JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
259 JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
260};
261
262
263/* Miscellaneous useful macros */
264
265#undef MAX
266#define MAX(a,b) ((a) > (b) ? (a) : (b))
267#undef MIN
268#define MIN(a,b) ((a) < (b) ? (a) : (b))
269
270
271/* We assume that right shift corresponds to signed division by 2 with
272 * rounding towards minus infinity. This is correct for typical "arithmetic
273 * shift" instructions that shift in copies of the sign bit. But some
274 * C compilers implement >> with an unsigned shift. For these machines you
275 * must define RIGHT_SHIFT_IS_UNSIGNED.
276 * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
277 * It is only applied with constant shift counts. SHIFT_TEMPS must be
278 * included in the variables of any routine using RIGHT_SHIFT.
279 */
280
281#ifdef RIGHT_SHIFT_IS_UNSIGNED
282#define SHIFT_TEMPS INT32 shift_temp;
283#define RIGHT_SHIFT(x,shft) \
284 ((shift_temp = (x)) < 0 ? \
285 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
286 (shift_temp >> (shft)))
287#else
288#define SHIFT_TEMPS
289#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
290#endif
291
292
293/* Short forms of external names for systems with brain-damaged linkers. */
294
295#ifdef NEED_SHORT_EXTERNAL_NAMES
296#define jinit_compress_master jICompress
297#define jinit_c_master_control jICMaster
298#define jinit_c_main_controller jICMainC
299#define jinit_c_prep_controller jICPrepC
300#define jinit_c_coef_controller jICCoefC
301#define jinit_color_converter jICColor
302#define jinit_downsampler jIDownsampler
303#define jinit_forward_dct jIFDCT
304#define jinit_huff_encoder jIHEncoder
305#define jinit_arith_encoder jIAEncoder
306#define jinit_marker_writer jIMWriter
307#define jinit_master_decompress jIDMaster
308#define jinit_d_main_controller jIDMainC
309#define jinit_d_coef_controller jIDCoefC
310#define jinit_d_post_controller jIDPostC
311#define jinit_input_controller jIInCtlr
312#define jinit_marker_reader jIMReader
313#define jinit_huff_decoder jIHDecoder
314#define jinit_arith_decoder jIADecoder
315#define jinit_inverse_dct jIIDCT
316#define jinit_upsampler jIUpsampler
317#define jinit_color_deconverter jIDColor
318#define jinit_1pass_quantizer jI1Quant
319#define jinit_2pass_quantizer jI2Quant
320#define jinit_merged_upsampler jIMUpsampler
321#define jinit_memory_mgr jIMemMgr
322#define jdiv_round_up jDivRound
323#define jround_up jRound
324#define jzero_far jZeroFar
325#define jcopy_sample_rows jCopySamples
326#define jcopy_block_row jCopyBlocks
327#define jpeg_zigzag_order jZIGTable
328#define jpeg_natural_order jZAGTable
329#define jpeg_natural_order7 jZAG7Table
330#define jpeg_natural_order6 jZAG6Table
331#define jpeg_natural_order5 jZAG5Table
332#define jpeg_natural_order4 jZAG4Table
333#define jpeg_natural_order3 jZAG3Table
334#define jpeg_natural_order2 jZAG2Table
335#define jpeg_aritab jAriTab
336#endif /* NEED_SHORT_EXTERNAL_NAMES */
337
338
339/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
340 * and coefficient-block arrays. This won't work on 80x86 because the arrays
341 * are FAR and we're assuming a small-pointer memory model. However, some
342 * DOS compilers provide far-pointer versions of memcpy() and memset() even
343 * in the small-model libraries. These will be used if USE_FMEM is defined.
344 * Otherwise, the routines in jutils.c do it the hard way.
345 */
346
347#ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */
348#define FMEMZERO(target,size) MEMZERO(target,size)
349#else /* 80x86 case */
350#ifdef USE_FMEM
351#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size))
352#else
353EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
354#define FMEMZERO(target,size) jzero_far(target, size)
355#endif
356#endif
357
358
359/* Compression module initialization routines */
360EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
361EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
362 boolean transcode_only));
363EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
364 boolean need_full_buffer));
365EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
366 boolean need_full_buffer));
367EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
368 boolean need_full_buffer));
369EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
370EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
371EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
372EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
373EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));
374EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
375/* Decompression module initialization routines */
376EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
377EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
378 boolean need_full_buffer));
379EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
380 boolean need_full_buffer));
381EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
382 boolean need_full_buffer));
383EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
384EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
385EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
386EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));
387EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
388EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
389EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
390EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
391EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
392EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
393/* Memory manager initialization */
394EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
395
396/* Utility routines in jutils.c */
397EXTERN(long) jdiv_round_up JPP((long a, long b));
398EXTERN(long) jround_up JPP((long a, long b));
399EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
400 JSAMPARRAY output_array, int dest_row,
401 int num_rows, JDIMENSION num_cols));
402EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
403 JDIMENSION num_blocks));
404/* Constant tables in jutils.c */
405#if 0 /* This table is not actually needed in v6a */
406extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
407#endif
408extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
409extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */
410extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */
411extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */
412extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */
413extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */
414extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */
415
416/* Arithmetic coding probability estimation tables in jaricom.c */
417extern const INT32 jpeg_aritab[];
418
419/* Suppress undefined-structure complaints if necessary. */
420
421#ifdef INCOMPLETE_TYPES_BROKEN
422#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */
423struct jvirt_sarray_control { long dummy; };
424struct jvirt_barray_control { long dummy; };
425#endif
426#endif /* INCOMPLETE_TYPES_BROKEN */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpeglib.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpeglib.h
new file mode 100644
index 0000000..5fc43d8
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpeglib.h
@@ -0,0 +1,1160 @@
1/*
2 * jpeglib.h
3 *
4 * Copyright (C) 1991-1998, Thomas G. Lane.
5 * Modified 2002-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file defines the application interface for the JPEG library.
10 * Most applications using the library need only include this file,
11 * and perhaps jerror.h if they want to know the exact error codes.
12 */
13
14#ifndef JPEGLIB_H
15#define JPEGLIB_H
16
17/*
18 * First we include the configuration files that record how this
19 * installation of the JPEG library is set up. jconfig.h can be
20 * generated automatically for many systems. jmorecfg.h contains
21 * manual configuration options that most people need not worry about.
22 */
23
24#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
25#include "jconfig.h" /* widely used configuration options */
26#endif
27#include "jmorecfg.h" /* seldom changed options */
28
29
30#ifdef __cplusplus
31#ifndef DONT_USE_EXTERN_C
32extern "C" {
33#endif
34#endif
35
36/* Version IDs for the JPEG library.
37 * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80".
38 */
39
40#define JPEG_LIB_VERSION 80 /* Compatibility version 8.0 */
41#define JPEG_LIB_VERSION_MAJOR 8
42#define JPEG_LIB_VERSION_MINOR 4
43
44
45/* Various constants determining the sizes of things.
46 * All of these are specified by the JPEG standard, so don't change them
47 * if you want to be compatible.
48 */
49
50#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */
51#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
52#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
53#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
54#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
55#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
56#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
57/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
58 * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
59 * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
60 * to handle it. We even let you do this from the jconfig.h file. However,
61 * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
62 * sometimes emits noncompliant files doesn't mean you should too.
63 */
64#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
65#ifndef D_MAX_BLOCKS_IN_MCU
66#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
67#endif
68
69
70/* Data structures for images (arrays of samples and of DCT coefficients).
71 * On 80x86 machines, the image arrays are too big for near pointers,
72 * but the pointer arrays can fit in near memory.
73 */
74
75typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
76typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
77typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
78
79typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
80typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */
81typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
82typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
83
84typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */
85
86
87/* Types for JPEG compression parameters and working tables. */
88
89
90/* DCT coefficient quantization tables. */
91
92typedef struct {
93 /* This array gives the coefficient quantizers in natural array order
94 * (not the zigzag order in which they are stored in a JPEG DQT marker).
95 * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
96 */
97 UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
98 /* This field is used only during compression. It's initialized FALSE when
99 * the table is created, and set TRUE when it's been output to the file.
100 * You could suppress output of a table by setting this to TRUE.
101 * (See jpeg_suppress_tables for an example.)
102 */
103 boolean sent_table; /* TRUE when table has been output */
104} JQUANT_TBL;
105
106
107/* Huffman coding tables. */
108
109typedef struct {
110 /* These two fields directly represent the contents of a JPEG DHT marker */
111 UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
112 /* length k bits; bits[0] is unused */
113 UINT8 huffval[256]; /* The symbols, in order of incr code length */
114 /* This field is used only during compression. It's initialized FALSE when
115 * the table is created, and set TRUE when it's been output to the file.
116 * You could suppress output of a table by setting this to TRUE.
117 * (See jpeg_suppress_tables for an example.)
118 */
119 boolean sent_table; /* TRUE when table has been output */
120} JHUFF_TBL;
121
122
123/* Basic info about one component (color channel). */
124
125typedef struct {
126 /* These values are fixed over the whole image. */
127 /* For compression, they must be supplied by parameter setup; */
128 /* for decompression, they are read from the SOF marker. */
129 int component_id; /* identifier for this component (0..255) */
130 int component_index; /* its index in SOF or cinfo->comp_info[] */
131 int h_samp_factor; /* horizontal sampling factor (1..4) */
132 int v_samp_factor; /* vertical sampling factor (1..4) */
133 int quant_tbl_no; /* quantization table selector (0..3) */
134 /* These values may vary between scans. */
135 /* For compression, they must be supplied by parameter setup; */
136 /* for decompression, they are read from the SOS marker. */
137 /* The decompressor output side may not use these variables. */
138 int dc_tbl_no; /* DC entropy table selector (0..3) */
139 int ac_tbl_no; /* AC entropy table selector (0..3) */
140
141 /* Remaining fields should be treated as private by applications. */
142
143 /* These values are computed during compression or decompression startup: */
144 /* Component's size in DCT blocks.
145 * Any dummy blocks added to complete an MCU are not counted; therefore
146 * these values do not depend on whether a scan is interleaved or not.
147 */
148 JDIMENSION width_in_blocks;
149 JDIMENSION height_in_blocks;
150 /* Size of a DCT block in samples,
151 * reflecting any scaling we choose to apply during the DCT step.
152 * Values from 1 to 16 are supported.
153 * Note that different components may receive different DCT scalings.
154 */
155 int DCT_h_scaled_size;
156 int DCT_v_scaled_size;
157 /* The downsampled dimensions are the component's actual, unpadded number
158 * of samples at the main buffer (preprocessing/compression interface);
159 * DCT scaling is included, so
160 * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)
161 * and similarly for height.
162 */
163 JDIMENSION downsampled_width; /* actual width in samples */
164 JDIMENSION downsampled_height; /* actual height in samples */
165 /* This flag is used only for decompression. In cases where some of the
166 * components will be ignored (eg grayscale output from YCbCr image),
167 * we can skip most computations for the unused components.
168 */
169 boolean component_needed; /* do we need the value of this component? */
170
171 /* These values are computed before starting a scan of the component. */
172 /* The decompressor output side may not use these variables. */
173 int MCU_width; /* number of blocks per MCU, horizontally */
174 int MCU_height; /* number of blocks per MCU, vertically */
175 int MCU_blocks; /* MCU_width * MCU_height */
176 int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */
177 int last_col_width; /* # of non-dummy blocks across in last MCU */
178 int last_row_height; /* # of non-dummy blocks down in last MCU */
179
180 /* Saved quantization table for component; NULL if none yet saved.
181 * See jdinput.c comments about the need for this information.
182 * This field is currently used only for decompression.
183 */
184 JQUANT_TBL * quant_table;
185
186 /* Private per-component storage for DCT or IDCT subsystem. */
187 void * dct_table;
188} jpeg_component_info;
189
190
191/* The script for encoding a multiple-scan file is an array of these: */
192
193typedef struct {
194 int comps_in_scan; /* number of components encoded in this scan */
195 int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
196 int Ss, Se; /* progressive JPEG spectral selection parms */
197 int Ah, Al; /* progressive JPEG successive approx. parms */
198} jpeg_scan_info;
199
200/* The decompressor can save APPn and COM markers in a list of these: */
201
202typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;
203
204struct jpeg_marker_struct {
205 jpeg_saved_marker_ptr next; /* next in list, or NULL */
206 UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
207 unsigned int original_length; /* # bytes of data in the file */
208 unsigned int data_length; /* # bytes of data saved at data[] */
209 JOCTET FAR * data; /* the data contained in the marker */
210 /* the marker length word is not counted in data_length or original_length */
211};
212
213/* Known color spaces. */
214
215typedef enum {
216 JCS_UNKNOWN, /* error/unspecified */
217 JCS_GRAYSCALE, /* monochrome */
218 JCS_RGB, /* red/green/blue */
219 JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
220 JCS_CMYK, /* C/M/Y/K */
221 JCS_YCCK /* Y/Cb/Cr/K */
222} J_COLOR_SPACE;
223
224/* DCT/IDCT algorithm options. */
225
226typedef enum {
227 JDCT_ISLOW, /* slow but accurate integer algorithm */
228 JDCT_IFAST, /* faster, less accurate integer method */
229 JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
230} J_DCT_METHOD;
231
232#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
233#define JDCT_DEFAULT JDCT_ISLOW
234#endif
235#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
236#define JDCT_FASTEST JDCT_IFAST
237#endif
238
239/* Dithering options for decompression. */
240
241typedef enum {
242 JDITHER_NONE, /* no dithering */
243 JDITHER_ORDERED, /* simple ordered dither */
244 JDITHER_FS /* Floyd-Steinberg error diffusion dither */
245} J_DITHER_MODE;
246
247
248/* Common fields between JPEG compression and decompression master structs. */
249
250#define jpeg_common_fields \
251 struct jpeg_error_mgr * err; /* Error handler module */\
252 struct jpeg_memory_mgr * mem; /* Memory manager module */\
253 struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
254 void * client_data; /* Available for use by application */\
255 boolean is_decompressor; /* So common code can tell which is which */\
256 int global_state /* For checking call sequence validity */
257
258/* Routines that are to be used by both halves of the library are declared
259 * to receive a pointer to this structure. There are no actual instances of
260 * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
261 */
262struct jpeg_common_struct {
263 jpeg_common_fields; /* Fields common to both master struct types */
264 /* Additional fields follow in an actual jpeg_compress_struct or
265 * jpeg_decompress_struct. All three structs must agree on these
266 * initial fields! (This would be a lot cleaner in C++.)
267 */
268};
269
270typedef struct jpeg_common_struct * j_common_ptr;
271typedef struct jpeg_compress_struct * j_compress_ptr;
272typedef struct jpeg_decompress_struct * j_decompress_ptr;
273
274
275/* Master record for a compression instance */
276
277struct jpeg_compress_struct {
278 jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
279
280 /* Destination for compressed data */
281 struct jpeg_destination_mgr * dest;
282
283 /* Description of source image --- these fields must be filled in by
284 * outer application before starting compression. in_color_space must
285 * be correct before you can even call jpeg_set_defaults().
286 */
287
288 JDIMENSION image_width; /* input image width */
289 JDIMENSION image_height; /* input image height */
290 int input_components; /* # of color components in input image */
291 J_COLOR_SPACE in_color_space; /* colorspace of input image */
292
293 double input_gamma; /* image gamma of input image */
294
295 /* Compression parameters --- these fields must be set before calling
296 * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
297 * initialize everything to reasonable defaults, then changing anything
298 * the application specifically wants to change. That way you won't get
299 * burnt when new parameters are added. Also note that there are several
300 * helper routines to simplify changing parameters.
301 */
302
303 unsigned int scale_num, scale_denom; /* fraction by which to scale image */
304
305 JDIMENSION jpeg_width; /* scaled JPEG image width */
306 JDIMENSION jpeg_height; /* scaled JPEG image height */
307 /* Dimensions of actual JPEG image that will be written to file,
308 * derived from input dimensions by scaling factors above.
309 * These fields are computed by jpeg_start_compress().
310 * You can also use jpeg_calc_jpeg_dimensions() to determine these values
311 * in advance of calling jpeg_start_compress().
312 */
313
314 int data_precision; /* bits of precision in image data */
315
316 int num_components; /* # of color components in JPEG image */
317 J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
318
319 jpeg_component_info * comp_info;
320 /* comp_info[i] describes component that appears i'th in SOF */
321
322 JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
323 int q_scale_factor[NUM_QUANT_TBLS];
324 /* ptrs to coefficient quantization tables, or NULL if not defined,
325 * and corresponding scale factors (percentage, initialized 100).
326 */
327
328 JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
329 JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
330 /* ptrs to Huffman coding tables, or NULL if not defined */
331
332 UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
333 UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
334 UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
335
336 int num_scans; /* # of entries in scan_info array */
337 const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
338 /* The default value of scan_info is NULL, which causes a single-scan
339 * sequential JPEG file to be emitted. To create a multi-scan file,
340 * set num_scans and scan_info to point to an array of scan definitions.
341 */
342
343 boolean raw_data_in; /* TRUE=caller supplies downsampled data */
344 boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
345 boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
346 boolean CCIR601_sampling; /* TRUE=first samples are cosited */
347 boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */
348 int smoothing_factor; /* 1..100, or 0 for no input smoothing */
349 J_DCT_METHOD dct_method; /* DCT algorithm selector */
350
351 /* The restart interval can be specified in absolute MCUs by setting
352 * restart_interval, or in MCU rows by setting restart_in_rows
353 * (in which case the correct restart_interval will be figured
354 * for each scan).
355 */
356 unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
357 int restart_in_rows; /* if > 0, MCU rows per restart interval */
358
359 /* Parameters controlling emission of special markers. */
360
361 boolean write_JFIF_header; /* should a JFIF marker be written? */
362 UINT8 JFIF_major_version; /* What to write for the JFIF version number */
363 UINT8 JFIF_minor_version;
364 /* These three values are not used by the JPEG code, merely copied */
365 /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
366 /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
367 /* ratio is defined by X_density/Y_density even when density_unit=0. */
368 UINT8 density_unit; /* JFIF code for pixel size units */
369 UINT16 X_density; /* Horizontal pixel density */
370 UINT16 Y_density; /* Vertical pixel density */
371 boolean write_Adobe_marker; /* should an Adobe marker be written? */
372
373 /* State variable: index of next scanline to be written to
374 * jpeg_write_scanlines(). Application may use this to control its
375 * processing loop, e.g., "while (next_scanline < image_height)".
376 */
377
378 JDIMENSION next_scanline; /* 0 .. image_height-1 */
379
380 /* Remaining fields are known throughout compressor, but generally
381 * should not be touched by a surrounding application.
382 */
383
384 /*
385 * These fields are computed during compression startup
386 */
387 boolean progressive_mode; /* TRUE if scan script uses progressive mode */
388 int max_h_samp_factor; /* largest h_samp_factor */
389 int max_v_samp_factor; /* largest v_samp_factor */
390
391 int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */
392 int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */
393
394 JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
395 /* The coefficient controller receives data in units of MCU rows as defined
396 * for fully interleaved scans (whether the JPEG file is interleaved or not).
397 * There are v_samp_factor * DCTSIZE sample rows of each component in an
398 * "iMCU" (interleaved MCU) row.
399 */
400
401 /*
402 * These fields are valid during any one scan.
403 * They describe the components and MCUs actually appearing in the scan.
404 */
405 int comps_in_scan; /* # of JPEG components in this scan */
406 jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
407 /* *cur_comp_info[i] describes component that appears i'th in SOS */
408
409 JDIMENSION MCUs_per_row; /* # of MCUs across the image */
410 JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
411
412 int blocks_in_MCU; /* # of DCT blocks per MCU */
413 int MCU_membership[C_MAX_BLOCKS_IN_MCU];
414 /* MCU_membership[i] is index in cur_comp_info of component owning */
415 /* i'th block in an MCU */
416
417 int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
418
419 int block_size; /* the basic DCT block size: 1..16 */
420 const int * natural_order; /* natural-order position array */
421 int lim_Se; /* min( Se, DCTSIZE2-1 ) */
422
423 /*
424 * Links to compression subobjects (methods and private variables of modules)
425 */
426 struct jpeg_comp_master * master;
427 struct jpeg_c_main_controller * main;
428 struct jpeg_c_prep_controller * prep;
429 struct jpeg_c_coef_controller * coef;
430 struct jpeg_marker_writer * marker;
431 struct jpeg_color_converter * cconvert;
432 struct jpeg_downsampler * downsample;
433 struct jpeg_forward_dct * fdct;
434 struct jpeg_entropy_encoder * entropy;
435 jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
436 int script_space_size;
437};
438
439
440/* Master record for a decompression instance */
441
442struct jpeg_decompress_struct {
443 jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
444
445 /* Source of compressed data */
446 struct jpeg_source_mgr * src;
447
448 /* Basic description of image --- filled in by jpeg_read_header(). */
449 /* Application may inspect these values to decide how to process image. */
450
451 JDIMENSION image_width; /* nominal image width (from SOF marker) */
452 JDIMENSION image_height; /* nominal image height */
453 int num_components; /* # of color components in JPEG image */
454 J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
455
456 /* Decompression processing parameters --- these fields must be set before
457 * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
458 * them to default values.
459 */
460
461 J_COLOR_SPACE out_color_space; /* colorspace for output */
462
463 unsigned int scale_num, scale_denom; /* fraction by which to scale image */
464
465 double output_gamma; /* image gamma wanted in output */
466
467 boolean buffered_image; /* TRUE=multiple output passes */
468 boolean raw_data_out; /* TRUE=downsampled data wanted */
469
470 J_DCT_METHOD dct_method; /* IDCT algorithm selector */
471 boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
472 boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
473
474 boolean quantize_colors; /* TRUE=colormapped output wanted */
475 /* the following are ignored if not quantize_colors: */
476 J_DITHER_MODE dither_mode; /* type of color dithering to use */
477 boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
478 int desired_number_of_colors; /* max # colors to use in created colormap */
479 /* these are significant only in buffered-image mode: */
480 boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
481 boolean enable_external_quant;/* enable future use of external colormap */
482 boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
483
484 /* Description of actual output image that will be returned to application.
485 * These fields are computed by jpeg_start_decompress().
486 * You can also use jpeg_calc_output_dimensions() to determine these values
487 * in advance of calling jpeg_start_decompress().
488 */
489
490 JDIMENSION output_width; /* scaled image width */
491 JDIMENSION output_height; /* scaled image height */
492 int out_color_components; /* # of color components in out_color_space */
493 int output_components; /* # of color components returned */
494 /* output_components is 1 (a colormap index) when quantizing colors;
495 * otherwise it equals out_color_components.
496 */
497 int rec_outbuf_height; /* min recommended height of scanline buffer */
498 /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
499 * high, space and time will be wasted due to unnecessary data copying.
500 * Usually rec_outbuf_height will be 1 or 2, at most 4.
501 */
502
503 /* When quantizing colors, the output colormap is described by these fields.
504 * The application can supply a colormap by setting colormap non-NULL before
505 * calling jpeg_start_decompress; otherwise a colormap is created during
506 * jpeg_start_decompress or jpeg_start_output.
507 * The map has out_color_components rows and actual_number_of_colors columns.
508 */
509 int actual_number_of_colors; /* number of entries in use */
510 JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
511
512 /* State variables: these variables indicate the progress of decompression.
513 * The application may examine these but must not modify them.
514 */
515
516 /* Row index of next scanline to be read from jpeg_read_scanlines().
517 * Application may use this to control its processing loop, e.g.,
518 * "while (output_scanline < output_height)".
519 */
520 JDIMENSION output_scanline; /* 0 .. output_height-1 */
521
522 /* Current input scan number and number of iMCU rows completed in scan.
523 * These indicate the progress of the decompressor input side.
524 */
525 int input_scan_number; /* Number of SOS markers seen so far */
526 JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
527
528 /* The "output scan number" is the notional scan being displayed by the
529 * output side. The decompressor will not allow output scan/row number
530 * to get ahead of input scan/row, but it can fall arbitrarily far behind.
531 */
532 int output_scan_number; /* Nominal scan number being displayed */
533 JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
534
535 /* Current progression status. coef_bits[c][i] indicates the precision
536 * with which component c's DCT coefficient i (in zigzag order) is known.
537 * It is -1 when no data has yet been received, otherwise it is the point
538 * transform (shift) value for the most recent scan of the coefficient
539 * (thus, 0 at completion of the progression).
540 * This pointer is NULL when reading a non-progressive file.
541 */
542 int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
543
544 /* Internal JPEG parameters --- the application usually need not look at
545 * these fields. Note that the decompressor output side may not use
546 * any parameters that can change between scans.
547 */
548
549 /* Quantization and Huffman tables are carried forward across input
550 * datastreams when processing abbreviated JPEG datastreams.
551 */
552
553 JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
554 /* ptrs to coefficient quantization tables, or NULL if not defined */
555
556 JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
557 JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
558 /* ptrs to Huffman coding tables, or NULL if not defined */
559
560 /* These parameters are never carried across datastreams, since they
561 * are given in SOF/SOS markers or defined to be reset by SOI.
562 */
563
564 int data_precision; /* bits of precision in image data */
565
566 jpeg_component_info * comp_info;
567 /* comp_info[i] describes component that appears i'th in SOF */
568
569 boolean is_baseline; /* TRUE if Baseline SOF0 encountered */
570 boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
571 boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
572
573 UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
574 UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
575 UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
576
577 unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
578
579 /* These fields record data obtained from optional markers recognized by
580 * the JPEG library.
581 */
582 boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
583 /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
584 UINT8 JFIF_major_version; /* JFIF version number */
585 UINT8 JFIF_minor_version;
586 UINT8 density_unit; /* JFIF code for pixel size units */
587 UINT16 X_density; /* Horizontal pixel density */
588 UINT16 Y_density; /* Vertical pixel density */
589 boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
590 UINT8 Adobe_transform; /* Color transform code from Adobe marker */
591
592 boolean CCIR601_sampling; /* TRUE=first samples are cosited */
593
594 /* Aside from the specific data retained from APPn markers known to the
595 * library, the uninterpreted contents of any or all APPn and COM markers
596 * can be saved in a list for examination by the application.
597 */
598 jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
599
600 /* Remaining fields are known throughout decompressor, but generally
601 * should not be touched by a surrounding application.
602 */
603
604 /*
605 * These fields are computed during decompression startup
606 */
607 int max_h_samp_factor; /* largest h_samp_factor */
608 int max_v_samp_factor; /* largest v_samp_factor */
609
610 int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */
611 int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */
612
613 JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
614 /* The coefficient controller's input and output progress is measured in
615 * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
616 * in fully interleaved JPEG scans, but are used whether the scan is
617 * interleaved or not. We define an iMCU row as v_samp_factor DCT block
618 * rows of each component. Therefore, the IDCT output contains
619 * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
620 */
621
622 JSAMPLE * sample_range_limit; /* table for fast range-limiting */
623
624 /*
625 * These fields are valid during any one scan.
626 * They describe the components and MCUs actually appearing in the scan.
627 * Note that the decompressor output side must not use these fields.
628 */
629 int comps_in_scan; /* # of JPEG components in this scan */
630 jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
631 /* *cur_comp_info[i] describes component that appears i'th in SOS */
632
633 JDIMENSION MCUs_per_row; /* # of MCUs across the image */
634 JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
635
636 int blocks_in_MCU; /* # of DCT blocks per MCU */
637 int MCU_membership[D_MAX_BLOCKS_IN_MCU];
638 /* MCU_membership[i] is index in cur_comp_info of component owning */
639 /* i'th block in an MCU */
640
641 int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
642
643 /* These fields are derived from Se of first SOS marker.
644 */
645 int block_size; /* the basic DCT block size: 1..16 */
646 const int * natural_order; /* natural-order position array for entropy decode */
647 int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */
648
649 /* This field is shared between entropy decoder and marker parser.
650 * It is either zero or the code of a JPEG marker that has been
651 * read from the data source, but has not yet been processed.
652 */
653 int unread_marker;
654
655 /*
656 * Links to decompression subobjects (methods, private variables of modules)
657 */
658 struct jpeg_decomp_master * master;
659 struct jpeg_d_main_controller * main;
660 struct jpeg_d_coef_controller * coef;
661 struct jpeg_d_post_controller * post;
662 struct jpeg_input_controller * inputctl;
663 struct jpeg_marker_reader * marker;
664 struct jpeg_entropy_decoder * entropy;
665 struct jpeg_inverse_dct * idct;
666 struct jpeg_upsampler * upsample;
667 struct jpeg_color_deconverter * cconvert;
668 struct jpeg_color_quantizer * cquantize;
669};
670
671
672/* "Object" declarations for JPEG modules that may be supplied or called
673 * directly by the surrounding application.
674 * As with all objects in the JPEG library, these structs only define the
675 * publicly visible methods and state variables of a module. Additional
676 * private fields may exist after the public ones.
677 */
678
679
680/* Error handler object */
681
682struct jpeg_error_mgr {
683 /* Error exit handler: does not return to caller */
684 JMETHOD(void, error_exit, (j_common_ptr cinfo));
685 /* Conditionally emit a trace or warning message */
686 JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
687 /* Routine that actually outputs a trace or error message */
688 JMETHOD(void, output_message, (j_common_ptr cinfo));
689 /* Format a message string for the most recent JPEG error or message */
690 JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
691#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
692 /* Reset error state variables at start of a new image */
693 JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
694
695 /* The message ID code and any parameters are saved here.
696 * A message can have one string parameter or up to 8 int parameters.
697 */
698 int msg_code;
699#define JMSG_STR_PARM_MAX 80
700 union {
701 int i[8];
702 char s[JMSG_STR_PARM_MAX];
703 } msg_parm;
704
705 /* Standard state variables for error facility */
706
707 int trace_level; /* max msg_level that will be displayed */
708
709 /* For recoverable corrupt-data errors, we emit a warning message,
710 * but keep going unless emit_message chooses to abort. emit_message
711 * should count warnings in num_warnings. The surrounding application
712 * can check for bad data by seeing if num_warnings is nonzero at the
713 * end of processing.
714 */
715 long num_warnings; /* number of corrupt-data warnings */
716
717 /* These fields point to the table(s) of error message strings.
718 * An application can change the table pointer to switch to a different
719 * message list (typically, to change the language in which errors are
720 * reported). Some applications may wish to add additional error codes
721 * that will be handled by the JPEG library error mechanism; the second
722 * table pointer is used for this purpose.
723 *
724 * First table includes all errors generated by JPEG library itself.
725 * Error code 0 is reserved for a "no such error string" message.
726 */
727 const char * const * jpeg_message_table; /* Library errors */
728 int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
729 /* Second table can be added by application (see cjpeg/djpeg for example).
730 * It contains strings numbered first_addon_message..last_addon_message.
731 */
732 const char * const * addon_message_table; /* Non-library errors */
733 int first_addon_message; /* code for first string in addon table */
734 int last_addon_message; /* code for last string in addon table */
735};
736
737
738/* Progress monitor object */
739
740struct jpeg_progress_mgr {
741 JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
742
743 long pass_counter; /* work units completed in this pass */
744 long pass_limit; /* total number of work units in this pass */
745 int completed_passes; /* passes completed so far */
746 int total_passes; /* total number of passes expected */
747};
748
749
750/* Data destination object for compression */
751
752struct jpeg_destination_mgr {
753 JOCTET * next_output_byte; /* => next byte to write in buffer */
754 size_t free_in_buffer; /* # of byte spaces remaining in buffer */
755
756 JMETHOD(void, init_destination, (j_compress_ptr cinfo));
757 JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
758 JMETHOD(void, term_destination, (j_compress_ptr cinfo));
759};
760
761
762/* Data source object for decompression */
763
764struct jpeg_source_mgr {
765 const JOCTET * next_input_byte; /* => next byte to read from buffer */
766 size_t bytes_in_buffer; /* # of bytes remaining in buffer */
767
768 JMETHOD(void, init_source, (j_decompress_ptr cinfo));
769 JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
770 JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
771 JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
772 JMETHOD(void, term_source, (j_decompress_ptr cinfo));
773};
774
775
776/* Memory manager object.
777 * Allocates "small" objects (a few K total), "large" objects (tens of K),
778 * and "really big" objects (virtual arrays with backing store if needed).
779 * The memory manager does not allow individual objects to be freed; rather,
780 * each created object is assigned to a pool, and whole pools can be freed
781 * at once. This is faster and more convenient than remembering exactly what
782 * to free, especially where malloc()/free() are not too speedy.
783 * NB: alloc routines never return NULL. They exit to error_exit if not
784 * successful.
785 */
786
787#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
788#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
789#define JPOOL_NUMPOOLS 2
790
791typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
792typedef struct jvirt_barray_control * jvirt_barray_ptr;
793
794
795struct jpeg_memory_mgr {
796 /* Method pointers */
797 JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
798 size_t sizeofobject));
799 JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
800 size_t sizeofobject));
801 JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
802 JDIMENSION samplesperrow,
803 JDIMENSION numrows));
804 JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
805 JDIMENSION blocksperrow,
806 JDIMENSION numrows));
807 JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
808 int pool_id,
809 boolean pre_zero,
810 JDIMENSION samplesperrow,
811 JDIMENSION numrows,
812 JDIMENSION maxaccess));
813 JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
814 int pool_id,
815 boolean pre_zero,
816 JDIMENSION blocksperrow,
817 JDIMENSION numrows,
818 JDIMENSION maxaccess));
819 JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
820 JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
821 jvirt_sarray_ptr ptr,
822 JDIMENSION start_row,
823 JDIMENSION num_rows,
824 boolean writable));
825 JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
826 jvirt_barray_ptr ptr,
827 JDIMENSION start_row,
828 JDIMENSION num_rows,
829 boolean writable));
830 JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
831 JMETHOD(void, self_destruct, (j_common_ptr cinfo));
832
833 /* Limit on memory allocation for this JPEG object. (Note that this is
834 * merely advisory, not a guaranteed maximum; it only affects the space
835 * used for virtual-array buffers.) May be changed by outer application
836 * after creating the JPEG object.
837 */
838 long max_memory_to_use;
839
840 /* Maximum allocation request accepted by alloc_large. */
841 long max_alloc_chunk;
842};
843
844
845/* Routine signature for application-supplied marker processing methods.
846 * Need not pass marker code since it is stored in cinfo->unread_marker.
847 */
848typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
849
850
851/* Declarations for routines called by application.
852 * The JPP macro hides prototype parameters from compilers that can't cope.
853 * Note JPP requires double parentheses.
854 */
855
856#ifdef HAVE_PROTOTYPES
857#define JPP(arglist) arglist
858#else
859#define JPP(arglist) ()
860#endif
861
862
863/* Short forms of external names for systems with brain-damaged linkers.
864 * We shorten external names to be unique in the first six letters, which
865 * is good enough for all known systems.
866 * (If your compiler itself needs names to be unique in less than 15
867 * characters, you are out of luck. Get a better compiler.)
868 */
869
870#ifdef NEED_SHORT_EXTERNAL_NAMES
871#define jpeg_std_error jStdError
872#define jpeg_CreateCompress jCreaCompress
873#define jpeg_CreateDecompress jCreaDecompress
874#define jpeg_destroy_compress jDestCompress
875#define jpeg_destroy_decompress jDestDecompress
876#define jpeg_stdio_dest jStdDest
877#define jpeg_stdio_src jStdSrc
878#define jpeg_mem_dest jMemDest
879#define jpeg_mem_src jMemSrc
880#define jpeg_set_defaults jSetDefaults
881#define jpeg_set_colorspace jSetColorspace
882#define jpeg_default_colorspace jDefColorspace
883#define jpeg_set_quality jSetQuality
884#define jpeg_set_linear_quality jSetLQuality
885#define jpeg_default_qtables jDefQTables
886#define jpeg_add_quant_table jAddQuantTable
887#define jpeg_quality_scaling jQualityScaling
888#define jpeg_simple_progression jSimProgress
889#define jpeg_suppress_tables jSuppressTables
890#define jpeg_alloc_quant_table jAlcQTable
891#define jpeg_alloc_huff_table jAlcHTable
892#define jpeg_start_compress jStrtCompress
893#define jpeg_write_scanlines jWrtScanlines
894#define jpeg_finish_compress jFinCompress
895#define jpeg_calc_jpeg_dimensions jCjpegDimensions
896#define jpeg_write_raw_data jWrtRawData
897#define jpeg_write_marker jWrtMarker
898#define jpeg_write_m_header jWrtMHeader
899#define jpeg_write_m_byte jWrtMByte
900#define jpeg_write_tables jWrtTables
901#define jpeg_read_header jReadHeader
902#define jpeg_start_decompress jStrtDecompress
903#define jpeg_read_scanlines jReadScanlines
904#define jpeg_finish_decompress jFinDecompress
905#define jpeg_read_raw_data jReadRawData
906#define jpeg_has_multiple_scans jHasMultScn
907#define jpeg_start_output jStrtOutput
908#define jpeg_finish_output jFinOutput
909#define jpeg_input_complete jInComplete
910#define jpeg_new_colormap jNewCMap
911#define jpeg_consume_input jConsumeInput
912#define jpeg_core_output_dimensions jCoreDimensions
913#define jpeg_calc_output_dimensions jCalcDimensions
914#define jpeg_save_markers jSaveMarkers
915#define jpeg_set_marker_processor jSetMarker
916#define jpeg_read_coefficients jReadCoefs
917#define jpeg_write_coefficients jWrtCoefs
918#define jpeg_copy_critical_parameters jCopyCrit
919#define jpeg_abort_compress jAbrtCompress
920#define jpeg_abort_decompress jAbrtDecompress
921#define jpeg_abort jAbort
922#define jpeg_destroy jDestroy
923#define jpeg_resync_to_restart jResyncRestart
924#endif /* NEED_SHORT_EXTERNAL_NAMES */
925
926
927/* Default error-management setup */
928EXTERN(struct jpeg_error_mgr *) jpeg_std_error
929 JPP((struct jpeg_error_mgr * err));
930
931/* Initialization of JPEG compression objects.
932 * jpeg_create_compress() and jpeg_create_decompress() are the exported
933 * names that applications should call. These expand to calls on
934 * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
935 * passed for version mismatch checking.
936 * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
937 */
938#define jpeg_create_compress(cinfo) \
939 jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
940 (size_t) sizeof(struct jpeg_compress_struct))
941#define jpeg_create_decompress(cinfo) \
942 jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
943 (size_t) sizeof(struct jpeg_decompress_struct))
944EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
945 int version, size_t structsize));
946EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
947 int version, size_t structsize));
948/* Destruction of JPEG compression objects */
949EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
950EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
951
952/* Standard data source and destination managers: stdio streams. */
953/* Caller is responsible for opening the file before and closing after. */
954EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
955EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
956
957/* Data source and destination managers: memory buffers. */
958EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
959 unsigned char ** outbuffer,
960 unsigned long * outsize));
961EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
962 unsigned char * inbuffer,
963 unsigned long insize));
964
965/* Default parameter setup for compression */
966EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
967/* Compression parameter setup aids */
968EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
969 J_COLOR_SPACE colorspace));
970EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
971EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
972 boolean force_baseline));
973EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
974 int scale_factor,
975 boolean force_baseline));
976EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,
977 boolean force_baseline));
978EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
979 const unsigned int *basic_table,
980 int scale_factor,
981 boolean force_baseline));
982EXTERN(int) jpeg_quality_scaling JPP((int quality));
983EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
984EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
985 boolean suppress));
986EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
987EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
988
989/* Main entry points for compression */
990EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
991 boolean write_all_tables));
992EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
993 JSAMPARRAY scanlines,
994 JDIMENSION num_lines));
995EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
996
997/* Precalculate JPEG dimensions for current compression parameters. */
998EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));
999
1000/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
1001EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
1002 JSAMPIMAGE data,
1003 JDIMENSION num_lines));
1004
1005/* Write a special marker. See libjpeg.txt concerning safe usage. */
1006EXTERN(void) jpeg_write_marker
1007 JPP((j_compress_ptr cinfo, int marker,
1008 const JOCTET * dataptr, unsigned int datalen));
1009/* Same, but piecemeal. */
1010EXTERN(void) jpeg_write_m_header
1011 JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
1012EXTERN(void) jpeg_write_m_byte
1013 JPP((j_compress_ptr cinfo, int val));
1014
1015/* Alternate compression function: just write an abbreviated table file */
1016EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
1017
1018/* Decompression startup: read start of JPEG datastream to see what's there */
1019EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
1020 boolean require_image));
1021/* Return value is one of: */
1022#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
1023#define JPEG_HEADER_OK 1 /* Found valid image datastream */
1024#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
1025/* If you pass require_image = TRUE (normal case), you need not check for
1026 * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
1027 * JPEG_SUSPENDED is only possible if you use a data source module that can
1028 * give a suspension return (the stdio source module doesn't).
1029 */
1030
1031/* Main entry points for decompression */
1032EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
1033EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
1034 JSAMPARRAY scanlines,
1035 JDIMENSION max_lines));
1036EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
1037
1038/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
1039EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
1040 JSAMPIMAGE data,
1041 JDIMENSION max_lines));
1042
1043/* Additional entry points for buffered-image mode. */
1044EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
1045EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
1046 int scan_number));
1047EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
1048EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
1049EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
1050EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
1051/* Return value is one of: */
1052/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
1053#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
1054#define JPEG_REACHED_EOI 2 /* Reached end of image */
1055#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
1056#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
1057
1058/* Precalculate output dimensions for current decompression parameters. */
1059EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));
1060EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
1061
1062/* Control saving of COM and APPn markers into marker_list. */
1063EXTERN(void) jpeg_save_markers
1064 JPP((j_decompress_ptr cinfo, int marker_code,
1065 unsigned int length_limit));
1066
1067/* Install a special processing method for COM or APPn markers. */
1068EXTERN(void) jpeg_set_marker_processor
1069 JPP((j_decompress_ptr cinfo, int marker_code,
1070 jpeg_marker_parser_method routine));
1071
1072/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
1073EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
1074EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
1075 jvirt_barray_ptr * coef_arrays));
1076EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
1077 j_compress_ptr dstinfo));
1078
1079/* If you choose to abort compression or decompression before completing
1080 * jpeg_finish_(de)compress, then you need to clean up to release memory,
1081 * temporary files, etc. You can just call jpeg_destroy_(de)compress
1082 * if you're done with the JPEG object, but if you want to clean it up and
1083 * reuse it, call this:
1084 */
1085EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
1086EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
1087
1088/* Generic versions of jpeg_abort and jpeg_destroy that work on either
1089 * flavor of JPEG object. These may be more convenient in some places.
1090 */
1091EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
1092EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
1093
1094/* Default restart-marker-resync procedure for use by data source modules */
1095EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
1096 int desired));
1097
1098
1099/* These marker codes are exported since applications and data source modules
1100 * are likely to want to use them.
1101 */
1102
1103#define JPEG_RST0 0xD0 /* RST0 marker code */
1104#define JPEG_EOI 0xD9 /* EOI marker code */
1105#define JPEG_APP0 0xE0 /* APP0 marker code */
1106#define JPEG_COM 0xFE /* COM marker code */
1107
1108
1109/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
1110 * for structure definitions that are never filled in, keep it quiet by
1111 * supplying dummy definitions for the various substructures.
1112 */
1113
1114#ifdef INCOMPLETE_TYPES_BROKEN
1115#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
1116struct jvirt_sarray_control { long dummy; };
1117struct jvirt_barray_control { long dummy; };
1118struct jpeg_comp_master { long dummy; };
1119struct jpeg_c_main_controller { long dummy; };
1120struct jpeg_c_prep_controller { long dummy; };
1121struct jpeg_c_coef_controller { long dummy; };
1122struct jpeg_marker_writer { long dummy; };
1123struct jpeg_color_converter { long dummy; };
1124struct jpeg_downsampler { long dummy; };
1125struct jpeg_forward_dct { long dummy; };
1126struct jpeg_entropy_encoder { long dummy; };
1127struct jpeg_decomp_master { long dummy; };
1128struct jpeg_d_main_controller { long dummy; };
1129struct jpeg_d_coef_controller { long dummy; };
1130struct jpeg_d_post_controller { long dummy; };
1131struct jpeg_input_controller { long dummy; };
1132struct jpeg_marker_reader { long dummy; };
1133struct jpeg_entropy_decoder { long dummy; };
1134struct jpeg_inverse_dct { long dummy; };
1135struct jpeg_upsampler { long dummy; };
1136struct jpeg_color_deconverter { long dummy; };
1137struct jpeg_color_quantizer { long dummy; };
1138#endif /* JPEG_INTERNALS */
1139#endif /* INCOMPLETE_TYPES_BROKEN */
1140
1141
1142/*
1143 * The JPEG library modules define JPEG_INTERNALS before including this file.
1144 * The internal structure declarations are read only when that is true.
1145 * Applications using the library should not include jpegint.h, but may wish
1146 * to include jerror.h.
1147 */
1148
1149#ifdef JPEG_INTERNALS
1150#include "jpegint.h" /* fetch private declarations */
1151#include "jerror.h" /* fetch error codes too */
1152#endif
1153
1154#ifdef __cplusplus
1155#ifndef DONT_USE_EXTERN_C
1156}
1157#endif
1158#endif
1159
1160#endif /* JPEGLIB_H */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.1 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.1
new file mode 100644
index 0000000..c377053
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.1
@@ -0,0 +1,285 @@
1.TH JPEGTRAN 1 "28 December 2009"
2.SH NAME
3jpegtran \- lossless transformation of JPEG files
4.SH SYNOPSIS
5.B jpegtran
6[
7.I options
8]
9[
10.I filename
11]
12.LP
13.SH DESCRIPTION
14.LP
15.B jpegtran
16performs various useful transformations of JPEG files.
17It can translate the coded representation from one variant of JPEG to another,
18for example from baseline JPEG to progressive JPEG or vice versa. It can also
19perform some rearrangements of the image data, for example turning an image
20from landscape to portrait format by rotation.
21.PP
22.B jpegtran
23works by rearranging the compressed data (DCT coefficients), without
24ever fully decoding the image. Therefore, its transformations are lossless:
25there is no image degradation at all, which would not be true if you used
26.B djpeg
27followed by
28.B cjpeg
29to accomplish the same conversion. But by the same token,
30.B jpegtran
31cannot perform lossy operations such as changing the image quality.
32.PP
33.B jpegtran
34reads the named JPEG/JFIF file, or the standard input if no file is
35named, and produces a JPEG/JFIF file on the standard output.
36.SH OPTIONS
37All switch names may be abbreviated; for example,
38.B \-optimize
39may be written
40.B \-opt
41or
42.BR \-o .
43Upper and lower case are equivalent.
44British spellings are also accepted (e.g.,
45.BR \-optimise ),
46though for brevity these are not mentioned below.
47.PP
48To specify the coded JPEG representation used in the output file,
49.B jpegtran
50accepts a subset of the switches recognized by
51.BR cjpeg :
52.TP
53.B \-optimize
54Perform optimization of entropy encoding parameters.
55.TP
56.B \-progressive
57Create progressive JPEG file.
58.TP
59.BI \-restart " N"
60Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
61attached to the number.
62.TP
63.B \-arithmetic
64Use arithmetic coding.
65.TP
66.BI \-scans " file"
67Use the scan script given in the specified text file.
68.PP
69See
70.BR cjpeg (1)
71for more details about these switches.
72If you specify none of these switches, you get a plain baseline-JPEG output
73file. The quality setting and so forth are determined by the input file.
74.PP
75The image can be losslessly transformed by giving one of these switches:
76.TP
77.B \-flip horizontal
78Mirror image horizontally (left-right).
79.TP
80.B \-flip vertical
81Mirror image vertically (top-bottom).
82.TP
83.B \-rotate 90
84Rotate image 90 degrees clockwise.
85.TP
86.B \-rotate 180
87Rotate image 180 degrees.
88.TP
89.B \-rotate 270
90Rotate image 270 degrees clockwise (or 90 ccw).
91.TP
92.B \-transpose
93Transpose image (across UL-to-LR axis).
94.TP
95.B \-transverse
96Transverse transpose (across UR-to-LL axis).
97.IP
98The transpose transformation has no restrictions regarding image dimensions.
99The other transformations operate rather oddly if the image dimensions are not
100a multiple of the iMCU size (usually 8 or 16 pixels), because they can only
101transform complete blocks of DCT coefficient data in the desired way.
102.IP
103.BR jpegtran 's
104default behavior when transforming an odd-size image is designed
105to preserve exact reversibility and mathematical consistency of the
106transformation set. As stated, transpose is able to flip the entire image
107area. Horizontal mirroring leaves any partial iMCU column at the right edge
108untouched, but is able to flip all rows of the image. Similarly, vertical
109mirroring leaves any partial iMCU row at the bottom edge untouched, but is
110able to flip all columns. The other transforms can be built up as sequences
111of transpose and flip operations; for consistency, their actions on edge
112pixels are defined to be the same as the end result of the corresponding
113transpose-and-flip sequence.
114.IP
115For practical use, you may prefer to discard any untransformable edge pixels
116rather than having a strange-looking strip along the right and/or bottom edges
117of a transformed image. To do this, add the
118.B \-trim
119switch:
120.TP
121.B \-trim
122Drop non-transformable edge blocks.
123.IP
124Obviously, a transformation with
125.B \-trim
126is not reversible, so strictly speaking
127.B jpegtran
128with this switch is not lossless. Also, the expected mathematical
129equivalences between the transformations no longer hold. For example,
130.B \-rot 270 -trim
131trims only the bottom edge, but
132.B \-rot 90 -trim
133followed by
134.B \-rot 180 -trim
135trims both edges.
136.IP
137If you are only interested in perfect transformation, add the
138.B \-perfect
139switch:
140.TP
141.B \-perfect
142Fails with an error if the transformation is not perfect.
143.IP
144For example you may want to do
145.IP
146.B (jpegtran \-rot 90 -perfect
147.I foo.jpg
148.B || djpeg
149.I foo.jpg
150.B | pnmflip \-r90 | cjpeg)
151.IP
152to do a perfect rotation if available or an approximated one if not.
153.PP
154We also offer a lossless-crop option, which discards data outside a given
155image region but losslessly preserves what is inside. Like the rotate and
156flip transforms, lossless crop is restricted by the current JPEG format: the
157upper left corner of the selected region must fall on an iMCU boundary. If
158this does not hold for the given crop parameters, we silently move the upper
159left corner up and/or left to make it so, simultaneously increasing the region
160dimensions to keep the lower right crop corner unchanged. (Thus, the output
161image covers at least the requested region, but may cover more.)
162
163The image can be losslessly cropped by giving the switch:
164.TP
165.B \-crop WxH+X+Y
166Crop to a rectangular subarea of width W, height H starting at point X,Y.
167.PP
168Other not-strictly-lossless transformation switches are:
169.TP
170.B \-grayscale
171Force grayscale output.
172.IP
173This option discards the chrominance channels if the input image is YCbCr
174(ie, a standard color JPEG), resulting in a grayscale JPEG file. The
175luminance channel is preserved exactly, so this is a better method of reducing
176to grayscale than decompression, conversion, and recompression. This switch
177is particularly handy for fixing a monochrome picture that was mistakenly
178encoded as a color JPEG. (In such a case, the space savings from getting rid
179of the near-empty chroma channels won't be large; but the decoding time for
180a grayscale JPEG is substantially less than that for a color JPEG.)
181.TP
182.BI \-scale " M/N"
183Scale the output image by a factor M/N.
184.IP
185Currently supported scale factors are M/N with all M from 1 to 16, where N is
186the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted,
187then M specifies the DCT scaled size to be applied on the given input. For
188baseline JPEG this is equivalent to M/8 scaling, since the source DCT size
189for baseline JPEG is 8.
190.B Caution:
191An implementation of the JPEG SmartScale extension is required for this
192feature. SmartScale enabled JPEG is not yet widely implemented, so many
193decoders will be unable to view a SmartScale extended JPEG file at all.
194.PP
195.B jpegtran
196also recognizes these switches that control what to do with "extra" markers,
197such as comment blocks:
198.TP
199.B \-copy none
200Copy no extra markers from source file. This setting suppresses all
201comments and other excess baggage present in the source file.
202.TP
203.B \-copy comments
204Copy only comment markers. This setting copies comments from the source file,
205but discards any other inessential (for image display) data.
206.TP
207.B \-copy all
208Copy all extra markers. This setting preserves miscellaneous markers
209found in the source file, such as JFIF thumbnails, Exif data, and Photoshop
210settings. In some files these extra markers can be sizable.
211.IP
212The default behavior is
213.BR "\-copy comments" .
214(Note: in IJG releases v6 and v6a,
215.B jpegtran
216always did the equivalent of
217.BR "\-copy none" .)
218.PP
219Additional switches recognized by jpegtran are:
220.TP
221.BI \-maxmemory " N"
222Set limit for amount of memory to use in processing large images. Value is
223in thousands of bytes, or millions of bytes if "M" is attached to the
224number. For example,
225.B \-max 4m
226selects 4000000 bytes. If more space is needed, temporary files will be used.
227.TP
228.BI \-outfile " name"
229Send output image to the named file, not to standard output.
230.TP
231.B \-verbose
232Enable debug printout. More
233.BR \-v 's
234give more output. Also, version information is printed at startup.
235.TP
236.B \-debug
237Same as
238.BR \-verbose .
239.SH EXAMPLES
240.LP
241This example converts a baseline JPEG file to progressive form:
242.IP
243.B jpegtran \-progressive
244.I foo.jpg
245.B >
246.I fooprog.jpg
247.PP
248This example rotates an image 90 degrees clockwise, discarding any
249unrotatable edge pixels:
250.IP
251.B jpegtran \-rot 90 -trim
252.I foo.jpg
253.B >
254.I foo90.jpg
255.SH ENVIRONMENT
256.TP
257.B JPEGMEM
258If this environment variable is set, its value is the default memory limit.
259The value is specified as described for the
260.B \-maxmemory
261switch.
262.B JPEGMEM
263overrides the default value specified when the program was compiled, and
264itself is overridden by an explicit
265.BR \-maxmemory .
266.SH SEE ALSO
267.BR cjpeg (1),
268.BR djpeg (1),
269.BR rdjpgcom (1),
270.BR wrjpgcom (1)
271.br
272Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
273Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
274.SH AUTHOR
275Independent JPEG Group
276.SH BUGS
277The transform options can't transform odd-size images perfectly. Use
278.B \-trim
279or
280.B \-perfect
281if you don't like the results.
282.PP
283The entire image is read into memory and then written out again, even in
284cases where this isn't really necessary. Expect swapping on large images,
285especially when using the more complex transform options.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.c
new file mode 100644
index 0000000..2193ffe
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jpegtran.c
@@ -0,0 +1,560 @@
1/*
2 * jpegtran.c
3 *
4 * Copyright (C) 1995-2011, Thomas G. Lane, Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains a command-line user interface for JPEG transcoding.
9 * It is very similar to cjpeg.c, and partly to djpeg.c, but provides
10 * lossless transcoding between different JPEG file formats. It also
11 * provides some lossless and sort-of-lossless transformations of JPEG data.
12 */
13
14#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
15#include "transupp.h" /* Support routines for jpegtran */
16#include "jversion.h" /* for version message */
17
18#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
19#ifdef __MWERKS__
20#include <SIOUX.h> /* Metrowerks needs this */
21#include <console.h> /* ... and this */
22#endif
23#ifdef THINK_C
24#include <console.h> /* Think declares it here */
25#endif
26#endif
27
28
29/*
30 * Argument-parsing code.
31 * The switch parser is designed to be useful with DOS-style command line
32 * syntax, ie, intermixed switches and file names, where only the switches
33 * to the left of a given file name affect processing of that file.
34 * The main program in this file doesn't actually use this capability...
35 */
36
37
38static const char * progname; /* program name for error messages */
39static char * outfilename; /* for -outfile switch */
40static char * scaleoption; /* -scale switch */
41static JCOPY_OPTION copyoption; /* -copy switch */
42static jpeg_transform_info transformoption; /* image transformation options */
43
44
45LOCAL(void)
46usage (void)
47/* complain about bad command line */
48{
49 fprintf(stderr, "usage: %s [switches] ", progname);
50#ifdef TWO_FILE_COMMANDLINE
51 fprintf(stderr, "inputfile outputfile\n");
52#else
53 fprintf(stderr, "[inputfile]\n");
54#endif
55
56 fprintf(stderr, "Switches (names may be abbreviated):\n");
57 fprintf(stderr, " -copy none Copy no extra markers from source file\n");
58 fprintf(stderr, " -copy comments Copy only comment markers (default)\n");
59 fprintf(stderr, " -copy all Copy all extra markers\n");
60#ifdef ENTROPY_OPT_SUPPORTED
61 fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n");
62#endif
63#ifdef C_PROGRESSIVE_SUPPORTED
64 fprintf(stderr, " -progressive Create progressive JPEG file\n");
65#endif
66 fprintf(stderr, "Switches for modifying the image:\n");
67#if TRANSFORMS_SUPPORTED
68 fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n");
69 fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n");
70 fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n");
71 fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n");
72 fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n");
73#endif
74 fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
75#if TRANSFORMS_SUPPORTED
76 fprintf(stderr, " -transpose Transpose image\n");
77 fprintf(stderr, " -transverse Transverse transpose image\n");
78 fprintf(stderr, " -trim Drop non-transformable edge blocks\n");
79#endif
80 fprintf(stderr, "Switches for advanced users:\n");
81#ifdef C_ARITH_CODING_SUPPORTED
82 fprintf(stderr, " -arithmetic Use arithmetic coding\n");
83#endif
84 fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
85 fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
86 fprintf(stderr, " -outfile name Specify name for output file\n");
87 fprintf(stderr, " -verbose or -debug Emit debug output\n");
88 fprintf(stderr, "Switches for wizards:\n");
89#ifdef C_MULTISCAN_FILES_SUPPORTED
90 fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
91#endif
92 exit(EXIT_FAILURE);
93}
94
95
96LOCAL(void)
97select_transform (JXFORM_CODE transform)
98/* Silly little routine to detect multiple transform options,
99 * which we can't handle.
100 */
101{
102#if TRANSFORMS_SUPPORTED
103 if (transformoption.transform == JXFORM_NONE ||
104 transformoption.transform == transform) {
105 transformoption.transform = transform;
106 } else {
107 fprintf(stderr, "%s: can only do one image transformation at a time\n",
108 progname);
109 usage();
110 }
111#else
112 fprintf(stderr, "%s: sorry, image transformation was not compiled\n",
113 progname);
114 exit(EXIT_FAILURE);
115#endif
116}
117
118
119LOCAL(int)
120parse_switches (j_compress_ptr cinfo, int argc, char **argv,
121 int last_file_arg_seen, boolean for_real)
122/* Parse optional switches.
123 * Returns argv[] index of first file-name argument (== argc if none).
124 * Any file names with indexes <= last_file_arg_seen are ignored;
125 * they have presumably been processed in a previous iteration.
126 * (Pass 0 for last_file_arg_seen on the first or only iteration.)
127 * for_real is FALSE on the first (dummy) pass; we may skip any expensive
128 * processing.
129 */
130{
131 int argn;
132 char * arg;
133 boolean simple_progressive;
134 char * scansarg = NULL; /* saves -scans parm if any */
135
136 /* Set up default JPEG parameters. */
137 simple_progressive = FALSE;
138 outfilename = NULL;
139 scaleoption = NULL;
140 copyoption = JCOPYOPT_DEFAULT;
141 transformoption.transform = JXFORM_NONE;
142 transformoption.perfect = FALSE;
143 transformoption.trim = FALSE;
144 transformoption.force_grayscale = FALSE;
145 transformoption.crop = FALSE;
146 cinfo->err->trace_level = 0;
147
148 /* Scan command line options, adjust parameters */
149
150 for (argn = 1; argn < argc; argn++) {
151 arg = argv[argn];
152 if (*arg != '-') {
153 /* Not a switch, must be a file name argument */
154 if (argn <= last_file_arg_seen) {
155 outfilename = NULL; /* -outfile applies to just one input file */
156 continue; /* ignore this name if previously processed */
157 }
158 break; /* else done parsing switches */
159 }
160 arg++; /* advance past switch marker character */
161
162 if (keymatch(arg, "arithmetic", 1)) {
163 /* Use arithmetic coding. */
164#ifdef C_ARITH_CODING_SUPPORTED
165 cinfo->arith_code = TRUE;
166#else
167 fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
168 progname);
169 exit(EXIT_FAILURE);
170#endif
171
172 } else if (keymatch(arg, "copy", 2)) {
173 /* Select which extra markers to copy. */
174 if (++argn >= argc) /* advance to next argument */
175 usage();
176 if (keymatch(argv[argn], "none", 1)) {
177 copyoption = JCOPYOPT_NONE;
178 } else if (keymatch(argv[argn], "comments", 1)) {
179 copyoption = JCOPYOPT_COMMENTS;
180 } else if (keymatch(argv[argn], "all", 1)) {
181 copyoption = JCOPYOPT_ALL;
182 } else
183 usage();
184
185 } else if (keymatch(arg, "crop", 2)) {
186 /* Perform lossless cropping. */
187#if TRANSFORMS_SUPPORTED
188 if (++argn >= argc) /* advance to next argument */
189 usage();
190 if (! jtransform_parse_crop_spec(&transformoption, argv[argn])) {
191 fprintf(stderr, "%s: bogus -crop argument '%s'\n",
192 progname, argv[argn]);
193 exit(EXIT_FAILURE);
194 }
195#else
196 select_transform(JXFORM_NONE); /* force an error */
197#endif
198
199 } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
200 /* Enable debug printouts. */
201 /* On first -d, print version identification */
202 static boolean printed_version = FALSE;
203
204 if (! printed_version) {
205 fprintf(stderr, "Independent JPEG Group's JPEGTRAN, version %s\n%s\n",
206 JVERSION, JCOPYRIGHT);
207 printed_version = TRUE;
208 }
209 cinfo->err->trace_level++;
210
211 } else if (keymatch(arg, "flip", 1)) {
212 /* Mirror left-right or top-bottom. */
213 if (++argn >= argc) /* advance to next argument */
214 usage();
215 if (keymatch(argv[argn], "horizontal", 1))
216 select_transform(JXFORM_FLIP_H);
217 else if (keymatch(argv[argn], "vertical", 1))
218 select_transform(JXFORM_FLIP_V);
219 else
220 usage();
221
222 } else if (keymatch(arg, "grayscale", 1) || keymatch(arg, "greyscale",1)) {
223 /* Force to grayscale. */
224#if TRANSFORMS_SUPPORTED
225 transformoption.force_grayscale = TRUE;
226#else
227 select_transform(JXFORM_NONE); /* force an error */
228#endif
229
230 } else if (keymatch(arg, "maxmemory", 3)) {
231 /* Maximum memory in Kb (or Mb with 'm'). */
232 long lval;
233 char ch = 'x';
234
235 if (++argn >= argc) /* advance to next argument */
236 usage();
237 if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
238 usage();
239 if (ch == 'm' || ch == 'M')
240 lval *= 1000L;
241 cinfo->mem->max_memory_to_use = lval * 1000L;
242
243 } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
244 /* Enable entropy parm optimization. */
245#ifdef ENTROPY_OPT_SUPPORTED
246 cinfo->optimize_coding = TRUE;
247#else
248 fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n",
249 progname);
250 exit(EXIT_FAILURE);
251#endif
252
253 } else if (keymatch(arg, "outfile", 4)) {
254 /* Set output file name. */
255 if (++argn >= argc) /* advance to next argument */
256 usage();
257 outfilename = argv[argn]; /* save it away for later use */
258
259 } else if (keymatch(arg, "perfect", 2)) {
260 /* Fail if there is any partial edge MCUs that the transform can't
261 * handle. */
262 transformoption.perfect = TRUE;
263
264 } else if (keymatch(arg, "progressive", 2)) {
265 /* Select simple progressive mode. */
266#ifdef C_PROGRESSIVE_SUPPORTED
267 simple_progressive = TRUE;
268 /* We must postpone execution until num_components is known. */
269#else
270 fprintf(stderr, "%s: sorry, progressive output was not compiled\n",
271 progname);
272 exit(EXIT_FAILURE);
273#endif
274
275 } else if (keymatch(arg, "restart", 1)) {
276 /* Restart interval in MCU rows (or in MCUs with 'b'). */
277 long lval;
278 char ch = 'x';
279
280 if (++argn >= argc) /* advance to next argument */
281 usage();
282 if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
283 usage();
284 if (lval < 0 || lval > 65535L)
285 usage();
286 if (ch == 'b' || ch == 'B') {
287 cinfo->restart_interval = (unsigned int) lval;
288 cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
289 } else {
290 cinfo->restart_in_rows = (int) lval;
291 /* restart_interval will be computed during startup */
292 }
293
294 } else if (keymatch(arg, "rotate", 2)) {
295 /* Rotate 90, 180, or 270 degrees (measured clockwise). */
296 if (++argn >= argc) /* advance to next argument */
297 usage();
298 if (keymatch(argv[argn], "90", 2))
299 select_transform(JXFORM_ROT_90);
300 else if (keymatch(argv[argn], "180", 3))
301 select_transform(JXFORM_ROT_180);
302 else if (keymatch(argv[argn], "270", 3))
303 select_transform(JXFORM_ROT_270);
304 else
305 usage();
306
307 } else if (keymatch(arg, "scale", 4)) {
308 /* Scale the output image by a fraction M/N. */
309 if (++argn >= argc) /* advance to next argument */
310 usage();
311 scaleoption = argv[argn];
312 /* We must postpone processing until decompression startup. */
313
314 } else if (keymatch(arg, "scans", 1)) {
315 /* Set scan script. */
316#ifdef C_MULTISCAN_FILES_SUPPORTED
317 if (++argn >= argc) /* advance to next argument */
318 usage();
319 scansarg = argv[argn];
320 /* We must postpone reading the file in case -progressive appears. */
321#else
322 fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n",
323 progname);
324 exit(EXIT_FAILURE);
325#endif
326
327 } else if (keymatch(arg, "transpose", 1)) {
328 /* Transpose (across UL-to-LR axis). */
329 select_transform(JXFORM_TRANSPOSE);
330
331 } else if (keymatch(arg, "transverse", 6)) {
332 /* Transverse transpose (across UR-to-LL axis). */
333 select_transform(JXFORM_TRANSVERSE);
334
335 } else if (keymatch(arg, "trim", 3)) {
336 /* Trim off any partial edge MCUs that the transform can't handle. */
337 transformoption.trim = TRUE;
338
339 } else {
340 usage(); /* bogus switch */
341 }
342 }
343
344 /* Post-switch-scanning cleanup */
345
346 if (for_real) {
347
348#ifdef C_PROGRESSIVE_SUPPORTED
349 if (simple_progressive) /* process -progressive; -scans can override */
350 jpeg_simple_progression(cinfo);
351#endif
352
353#ifdef C_MULTISCAN_FILES_SUPPORTED
354 if (scansarg != NULL) /* process -scans if it was present */
355 if (! read_scan_script(cinfo, scansarg))
356 usage();
357#endif
358 }
359
360 return argn; /* return index of next arg (file name) */
361}
362
363
364/*
365 * The main program.
366 */
367
368int
369main (int argc, char **argv)
370{
371 struct jpeg_decompress_struct srcinfo;
372 struct jpeg_compress_struct dstinfo;
373 struct jpeg_error_mgr jsrcerr, jdsterr;
374#ifdef PROGRESS_REPORT
375 struct cdjpeg_progress_mgr progress;
376#endif
377 jvirt_barray_ptr * src_coef_arrays;
378 jvirt_barray_ptr * dst_coef_arrays;
379 int file_index;
380 /* We assume all-in-memory processing and can therefore use only a
381 * single file pointer for sequential input and output operation.
382 */
383 FILE * fp;
384
385 /* On Mac, fetch a command line. */
386#ifdef USE_CCOMMAND
387 argc = ccommand(&argv);
388#endif
389
390 progname = argv[0];
391 if (progname == NULL || progname[0] == 0)
392 progname = "jpegtran"; /* in case C library doesn't provide it */
393
394 /* Initialize the JPEG decompression object with default error handling. */
395 srcinfo.err = jpeg_std_error(&jsrcerr);
396 jpeg_create_decompress(&srcinfo);
397 /* Initialize the JPEG compression object with default error handling. */
398 dstinfo.err = jpeg_std_error(&jdsterr);
399 jpeg_create_compress(&dstinfo);
400
401 /* Now safe to enable signal catcher.
402 * Note: we assume only the decompression object will have virtual arrays.
403 */
404#ifdef NEED_SIGNAL_CATCHER
405 enable_signal_catcher((j_common_ptr) &srcinfo);
406#endif
407
408 /* Scan command line to find file names.
409 * It is convenient to use just one switch-parsing routine, but the switch
410 * values read here are mostly ignored; we will rescan the switches after
411 * opening the input file. Also note that most of the switches affect the
412 * destination JPEG object, so we parse into that and then copy over what
413 * needs to affects the source too.
414 */
415
416 file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);
417 jsrcerr.trace_level = jdsterr.trace_level;
418 srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;
419
420#ifdef TWO_FILE_COMMANDLINE
421 /* Must have either -outfile switch or explicit output file name */
422 if (outfilename == NULL) {
423 if (file_index != argc-2) {
424 fprintf(stderr, "%s: must name one input and one output file\n",
425 progname);
426 usage();
427 }
428 outfilename = argv[file_index+1];
429 } else {
430 if (file_index != argc-1) {
431 fprintf(stderr, "%s: must name one input and one output file\n",
432 progname);
433 usage();
434 }
435 }
436#else
437 /* Unix style: expect zero or one file name */
438 if (file_index < argc-1) {
439 fprintf(stderr, "%s: only one input file\n", progname);
440 usage();
441 }
442#endif /* TWO_FILE_COMMANDLINE */
443
444 /* Open the input file. */
445 if (file_index < argc) {
446 if ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) {
447 fprintf(stderr, "%s: can't open %s for reading\n", progname, argv[file_index]);
448 exit(EXIT_FAILURE);
449 }
450 } else {
451 /* default input file is stdin */
452 fp = read_stdin();
453 }
454
455#ifdef PROGRESS_REPORT
456 start_progress_monitor((j_common_ptr) &dstinfo, &progress);
457#endif
458
459 /* Specify data source for decompression */
460 jpeg_stdio_src(&srcinfo, fp);
461
462 /* Enable saving of extra markers that we want to copy */
463 jcopy_markers_setup(&srcinfo, copyoption);
464
465 /* Read file header */
466 (void) jpeg_read_header(&srcinfo, TRUE);
467
468 /* Adjust default decompression parameters */
469 if (scaleoption != NULL)
470 if (sscanf(scaleoption, "%d/%d",
471 &srcinfo.scale_num, &srcinfo.scale_denom) < 1)
472 usage();
473
474 /* Any space needed by a transform option must be requested before
475 * jpeg_read_coefficients so that memory allocation will be done right.
476 */
477#if TRANSFORMS_SUPPORTED
478 /* Fail right away if -perfect is given and transformation is not perfect.
479 */
480 if (!jtransform_request_workspace(&srcinfo, &transformoption)) {
481 fprintf(stderr, "%s: transformation is not perfect\n", progname);
482 exit(EXIT_FAILURE);
483 }
484#endif
485
486 /* Read source file as DCT coefficients */
487 src_coef_arrays = jpeg_read_coefficients(&srcinfo);
488
489 /* Initialize destination compression parameters from source values */
490 jpeg_copy_critical_parameters(&srcinfo, &dstinfo);
491
492 /* Adjust destination parameters if required by transform options;
493 * also find out which set of coefficient arrays will hold the output.
494 */
495#if TRANSFORMS_SUPPORTED
496 dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,
497 src_coef_arrays,
498 &transformoption);
499#else
500 dst_coef_arrays = src_coef_arrays;
501#endif
502
503 /* Close input file, if we opened it.
504 * Note: we assume that jpeg_read_coefficients consumed all input
505 * until JPEG_REACHED_EOI, and that jpeg_finish_decompress will
506 * only consume more while (! cinfo->inputctl->eoi_reached).
507 * We cannot call jpeg_finish_decompress here since we still need the
508 * virtual arrays allocated from the source object for processing.
509 */
510 if (fp != stdin)
511 fclose(fp);
512
513 /* Open the output file. */
514 if (outfilename != NULL) {
515 if ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) {
516 fprintf(stderr, "%s: can't open %s for writing\n", progname, outfilename);
517 exit(EXIT_FAILURE);
518 }
519 } else {
520 /* default output file is stdout */
521 fp = write_stdout();
522 }
523
524 /* Adjust default compression parameters by re-parsing the options */
525 file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE);
526
527 /* Specify data destination for compression */
528 jpeg_stdio_dest(&dstinfo, fp);
529
530 /* Start compressor (note no image data is actually written here) */
531 jpeg_write_coefficients(&dstinfo, dst_coef_arrays);
532
533 /* Copy to the output file any extra markers that we want to preserve */
534 jcopy_markers_execute(&srcinfo, &dstinfo, copyoption);
535
536 /* Execute image transformation, if any */
537#if TRANSFORMS_SUPPORTED
538 jtransform_execute_transformation(&srcinfo, &dstinfo,
539 src_coef_arrays,
540 &transformoption);
541#endif
542
543 /* Finish compression and release memory */
544 jpeg_finish_compress(&dstinfo);
545 jpeg_destroy_compress(&dstinfo);
546 (void) jpeg_finish_decompress(&srcinfo);
547 jpeg_destroy_decompress(&srcinfo);
548
549 /* Close output file, if we opened it */
550 if (fp != stdout)
551 fclose(fp);
552
553#ifdef PROGRESS_REPORT
554 end_progress_monitor((j_common_ptr) &dstinfo);
555#endif
556
557 /* All done. */
558 exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);
559 return 0; /* suppress no-return-value warnings */
560}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant1.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant1.c
new file mode 100644
index 0000000..1c482bc
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant1.c
@@ -0,0 +1,857 @@
1/*
2 * jquant1.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modified 2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains 1-pass color quantization (color mapping) routines.
10 * These routines provide mapping to a fixed color map using equally spaced
11 * color values. Optional Floyd-Steinberg or ordered dithering is available.
12 */
13
14#define JPEG_INTERNALS
15#include "jinclude.h"
16#include "jpeglib.h"
17
18#ifdef QUANT_1PASS_SUPPORTED
19
20
21/*
22 * The main purpose of 1-pass quantization is to provide a fast, if not very
23 * high quality, colormapped output capability. A 2-pass quantizer usually
24 * gives better visual quality; however, for quantized grayscale output this
25 * quantizer is perfectly adequate. Dithering is highly recommended with this
26 * quantizer, though you can turn it off if you really want to.
27 *
28 * In 1-pass quantization the colormap must be chosen in advance of seeing the
29 * image. We use a map consisting of all combinations of Ncolors[i] color
30 * values for the i'th component. The Ncolors[] values are chosen so that
31 * their product, the total number of colors, is no more than that requested.
32 * (In most cases, the product will be somewhat less.)
33 *
34 * Since the colormap is orthogonal, the representative value for each color
35 * component can be determined without considering the other components;
36 * then these indexes can be combined into a colormap index by a standard
37 * N-dimensional-array-subscript calculation. Most of the arithmetic involved
38 * can be precalculated and stored in the lookup table colorindex[].
39 * colorindex[i][j] maps pixel value j in component i to the nearest
40 * representative value (grid plane) for that component; this index is
41 * multiplied by the array stride for component i, so that the
42 * index of the colormap entry closest to a given pixel value is just
43 * sum( colorindex[component-number][pixel-component-value] )
44 * Aside from being fast, this scheme allows for variable spacing between
45 * representative values with no additional lookup cost.
46 *
47 * If gamma correction has been applied in color conversion, it might be wise
48 * to adjust the color grid spacing so that the representative colors are
49 * equidistant in linear space. At this writing, gamma correction is not
50 * implemented by jdcolor, so nothing is done here.
51 */
52
53
54/* Declarations for ordered dithering.
55 *
56 * We use a standard 16x16 ordered dither array. The basic concept of ordered
57 * dithering is described in many references, for instance Dale Schumacher's
58 * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991).
59 * In place of Schumacher's comparisons against a "threshold" value, we add a
60 * "dither" value to the input pixel and then round the result to the nearest
61 * output value. The dither value is equivalent to (0.5 - threshold) times
62 * the distance between output values. For ordered dithering, we assume that
63 * the output colors are equally spaced; if not, results will probably be
64 * worse, since the dither may be too much or too little at a given point.
65 *
66 * The normal calculation would be to form pixel value + dither, range-limit
67 * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual.
68 * We can skip the separate range-limiting step by extending the colorindex
69 * table in both directions.
70 */
71
72#define ODITHER_SIZE 16 /* dimension of dither matrix */
73/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */
74#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */
75#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */
76
77typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];
78typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];
79
80static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
81 /* Bayer's order-4 dither array. Generated by the code given in
82 * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I.
83 * The values in this array must range from 0 to ODITHER_CELLS-1.
84 */
85 { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 },
86 { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },
87 { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },
88 { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },
89 { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 },
90 { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },
91 { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },
92 { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },
93 { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 },
94 { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },
95 { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },
96 { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },
97 { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 },
98 { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },
99 { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },
100 { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }
101};
102
103
104/* Declarations for Floyd-Steinberg dithering.
105 *
106 * Errors are accumulated into the array fserrors[], at a resolution of
107 * 1/16th of a pixel count. The error at a given pixel is propagated
108 * to its not-yet-processed neighbors using the standard F-S fractions,
109 * ... (here) 7/16
110 * 3/16 5/16 1/16
111 * We work left-to-right on even rows, right-to-left on odd rows.
112 *
113 * We can get away with a single array (holding one row's worth of errors)
114 * by using it to store the current row's errors at pixel columns not yet
115 * processed, but the next row's errors at columns already processed. We
116 * need only a few extra variables to hold the errors immediately around the
117 * current column. (If we are lucky, those variables are in registers, but
118 * even if not, they're probably cheaper to access than array elements are.)
119 *
120 * The fserrors[] array is indexed [component#][position].
121 * We provide (#columns + 2) entries per component; the extra entry at each
122 * end saves us from special-casing the first and last pixels.
123 *
124 * Note: on a wide image, we might not have enough room in a PC's near data
125 * segment to hold the error array; so it is allocated with alloc_large.
126 */
127
128#if BITS_IN_JSAMPLE == 8
129typedef INT16 FSERROR; /* 16 bits should be enough */
130typedef int LOCFSERROR; /* use 'int' for calculation temps */
131#else
132typedef INT32 FSERROR; /* may need more than 16 bits */
133typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */
134#endif
135
136typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */
137
138
139/* Private subobject */
140
141#define MAX_Q_COMPS 4 /* max components I can handle */
142
143typedef struct {
144 struct jpeg_color_quantizer pub; /* public fields */
145
146 /* Initially allocated colormap is saved here */
147 JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */
148 int sv_actual; /* number of entries in use */
149
150 JSAMPARRAY colorindex; /* Precomputed mapping for speed */
151 /* colorindex[i][j] = index of color closest to pixel value j in component i,
152 * premultiplied as described above. Since colormap indexes must fit into
153 * JSAMPLEs, the entries of this array will too.
154 */
155 boolean is_padded; /* is the colorindex padded for odither? */
156
157 int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */
158
159 /* Variables for ordered dithering */
160 int row_index; /* cur row's vertical index in dither matrix */
161 ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */
162
163 /* Variables for Floyd-Steinberg dithering */
164 FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */
165 boolean on_odd_row; /* flag to remember which row we are on */
166} my_cquantizer;
167
168typedef my_cquantizer * my_cquantize_ptr;
169
170
171/*
172 * Policy-making subroutines for create_colormap and create_colorindex.
173 * These routines determine the colormap to be used. The rest of the module
174 * only assumes that the colormap is orthogonal.
175 *
176 * * select_ncolors decides how to divvy up the available colors
177 * among the components.
178 * * output_value defines the set of representative values for a component.
179 * * largest_input_value defines the mapping from input values to
180 * representative values for a component.
181 * Note that the latter two routines may impose different policies for
182 * different components, though this is not currently done.
183 */
184
185
186LOCAL(int)
187select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
188/* Determine allocation of desired colors to components, */
189/* and fill in Ncolors[] array to indicate choice. */
190/* Return value is total number of colors (product of Ncolors[] values). */
191{
192 int nc = cinfo->out_color_components; /* number of color components */
193 int max_colors = cinfo->desired_number_of_colors;
194 int total_colors, iroot, i, j;
195 boolean changed;
196 long temp;
197 static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };
198
199 /* We can allocate at least the nc'th root of max_colors per component. */
200 /* Compute floor(nc'th root of max_colors). */
201 iroot = 1;
202 do {
203 iroot++;
204 temp = iroot; /* set temp = iroot ** nc */
205 for (i = 1; i < nc; i++)
206 temp *= iroot;
207 } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */
208 iroot--; /* now iroot = floor(root) */
209
210 /* Must have at least 2 color values per component */
211 if (iroot < 2)
212 ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);
213
214 /* Initialize to iroot color values for each component */
215 total_colors = 1;
216 for (i = 0; i < nc; i++) {
217 Ncolors[i] = iroot;
218 total_colors *= iroot;
219 }
220 /* We may be able to increment the count for one or more components without
221 * exceeding max_colors, though we know not all can be incremented.
222 * Sometimes, the first component can be incremented more than once!
223 * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)
224 * In RGB colorspace, try to increment G first, then R, then B.
225 */
226 do {
227 changed = FALSE;
228 for (i = 0; i < nc; i++) {
229 j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);
230 /* calculate new total_colors if Ncolors[j] is incremented */
231 temp = total_colors / Ncolors[j];
232 temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */
233 if (temp > (long) max_colors)
234 break; /* won't fit, done with this pass */
235 Ncolors[j]++; /* OK, apply the increment */
236 total_colors = (int) temp;
237 changed = TRUE;
238 }
239 } while (changed);
240
241 return total_colors;
242}
243
244
245LOCAL(int)
246output_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
247/* Return j'th output value, where j will range from 0 to maxj */
248/* The output values must fall in 0..MAXJSAMPLE in increasing order */
249{
250 /* We always provide values 0 and MAXJSAMPLE for each component;
251 * any additional values are equally spaced between these limits.
252 * (Forcing the upper and lower values to the limits ensures that
253 * dithering can't produce a color outside the selected gamut.)
254 */
255 return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);
256}
257
258
259LOCAL(int)
260largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
261/* Return largest input value that should map to j'th output value */
262/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
263{
264 /* Breakpoints are halfway between values returned by output_value */
265 return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
266}
267
268
269/*
270 * Create the colormap.
271 */
272
273LOCAL(void)
274create_colormap (j_decompress_ptr cinfo)
275{
276 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
277 JSAMPARRAY colormap; /* Created colormap */
278 int total_colors; /* Number of distinct output colors */
279 int i,j,k, nci, blksize, blkdist, ptr, val;
280
281 /* Select number of colors for each component */
282 total_colors = select_ncolors(cinfo, cquantize->Ncolors);
283
284 /* Report selected color counts */
285 if (cinfo->out_color_components == 3)
286 TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,
287 total_colors, cquantize->Ncolors[0],
288 cquantize->Ncolors[1], cquantize->Ncolors[2]);
289 else
290 TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);
291
292 /* Allocate and fill in the colormap. */
293 /* The colors are ordered in the map in standard row-major order, */
294 /* i.e. rightmost (highest-indexed) color changes most rapidly. */
295
296 colormap = (*cinfo->mem->alloc_sarray)
297 ((j_common_ptr) cinfo, JPOOL_IMAGE,
298 (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);
299
300 /* blksize is number of adjacent repeated entries for a component */
301 /* blkdist is distance between groups of identical entries for a component */
302 blkdist = total_colors;
303
304 for (i = 0; i < cinfo->out_color_components; i++) {
305 /* fill in colormap entries for i'th color component */
306 nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
307 blksize = blkdist / nci;
308 for (j = 0; j < nci; j++) {
309 /* Compute j'th output value (out of nci) for component */
310 val = output_value(cinfo, i, j, nci-1);
311 /* Fill in all colormap entries that have this value of this component */
312 for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {
313 /* fill in blksize entries beginning at ptr */
314 for (k = 0; k < blksize; k++)
315 colormap[i][ptr+k] = (JSAMPLE) val;
316 }
317 }
318 blkdist = blksize; /* blksize of this color is blkdist of next */
319 }
320
321 /* Save the colormap in private storage,
322 * where it will survive color quantization mode changes.
323 */
324 cquantize->sv_colormap = colormap;
325 cquantize->sv_actual = total_colors;
326}
327
328
329/*
330 * Create the color index table.
331 */
332
333LOCAL(void)
334create_colorindex (j_decompress_ptr cinfo)
335{
336 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
337 JSAMPROW indexptr;
338 int i,j,k, nci, blksize, val, pad;
339
340 /* For ordered dither, we pad the color index tables by MAXJSAMPLE in
341 * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).
342 * This is not necessary in the other dithering modes. However, we
343 * flag whether it was done in case user changes dithering mode.
344 */
345 if (cinfo->dither_mode == JDITHER_ORDERED) {
346 pad = MAXJSAMPLE*2;
347 cquantize->is_padded = TRUE;
348 } else {
349 pad = 0;
350 cquantize->is_padded = FALSE;
351 }
352
353 cquantize->colorindex = (*cinfo->mem->alloc_sarray)
354 ((j_common_ptr) cinfo, JPOOL_IMAGE,
355 (JDIMENSION) (MAXJSAMPLE+1 + pad),
356 (JDIMENSION) cinfo->out_color_components);
357
358 /* blksize is number of adjacent repeated entries for a component */
359 blksize = cquantize->sv_actual;
360
361 for (i = 0; i < cinfo->out_color_components; i++) {
362 /* fill in colorindex entries for i'th color component */
363 nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
364 blksize = blksize / nci;
365
366 /* adjust colorindex pointers to provide padding at negative indexes. */
367 if (pad)
368 cquantize->colorindex[i] += MAXJSAMPLE;
369
370 /* in loop, val = index of current output value, */
371 /* and k = largest j that maps to current val */
372 indexptr = cquantize->colorindex[i];
373 val = 0;
374 k = largest_input_value(cinfo, i, 0, nci-1);
375 for (j = 0; j <= MAXJSAMPLE; j++) {
376 while (j > k) /* advance val if past boundary */
377 k = largest_input_value(cinfo, i, ++val, nci-1);
378 /* premultiply so that no multiplication needed in main processing */
379 indexptr[j] = (JSAMPLE) (val * blksize);
380 }
381 /* Pad at both ends if necessary */
382 if (pad)
383 for (j = 1; j <= MAXJSAMPLE; j++) {
384 indexptr[-j] = indexptr[0];
385 indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];
386 }
387 }
388}
389
390
391/*
392 * Create an ordered-dither array for a component having ncolors
393 * distinct output values.
394 */
395
396LOCAL(ODITHER_MATRIX_PTR)
397make_odither_array (j_decompress_ptr cinfo, int ncolors)
398{
399 ODITHER_MATRIX_PTR odither;
400 int j,k;
401 INT32 num,den;
402
403 odither = (ODITHER_MATRIX_PTR)
404 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
405 SIZEOF(ODITHER_MATRIX));
406 /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).
407 * Hence the dither value for the matrix cell with fill order f
408 * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
409 * On 16-bit-int machine, be careful to avoid overflow.
410 */
411 den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));
412 for (j = 0; j < ODITHER_SIZE; j++) {
413 for (k = 0; k < ODITHER_SIZE; k++) {
414 num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
415 * MAXJSAMPLE;
416 /* Ensure round towards zero despite C's lack of consistency
417 * about rounding negative values in integer division...
418 */
419 odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);
420 }
421 }
422 return odither;
423}
424
425
426/*
427 * Create the ordered-dither tables.
428 * Components having the same number of representative colors may
429 * share a dither table.
430 */
431
432LOCAL(void)
433create_odither_tables (j_decompress_ptr cinfo)
434{
435 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
436 ODITHER_MATRIX_PTR odither;
437 int i, j, nci;
438
439 for (i = 0; i < cinfo->out_color_components; i++) {
440 nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
441 odither = NULL; /* search for matching prior component */
442 for (j = 0; j < i; j++) {
443 if (nci == cquantize->Ncolors[j]) {
444 odither = cquantize->odither[j];
445 break;
446 }
447 }
448 if (odither == NULL) /* need a new table? */
449 odither = make_odither_array(cinfo, nci);
450 cquantize->odither[i] = odither;
451 }
452}
453
454
455/*
456 * Map some rows of pixels to the output colormapped representation.
457 */
458
459METHODDEF(void)
460color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
461 JSAMPARRAY output_buf, int num_rows)
462/* General case, no dithering */
463{
464 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
465 JSAMPARRAY colorindex = cquantize->colorindex;
466 register int pixcode, ci;
467 register JSAMPROW ptrin, ptrout;
468 int row;
469 JDIMENSION col;
470 JDIMENSION width = cinfo->output_width;
471 register int nc = cinfo->out_color_components;
472
473 for (row = 0; row < num_rows; row++) {
474 ptrin = input_buf[row];
475 ptrout = output_buf[row];
476 for (col = width; col > 0; col--) {
477 pixcode = 0;
478 for (ci = 0; ci < nc; ci++) {
479 pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
480 }
481 *ptrout++ = (JSAMPLE) pixcode;
482 }
483 }
484}
485
486
487METHODDEF(void)
488color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
489 JSAMPARRAY output_buf, int num_rows)
490/* Fast path for out_color_components==3, no dithering */
491{
492 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
493 register int pixcode;
494 register JSAMPROW ptrin, ptrout;
495 JSAMPROW colorindex0 = cquantize->colorindex[0];
496 JSAMPROW colorindex1 = cquantize->colorindex[1];
497 JSAMPROW colorindex2 = cquantize->colorindex[2];
498 int row;
499 JDIMENSION col;
500 JDIMENSION width = cinfo->output_width;
501
502 for (row = 0; row < num_rows; row++) {
503 ptrin = input_buf[row];
504 ptrout = output_buf[row];
505 for (col = width; col > 0; col--) {
506 pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
507 pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
508 pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
509 *ptrout++ = (JSAMPLE) pixcode;
510 }
511 }
512}
513
514
515METHODDEF(void)
516quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
517 JSAMPARRAY output_buf, int num_rows)
518/* General case, with ordered dithering */
519{
520 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
521 register JSAMPROW input_ptr;
522 register JSAMPROW output_ptr;
523 JSAMPROW colorindex_ci;
524 int * dither; /* points to active row of dither matrix */
525 int row_index, col_index; /* current indexes into dither matrix */
526 int nc = cinfo->out_color_components;
527 int ci;
528 int row;
529 JDIMENSION col;
530 JDIMENSION width = cinfo->output_width;
531
532 for (row = 0; row < num_rows; row++) {
533 /* Initialize output values to 0 so can process components separately */
534 FMEMZERO((void FAR *) output_buf[row],
535 (size_t) (width * SIZEOF(JSAMPLE)));
536 row_index = cquantize->row_index;
537 for (ci = 0; ci < nc; ci++) {
538 input_ptr = input_buf[row] + ci;
539 output_ptr = output_buf[row];
540 colorindex_ci = cquantize->colorindex[ci];
541 dither = cquantize->odither[ci][row_index];
542 col_index = 0;
543
544 for (col = width; col > 0; col--) {
545 /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
546 * select output value, accumulate into output code for this pixel.
547 * Range-limiting need not be done explicitly, as we have extended
548 * the colorindex table to produce the right answers for out-of-range
549 * inputs. The maximum dither is +- MAXJSAMPLE; this sets the
550 * required amount of padding.
551 */
552 *output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
553 input_ptr += nc;
554 output_ptr++;
555 col_index = (col_index + 1) & ODITHER_MASK;
556 }
557 }
558 /* Advance row index for next row */
559 row_index = (row_index + 1) & ODITHER_MASK;
560 cquantize->row_index = row_index;
561 }
562}
563
564
565METHODDEF(void)
566quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
567 JSAMPARRAY output_buf, int num_rows)
568/* Fast path for out_color_components==3, with ordered dithering */
569{
570 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
571 register int pixcode;
572 register JSAMPROW input_ptr;
573 register JSAMPROW output_ptr;
574 JSAMPROW colorindex0 = cquantize->colorindex[0];
575 JSAMPROW colorindex1 = cquantize->colorindex[1];
576 JSAMPROW colorindex2 = cquantize->colorindex[2];
577 int * dither0; /* points to active row of dither matrix */
578 int * dither1;
579 int * dither2;
580 int row_index, col_index; /* current indexes into dither matrix */
581 int row;
582 JDIMENSION col;
583 JDIMENSION width = cinfo->output_width;
584
585 for (row = 0; row < num_rows; row++) {
586 row_index = cquantize->row_index;
587 input_ptr = input_buf[row];
588 output_ptr = output_buf[row];
589 dither0 = cquantize->odither[0][row_index];
590 dither1 = cquantize->odither[1][row_index];
591 dither2 = cquantize->odither[2][row_index];
592 col_index = 0;
593
594 for (col = width; col > 0; col--) {
595 pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
596 dither0[col_index]]);
597 pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
598 dither1[col_index]]);
599 pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
600 dither2[col_index]]);
601 *output_ptr++ = (JSAMPLE) pixcode;
602 col_index = (col_index + 1) & ODITHER_MASK;
603 }
604 row_index = (row_index + 1) & ODITHER_MASK;
605 cquantize->row_index = row_index;
606 }
607}
608
609
610METHODDEF(void)
611quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
612 JSAMPARRAY output_buf, int num_rows)
613/* General case, with Floyd-Steinberg dithering */
614{
615 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
616 register LOCFSERROR cur; /* current error or pixel value */
617 LOCFSERROR belowerr; /* error for pixel below cur */
618 LOCFSERROR bpreverr; /* error for below/prev col */
619 LOCFSERROR bnexterr; /* error for below/next col */
620 LOCFSERROR delta;
621 register FSERRPTR errorptr; /* => fserrors[] at column before current */
622 register JSAMPROW input_ptr;
623 register JSAMPROW output_ptr;
624 JSAMPROW colorindex_ci;
625 JSAMPROW colormap_ci;
626 int pixcode;
627 int nc = cinfo->out_color_components;
628 int dir; /* 1 for left-to-right, -1 for right-to-left */
629 int dirnc; /* dir * nc */
630 int ci;
631 int row;
632 JDIMENSION col;
633 JDIMENSION width = cinfo->output_width;
634 JSAMPLE *range_limit = cinfo->sample_range_limit;
635 SHIFT_TEMPS
636
637 for (row = 0; row < num_rows; row++) {
638 /* Initialize output values to 0 so can process components separately */
639 FMEMZERO((void FAR *) output_buf[row],
640 (size_t) (width * SIZEOF(JSAMPLE)));
641 for (ci = 0; ci < nc; ci++) {
642 input_ptr = input_buf[row] + ci;
643 output_ptr = output_buf[row];
644 if (cquantize->on_odd_row) {
645 /* work right to left in this row */
646 input_ptr += (width-1) * nc; /* so point to rightmost pixel */
647 output_ptr += width-1;
648 dir = -1;
649 dirnc = -nc;
650 errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */
651 } else {
652 /* work left to right in this row */
653 dir = 1;
654 dirnc = nc;
655 errorptr = cquantize->fserrors[ci]; /* => entry before first column */
656 }
657 colorindex_ci = cquantize->colorindex[ci];
658 colormap_ci = cquantize->sv_colormap[ci];
659 /* Preset error values: no error propagated to first pixel from left */
660 cur = 0;
661 /* and no error propagated to row below yet */
662 belowerr = bpreverr = 0;
663
664 for (col = width; col > 0; col--) {
665 /* cur holds the error propagated from the previous pixel on the
666 * current line. Add the error propagated from the previous line
667 * to form the complete error correction term for this pixel, and
668 * round the error term (which is expressed * 16) to an integer.
669 * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
670 * for either sign of the error value.
671 * Note: errorptr points to *previous* column's array entry.
672 */
673 cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);
674 /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
675 * The maximum error is +- MAXJSAMPLE; this sets the required size
676 * of the range_limit array.
677 */
678 cur += GETJSAMPLE(*input_ptr);
679 cur = GETJSAMPLE(range_limit[cur]);
680 /* Select output value, accumulate into output code for this pixel */
681 pixcode = GETJSAMPLE(colorindex_ci[cur]);
682 *output_ptr += (JSAMPLE) pixcode;
683 /* Compute actual representation error at this pixel */
684 /* Note: we can do this even though we don't have the final */
685 /* pixel code, because the colormap is orthogonal. */
686 cur -= GETJSAMPLE(colormap_ci[pixcode]);
687 /* Compute error fractions to be propagated to adjacent pixels.
688 * Add these into the running sums, and simultaneously shift the
689 * next-line error sums left by 1 column.
690 */
691 bnexterr = cur;
692 delta = cur * 2;
693 cur += delta; /* form error * 3 */
694 errorptr[0] = (FSERROR) (bpreverr + cur);
695 cur += delta; /* form error * 5 */
696 bpreverr = belowerr + cur;
697 belowerr = bnexterr;
698 cur += delta; /* form error * 7 */
699 /* At this point cur contains the 7/16 error value to be propagated
700 * to the next pixel on the current line, and all the errors for the
701 * next line have been shifted over. We are therefore ready to move on.
702 */
703 input_ptr += dirnc; /* advance input ptr to next column */
704 output_ptr += dir; /* advance output ptr to next column */
705 errorptr += dir; /* advance errorptr to current column */
706 }
707 /* Post-loop cleanup: we must unload the final error value into the
708 * final fserrors[] entry. Note we need not unload belowerr because
709 * it is for the dummy column before or after the actual array.
710 */
711 errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */
712 }
713 cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);
714 }
715}
716
717
718/*
719 * Allocate workspace for Floyd-Steinberg errors.
720 */
721
722LOCAL(void)
723alloc_fs_workspace (j_decompress_ptr cinfo)
724{
725 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
726 size_t arraysize;
727 int i;
728
729 arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
730 for (i = 0; i < cinfo->out_color_components; i++) {
731 cquantize->fserrors[i] = (FSERRPTR)
732 (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
733 }
734}
735
736
737/*
738 * Initialize for one-pass color quantization.
739 */
740
741METHODDEF(void)
742start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
743{
744 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
745 size_t arraysize;
746 int i;
747
748 /* Install my colormap. */
749 cinfo->colormap = cquantize->sv_colormap;
750 cinfo->actual_number_of_colors = cquantize->sv_actual;
751
752 /* Initialize for desired dithering mode. */
753 switch (cinfo->dither_mode) {
754 case JDITHER_NONE:
755 if (cinfo->out_color_components == 3)
756 cquantize->pub.color_quantize = color_quantize3;
757 else
758 cquantize->pub.color_quantize = color_quantize;
759 break;
760 case JDITHER_ORDERED:
761 if (cinfo->out_color_components == 3)
762 cquantize->pub.color_quantize = quantize3_ord_dither;
763 else
764 cquantize->pub.color_quantize = quantize_ord_dither;
765 cquantize->row_index = 0; /* initialize state for ordered dither */
766 /* If user changed to ordered dither from another mode,
767 * we must recreate the color index table with padding.
768 * This will cost extra space, but probably isn't very likely.
769 */
770 if (! cquantize->is_padded)
771 create_colorindex(cinfo);
772 /* Create ordered-dither tables if we didn't already. */
773 if (cquantize->odither[0] == NULL)
774 create_odither_tables(cinfo);
775 break;
776 case JDITHER_FS:
777 cquantize->pub.color_quantize = quantize_fs_dither;
778 cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */
779 /* Allocate Floyd-Steinberg workspace if didn't already. */
780 if (cquantize->fserrors[0] == NULL)
781 alloc_fs_workspace(cinfo);
782 /* Initialize the propagated errors to zero. */
783 arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
784 for (i = 0; i < cinfo->out_color_components; i++)
785 FMEMZERO((void FAR *) cquantize->fserrors[i], arraysize);
786 break;
787 default:
788 ERREXIT(cinfo, JERR_NOT_COMPILED);
789 break;
790 }
791}
792
793
794/*
795 * Finish up at the end of the pass.
796 */
797
798METHODDEF(void)
799finish_pass_1_quant (j_decompress_ptr cinfo)
800{
801 /* no work in 1-pass case */
802}
803
804
805/*
806 * Switch to a new external colormap between output passes.
807 * Shouldn't get to this module!
808 */
809
810METHODDEF(void)
811new_color_map_1_quant (j_decompress_ptr cinfo)
812{
813 ERREXIT(cinfo, JERR_MODE_CHANGE);
814}
815
816
817/*
818 * Module initialization routine for 1-pass color quantization.
819 */
820
821GLOBAL(void)
822jinit_1pass_quantizer (j_decompress_ptr cinfo)
823{
824 my_cquantize_ptr cquantize;
825
826 cquantize = (my_cquantize_ptr)
827 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
828 SIZEOF(my_cquantizer));
829 cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
830 cquantize->pub.start_pass = start_pass_1_quant;
831 cquantize->pub.finish_pass = finish_pass_1_quant;
832 cquantize->pub.new_color_map = new_color_map_1_quant;
833 cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */
834 cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */
835
836 /* Make sure my internal arrays won't overflow */
837 if (cinfo->out_color_components > MAX_Q_COMPS)
838 ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);
839 /* Make sure colormap indexes can be represented by JSAMPLEs */
840 if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))
841 ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);
842
843 /* Create the colormap and color index table. */
844 create_colormap(cinfo);
845 create_colorindex(cinfo);
846
847 /* Allocate Floyd-Steinberg workspace now if requested.
848 * We do this now since it is FAR storage and may affect the memory
849 * manager's space calculations. If the user changes to FS dither
850 * mode in a later pass, we will allocate the space then, and will
851 * possibly overrun the max_memory_to_use setting.
852 */
853 if (cinfo->dither_mode == JDITHER_FS)
854 alloc_fs_workspace(cinfo);
855}
856
857#endif /* QUANT_1PASS_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant2.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant2.c
new file mode 100644
index 0000000..f7e351f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jquant2.c
@@ -0,0 +1,1311 @@
1/*
2 * jquant2.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modified 2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains 2-pass color quantization (color mapping) routines.
10 * These routines provide selection of a custom color map for an image,
11 * followed by mapping of the image to that color map, with optional
12 * Floyd-Steinberg dithering.
13 * It is also possible to use just the second pass to map to an arbitrary
14 * externally-given color map.
15 *
16 * Note: ordered dithering is not supported, since there isn't any fast
17 * way to compute intercolor distances; it's unclear that ordered dither's
18 * fundamental assumptions even hold with an irregularly spaced color map.
19 */
20
21#define JPEG_INTERNALS
22#include "jinclude.h"
23#include "jpeglib.h"
24
25#ifdef QUANT_2PASS_SUPPORTED
26
27
28/*
29 * This module implements the well-known Heckbert paradigm for color
30 * quantization. Most of the ideas used here can be traced back to
31 * Heckbert's seminal paper
32 * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display",
33 * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304.
34 *
35 * In the first pass over the image, we accumulate a histogram showing the
36 * usage count of each possible color. To keep the histogram to a reasonable
37 * size, we reduce the precision of the input; typical practice is to retain
38 * 5 or 6 bits per color, so that 8 or 4 different input values are counted
39 * in the same histogram cell.
40 *
41 * Next, the color-selection step begins with a box representing the whole
42 * color space, and repeatedly splits the "largest" remaining box until we
43 * have as many boxes as desired colors. Then the mean color in each
44 * remaining box becomes one of the possible output colors.
45 *
46 * The second pass over the image maps each input pixel to the closest output
47 * color (optionally after applying a Floyd-Steinberg dithering correction).
48 * This mapping is logically trivial, but making it go fast enough requires
49 * considerable care.
50 *
51 * Heckbert-style quantizers vary a good deal in their policies for choosing
52 * the "largest" box and deciding where to cut it. The particular policies
53 * used here have proved out well in experimental comparisons, but better ones
54 * may yet be found.
55 *
56 * In earlier versions of the IJG code, this module quantized in YCbCr color
57 * space, processing the raw upsampled data without a color conversion step.
58 * This allowed the color conversion math to be done only once per colormap
59 * entry, not once per pixel. However, that optimization precluded other
60 * useful optimizations (such as merging color conversion with upsampling)
61 * and it also interfered with desired capabilities such as quantizing to an
62 * externally-supplied colormap. We have therefore abandoned that approach.
63 * The present code works in the post-conversion color space, typically RGB.
64 *
65 * To improve the visual quality of the results, we actually work in scaled
66 * RGB space, giving G distances more weight than R, and R in turn more than
67 * B. To do everything in integer math, we must use integer scale factors.
68 * The 2/3/1 scale factors used here correspond loosely to the relative
69 * weights of the colors in the NTSC grayscale equation.
70 * If you want to use this code to quantize a non-RGB color space, you'll
71 * probably need to change these scale factors.
72 */
73
74#define R_SCALE 2 /* scale R distances by this much */
75#define G_SCALE 3 /* scale G distances by this much */
76#define B_SCALE 1 /* and B by this much */
77
78/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined
79 * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B
80 * and B,G,R orders. If you define some other weird order in jmorecfg.h,
81 * you'll get compile errors until you extend this logic. In that case
82 * you'll probably want to tweak the histogram sizes too.
83 */
84
85#if RGB_RED == 0
86#define C0_SCALE R_SCALE
87#endif
88#if RGB_BLUE == 0
89#define C0_SCALE B_SCALE
90#endif
91#if RGB_GREEN == 1
92#define C1_SCALE G_SCALE
93#endif
94#if RGB_RED == 2
95#define C2_SCALE R_SCALE
96#endif
97#if RGB_BLUE == 2
98#define C2_SCALE B_SCALE
99#endif
100
101
102/*
103 * First we have the histogram data structure and routines for creating it.
104 *
105 * The number of bits of precision can be adjusted by changing these symbols.
106 * We recommend keeping 6 bits for G and 5 each for R and B.
107 * If you have plenty of memory and cycles, 6 bits all around gives marginally
108 * better results; if you are short of memory, 5 bits all around will save
109 * some space but degrade the results.
110 * To maintain a fully accurate histogram, we'd need to allocate a "long"
111 * (preferably unsigned long) for each cell. In practice this is overkill;
112 * we can get by with 16 bits per cell. Few of the cell counts will overflow,
113 * and clamping those that do overflow to the maximum value will give close-
114 * enough results. This reduces the recommended histogram size from 256Kb
115 * to 128Kb, which is a useful savings on PC-class machines.
116 * (In the second pass the histogram space is re-used for pixel mapping data;
117 * in that capacity, each cell must be able to store zero to the number of
118 * desired colors. 16 bits/cell is plenty for that too.)
119 * Since the JPEG code is intended to run in small memory model on 80x86
120 * machines, we can't just allocate the histogram in one chunk. Instead
121 * of a true 3-D array, we use a row of pointers to 2-D arrays. Each
122 * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and
123 * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that
124 * on 80x86 machines, the pointer row is in near memory but the actual
125 * arrays are in far memory (same arrangement as we use for image arrays).
126 */
127
128#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */
129
130/* These will do the right thing for either R,G,B or B,G,R color order,
131 * but you may not like the results for other color orders.
132 */
133#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */
134#define HIST_C1_BITS 6 /* bits of precision in G histogram */
135#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */
136
137/* Number of elements along histogram axes. */
138#define HIST_C0_ELEMS (1<<HIST_C0_BITS)
139#define HIST_C1_ELEMS (1<<HIST_C1_BITS)
140#define HIST_C2_ELEMS (1<<HIST_C2_BITS)
141
142/* These are the amounts to shift an input value to get a histogram index. */
143#define C0_SHIFT (BITS_IN_JSAMPLE-HIST_C0_BITS)
144#define C1_SHIFT (BITS_IN_JSAMPLE-HIST_C1_BITS)
145#define C2_SHIFT (BITS_IN_JSAMPLE-HIST_C2_BITS)
146
147
148typedef UINT16 histcell; /* histogram cell; prefer an unsigned type */
149
150typedef histcell FAR * histptr; /* for pointers to histogram cells */
151
152typedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */
153typedef hist1d FAR * hist2d; /* type for the 2nd-level pointers */
154typedef hist2d * hist3d; /* type for top-level pointer */
155
156
157/* Declarations for Floyd-Steinberg dithering.
158 *
159 * Errors are accumulated into the array fserrors[], at a resolution of
160 * 1/16th of a pixel count. The error at a given pixel is propagated
161 * to its not-yet-processed neighbors using the standard F-S fractions,
162 * ... (here) 7/16
163 * 3/16 5/16 1/16
164 * We work left-to-right on even rows, right-to-left on odd rows.
165 *
166 * We can get away with a single array (holding one row's worth of errors)
167 * by using it to store the current row's errors at pixel columns not yet
168 * processed, but the next row's errors at columns already processed. We
169 * need only a few extra variables to hold the errors immediately around the
170 * current column. (If we are lucky, those variables are in registers, but
171 * even if not, they're probably cheaper to access than array elements are.)
172 *
173 * The fserrors[] array has (#columns + 2) entries; the extra entry at
174 * each end saves us from special-casing the first and last pixels.
175 * Each entry is three values long, one value for each color component.
176 *
177 * Note: on a wide image, we might not have enough room in a PC's near data
178 * segment to hold the error array; so it is allocated with alloc_large.
179 */
180
181#if BITS_IN_JSAMPLE == 8
182typedef INT16 FSERROR; /* 16 bits should be enough */
183typedef int LOCFSERROR; /* use 'int' for calculation temps */
184#else
185typedef INT32 FSERROR; /* may need more than 16 bits */
186typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */
187#endif
188
189typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */
190
191
192/* Private subobject */
193
194typedef struct {
195 struct jpeg_color_quantizer pub; /* public fields */
196
197 /* Space for the eventually created colormap is stashed here */
198 JSAMPARRAY sv_colormap; /* colormap allocated at init time */
199 int desired; /* desired # of colors = size of colormap */
200
201 /* Variables for accumulating image statistics */
202 hist3d histogram; /* pointer to the histogram */
203
204 boolean needs_zeroed; /* TRUE if next pass must zero histogram */
205
206 /* Variables for Floyd-Steinberg dithering */
207 FSERRPTR fserrors; /* accumulated errors */
208 boolean on_odd_row; /* flag to remember which row we are on */
209 int * error_limiter; /* table for clamping the applied error */
210} my_cquantizer;
211
212typedef my_cquantizer * my_cquantize_ptr;
213
214
215/*
216 * Prescan some rows of pixels.
217 * In this module the prescan simply updates the histogram, which has been
218 * initialized to zeroes by start_pass.
219 * An output_buf parameter is required by the method signature, but no data
220 * is actually output (in fact the buffer controller is probably passing a
221 * NULL pointer).
222 */
223
224METHODDEF(void)
225prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
226 JSAMPARRAY output_buf, int num_rows)
227{
228 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
229 register JSAMPROW ptr;
230 register histptr histp;
231 register hist3d histogram = cquantize->histogram;
232 int row;
233 JDIMENSION col;
234 JDIMENSION width = cinfo->output_width;
235
236 for (row = 0; row < num_rows; row++) {
237 ptr = input_buf[row];
238 for (col = width; col > 0; col--) {
239 /* get pixel value and index into the histogram */
240 histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
241 [GETJSAMPLE(ptr[1]) >> C1_SHIFT]
242 [GETJSAMPLE(ptr[2]) >> C2_SHIFT];
243 /* increment, check for overflow and undo increment if so. */
244 if (++(*histp) <= 0)
245 (*histp)--;
246 ptr += 3;
247 }
248 }
249}
250
251
252/*
253 * Next we have the really interesting routines: selection of a colormap
254 * given the completed histogram.
255 * These routines work with a list of "boxes", each representing a rectangular
256 * subset of the input color space (to histogram precision).
257 */
258
259typedef struct {
260 /* The bounds of the box (inclusive); expressed as histogram indexes */
261 int c0min, c0max;
262 int c1min, c1max;
263 int c2min, c2max;
264 /* The volume (actually 2-norm) of the box */
265 INT32 volume;
266 /* The number of nonzero histogram cells within this box */
267 long colorcount;
268} box;
269
270typedef box * boxptr;
271
272
273LOCAL(boxptr)
274find_biggest_color_pop (boxptr boxlist, int numboxes)
275/* Find the splittable box with the largest color population */
276/* Returns NULL if no splittable boxes remain */
277{
278 register boxptr boxp;
279 register int i;
280 register long maxc = 0;
281 boxptr which = NULL;
282
283 for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
284 if (boxp->colorcount > maxc && boxp->volume > 0) {
285 which = boxp;
286 maxc = boxp->colorcount;
287 }
288 }
289 return which;
290}
291
292
293LOCAL(boxptr)
294find_biggest_volume (boxptr boxlist, int numboxes)
295/* Find the splittable box with the largest (scaled) volume */
296/* Returns NULL if no splittable boxes remain */
297{
298 register boxptr boxp;
299 register int i;
300 register INT32 maxv = 0;
301 boxptr which = NULL;
302
303 for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
304 if (boxp->volume > maxv) {
305 which = boxp;
306 maxv = boxp->volume;
307 }
308 }
309 return which;
310}
311
312
313LOCAL(void)
314update_box (j_decompress_ptr cinfo, boxptr boxp)
315/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
316/* and recompute its volume and population */
317{
318 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
319 hist3d histogram = cquantize->histogram;
320 histptr histp;
321 int c0,c1,c2;
322 int c0min,c0max,c1min,c1max,c2min,c2max;
323 INT32 dist0,dist1,dist2;
324 long ccount;
325
326 c0min = boxp->c0min; c0max = boxp->c0max;
327 c1min = boxp->c1min; c1max = boxp->c1max;
328 c2min = boxp->c2min; c2max = boxp->c2max;
329
330 if (c0max > c0min)
331 for (c0 = c0min; c0 <= c0max; c0++)
332 for (c1 = c1min; c1 <= c1max; c1++) {
333 histp = & histogram[c0][c1][c2min];
334 for (c2 = c2min; c2 <= c2max; c2++)
335 if (*histp++ != 0) {
336 boxp->c0min = c0min = c0;
337 goto have_c0min;
338 }
339 }
340 have_c0min:
341 if (c0max > c0min)
342 for (c0 = c0max; c0 >= c0min; c0--)
343 for (c1 = c1min; c1 <= c1max; c1++) {
344 histp = & histogram[c0][c1][c2min];
345 for (c2 = c2min; c2 <= c2max; c2++)
346 if (*histp++ != 0) {
347 boxp->c0max = c0max = c0;
348 goto have_c0max;
349 }
350 }
351 have_c0max:
352 if (c1max > c1min)
353 for (c1 = c1min; c1 <= c1max; c1++)
354 for (c0 = c0min; c0 <= c0max; c0++) {
355 histp = & histogram[c0][c1][c2min];
356 for (c2 = c2min; c2 <= c2max; c2++)
357 if (*histp++ != 0) {
358 boxp->c1min = c1min = c1;
359 goto have_c1min;
360 }
361 }
362 have_c1min:
363 if (c1max > c1min)
364 for (c1 = c1max; c1 >= c1min; c1--)
365 for (c0 = c0min; c0 <= c0max; c0++) {
366 histp = & histogram[c0][c1][c2min];
367 for (c2 = c2min; c2 <= c2max; c2++)
368 if (*histp++ != 0) {
369 boxp->c1max = c1max = c1;
370 goto have_c1max;
371 }
372 }
373 have_c1max:
374 if (c2max > c2min)
375 for (c2 = c2min; c2 <= c2max; c2++)
376 for (c0 = c0min; c0 <= c0max; c0++) {
377 histp = & histogram[c0][c1min][c2];
378 for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
379 if (*histp != 0) {
380 boxp->c2min = c2min = c2;
381 goto have_c2min;
382 }
383 }
384 have_c2min:
385 if (c2max > c2min)
386 for (c2 = c2max; c2 >= c2min; c2--)
387 for (c0 = c0min; c0 <= c0max; c0++) {
388 histp = & histogram[c0][c1min][c2];
389 for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
390 if (*histp != 0) {
391 boxp->c2max = c2max = c2;
392 goto have_c2max;
393 }
394 }
395 have_c2max:
396
397 /* Update box volume.
398 * We use 2-norm rather than real volume here; this biases the method
399 * against making long narrow boxes, and it has the side benefit that
400 * a box is splittable iff norm > 0.
401 * Since the differences are expressed in histogram-cell units,
402 * we have to shift back to JSAMPLE units to get consistent distances;
403 * after which, we scale according to the selected distance scale factors.
404 */
405 dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;
406 dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;
407 dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;
408 boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;
409
410 /* Now scan remaining volume of box and compute population */
411 ccount = 0;
412 for (c0 = c0min; c0 <= c0max; c0++)
413 for (c1 = c1min; c1 <= c1max; c1++) {
414 histp = & histogram[c0][c1][c2min];
415 for (c2 = c2min; c2 <= c2max; c2++, histp++)
416 if (*histp != 0) {
417 ccount++;
418 }
419 }
420 boxp->colorcount = ccount;
421}
422
423
424LOCAL(int)
425median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
426 int desired_colors)
427/* Repeatedly select and split the largest box until we have enough boxes */
428{
429 int n,lb;
430 int c0,c1,c2,cmax;
431 register boxptr b1,b2;
432
433 while (numboxes < desired_colors) {
434 /* Select box to split.
435 * Current algorithm: by population for first half, then by volume.
436 */
437 if (numboxes*2 <= desired_colors) {
438 b1 = find_biggest_color_pop(boxlist, numboxes);
439 } else {
440 b1 = find_biggest_volume(boxlist, numboxes);
441 }
442 if (b1 == NULL) /* no splittable boxes left! */
443 break;
444 b2 = &boxlist[numboxes]; /* where new box will go */
445 /* Copy the color bounds to the new box. */
446 b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;
447 b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;
448 /* Choose which axis to split the box on.
449 * Current algorithm: longest scaled axis.
450 * See notes in update_box about scaling distances.
451 */
452 c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;
453 c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;
454 c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;
455 /* We want to break any ties in favor of green, then red, blue last.
456 * This code does the right thing for R,G,B or B,G,R color orders only.
457 */
458#if RGB_RED == 0
459 cmax = c1; n = 1;
460 if (c0 > cmax) { cmax = c0; n = 0; }
461 if (c2 > cmax) { n = 2; }
462#else
463 cmax = c1; n = 1;
464 if (c2 > cmax) { cmax = c2; n = 2; }
465 if (c0 > cmax) { n = 0; }
466#endif
467 /* Choose split point along selected axis, and update box bounds.
468 * Current algorithm: split at halfway point.
469 * (Since the box has been shrunk to minimum volume,
470 * any split will produce two nonempty subboxes.)
471 * Note that lb value is max for lower box, so must be < old max.
472 */
473 switch (n) {
474 case 0:
475 lb = (b1->c0max + b1->c0min) / 2;
476 b1->c0max = lb;
477 b2->c0min = lb+1;
478 break;
479 case 1:
480 lb = (b1->c1max + b1->c1min) / 2;
481 b1->c1max = lb;
482 b2->c1min = lb+1;
483 break;
484 case 2:
485 lb = (b1->c2max + b1->c2min) / 2;
486 b1->c2max = lb;
487 b2->c2min = lb+1;
488 break;
489 }
490 /* Update stats for boxes */
491 update_box(cinfo, b1);
492 update_box(cinfo, b2);
493 numboxes++;
494 }
495 return numboxes;
496}
497
498
499LOCAL(void)
500compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
501/* Compute representative color for a box, put it in colormap[icolor] */
502{
503 /* Current algorithm: mean weighted by pixels (not colors) */
504 /* Note it is important to get the rounding correct! */
505 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
506 hist3d histogram = cquantize->histogram;
507 histptr histp;
508 int c0,c1,c2;
509 int c0min,c0max,c1min,c1max,c2min,c2max;
510 long count;
511 long total = 0;
512 long c0total = 0;
513 long c1total = 0;
514 long c2total = 0;
515
516 c0min = boxp->c0min; c0max = boxp->c0max;
517 c1min = boxp->c1min; c1max = boxp->c1max;
518 c2min = boxp->c2min; c2max = boxp->c2max;
519
520 for (c0 = c0min; c0 <= c0max; c0++)
521 for (c1 = c1min; c1 <= c1max; c1++) {
522 histp = & histogram[c0][c1][c2min];
523 for (c2 = c2min; c2 <= c2max; c2++) {
524 if ((count = *histp++) != 0) {
525 total += count;
526 c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;
527 c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;
528 c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;
529 }
530 }
531 }
532
533 cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
534 cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
535 cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
536}
537
538
539LOCAL(void)
540select_colors (j_decompress_ptr cinfo, int desired_colors)
541/* Master routine for color selection */
542{
543 boxptr boxlist;
544 int numboxes;
545 int i;
546
547 /* Allocate workspace for box list */
548 boxlist = (boxptr) (*cinfo->mem->alloc_small)
549 ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));
550 /* Initialize one box containing whole space */
551 numboxes = 1;
552 boxlist[0].c0min = 0;
553 boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;
554 boxlist[0].c1min = 0;
555 boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;
556 boxlist[0].c2min = 0;
557 boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;
558 /* Shrink it to actually-used volume and set its statistics */
559 update_box(cinfo, & boxlist[0]);
560 /* Perform median-cut to produce final box list */
561 numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);
562 /* Compute the representative color for each box, fill colormap */
563 for (i = 0; i < numboxes; i++)
564 compute_color(cinfo, & boxlist[i], i);
565 cinfo->actual_number_of_colors = numboxes;
566 TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
567}
568
569
570/*
571 * These routines are concerned with the time-critical task of mapping input
572 * colors to the nearest color in the selected colormap.
573 *
574 * We re-use the histogram space as an "inverse color map", essentially a
575 * cache for the results of nearest-color searches. All colors within a
576 * histogram cell will be mapped to the same colormap entry, namely the one
577 * closest to the cell's center. This may not be quite the closest entry to
578 * the actual input color, but it's almost as good. A zero in the cache
579 * indicates we haven't found the nearest color for that cell yet; the array
580 * is cleared to zeroes before starting the mapping pass. When we find the
581 * nearest color for a cell, its colormap index plus one is recorded in the
582 * cache for future use. The pass2 scanning routines call fill_inverse_cmap
583 * when they need to use an unfilled entry in the cache.
584 *
585 * Our method of efficiently finding nearest colors is based on the "locally
586 * sorted search" idea described by Heckbert and on the incremental distance
587 * calculation described by Spencer W. Thomas in chapter III.1 of Graphics
588 * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that
589 * the distances from a given colormap entry to each cell of the histogram can
590 * be computed quickly using an incremental method: the differences between
591 * distances to adjacent cells themselves differ by a constant. This allows a
592 * fairly fast implementation of the "brute force" approach of computing the
593 * distance from every colormap entry to every histogram cell. Unfortunately,
594 * it needs a work array to hold the best-distance-so-far for each histogram
595 * cell (because the inner loop has to be over cells, not colormap entries).
596 * The work array elements have to be INT32s, so the work array would need
597 * 256Kb at our recommended precision. This is not feasible in DOS machines.
598 *
599 * To get around these problems, we apply Thomas' method to compute the
600 * nearest colors for only the cells within a small subbox of the histogram.
601 * The work array need be only as big as the subbox, so the memory usage
602 * problem is solved. Furthermore, we need not fill subboxes that are never
603 * referenced in pass2; many images use only part of the color gamut, so a
604 * fair amount of work is saved. An additional advantage of this
605 * approach is that we can apply Heckbert's locality criterion to quickly
606 * eliminate colormap entries that are far away from the subbox; typically
607 * three-fourths of the colormap entries are rejected by Heckbert's criterion,
608 * and we need not compute their distances to individual cells in the subbox.
609 * The speed of this approach is heavily influenced by the subbox size: too
610 * small means too much overhead, too big loses because Heckbert's criterion
611 * can't eliminate as many colormap entries. Empirically the best subbox
612 * size seems to be about 1/512th of the histogram (1/8th in each direction).
613 *
614 * Thomas' article also describes a refined method which is asymptotically
615 * faster than the brute-force method, but it is also far more complex and
616 * cannot efficiently be applied to small subboxes. It is therefore not
617 * useful for programs intended to be portable to DOS machines. On machines
618 * with plenty of memory, filling the whole histogram in one shot with Thomas'
619 * refined method might be faster than the present code --- but then again,
620 * it might not be any faster, and it's certainly more complicated.
621 */
622
623
624/* log2(histogram cells in update box) for each axis; this can be adjusted */
625#define BOX_C0_LOG (HIST_C0_BITS-3)
626#define BOX_C1_LOG (HIST_C1_BITS-3)
627#define BOX_C2_LOG (HIST_C2_BITS-3)
628
629#define BOX_C0_ELEMS (1<<BOX_C0_LOG) /* # of hist cells in update box */
630#define BOX_C1_ELEMS (1<<BOX_C1_LOG)
631#define BOX_C2_ELEMS (1<<BOX_C2_LOG)
632
633#define BOX_C0_SHIFT (C0_SHIFT + BOX_C0_LOG)
634#define BOX_C1_SHIFT (C1_SHIFT + BOX_C1_LOG)
635#define BOX_C2_SHIFT (C2_SHIFT + BOX_C2_LOG)
636
637
638/*
639 * The next three routines implement inverse colormap filling. They could
640 * all be folded into one big routine, but splitting them up this way saves
641 * some stack space (the mindist[] and bestdist[] arrays need not coexist)
642 * and may allow some compilers to produce better code by registerizing more
643 * inner-loop variables.
644 */
645
646LOCAL(int)
647find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
648 JSAMPLE colorlist[])
649/* Locate the colormap entries close enough to an update box to be candidates
650 * for the nearest entry to some cell(s) in the update box. The update box
651 * is specified by the center coordinates of its first cell. The number of
652 * candidate colormap entries is returned, and their colormap indexes are
653 * placed in colorlist[].
654 * This routine uses Heckbert's "locally sorted search" criterion to select
655 * the colors that need further consideration.
656 */
657{
658 int numcolors = cinfo->actual_number_of_colors;
659 int maxc0, maxc1, maxc2;
660 int centerc0, centerc1, centerc2;
661 int i, x, ncolors;
662 INT32 minmaxdist, min_dist, max_dist, tdist;
663 INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
664
665 /* Compute true coordinates of update box's upper corner and center.
666 * Actually we compute the coordinates of the center of the upper-corner
667 * histogram cell, which are the upper bounds of the volume we care about.
668 * Note that since ">>" rounds down, the "center" values may be closer to
669 * min than to max; hence comparisons to them must be "<=", not "<".
670 */
671 maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));
672 centerc0 = (minc0 + maxc0) >> 1;
673 maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));
674 centerc1 = (minc1 + maxc1) >> 1;
675 maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));
676 centerc2 = (minc2 + maxc2) >> 1;
677
678 /* For each color in colormap, find:
679 * 1. its minimum squared-distance to any point in the update box
680 * (zero if color is within update box);
681 * 2. its maximum squared-distance to any point in the update box.
682 * Both of these can be found by considering only the corners of the box.
683 * We save the minimum distance for each color in mindist[];
684 * only the smallest maximum distance is of interest.
685 */
686 minmaxdist = 0x7FFFFFFFL;
687
688 for (i = 0; i < numcolors; i++) {
689 /* We compute the squared-c0-distance term, then add in the other two. */
690 x = GETJSAMPLE(cinfo->colormap[0][i]);
691 if (x < minc0) {
692 tdist = (x - minc0) * C0_SCALE;
693 min_dist = tdist*tdist;
694 tdist = (x - maxc0) * C0_SCALE;
695 max_dist = tdist*tdist;
696 } else if (x > maxc0) {
697 tdist = (x - maxc0) * C0_SCALE;
698 min_dist = tdist*tdist;
699 tdist = (x - minc0) * C0_SCALE;
700 max_dist = tdist*tdist;
701 } else {
702 /* within cell range so no contribution to min_dist */
703 min_dist = 0;
704 if (x <= centerc0) {
705 tdist = (x - maxc0) * C0_SCALE;
706 max_dist = tdist*tdist;
707 } else {
708 tdist = (x - minc0) * C0_SCALE;
709 max_dist = tdist*tdist;
710 }
711 }
712
713 x = GETJSAMPLE(cinfo->colormap[1][i]);
714 if (x < minc1) {
715 tdist = (x - minc1) * C1_SCALE;
716 min_dist += tdist*tdist;
717 tdist = (x - maxc1) * C1_SCALE;
718 max_dist += tdist*tdist;
719 } else if (x > maxc1) {
720 tdist = (x - maxc1) * C1_SCALE;
721 min_dist += tdist*tdist;
722 tdist = (x - minc1) * C1_SCALE;
723 max_dist += tdist*tdist;
724 } else {
725 /* within cell range so no contribution to min_dist */
726 if (x <= centerc1) {
727 tdist = (x - maxc1) * C1_SCALE;
728 max_dist += tdist*tdist;
729 } else {
730 tdist = (x - minc1) * C1_SCALE;
731 max_dist += tdist*tdist;
732 }
733 }
734
735 x = GETJSAMPLE(cinfo->colormap[2][i]);
736 if (x < minc2) {
737 tdist = (x - minc2) * C2_SCALE;
738 min_dist += tdist*tdist;
739 tdist = (x - maxc2) * C2_SCALE;
740 max_dist += tdist*tdist;
741 } else if (x > maxc2) {
742 tdist = (x - maxc2) * C2_SCALE;
743 min_dist += tdist*tdist;
744 tdist = (x - minc2) * C2_SCALE;
745 max_dist += tdist*tdist;
746 } else {
747 /* within cell range so no contribution to min_dist */
748 if (x <= centerc2) {
749 tdist = (x - maxc2) * C2_SCALE;
750 max_dist += tdist*tdist;
751 } else {
752 tdist = (x - minc2) * C2_SCALE;
753 max_dist += tdist*tdist;
754 }
755 }
756
757 mindist[i] = min_dist; /* save away the results */
758 if (max_dist < minmaxdist)
759 minmaxdist = max_dist;
760 }
761
762 /* Now we know that no cell in the update box is more than minmaxdist
763 * away from some colormap entry. Therefore, only colors that are
764 * within minmaxdist of some part of the box need be considered.
765 */
766 ncolors = 0;
767 for (i = 0; i < numcolors; i++) {
768 if (mindist[i] <= minmaxdist)
769 colorlist[ncolors++] = (JSAMPLE) i;
770 }
771 return ncolors;
772}
773
774
775LOCAL(void)
776find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
777 int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
778/* Find the closest colormap entry for each cell in the update box,
779 * given the list of candidate colors prepared by find_nearby_colors.
780 * Return the indexes of the closest entries in the bestcolor[] array.
781 * This routine uses Thomas' incremental distance calculation method to
782 * find the distance from a colormap entry to successive cells in the box.
783 */
784{
785 int ic0, ic1, ic2;
786 int i, icolor;
787 register INT32 * bptr; /* pointer into bestdist[] array */
788 JSAMPLE * cptr; /* pointer into bestcolor[] array */
789 INT32 dist0, dist1; /* initial distance values */
790 register INT32 dist2; /* current distance in inner loop */
791 INT32 xx0, xx1; /* distance increments */
792 register INT32 xx2;
793 INT32 inc0, inc1, inc2; /* initial values for increments */
794 /* This array holds the distance to the nearest-so-far color for each cell */
795 INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
796
797 /* Initialize best-distance for each cell of the update box */
798 bptr = bestdist;
799 for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)
800 *bptr++ = 0x7FFFFFFFL;
801
802 /* For each color selected by find_nearby_colors,
803 * compute its distance to the center of each cell in the box.
804 * If that's less than best-so-far, update best distance and color number.
805 */
806
807 /* Nominal steps between cell centers ("x" in Thomas article) */
808#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE)
809#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE)
810#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE)
811
812 for (i = 0; i < numcolors; i++) {
813 icolor = GETJSAMPLE(colorlist[i]);
814 /* Compute (square of) distance from minc0/c1/c2 to this color */
815 inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
816 dist0 = inc0*inc0;
817 inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
818 dist0 += inc1*inc1;
819 inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
820 dist0 += inc2*inc2;
821 /* Form the initial difference increments */
822 inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
823 inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;
824 inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;
825 /* Now loop over all cells in box, updating distance per Thomas method */
826 bptr = bestdist;
827 cptr = bestcolor;
828 xx0 = inc0;
829 for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {
830 dist1 = dist0;
831 xx1 = inc1;
832 for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {
833 dist2 = dist1;
834 xx2 = inc2;
835 for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {
836 if (dist2 < *bptr) {
837 *bptr = dist2;
838 *cptr = (JSAMPLE) icolor;
839 }
840 dist2 += xx2;
841 xx2 += 2 * STEP_C2 * STEP_C2;
842 bptr++;
843 cptr++;
844 }
845 dist1 += xx1;
846 xx1 += 2 * STEP_C1 * STEP_C1;
847 }
848 dist0 += xx0;
849 xx0 += 2 * STEP_C0 * STEP_C0;
850 }
851 }
852}
853
854
855LOCAL(void)
856fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
857/* Fill the inverse-colormap entries in the update box that contains */
858/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */
859/* we can fill as many others as we wish.) */
860{
861 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
862 hist3d histogram = cquantize->histogram;
863 int minc0, minc1, minc2; /* lower left corner of update box */
864 int ic0, ic1, ic2;
865 register JSAMPLE * cptr; /* pointer into bestcolor[] array */
866 register histptr cachep; /* pointer into main cache array */
867 /* This array lists the candidate colormap indexes. */
868 JSAMPLE colorlist[MAXNUMCOLORS];
869 int numcolors; /* number of candidate colors */
870 /* This array holds the actually closest colormap index for each cell. */
871 JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
872
873 /* Convert cell coordinates to update box ID */
874 c0 >>= BOX_C0_LOG;
875 c1 >>= BOX_C1_LOG;
876 c2 >>= BOX_C2_LOG;
877
878 /* Compute true coordinates of update box's origin corner.
879 * Actually we compute the coordinates of the center of the corner
880 * histogram cell, which are the lower bounds of the volume we care about.
881 */
882 minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);
883 minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);
884 minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);
885
886 /* Determine which colormap entries are close enough to be candidates
887 * for the nearest entry to some cell in the update box.
888 */
889 numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);
890
891 /* Determine the actually nearest colors. */
892 find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,
893 bestcolor);
894
895 /* Save the best color numbers (plus 1) in the main cache array */
896 c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */
897 c1 <<= BOX_C1_LOG;
898 c2 <<= BOX_C2_LOG;
899 cptr = bestcolor;
900 for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {
901 for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {
902 cachep = & histogram[c0+ic0][c1+ic1][c2];
903 for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {
904 *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);
905 }
906 }
907 }
908}
909
910
911/*
912 * Map some rows of pixels to the output colormapped representation.
913 */
914
915METHODDEF(void)
916pass2_no_dither (j_decompress_ptr cinfo,
917 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
918/* This version performs no dithering */
919{
920 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
921 hist3d histogram = cquantize->histogram;
922 register JSAMPROW inptr, outptr;
923 register histptr cachep;
924 register int c0, c1, c2;
925 int row;
926 JDIMENSION col;
927 JDIMENSION width = cinfo->output_width;
928
929 for (row = 0; row < num_rows; row++) {
930 inptr = input_buf[row];
931 outptr = output_buf[row];
932 for (col = width; col > 0; col--) {
933 /* get pixel value and index into the cache */
934 c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
935 c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
936 c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
937 cachep = & histogram[c0][c1][c2];
938 /* If we have not seen this color before, find nearest colormap entry */
939 /* and update the cache */
940 if (*cachep == 0)
941 fill_inverse_cmap(cinfo, c0,c1,c2);
942 /* Now emit the colormap index for this cell */
943 *outptr++ = (JSAMPLE) (*cachep - 1);
944 }
945 }
946}
947
948
949METHODDEF(void)
950pass2_fs_dither (j_decompress_ptr cinfo,
951 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
952/* This version performs Floyd-Steinberg dithering */
953{
954 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
955 hist3d histogram = cquantize->histogram;
956 register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */
957 LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
958 LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
959 register FSERRPTR errorptr; /* => fserrors[] at column before current */
960 JSAMPROW inptr; /* => current input pixel */
961 JSAMPROW outptr; /* => current output pixel */
962 histptr cachep;
963 int dir; /* +1 or -1 depending on direction */
964 int dir3; /* 3*dir, for advancing inptr & errorptr */
965 int row;
966 JDIMENSION col;
967 JDIMENSION width = cinfo->output_width;
968 JSAMPLE *range_limit = cinfo->sample_range_limit;
969 int *error_limit = cquantize->error_limiter;
970 JSAMPROW colormap0 = cinfo->colormap[0];
971 JSAMPROW colormap1 = cinfo->colormap[1];
972 JSAMPROW colormap2 = cinfo->colormap[2];
973 SHIFT_TEMPS
974
975 for (row = 0; row < num_rows; row++) {
976 inptr = input_buf[row];
977 outptr = output_buf[row];
978 if (cquantize->on_odd_row) {
979 /* work right to left in this row */
980 inptr += (width-1) * 3; /* so point to rightmost pixel */
981 outptr += width-1;
982 dir = -1;
983 dir3 = -3;
984 errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */
985 cquantize->on_odd_row = FALSE; /* flip for next time */
986 } else {
987 /* work left to right in this row */
988 dir = 1;
989 dir3 = 3;
990 errorptr = cquantize->fserrors; /* => entry before first real column */
991 cquantize->on_odd_row = TRUE; /* flip for next time */
992 }
993 /* Preset error values: no error propagated to first pixel from left */
994 cur0 = cur1 = cur2 = 0;
995 /* and no error propagated to row below yet */
996 belowerr0 = belowerr1 = belowerr2 = 0;
997 bpreverr0 = bpreverr1 = bpreverr2 = 0;
998
999 for (col = width; col > 0; col--) {
1000 /* curN holds the error propagated from the previous pixel on the
1001 * current line. Add the error propagated from the previous line
1002 * to form the complete error correction term for this pixel, and
1003 * round the error term (which is expressed * 16) to an integer.
1004 * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
1005 * for either sign of the error value.
1006 * Note: errorptr points to *previous* column's array entry.
1007 */
1008 cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4);
1009 cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4);
1010 cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4);
1011 /* Limit the error using transfer function set by init_error_limit.
1012 * See comments with init_error_limit for rationale.
1013 */
1014 cur0 = error_limit[cur0];
1015 cur1 = error_limit[cur1];
1016 cur2 = error_limit[cur2];
1017 /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
1018 * The maximum error is +- MAXJSAMPLE (or less with error limiting);
1019 * this sets the required size of the range_limit array.
1020 */
1021 cur0 += GETJSAMPLE(inptr[0]);
1022 cur1 += GETJSAMPLE(inptr[1]);
1023 cur2 += GETJSAMPLE(inptr[2]);
1024 cur0 = GETJSAMPLE(range_limit[cur0]);
1025 cur1 = GETJSAMPLE(range_limit[cur1]);
1026 cur2 = GETJSAMPLE(range_limit[cur2]);
1027 /* Index into the cache with adjusted pixel value */
1028 cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];
1029 /* If we have not seen this color before, find nearest colormap */
1030 /* entry and update the cache */
1031 if (*cachep == 0)
1032 fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
1033 /* Now emit the colormap index for this cell */
1034 { register int pixcode = *cachep - 1;
1035 *outptr = (JSAMPLE) pixcode;
1036 /* Compute representation error for this pixel */
1037 cur0 -= GETJSAMPLE(colormap0[pixcode]);
1038 cur1 -= GETJSAMPLE(colormap1[pixcode]);
1039 cur2 -= GETJSAMPLE(colormap2[pixcode]);
1040 }
1041 /* Compute error fractions to be propagated to adjacent pixels.
1042 * Add these into the running sums, and simultaneously shift the
1043 * next-line error sums left by 1 column.
1044 */
1045 { register LOCFSERROR bnexterr, delta;
1046
1047 bnexterr = cur0; /* Process component 0 */
1048 delta = cur0 * 2;
1049 cur0 += delta; /* form error * 3 */
1050 errorptr[0] = (FSERROR) (bpreverr0 + cur0);
1051 cur0 += delta; /* form error * 5 */
1052 bpreverr0 = belowerr0 + cur0;
1053 belowerr0 = bnexterr;
1054 cur0 += delta; /* form error * 7 */
1055 bnexterr = cur1; /* Process component 1 */
1056 delta = cur1 * 2;
1057 cur1 += delta; /* form error * 3 */
1058 errorptr[1] = (FSERROR) (bpreverr1 + cur1);
1059 cur1 += delta; /* form error * 5 */
1060 bpreverr1 = belowerr1 + cur1;
1061 belowerr1 = bnexterr;
1062 cur1 += delta; /* form error * 7 */
1063 bnexterr = cur2; /* Process component 2 */
1064 delta = cur2 * 2;
1065 cur2 += delta; /* form error * 3 */
1066 errorptr[2] = (FSERROR) (bpreverr2 + cur2);
1067 cur2 += delta; /* form error * 5 */
1068 bpreverr2 = belowerr2 + cur2;
1069 belowerr2 = bnexterr;
1070 cur2 += delta; /* form error * 7 */
1071 }
1072 /* At this point curN contains the 7/16 error value to be propagated
1073 * to the next pixel on the current line, and all the errors for the
1074 * next line have been shifted over. We are therefore ready to move on.
1075 */
1076 inptr += dir3; /* Advance pixel pointers to next column */
1077 outptr += dir;
1078 errorptr += dir3; /* advance errorptr to current column */
1079 }
1080 /* Post-loop cleanup: we must unload the final error values into the
1081 * final fserrors[] entry. Note we need not unload belowerrN because
1082 * it is for the dummy column before or after the actual array.
1083 */
1084 errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */
1085 errorptr[1] = (FSERROR) bpreverr1;
1086 errorptr[2] = (FSERROR) bpreverr2;
1087 }
1088}
1089
1090
1091/*
1092 * Initialize the error-limiting transfer function (lookup table).
1093 * The raw F-S error computation can potentially compute error values of up to
1094 * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be
1095 * much less, otherwise obviously wrong pixels will be created. (Typical
1096 * effects include weird fringes at color-area boundaries, isolated bright
1097 * pixels in a dark area, etc.) The standard advice for avoiding this problem
1098 * is to ensure that the "corners" of the color cube are allocated as output
1099 * colors; then repeated errors in the same direction cannot cause cascading
1100 * error buildup. However, that only prevents the error from getting
1101 * completely out of hand; Aaron Giles reports that error limiting improves
1102 * the results even with corner colors allocated.
1103 * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty
1104 * well, but the smoother transfer function used below is even better. Thanks
1105 * to Aaron Giles for this idea.
1106 */
1107
1108LOCAL(void)
1109init_error_limit (j_decompress_ptr cinfo)
1110/* Allocate and fill in the error_limiter table */
1111{
1112 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1113 int * table;
1114 int in, out;
1115
1116 table = (int *) (*cinfo->mem->alloc_small)
1117 ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));
1118 table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */
1119 cquantize->error_limiter = table;
1120
1121#define STEPSIZE ((MAXJSAMPLE+1)/16)
1122 /* Map errors 1:1 up to +- MAXJSAMPLE/16 */
1123 out = 0;
1124 for (in = 0; in < STEPSIZE; in++, out++) {
1125 table[in] = out; table[-in] = -out;
1126 }
1127 /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */
1128 for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {
1129 table[in] = out; table[-in] = -out;
1130 }
1131 /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */
1132 for (; in <= MAXJSAMPLE; in++) {
1133 table[in] = out; table[-in] = -out;
1134 }
1135#undef STEPSIZE
1136}
1137
1138
1139/*
1140 * Finish up at the end of each pass.
1141 */
1142
1143METHODDEF(void)
1144finish_pass1 (j_decompress_ptr cinfo)
1145{
1146 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1147
1148 /* Select the representative colors and fill in cinfo->colormap */
1149 cinfo->colormap = cquantize->sv_colormap;
1150 select_colors(cinfo, cquantize->desired);
1151 /* Force next pass to zero the color index table */
1152 cquantize->needs_zeroed = TRUE;
1153}
1154
1155
1156METHODDEF(void)
1157finish_pass2 (j_decompress_ptr cinfo)
1158{
1159 /* no work */
1160}
1161
1162
1163/*
1164 * Initialize for each processing pass.
1165 */
1166
1167METHODDEF(void)
1168start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
1169{
1170 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1171 hist3d histogram = cquantize->histogram;
1172 int i;
1173
1174 /* Only F-S dithering or no dithering is supported. */
1175 /* If user asks for ordered dither, give him F-S. */
1176 if (cinfo->dither_mode != JDITHER_NONE)
1177 cinfo->dither_mode = JDITHER_FS;
1178
1179 if (is_pre_scan) {
1180 /* Set up method pointers */
1181 cquantize->pub.color_quantize = prescan_quantize;
1182 cquantize->pub.finish_pass = finish_pass1;
1183 cquantize->needs_zeroed = TRUE; /* Always zero histogram */
1184 } else {
1185 /* Set up method pointers */
1186 if (cinfo->dither_mode == JDITHER_FS)
1187 cquantize->pub.color_quantize = pass2_fs_dither;
1188 else
1189 cquantize->pub.color_quantize = pass2_no_dither;
1190 cquantize->pub.finish_pass = finish_pass2;
1191
1192 /* Make sure color count is acceptable */
1193 i = cinfo->actual_number_of_colors;
1194 if (i < 1)
1195 ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);
1196 if (i > MAXNUMCOLORS)
1197 ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
1198
1199 if (cinfo->dither_mode == JDITHER_FS) {
1200 size_t arraysize = (size_t) ((cinfo->output_width + 2) *
1201 (3 * SIZEOF(FSERROR)));
1202 /* Allocate Floyd-Steinberg workspace if we didn't already. */
1203 if (cquantize->fserrors == NULL)
1204 cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
1205 ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
1206 /* Initialize the propagated errors to zero. */
1207 FMEMZERO((void FAR *) cquantize->fserrors, arraysize);
1208 /* Make the error-limit table if we didn't already. */
1209 if (cquantize->error_limiter == NULL)
1210 init_error_limit(cinfo);
1211 cquantize->on_odd_row = FALSE;
1212 }
1213
1214 }
1215 /* Zero the histogram or inverse color map, if necessary */
1216 if (cquantize->needs_zeroed) {
1217 for (i = 0; i < HIST_C0_ELEMS; i++) {
1218 FMEMZERO((void FAR *) histogram[i],
1219 HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));
1220 }
1221 cquantize->needs_zeroed = FALSE;
1222 }
1223}
1224
1225
1226/*
1227 * Switch to a new external colormap between output passes.
1228 */
1229
1230METHODDEF(void)
1231new_color_map_2_quant (j_decompress_ptr cinfo)
1232{
1233 my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1234
1235 /* Reset the inverse color map */
1236 cquantize->needs_zeroed = TRUE;
1237}
1238
1239
1240/*
1241 * Module initialization routine for 2-pass color quantization.
1242 */
1243
1244GLOBAL(void)
1245jinit_2pass_quantizer (j_decompress_ptr cinfo)
1246{
1247 my_cquantize_ptr cquantize;
1248 int i;
1249
1250 cquantize = (my_cquantize_ptr)
1251 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
1252 SIZEOF(my_cquantizer));
1253 cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
1254 cquantize->pub.start_pass = start_pass_2_quant;
1255 cquantize->pub.new_color_map = new_color_map_2_quant;
1256 cquantize->fserrors = NULL; /* flag optional arrays not allocated */
1257 cquantize->error_limiter = NULL;
1258
1259 /* Make sure jdmaster didn't give me a case I can't handle */
1260 if (cinfo->out_color_components != 3)
1261 ERREXIT(cinfo, JERR_NOTIMPL);
1262
1263 /* Allocate the histogram/inverse colormap storage */
1264 cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
1265 ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d));
1266 for (i = 0; i < HIST_C0_ELEMS; i++) {
1267 cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
1268 ((j_common_ptr) cinfo, JPOOL_IMAGE,
1269 HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));
1270 }
1271 cquantize->needs_zeroed = TRUE; /* histogram is garbage now */
1272
1273 /* Allocate storage for the completed colormap, if required.
1274 * We do this now since it is FAR storage and may affect
1275 * the memory manager's space calculations.
1276 */
1277 if (cinfo->enable_2pass_quant) {
1278 /* Make sure color count is acceptable */
1279 int desired = cinfo->desired_number_of_colors;
1280 /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */
1281 if (desired < 8)
1282 ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);
1283 /* Make sure colormap indexes can be represented by JSAMPLEs */
1284 if (desired > MAXNUMCOLORS)
1285 ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
1286 cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)
1287 ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);
1288 cquantize->desired = desired;
1289 } else
1290 cquantize->sv_colormap = NULL;
1291
1292 /* Only F-S dithering or no dithering is supported. */
1293 /* If user asks for ordered dither, give him F-S. */
1294 if (cinfo->dither_mode != JDITHER_NONE)
1295 cinfo->dither_mode = JDITHER_FS;
1296
1297 /* Allocate Floyd-Steinberg workspace if necessary.
1298 * This isn't really needed until pass 2, but again it is FAR storage.
1299 * Although we will cope with a later change in dither_mode,
1300 * we do not promise to honor max_memory_to_use if dither_mode changes.
1301 */
1302 if (cinfo->dither_mode == JDITHER_FS) {
1303 cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
1304 ((j_common_ptr) cinfo, JPOOL_IMAGE,
1305 (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));
1306 /* Might as well create the error-limiting table too. */
1307 init_error_limit(cinfo);
1308 }
1309}
1310
1311#endif /* QUANT_2PASS_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jutils.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jutils.c
new file mode 100644
index 0000000..037a795
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jutils.c
@@ -0,0 +1,227 @@
1/*
2 * jutils.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modified 2009-2011 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains tables and miscellaneous utility routines needed
10 * for both compression and decompression.
11 * Note we prefix all global names with "j" to minimize conflicts with
12 * a surrounding application.
13 */
14
15#define JPEG_INTERNALS
16#include "jinclude.h"
17#include "jpeglib.h"
18
19
20/*
21 * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element
22 * of a DCT block read in natural order (left to right, top to bottom).
23 */
24
25#if 0 /* This table is not actually needed in v6a */
26
27const int jpeg_zigzag_order[DCTSIZE2] = {
28 0, 1, 5, 6, 14, 15, 27, 28,
29 2, 4, 7, 13, 16, 26, 29, 42,
30 3, 8, 12, 17, 25, 30, 41, 43,
31 9, 11, 18, 24, 31, 40, 44, 53,
32 10, 19, 23, 32, 39, 45, 52, 54,
33 20, 22, 33, 38, 46, 51, 55, 60,
34 21, 34, 37, 47, 50, 56, 59, 61,
35 35, 36, 48, 49, 57, 58, 62, 63
36};
37
38#endif
39
40/*
41 * jpeg_natural_order[i] is the natural-order position of the i'th element
42 * of zigzag order.
43 *
44 * When reading corrupted data, the Huffman decoders could attempt
45 * to reference an entry beyond the end of this array (if the decoded
46 * zero run length reaches past the end of the block). To prevent
47 * wild stores without adding an inner-loop test, we put some extra
48 * "63"s after the real entries. This will cause the extra coefficient
49 * to be stored in location 63 of the block, not somewhere random.
50 * The worst case would be a run-length of 15, which means we need 16
51 * fake entries.
52 */
53
54const int jpeg_natural_order[DCTSIZE2+16] = {
55 0, 1, 8, 16, 9, 2, 3, 10,
56 17, 24, 32, 25, 18, 11, 4, 5,
57 12, 19, 26, 33, 40, 48, 41, 34,
58 27, 20, 13, 6, 7, 14, 21, 28,
59 35, 42, 49, 56, 57, 50, 43, 36,
60 29, 22, 15, 23, 30, 37, 44, 51,
61 58, 59, 52, 45, 38, 31, 39, 46,
62 53, 60, 61, 54, 47, 55, 62, 63,
63 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
64 63, 63, 63, 63, 63, 63, 63, 63
65};
66
67const int jpeg_natural_order7[7*7+16] = {
68 0, 1, 8, 16, 9, 2, 3, 10,
69 17, 24, 32, 25, 18, 11, 4, 5,
70 12, 19, 26, 33, 40, 48, 41, 34,
71 27, 20, 13, 6, 14, 21, 28, 35,
72 42, 49, 50, 43, 36, 29, 22, 30,
73 37, 44, 51, 52, 45, 38, 46, 53,
74 54,
75 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
76 63, 63, 63, 63, 63, 63, 63, 63
77};
78
79const int jpeg_natural_order6[6*6+16] = {
80 0, 1, 8, 16, 9, 2, 3, 10,
81 17, 24, 32, 25, 18, 11, 4, 5,
82 12, 19, 26, 33, 40, 41, 34, 27,
83 20, 13, 21, 28, 35, 42, 43, 36,
84 29, 37, 44, 45,
85 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
86 63, 63, 63, 63, 63, 63, 63, 63
87};
88
89const int jpeg_natural_order5[5*5+16] = {
90 0, 1, 8, 16, 9, 2, 3, 10,
91 17, 24, 32, 25, 18, 11, 4, 12,
92 19, 26, 33, 34, 27, 20, 28, 35,
93 36,
94 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
95 63, 63, 63, 63, 63, 63, 63, 63
96};
97
98const int jpeg_natural_order4[4*4+16] = {
99 0, 1, 8, 16, 9, 2, 3, 10,
100 17, 24, 25, 18, 11, 19, 26, 27,
101 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
102 63, 63, 63, 63, 63, 63, 63, 63
103};
104
105const int jpeg_natural_order3[3*3+16] = {
106 0, 1, 8, 16, 9, 2, 10, 17,
107 18,
108 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
109 63, 63, 63, 63, 63, 63, 63, 63
110};
111
112const int jpeg_natural_order2[2*2+16] = {
113 0, 1, 8, 9,
114 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
115 63, 63, 63, 63, 63, 63, 63, 63
116};
117
118
119/*
120 * Arithmetic utilities
121 */
122
123GLOBAL(long)
124jdiv_round_up (long a, long b)
125/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
126/* Assumes a >= 0, b > 0 */
127{
128 return (a + b - 1L) / b;
129}
130
131
132GLOBAL(long)
133jround_up (long a, long b)
134/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
135/* Assumes a >= 0, b > 0 */
136{
137 a += b - 1L;
138 return a - (a % b);
139}
140
141
142/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
143 * and coefficient-block arrays. This won't work on 80x86 because the arrays
144 * are FAR and we're assuming a small-pointer memory model. However, some
145 * DOS compilers provide far-pointer versions of memcpy() and memset() even
146 * in the small-model libraries. These will be used if USE_FMEM is defined.
147 * Otherwise, the routines below do it the hard way. (The performance cost
148 * is not all that great, because these routines aren't very heavily used.)
149 */
150
151#ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */
152#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size)
153#else /* 80x86 case, define if we can */
154#ifdef USE_FMEM
155#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))
156#else
157/* This function is for use by the FMEMZERO macro defined in jpegint.h.
158 * Do not call this function directly, use the FMEMZERO macro instead.
159 */
160GLOBAL(void)
161jzero_far (void FAR * target, size_t bytestozero)
162/* Zero out a chunk of FAR memory. */
163/* This might be sample-array data, block-array data, or alloc_large data. */
164{
165 register char FAR * ptr = (char FAR *) target;
166 register size_t count;
167
168 for (count = bytestozero; count > 0; count--) {
169 *ptr++ = 0;
170 }
171}
172#endif
173#endif
174
175
176GLOBAL(void)
177jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
178 JSAMPARRAY output_array, int dest_row,
179 int num_rows, JDIMENSION num_cols)
180/* Copy some rows of samples from one place to another.
181 * num_rows rows are copied from input_array[source_row++]
182 * to output_array[dest_row++]; these areas may overlap for duplication.
183 * The source and destination arrays must be at least as wide as num_cols.
184 */
185{
186 register JSAMPROW inptr, outptr;
187#ifdef FMEMCOPY
188 register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
189#else
190 register JDIMENSION count;
191#endif
192 register int row;
193
194 input_array += source_row;
195 output_array += dest_row;
196
197 for (row = num_rows; row > 0; row--) {
198 inptr = *input_array++;
199 outptr = *output_array++;
200#ifdef FMEMCOPY
201 FMEMCOPY(outptr, inptr, count);
202#else
203 for (count = num_cols; count > 0; count--)
204 *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */
205#endif
206 }
207}
208
209
210GLOBAL(void)
211jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
212 JDIMENSION num_blocks)
213/* Copy a row of coefficient blocks from one place to another. */
214{
215#ifdef FMEMCOPY
216 FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
217#else
218 register JCOEFPTR inptr, outptr;
219 register long count;
220
221 inptr = (JCOEFPTR) input_row;
222 outptr = (JCOEFPTR) output_row;
223 for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
224 *outptr++ = *inptr++;
225 }
226#endif
227}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jversion.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jversion.h
new file mode 100644
index 0000000..84658eb
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/jversion.h
@@ -0,0 +1,14 @@
1/*
2 * jversion.h
3 *
4 * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains software version identification.
9 */
10
11
12#define JVERSION "8d 15-Jan-2012"
13
14#define JCOPYRIGHT "Copyright (C) 2012, Thomas G. Lane, Guido Vollbeding"
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.map b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.map
new file mode 100644
index 0000000..5f1ea76
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.map
@@ -0,0 +1,4 @@
1LIBJPEG_8.0 {
2 global:
3 *;
4};
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.txt
new file mode 100644
index 0000000..98394c8
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/libjpeg.txt
@@ -0,0 +1,3085 @@
1USING THE IJG JPEG LIBRARY
2
3Copyright (C) 1994-2011, Thomas G. Lane, Guido Vollbeding.
4This file is part of the Independent JPEG Group's software.
5For conditions of distribution and use, see the accompanying README file.
6
7
8This file describes how to use the IJG JPEG library within an application
9program. Read it if you want to write a program that uses the library.
10
11The file example.c provides heavily commented skeleton code for calling the
12JPEG library. Also see jpeglib.h (the include file to be used by application
13programs) for full details about data structures and function parameter lists.
14The library source code, of course, is the ultimate reference.
15
16Note that there have been *major* changes from the application interface
17presented by IJG version 4 and earlier versions. The old design had several
18inherent limitations, and it had accumulated a lot of cruft as we added
19features while trying to minimize application-interface changes. We have
20sacrificed backward compatibility in the version 5 rewrite, but we think the
21improvements justify this.
22
23
24TABLE OF CONTENTS
25-----------------
26
27Overview:
28 Functions provided by the library
29 Outline of typical usage
30Basic library usage:
31 Data formats
32 Compression details
33 Decompression details
34 Mechanics of usage: include files, linking, etc
35Advanced features:
36 Compression parameter selection
37 Decompression parameter selection
38 Special color spaces
39 Error handling
40 Compressed data handling (source and destination managers)
41 I/O suspension
42 Progressive JPEG support
43 Buffered-image mode
44 Abbreviated datastreams and multiple images
45 Special markers
46 Raw (downsampled) image data
47 Really raw data: DCT coefficients
48 Progress monitoring
49 Memory management
50 Memory usage
51 Library compile-time options
52 Portability considerations
53 Notes for MS-DOS implementors
54
55You should read at least the overview and basic usage sections before trying
56to program with the library. The sections on advanced features can be read
57if and when you need them.
58
59
60OVERVIEW
61========
62
63Functions provided by the library
64---------------------------------
65
66The IJG JPEG library provides C code to read and write JPEG-compressed image
67files. The surrounding application program receives or supplies image data a
68scanline at a time, using a straightforward uncompressed image format. All
69details of color conversion and other preprocessing/postprocessing can be
70handled by the library.
71
72The library includes a substantial amount of code that is not covered by the
73JPEG standard but is necessary for typical applications of JPEG. These
74functions preprocess the image before JPEG compression or postprocess it after
75decompression. They include colorspace conversion, downsampling/upsampling,
76and color quantization. The application indirectly selects use of this code
77by specifying the format in which it wishes to supply or receive image data.
78For example, if colormapped output is requested, then the decompression
79library automatically invokes color quantization.
80
81A wide range of quality vs. speed tradeoffs are possible in JPEG processing,
82and even more so in decompression postprocessing. The decompression library
83provides multiple implementations that cover most of the useful tradeoffs,
84ranging from very-high-quality down to fast-preview operation. On the
85compression side we have generally not provided low-quality choices, since
86compression is normally less time-critical. It should be understood that the
87low-quality modes may not meet the JPEG standard's accuracy requirements;
88nonetheless, they are useful for viewers.
89
90A word about functions *not* provided by the library. We handle a subset of
91the ISO JPEG standard; most baseline, extended-sequential, and progressive
92JPEG processes are supported. (Our subset includes all features now in common
93use.) Unsupported ISO options include:
94 * Hierarchical storage
95 * Lossless JPEG
96 * DNL marker
97 * Nonintegral subsampling ratios
98We support both 8- and 12-bit data precision, but this is a compile-time
99choice rather than a run-time choice; hence it is difficult to use both
100precisions in a single application.
101
102By itself, the library handles only interchange JPEG datastreams --- in
103particular the widely used JFIF file format. The library can be used by
104surrounding code to process interchange or abbreviated JPEG datastreams that
105are embedded in more complex file formats. (For example, this library is
106used by the free LIBTIFF library to support JPEG compression in TIFF.)
107
108
109Outline of typical usage
110------------------------
111
112The rough outline of a JPEG compression operation is:
113
114 Allocate and initialize a JPEG compression object
115 Specify the destination for the compressed data (eg, a file)
116 Set parameters for compression, including image size & colorspace
117 jpeg_start_compress(...);
118 while (scan lines remain to be written)
119 jpeg_write_scanlines(...);
120 jpeg_finish_compress(...);
121 Release the JPEG compression object
122
123A JPEG compression object holds parameters and working state for the JPEG
124library. We make creation/destruction of the object separate from starting
125or finishing compression of an image; the same object can be re-used for a
126series of image compression operations. This makes it easy to re-use the
127same parameter settings for a sequence of images. Re-use of a JPEG object
128also has important implications for processing abbreviated JPEG datastreams,
129as discussed later.
130
131The image data to be compressed is supplied to jpeg_write_scanlines() from
132in-memory buffers. If the application is doing file-to-file compression,
133reading image data from the source file is the application's responsibility.
134The library emits compressed data by calling a "data destination manager",
135which typically will write the data into a file; but the application can
136provide its own destination manager to do something else.
137
138Similarly, the rough outline of a JPEG decompression operation is:
139
140 Allocate and initialize a JPEG decompression object
141 Specify the source of the compressed data (eg, a file)
142 Call jpeg_read_header() to obtain image info
143 Set parameters for decompression
144 jpeg_start_decompress(...);
145 while (scan lines remain to be read)
146 jpeg_read_scanlines(...);
147 jpeg_finish_decompress(...);
148 Release the JPEG decompression object
149
150This is comparable to the compression outline except that reading the
151datastream header is a separate step. This is helpful because information
152about the image's size, colorspace, etc is available when the application
153selects decompression parameters. For example, the application can choose an
154output scaling ratio that will fit the image into the available screen size.
155
156The decompression library obtains compressed data by calling a data source
157manager, which typically will read the data from a file; but other behaviors
158can be obtained with a custom source manager. Decompressed data is delivered
159into in-memory buffers passed to jpeg_read_scanlines().
160
161It is possible to abort an incomplete compression or decompression operation
162by calling jpeg_abort(); or, if you do not need to retain the JPEG object,
163simply release it by calling jpeg_destroy().
164
165JPEG compression and decompression objects are two separate struct types.
166However, they share some common fields, and certain routines such as
167jpeg_destroy() can work on either type of object.
168
169The JPEG library has no static variables: all state is in the compression
170or decompression object. Therefore it is possible to process multiple
171compression and decompression operations concurrently, using multiple JPEG
172objects.
173
174Both compression and decompression can be done in an incremental memory-to-
175memory fashion, if suitable source/destination managers are used. See the
176section on "I/O suspension" for more details.
177
178
179BASIC LIBRARY USAGE
180===================
181
182Data formats
183------------
184
185Before diving into procedural details, it is helpful to understand the
186image data format that the JPEG library expects or returns.
187
188The standard input image format is a rectangular array of pixels, with each
189pixel having the same number of "component" or "sample" values (color
190channels). You must specify how many components there are and the colorspace
191interpretation of the components. Most applications will use RGB data
192(three components per pixel) or grayscale data (one component per pixel).
193PLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE.
194A remarkable number of people manage to miss this, only to find that their
195programs don't work with grayscale JPEG files.
196
197There is no provision for colormapped input. JPEG files are always full-color
198or full grayscale (or sometimes another colorspace such as CMYK). You can
199feed in a colormapped image by expanding it to full-color format. However
200JPEG often doesn't work very well with source data that has been colormapped,
201because of dithering noise. This is discussed in more detail in the JPEG FAQ
202and the other references mentioned in the README file.
203
204Pixels are stored by scanlines, with each scanline running from left to
205right. The component values for each pixel are adjacent in the row; for
206example, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color. Each scanline is an
207array of data type JSAMPLE --- which is typically "unsigned char", unless
208you've changed jmorecfg.h. (You can also change the RGB pixel layout, say
209to B,G,R order, by modifying jmorecfg.h. But see the restrictions listed in
210that file before doing so.)
211
212A 2-D array of pixels is formed by making a list of pointers to the starts of
213scanlines; so the scanlines need not be physically adjacent in memory. Even
214if you process just one scanline at a time, you must make a one-element
215pointer array to conform to this structure. Pointers to JSAMPLE rows are of
216type JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY.
217
218The library accepts or supplies one or more complete scanlines per call.
219It is not possible to process part of a row at a time. Scanlines are always
220processed top-to-bottom. You can process an entire image in one call if you
221have it all in memory, but usually it's simplest to process one scanline at
222a time.
223
224For best results, source data values should have the precision specified by
225BITS_IN_JSAMPLE (normally 8 bits). For instance, if you choose to compress
226data that's only 6 bits/channel, you should left-justify each value in a
227byte before passing it to the compressor. If you need to compress data
228that has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 12.
229(See "Library compile-time options", later.)
230
231
232The data format returned by the decompressor is the same in all details,
233except that colormapped output is supported. (Again, a JPEG file is never
234colormapped. But you can ask the decompressor to perform on-the-fly color
235quantization to deliver colormapped output.) If you request colormapped
236output then the returned data array contains a single JSAMPLE per pixel;
237its value is an index into a color map. The color map is represented as
238a 2-D JSAMPARRAY in which each row holds the values of one color component,
239that is, colormap[i][j] is the value of the i'th color component for pixel
240value (map index) j. Note that since the colormap indexes are stored in
241JSAMPLEs, the maximum number of colors is limited by the size of JSAMPLE
242(ie, at most 256 colors for an 8-bit JPEG library).
243
244
245Compression details
246-------------------
247
248Here we revisit the JPEG compression outline given in the overview.
249
2501. Allocate and initialize a JPEG compression object.
251
252A JPEG compression object is a "struct jpeg_compress_struct". (It also has
253a bunch of subsidiary structures which are allocated via malloc(), but the
254application doesn't control those directly.) This struct can be just a local
255variable in the calling routine, if a single routine is going to execute the
256whole JPEG compression sequence. Otherwise it can be static or allocated
257from malloc().
258
259You will also need a structure representing a JPEG error handler. The part
260of this that the library cares about is a "struct jpeg_error_mgr". If you
261are providing your own error handler, you'll typically want to embed the
262jpeg_error_mgr struct in a larger structure; this is discussed later under
263"Error handling". For now we'll assume you are just using the default error
264handler. The default error handler will print JPEG error/warning messages
265on stderr, and it will call exit() if a fatal error occurs.
266
267You must initialize the error handler structure, store a pointer to it into
268the JPEG object's "err" field, and then call jpeg_create_compress() to
269initialize the rest of the JPEG object.
270
271Typical code for this step, if you are using the default error handler, is
272
273 struct jpeg_compress_struct cinfo;
274 struct jpeg_error_mgr jerr;
275 ...
276 cinfo.err = jpeg_std_error(&jerr);
277 jpeg_create_compress(&cinfo);
278
279jpeg_create_compress allocates a small amount of memory, so it could fail
280if you are out of memory. In that case it will exit via the error handler;
281that's why the error handler must be initialized first.
282
283
2842. Specify the destination for the compressed data (eg, a file).
285
286As previously mentioned, the JPEG library delivers compressed data to a
287"data destination" module. The library includes one data destination
288module which knows how to write to a stdio stream. You can use your own
289destination module if you want to do something else, as discussed later.
290
291If you use the standard destination module, you must open the target stdio
292stream beforehand. Typical code for this step looks like:
293
294 FILE * outfile;
295 ...
296 if ((outfile = fopen(filename, "wb")) == NULL) {
297 fprintf(stderr, "can't open %s\n", filename);
298 exit(1);
299 }
300 jpeg_stdio_dest(&cinfo, outfile);
301
302where the last line invokes the standard destination module.
303
304WARNING: it is critical that the binary compressed data be delivered to the
305output file unchanged. On non-Unix systems the stdio library may perform
306newline translation or otherwise corrupt binary data. To suppress this
307behavior, you may need to use a "b" option to fopen (as shown above), or use
308setmode() or another routine to put the stdio stream in binary mode. See
309cjpeg.c and djpeg.c for code that has been found to work on many systems.
310
311You can select the data destination after setting other parameters (step 3),
312if that's more convenient. You may not change the destination between
313calling jpeg_start_compress() and jpeg_finish_compress().
314
315
3163. Set parameters for compression, including image size & colorspace.
317
318You must supply information about the source image by setting the following
319fields in the JPEG object (cinfo structure):
320
321 image_width Width of image, in pixels
322 image_height Height of image, in pixels
323 input_components Number of color channels (samples per pixel)
324 in_color_space Color space of source image
325
326The image dimensions are, hopefully, obvious. JPEG supports image dimensions
327of 1 to 64K pixels in either direction. The input color space is typically
328RGB or grayscale, and input_components is 3 or 1 accordingly. (See "Special
329color spaces", later, for more info.) The in_color_space field must be
330assigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or
331JCS_GRAYSCALE.
332
333JPEG has a large number of compression parameters that determine how the
334image is encoded. Most applications don't need or want to know about all
335these parameters. You can set all the parameters to reasonable defaults by
336calling jpeg_set_defaults(); then, if there are particular values you want
337to change, you can do so after that. The "Compression parameter selection"
338section tells about all the parameters.
339
340You must set in_color_space correctly before calling jpeg_set_defaults(),
341because the defaults depend on the source image colorspace. However the
342other three source image parameters need not be valid until you call
343jpeg_start_compress(). There's no harm in calling jpeg_set_defaults() more
344than once, if that happens to be convenient.
345
346Typical code for a 24-bit RGB source image is
347
348 cinfo.image_width = Width; /* image width and height, in pixels */
349 cinfo.image_height = Height;
350 cinfo.input_components = 3; /* # of color components per pixel */
351 cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
352
353 jpeg_set_defaults(&cinfo);
354 /* Make optional parameter settings here */
355
356
3574. jpeg_start_compress(...);
358
359After you have established the data destination and set all the necessary
360source image info and other parameters, call jpeg_start_compress() to begin
361a compression cycle. This will initialize internal state, allocate working
362storage, and emit the first few bytes of the JPEG datastream header.
363
364Typical code:
365
366 jpeg_start_compress(&cinfo, TRUE);
367
368The "TRUE" parameter ensures that a complete JPEG interchange datastream
369will be written. This is appropriate in most cases. If you think you might
370want to use an abbreviated datastream, read the section on abbreviated
371datastreams, below.
372
373Once you have called jpeg_start_compress(), you may not alter any JPEG
374parameters or other fields of the JPEG object until you have completed
375the compression cycle.
376
377
3785. while (scan lines remain to be written)
379 jpeg_write_scanlines(...);
380
381Now write all the required image data by calling jpeg_write_scanlines()
382one or more times. You can pass one or more scanlines in each call, up
383to the total image height. In most applications it is convenient to pass
384just one or a few scanlines at a time. The expected format for the passed
385data is discussed under "Data formats", above.
386
387Image data should be written in top-to-bottom scanline order. The JPEG spec
388contains some weasel wording about how top and bottom are application-defined
389terms (a curious interpretation of the English language...) but if you want
390your files to be compatible with everyone else's, you WILL use top-to-bottom
391order. If the source data must be read in bottom-to-top order, you can use
392the JPEG library's virtual array mechanism to invert the data efficiently.
393Examples of this can be found in the sample application cjpeg.
394
395The library maintains a count of the number of scanlines written so far
396in the next_scanline field of the JPEG object. Usually you can just use
397this variable as the loop counter, so that the loop test looks like
398"while (cinfo.next_scanline < cinfo.image_height)".
399
400Code for this step depends heavily on the way that you store the source data.
401example.c shows the following code for the case of a full-size 2-D source
402array containing 3-byte RGB pixels:
403
404 JSAMPROW row_pointer[1]; /* pointer to a single row */
405 int row_stride; /* physical row width in buffer */
406
407 row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
408
409 while (cinfo.next_scanline < cinfo.image_height) {
410 row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
411 jpeg_write_scanlines(&cinfo, row_pointer, 1);
412 }
413
414jpeg_write_scanlines() returns the number of scanlines actually written.
415This will normally be equal to the number passed in, so you can usually
416ignore the return value. It is different in just two cases:
417 * If you try to write more scanlines than the declared image height,
418 the additional scanlines are ignored.
419 * If you use a suspending data destination manager, output buffer overrun
420 will cause the compressor to return before accepting all the passed lines.
421 This feature is discussed under "I/O suspension", below. The normal
422 stdio destination manager will NOT cause this to happen.
423In any case, the return value is the same as the change in the value of
424next_scanline.
425
426
4276. jpeg_finish_compress(...);
428
429After all the image data has been written, call jpeg_finish_compress() to
430complete the compression cycle. This step is ESSENTIAL to ensure that the
431last bufferload of data is written to the data destination.
432jpeg_finish_compress() also releases working memory associated with the JPEG
433object.
434
435Typical code:
436
437 jpeg_finish_compress(&cinfo);
438
439If using the stdio destination manager, don't forget to close the output
440stdio stream (if necessary) afterwards.
441
442If you have requested a multi-pass operating mode, such as Huffman code
443optimization, jpeg_finish_compress() will perform the additional passes using
444data buffered by the first pass. In this case jpeg_finish_compress() may take
445quite a while to complete. With the default compression parameters, this will
446not happen.
447
448It is an error to call jpeg_finish_compress() before writing the necessary
449total number of scanlines. If you wish to abort compression, call
450jpeg_abort() as discussed below.
451
452After completing a compression cycle, you may dispose of the JPEG object
453as discussed next, or you may use it to compress another image. In that case
454return to step 2, 3, or 4 as appropriate. If you do not change the
455destination manager, the new datastream will be written to the same target.
456If you do not change any JPEG parameters, the new datastream will be written
457with the same parameters as before. Note that you can change the input image
458dimensions freely between cycles, but if you change the input colorspace, you
459should call jpeg_set_defaults() to adjust for the new colorspace; and then
460you'll need to repeat all of step 3.
461
462
4637. Release the JPEG compression object.
464
465When you are done with a JPEG compression object, destroy it by calling
466jpeg_destroy_compress(). This will free all subsidiary memory (regardless of
467the previous state of the object). Or you can call jpeg_destroy(), which
468works for either compression or decompression objects --- this may be more
469convenient if you are sharing code between compression and decompression
470cases. (Actually, these routines are equivalent except for the declared type
471of the passed pointer. To avoid gripes from ANSI C compilers, jpeg_destroy()
472should be passed a j_common_ptr.)
473
474If you allocated the jpeg_compress_struct structure from malloc(), freeing
475it is your responsibility --- jpeg_destroy() won't. Ditto for the error
476handler structure.
477
478Typical code:
479
480 jpeg_destroy_compress(&cinfo);
481
482
4838. Aborting.
484
485If you decide to abort a compression cycle before finishing, you can clean up
486in either of two ways:
487
488* If you don't need the JPEG object any more, just call
489 jpeg_destroy_compress() or jpeg_destroy() to release memory. This is
490 legitimate at any point after calling jpeg_create_compress() --- in fact,
491 it's safe even if jpeg_create_compress() fails.
492
493* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call
494 jpeg_abort() which works on both compression and decompression objects.
495 This will return the object to an idle state, releasing any working memory.
496 jpeg_abort() is allowed at any time after successful object creation.
497
498Note that cleaning up the data destination, if required, is your
499responsibility; neither of these routines will call term_destination().
500(See "Compressed data handling", below, for more about that.)
501
502jpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG
503object that has reported an error by calling error_exit (see "Error handling"
504for more info). The internal state of such an object is likely to be out of
505whack. Either of these two routines will return the object to a known state.
506
507
508Decompression details
509---------------------
510
511Here we revisit the JPEG decompression outline given in the overview.
512
5131. Allocate and initialize a JPEG decompression object.
514
515This is just like initialization for compression, as discussed above,
516except that the object is a "struct jpeg_decompress_struct" and you
517call jpeg_create_decompress(). Error handling is exactly the same.
518
519Typical code:
520
521 struct jpeg_decompress_struct cinfo;
522 struct jpeg_error_mgr jerr;
523 ...
524 cinfo.err = jpeg_std_error(&jerr);
525 jpeg_create_decompress(&cinfo);
526
527(Both here and in the IJG code, we usually use variable name "cinfo" for
528both compression and decompression objects.)
529
530
5312. Specify the source of the compressed data (eg, a file).
532
533As previously mentioned, the JPEG library reads compressed data from a "data
534source" module. The library includes one data source module which knows how
535to read from a stdio stream. You can use your own source module if you want
536to do something else, as discussed later.
537
538If you use the standard source module, you must open the source stdio stream
539beforehand. Typical code for this step looks like:
540
541 FILE * infile;
542 ...
543 if ((infile = fopen(filename, "rb")) == NULL) {
544 fprintf(stderr, "can't open %s\n", filename);
545 exit(1);
546 }
547 jpeg_stdio_src(&cinfo, infile);
548
549where the last line invokes the standard source module.
550
551WARNING: it is critical that the binary compressed data be read unchanged.
552On non-Unix systems the stdio library may perform newline translation or
553otherwise corrupt binary data. To suppress this behavior, you may need to use
554a "b" option to fopen (as shown above), or use setmode() or another routine to
555put the stdio stream in binary mode. See cjpeg.c and djpeg.c for code that
556has been found to work on many systems.
557
558You may not change the data source between calling jpeg_read_header() and
559jpeg_finish_decompress(). If you wish to read a series of JPEG images from
560a single source file, you should repeat the jpeg_read_header() to
561jpeg_finish_decompress() sequence without reinitializing either the JPEG
562object or the data source module; this prevents buffered input data from
563being discarded.
564
565
5663. Call jpeg_read_header() to obtain image info.
567
568Typical code for this step is just
569
570 jpeg_read_header(&cinfo, TRUE);
571
572This will read the source datastream header markers, up to the beginning
573of the compressed data proper. On return, the image dimensions and other
574info have been stored in the JPEG object. The application may wish to
575consult this information before selecting decompression parameters.
576
577More complex code is necessary if
578 * A suspending data source is used --- in that case jpeg_read_header()
579 may return before it has read all the header data. See "I/O suspension",
580 below. The normal stdio source manager will NOT cause this to happen.
581 * Abbreviated JPEG files are to be processed --- see the section on
582 abbreviated datastreams. Standard applications that deal only in
583 interchange JPEG files need not be concerned with this case either.
584
585It is permissible to stop at this point if you just wanted to find out the
586image dimensions and other header info for a JPEG file. In that case,
587call jpeg_destroy() when you are done with the JPEG object, or call
588jpeg_abort() to return it to an idle state before selecting a new data
589source and reading another header.
590
591
5924. Set parameters for decompression.
593
594jpeg_read_header() sets appropriate default decompression parameters based on
595the properties of the image (in particular, its colorspace). However, you
596may well want to alter these defaults before beginning the decompression.
597For example, the default is to produce full color output from a color file.
598If you want colormapped output you must ask for it. Other options allow the
599returned image to be scaled and allow various speed/quality tradeoffs to be
600selected. "Decompression parameter selection", below, gives details.
601
602If the defaults are appropriate, nothing need be done at this step.
603
604Note that all default values are set by each call to jpeg_read_header().
605If you reuse a decompression object, you cannot expect your parameter
606settings to be preserved across cycles, as you can for compression.
607You must set desired parameter values each time.
608
609
6105. jpeg_start_decompress(...);
611
612Once the parameter values are satisfactory, call jpeg_start_decompress() to
613begin decompression. This will initialize internal state, allocate working
614memory, and prepare for returning data.
615
616Typical code is just
617
618 jpeg_start_decompress(&cinfo);
619
620If you have requested a multi-pass operating mode, such as 2-pass color
621quantization, jpeg_start_decompress() will do everything needed before data
622output can begin. In this case jpeg_start_decompress() may take quite a while
623to complete. With a single-scan (non progressive) JPEG file and default
624decompression parameters, this will not happen; jpeg_start_decompress() will
625return quickly.
626
627After this call, the final output image dimensions, including any requested
628scaling, are available in the JPEG object; so is the selected colormap, if
629colormapped output has been requested. Useful fields include
630
631 output_width image width and height, as scaled
632 output_height
633 out_color_components # of color components in out_color_space
634 output_components # of color components returned per pixel
635 colormap the selected colormap, if any
636 actual_number_of_colors number of entries in colormap
637
638output_components is 1 (a colormap index) when quantizing colors; otherwise it
639equals out_color_components. It is the number of JSAMPLE values that will be
640emitted per pixel in the output arrays.
641
642Typically you will need to allocate data buffers to hold the incoming image.
643You will need output_width * output_components JSAMPLEs per scanline in your
644output buffer, and a total of output_height scanlines will be returned.
645
646Note: if you are using the JPEG library's internal memory manager to allocate
647data buffers (as djpeg does), then the manager's protocol requires that you
648request large buffers *before* calling jpeg_start_decompress(). This is a
649little tricky since the output_XXX fields are not normally valid then. You
650can make them valid by calling jpeg_calc_output_dimensions() after setting the
651relevant parameters (scaling, output color space, and quantization flag).
652
653
6546. while (scan lines remain to be read)
655 jpeg_read_scanlines(...);
656
657Now you can read the decompressed image data by calling jpeg_read_scanlines()
658one or more times. At each call, you pass in the maximum number of scanlines
659to be read (ie, the height of your working buffer); jpeg_read_scanlines()
660will return up to that many lines. The return value is the number of lines
661actually read. The format of the returned data is discussed under "Data
662formats", above. Don't forget that grayscale and color JPEGs will return
663different data formats!
664
665Image data is returned in top-to-bottom scanline order. If you must write
666out the image in bottom-to-top order, you can use the JPEG library's virtual
667array mechanism to invert the data efficiently. Examples of this can be
668found in the sample application djpeg.
669
670The library maintains a count of the number of scanlines returned so far
671in the output_scanline field of the JPEG object. Usually you can just use
672this variable as the loop counter, so that the loop test looks like
673"while (cinfo.output_scanline < cinfo.output_height)". (Note that the test
674should NOT be against image_height, unless you never use scaling. The
675image_height field is the height of the original unscaled image.)
676The return value always equals the change in the value of output_scanline.
677
678If you don't use a suspending data source, it is safe to assume that
679jpeg_read_scanlines() reads at least one scanline per call, until the
680bottom of the image has been reached.
681
682If you use a buffer larger than one scanline, it is NOT safe to assume that
683jpeg_read_scanlines() fills it. (The current implementation returns only a
684few scanlines per call, no matter how large a buffer you pass.) So you must
685always provide a loop that calls jpeg_read_scanlines() repeatedly until the
686whole image has been read.
687
688
6897. jpeg_finish_decompress(...);
690
691After all the image data has been read, call jpeg_finish_decompress() to
692complete the decompression cycle. This causes working memory associated
693with the JPEG object to be released.
694
695Typical code:
696
697 jpeg_finish_decompress(&cinfo);
698
699If using the stdio source manager, don't forget to close the source stdio
700stream if necessary.
701
702It is an error to call jpeg_finish_decompress() before reading the correct
703total number of scanlines. If you wish to abort decompression, call
704jpeg_abort() as discussed below.
705
706After completing a decompression cycle, you may dispose of the JPEG object as
707discussed next, or you may use it to decompress another image. In that case
708return to step 2 or 3 as appropriate. If you do not change the source
709manager, the next image will be read from the same source.
710
711
7128. Release the JPEG decompression object.
713
714When you are done with a JPEG decompression object, destroy it by calling
715jpeg_destroy_decompress() or jpeg_destroy(). The previous discussion of
716destroying compression objects applies here too.
717
718Typical code:
719
720 jpeg_destroy_decompress(&cinfo);
721
722
7239. Aborting.
724
725You can abort a decompression cycle by calling jpeg_destroy_decompress() or
726jpeg_destroy() if you don't need the JPEG object any more, or
727jpeg_abort_decompress() or jpeg_abort() if you want to reuse the object.
728The previous discussion of aborting compression cycles applies here too.
729
730
731Mechanics of usage: include files, linking, etc
732-----------------------------------------------
733
734Applications using the JPEG library should include the header file jpeglib.h
735to obtain declarations of data types and routines. Before including
736jpeglib.h, include system headers that define at least the typedefs FILE and
737size_t. On ANSI-conforming systems, including <stdio.h> is sufficient; on
738older Unix systems, you may need <sys/types.h> to define size_t.
739
740If the application needs to refer to individual JPEG library error codes, also
741include jerror.h to define those symbols.
742
743jpeglib.h indirectly includes the files jconfig.h and jmorecfg.h. If you are
744installing the JPEG header files in a system directory, you will want to
745install all four files: jpeglib.h, jerror.h, jconfig.h, jmorecfg.h.
746
747The most convenient way to include the JPEG code into your executable program
748is to prepare a library file ("libjpeg.a", or a corresponding name on non-Unix
749machines) and reference it at your link step. If you use only half of the
750library (only compression or only decompression), only that much code will be
751included from the library, unless your linker is hopelessly brain-damaged.
752The supplied makefiles build libjpeg.a automatically (see install.txt).
753
754While you can build the JPEG library as a shared library if the whim strikes
755you, we don't really recommend it. The trouble with shared libraries is that
756at some point you'll probably try to substitute a new version of the library
757without recompiling the calling applications. That generally doesn't work
758because the parameter struct declarations usually change with each new
759version. In other words, the library's API is *not* guaranteed binary
760compatible across versions; we only try to ensure source-code compatibility.
761(In hindsight, it might have been smarter to hide the parameter structs from
762applications and introduce a ton of access functions instead. Too late now,
763however.)
764
765On some systems your application may need to set up a signal handler to ensure
766that temporary files are deleted if the program is interrupted. This is most
767critical if you are on MS-DOS and use the jmemdos.c memory manager back end;
768it will try to grab extended memory for temp files, and that space will NOT be
769freed automatically. See cjpeg.c or djpeg.c for an example signal handler.
770
771It may be worth pointing out that the core JPEG library does not actually
772require the stdio library: only the default source/destination managers and
773error handler need it. You can use the library in a stdio-less environment
774if you replace those modules and use jmemnobs.c (or another memory manager of
775your own devising). More info about the minimum system library requirements
776may be found in jinclude.h.
777
778
779ADVANCED FEATURES
780=================
781
782Compression parameter selection
783-------------------------------
784
785This section describes all the optional parameters you can set for JPEG
786compression, as well as the "helper" routines provided to assist in this
787task. Proper setting of some parameters requires detailed understanding
788of the JPEG standard; if you don't know what a parameter is for, it's best
789not to mess with it! See REFERENCES in the README file for pointers to
790more info about JPEG.
791
792It's a good idea to call jpeg_set_defaults() first, even if you plan to set
793all the parameters; that way your code is more likely to work with future JPEG
794libraries that have additional parameters. For the same reason, we recommend
795you use a helper routine where one is provided, in preference to twiddling
796cinfo fields directly.
797
798The helper routines are:
799
800jpeg_set_defaults (j_compress_ptr cinfo)
801 This routine sets all JPEG parameters to reasonable defaults, using
802 only the input image's color space (field in_color_space, which must
803 already be set in cinfo). Many applications will only need to use
804 this routine and perhaps jpeg_set_quality().
805
806jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
807 Sets the JPEG file's colorspace (field jpeg_color_space) as specified,
808 and sets other color-space-dependent parameters appropriately. See
809 "Special color spaces", below, before using this. A large number of
810 parameters, including all per-component parameters, are set by this
811 routine; if you want to twiddle individual parameters you should call
812 jpeg_set_colorspace() before rather than after.
813
814jpeg_default_colorspace (j_compress_ptr cinfo)
815 Selects an appropriate JPEG colorspace based on cinfo->in_color_space,
816 and calls jpeg_set_colorspace(). This is actually a subroutine of
817 jpeg_set_defaults(). It's broken out in case you want to change
818 just the colorspace-dependent JPEG parameters.
819
820jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
821 Constructs JPEG quantization tables appropriate for the indicated
822 quality setting. The quality value is expressed on the 0..100 scale
823 recommended by IJG (cjpeg's "-quality" switch uses this routine).
824 Note that the exact mapping from quality values to tables may change
825 in future IJG releases as more is learned about DCT quantization.
826 If the force_baseline parameter is TRUE, then the quantization table
827 entries are constrained to the range 1..255 for full JPEG baseline
828 compatibility. In the current implementation, this only makes a
829 difference for quality settings below 25, and it effectively prevents
830 very small/low quality files from being generated. The IJG decoder
831 is capable of reading the non-baseline files generated at low quality
832 settings when force_baseline is FALSE, but other decoders may not be.
833
834jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
835 boolean force_baseline)
836 Same as jpeg_set_quality() except that the generated tables are the
837 sample tables given in the JPEC spec section K.1, multiplied by the
838 specified scale factor (which is expressed as a percentage; thus
839 scale_factor = 100 reproduces the spec's tables). Note that larger
840 scale factors give lower quality. This entry point is useful for
841 conforming to the Adobe PostScript DCT conventions, but we do not
842 recommend linear scaling as a user-visible quality scale otherwise.
843 force_baseline again constrains the computed table entries to 1..255.
844
845int jpeg_quality_scaling (int quality)
846 Converts a value on the IJG-recommended quality scale to a linear
847 scaling percentage. Note that this routine may change or go away
848 in future releases --- IJG may choose to adopt a scaling method that
849 can't be expressed as a simple scalar multiplier, in which case the
850 premise of this routine collapses. Caveat user.
851
852jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
853 Set default quantization tables with linear q_scale_factor[] values
854 (see below).
855
856jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
857 const unsigned int *basic_table,
858 int scale_factor, boolean force_baseline)
859 Allows an arbitrary quantization table to be created. which_tbl
860 indicates which table slot to fill. basic_table points to an array
861 of 64 unsigned ints given in normal array order. These values are
862 multiplied by scale_factor/100 and then clamped to the range 1..65535
863 (or to 1..255 if force_baseline is TRUE).
864 CAUTION: prior to library version 6a, jpeg_add_quant_table expected
865 the basic table to be given in JPEG zigzag order. If you need to
866 write code that works with either older or newer versions of this
867 routine, you must check the library version number. Something like
868 "#if JPEG_LIB_VERSION >= 61" is the right test.
869
870jpeg_simple_progression (j_compress_ptr cinfo)
871 Generates a default scan script for writing a progressive-JPEG file.
872 This is the recommended method of creating a progressive file,
873 unless you want to make a custom scan sequence. You must ensure that
874 the JPEG color space is set correctly before calling this routine.
875
876
877Compression parameters (cinfo fields) include:
878
879int block_size
880 Set DCT block size. All N from 1 to 16 are possible.
881 Default is 8 (baseline format).
882 Larger values produce higher compression,
883 smaller values produce higher quality.
884 An exact DCT stage is possible with 1 or 2.
885 With the default quality of 75 and default Luminance qtable
886 the DCT+Quantization stage is lossless for value 1.
887 Note that values other than 8 require a SmartScale capable decoder,
888 introduced with IJG JPEG 8. Setting the block_size parameter for
889 compression works with version 8c and later.
890
891J_DCT_METHOD dct_method
892 Selects the algorithm used for the DCT step. Choices are:
893 JDCT_ISLOW: slow but accurate integer algorithm
894 JDCT_IFAST: faster, less accurate integer method
895 JDCT_FLOAT: floating-point method
896 JDCT_DEFAULT: default method (normally JDCT_ISLOW)
897 JDCT_FASTEST: fastest method (normally JDCT_IFAST)
898 The FLOAT method is very slightly more accurate than the ISLOW method,
899 but may give different results on different machines due to varying
900 roundoff behavior. The integer methods should give the same results
901 on all machines. On machines with sufficiently fast FP hardware, the
902 floating-point method may also be the fastest. The IFAST method is
903 considerably less accurate than the other two; its use is not
904 recommended if high quality is a concern. JDCT_DEFAULT and
905 JDCT_FASTEST are macros configurable by each installation.
906
907unsigned int scale_num, scale_denom
908 Scale the image by the fraction scale_num/scale_denom. Default is
909 1/1, or no scaling. Currently, the supported scaling ratios are
910 M/N with all N from 1 to 16, where M is the destination DCT size,
911 which is 8 by default (see block_size parameter above).
912 (The library design allows for arbitrary scaling ratios but this
913 is not likely to be implemented any time soon.)
914
915J_COLOR_SPACE jpeg_color_space
916int num_components
917 The JPEG color space and corresponding number of components; see
918 "Special color spaces", below, for more info. We recommend using
919 jpeg_set_color_space() if you want to change these.
920
921boolean optimize_coding
922 TRUE causes the compressor to compute optimal Huffman coding tables
923 for the image. This requires an extra pass over the data and
924 therefore costs a good deal of space and time. The default is
925 FALSE, which tells the compressor to use the supplied or default
926 Huffman tables. In most cases optimal tables save only a few percent
927 of file size compared to the default tables. Note that when this is
928 TRUE, you need not supply Huffman tables at all, and any you do
929 supply will be overwritten.
930
931unsigned int restart_interval
932int restart_in_rows
933 To emit restart markers in the JPEG file, set one of these nonzero.
934 Set restart_interval to specify the exact interval in MCU blocks.
935 Set restart_in_rows to specify the interval in MCU rows. (If
936 restart_in_rows is not 0, then restart_interval is set after the
937 image width in MCUs is computed.) Defaults are zero (no restarts).
938 One restart marker per MCU row is often a good choice.
939 NOTE: the overhead of restart markers is higher in grayscale JPEG
940 files than in color files, and MUCH higher in progressive JPEGs.
941 If you use restarts, you may want to use larger intervals in those
942 cases.
943
944const jpeg_scan_info * scan_info
945int num_scans
946 By default, scan_info is NULL; this causes the compressor to write a
947 single-scan sequential JPEG file. If not NULL, scan_info points to
948 an array of scan definition records of length num_scans. The
949 compressor will then write a JPEG file having one scan for each scan
950 definition record. This is used to generate noninterleaved or
951 progressive JPEG files. The library checks that the scan array
952 defines a valid JPEG scan sequence. (jpeg_simple_progression creates
953 a suitable scan definition array for progressive JPEG.) This is
954 discussed further under "Progressive JPEG support".
955
956boolean do_fancy_downsampling
957 If TRUE, use direct DCT scaling with DCT size > 8 for downsampling
958 of chroma components.
959 If FALSE, use only DCT size <= 8 and simple separate downsampling.
960 Default is TRUE.
961 For better image stability in multiple generation compression cycles
962 it is preferable that this value matches the corresponding
963 do_fancy_upsampling value in decompression.
964
965int smoothing_factor
966 If non-zero, the input image is smoothed; the value should be 1 for
967 minimal smoothing to 100 for maximum smoothing. Consult jcsample.c
968 for details of the smoothing algorithm. The default is zero.
969
970boolean write_JFIF_header
971 If TRUE, a JFIF APP0 marker is emitted. jpeg_set_defaults() and
972 jpeg_set_colorspace() set this TRUE if a JFIF-legal JPEG color space
973 (ie, YCbCr or grayscale) is selected, otherwise FALSE.
974
975UINT8 JFIF_major_version
976UINT8 JFIF_minor_version
977 The version number to be written into the JFIF marker.
978 jpeg_set_defaults() initializes the version to 1.01 (major=minor=1).
979 You should set it to 1.02 (major=1, minor=2) if you plan to write
980 any JFIF 1.02 extension markers.
981
982UINT8 density_unit
983UINT16 X_density
984UINT16 Y_density
985 The resolution information to be written into the JFIF marker;
986 not used otherwise. density_unit may be 0 for unknown,
987 1 for dots/inch, or 2 for dots/cm. The default values are 0,1,1
988 indicating square pixels of unknown size.
989
990boolean write_Adobe_marker
991 If TRUE, an Adobe APP14 marker is emitted. jpeg_set_defaults() and
992 jpeg_set_colorspace() set this TRUE if JPEG color space RGB, CMYK,
993 or YCCK is selected, otherwise FALSE. It is generally a bad idea
994 to set both write_JFIF_header and write_Adobe_marker. In fact,
995 you probably shouldn't change the default settings at all --- the
996 default behavior ensures that the JPEG file's color space can be
997 recognized by the decoder.
998
999JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
1000 Pointers to coefficient quantization tables, one per table slot,
1001 or NULL if no table is defined for a slot. Usually these should
1002 be set via one of the above helper routines; jpeg_add_quant_table()
1003 is general enough to define any quantization table. The other
1004 routines will set up table slot 0 for luminance quality and table
1005 slot 1 for chrominance.
1006
1007int q_scale_factor[NUM_QUANT_TBLS]
1008 Linear quantization scaling factors (percentage, initialized 100)
1009 for use with jpeg_default_qtables().
1010 See rdswitch.c and cjpeg.c for an example of usage.
1011 Note that the q_scale_factor[] fields are the "linear" scales, so you
1012 have to convert from user-defined ratings via jpeg_quality_scaling().
1013 Here is an example code which corresponds to cjpeg -quality 90,70:
1014
1015 jpeg_set_defaults(cinfo);
1016
1017 /* Set luminance quality 90. */
1018 cinfo->q_scale_factor[0] = jpeg_quality_scaling(90);
1019 /* Set chrominance quality 70. */
1020 cinfo->q_scale_factor[1] = jpeg_quality_scaling(70);
1021
1022 jpeg_default_qtables(cinfo, force_baseline);
1023
1024 CAUTION: You must also set 1x1 subsampling for efficient separate
1025 color quality selection, since the default value used by library
1026 is 2x2:
1027
1028 cinfo->comp_info[0].v_samp_factor = 1;
1029 cinfo->comp_info[0].h_samp_factor = 1;
1030
1031JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]
1032JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
1033 Pointers to Huffman coding tables, one per table slot, or NULL if
1034 no table is defined for a slot. Slots 0 and 1 are filled with the
1035 JPEG sample tables by jpeg_set_defaults(). If you need to allocate
1036 more table structures, jpeg_alloc_huff_table() may be used.
1037 Note that optimal Huffman tables can be computed for an image
1038 by setting optimize_coding, as discussed above; there's seldom
1039 any need to mess with providing your own Huffman tables.
1040
1041
1042The actual dimensions of the JPEG image that will be written to the file are
1043given by the following fields. These are computed from the input image
1044dimensions and the compression parameters by jpeg_start_compress(). You can
1045also call jpeg_calc_jpeg_dimensions() to obtain the values that will result
1046from the current parameter settings. This can be useful if you are trying
1047to pick a scaling ratio that will get close to a desired target size.
1048
1049JDIMENSION jpeg_width Actual dimensions of output image.
1050JDIMENSION jpeg_height
1051
1052
1053Per-component parameters are stored in the struct cinfo.comp_info[i] for
1054component number i. Note that components here refer to components of the
1055JPEG color space, *not* the source image color space. A suitably large
1056comp_info[] array is allocated by jpeg_set_defaults(); if you choose not
1057to use that routine, it's up to you to allocate the array.
1058
1059int component_id
1060 The one-byte identifier code to be recorded in the JPEG file for
1061 this component. For the standard color spaces, we recommend you
1062 leave the default values alone.
1063
1064int h_samp_factor
1065int v_samp_factor
1066 Horizontal and vertical sampling factors for the component; must
1067 be 1..4 according to the JPEG standard. Note that larger sampling
1068 factors indicate a higher-resolution component; many people find
1069 this behavior quite unintuitive. The default values are 2,2 for
1070 luminance components and 1,1 for chrominance components, except
1071 for grayscale where 1,1 is used.
1072
1073int quant_tbl_no
1074 Quantization table number for component. The default value is
1075 0 for luminance components and 1 for chrominance components.
1076
1077int dc_tbl_no
1078int ac_tbl_no
1079 DC and AC entropy coding table numbers. The default values are
1080 0 for luminance components and 1 for chrominance components.
1081
1082int component_index
1083 Must equal the component's index in comp_info[]. (Beginning in
1084 release v6, the compressor library will fill this in automatically;
1085 you don't have to.)
1086
1087
1088Decompression parameter selection
1089---------------------------------
1090
1091Decompression parameter selection is somewhat simpler than compression
1092parameter selection, since all of the JPEG internal parameters are
1093recorded in the source file and need not be supplied by the application.
1094(Unless you are working with abbreviated files, in which case see
1095"Abbreviated datastreams", below.) Decompression parameters control
1096the postprocessing done on the image to deliver it in a format suitable
1097for the application's use. Many of the parameters control speed/quality
1098tradeoffs, in which faster decompression may be obtained at the price of
1099a poorer-quality image. The defaults select the highest quality (slowest)
1100processing.
1101
1102The following fields in the JPEG object are set by jpeg_read_header() and
1103may be useful to the application in choosing decompression parameters:
1104
1105JDIMENSION image_width Width and height of image
1106JDIMENSION image_height
1107int num_components Number of color components
1108J_COLOR_SPACE jpeg_color_space Colorspace of image
1109boolean saw_JFIF_marker TRUE if a JFIF APP0 marker was seen
1110 UINT8 JFIF_major_version Version information from JFIF marker
1111 UINT8 JFIF_minor_version
1112 UINT8 density_unit Resolution data from JFIF marker
1113 UINT16 X_density
1114 UINT16 Y_density
1115boolean saw_Adobe_marker TRUE if an Adobe APP14 marker was seen
1116 UINT8 Adobe_transform Color transform code from Adobe marker
1117
1118The JPEG color space, unfortunately, is something of a guess since the JPEG
1119standard proper does not provide a way to record it. In practice most files
1120adhere to the JFIF or Adobe conventions, and the decoder will recognize these
1121correctly. See "Special color spaces", below, for more info.
1122
1123
1124The decompression parameters that determine the basic properties of the
1125returned image are:
1126
1127J_COLOR_SPACE out_color_space
1128 Output color space. jpeg_read_header() sets an appropriate default
1129 based on jpeg_color_space; typically it will be RGB or grayscale.
1130 The application can change this field to request output in a different
1131 colorspace. For example, set it to JCS_GRAYSCALE to get grayscale
1132 output from a color file. (This is useful for previewing: grayscale
1133 output is faster than full color since the color components need not
1134 be processed.) Note that not all possible color space transforms are
1135 currently implemented; you may need to extend jdcolor.c if you want an
1136 unusual conversion.
1137
1138unsigned int scale_num, scale_denom
1139 Scale the image by the fraction scale_num/scale_denom. Currently,
1140 the supported scaling ratios are M/N with all M from 1 to 16, where
1141 N is the source DCT size, which is 8 for baseline JPEG. (The library
1142 design allows for arbitrary scaling ratios but this is not likely
1143 to be implemented any time soon.) The values are initialized by
1144 jpeg_read_header() with the source DCT size. For baseline JPEG
1145 this is 8/8. If you change only the scale_num value while leaving
1146 the other unchanged, then this specifies the DCT scaled size to be
1147 applied on the given input. For baseline JPEG this is equivalent
1148 to M/8 scaling, since the source DCT size for baseline JPEG is 8.
1149 Smaller scaling ratios permit significantly faster decoding since
1150 fewer pixels need be processed and a simpler IDCT method can be used.
1151
1152boolean quantize_colors
1153 If set TRUE, colormapped output will be delivered. Default is FALSE,
1154 meaning that full-color output will be delivered.
1155
1156The next three parameters are relevant only if quantize_colors is TRUE.
1157
1158int desired_number_of_colors
1159 Maximum number of colors to use in generating a library-supplied color
1160 map (the actual number of colors is returned in a different field).
1161 Default 256. Ignored when the application supplies its own color map.
1162
1163boolean two_pass_quantize
1164 If TRUE, an extra pass over the image is made to select a custom color
1165 map for the image. This usually looks a lot better than the one-size-
1166 fits-all colormap that is used otherwise. Default is TRUE. Ignored
1167 when the application supplies its own color map.
1168
1169J_DITHER_MODE dither_mode
1170 Selects color dithering method. Supported values are:
1171 JDITHER_NONE no dithering: fast, very low quality
1172 JDITHER_ORDERED ordered dither: moderate speed and quality
1173 JDITHER_FS Floyd-Steinberg dither: slow, high quality
1174 Default is JDITHER_FS. (At present, ordered dither is implemented
1175 only in the single-pass, standard-colormap case. If you ask for
1176 ordered dither when two_pass_quantize is TRUE or when you supply
1177 an external color map, you'll get F-S dithering.)
1178
1179When quantize_colors is TRUE, the target color map is described by the next
1180two fields. colormap is set to NULL by jpeg_read_header(). The application
1181can supply a color map by setting colormap non-NULL and setting
1182actual_number_of_colors to the map size. Otherwise, jpeg_start_decompress()
1183selects a suitable color map and sets these two fields itself.
1184[Implementation restriction: at present, an externally supplied colormap is
1185only accepted for 3-component output color spaces.]
1186
1187JSAMPARRAY colormap
1188 The color map, represented as a 2-D pixel array of out_color_components
1189 rows and actual_number_of_colors columns. Ignored if not quantizing.
1190 CAUTION: if the JPEG library creates its own colormap, the storage
1191 pointed to by this field is released by jpeg_finish_decompress().
1192 Copy the colormap somewhere else first, if you want to save it.
1193
1194int actual_number_of_colors
1195 The number of colors in the color map.
1196
1197Additional decompression parameters that the application may set include:
1198
1199J_DCT_METHOD dct_method
1200 Selects the algorithm used for the DCT step. Choices are the same
1201 as described above for compression.
1202
1203boolean do_fancy_upsampling
1204 If TRUE, use direct DCT scaling with DCT size > 8 for upsampling
1205 of chroma components.
1206 If FALSE, use only DCT size <= 8 and simple separate upsampling.
1207 Default is TRUE.
1208 For better image stability in multiple generation compression cycles
1209 it is preferable that this value matches the corresponding
1210 do_fancy_downsampling value in compression.
1211
1212boolean do_block_smoothing
1213 If TRUE, interblock smoothing is applied in early stages of decoding
1214 progressive JPEG files; if FALSE, not. Default is TRUE. Early
1215 progression stages look "fuzzy" with smoothing, "blocky" without.
1216 In any case, block smoothing ceases to be applied after the first few
1217 AC coefficients are known to full accuracy, so it is relevant only
1218 when using buffered-image mode for progressive images.
1219
1220boolean enable_1pass_quant
1221boolean enable_external_quant
1222boolean enable_2pass_quant
1223 These are significant only in buffered-image mode, which is
1224 described in its own section below.
1225
1226
1227The output image dimensions are given by the following fields. These are
1228computed from the source image dimensions and the decompression parameters
1229by jpeg_start_decompress(). You can also call jpeg_calc_output_dimensions()
1230to obtain the values that will result from the current parameter settings.
1231This can be useful if you are trying to pick a scaling ratio that will get
1232close to a desired target size. It's also important if you are using the
1233JPEG library's memory manager to allocate output buffer space, because you
1234are supposed to request such buffers *before* jpeg_start_decompress().
1235
1236JDIMENSION output_width Actual dimensions of output image.
1237JDIMENSION output_height
1238int out_color_components Number of color components in out_color_space.
1239int output_components Number of color components returned.
1240int rec_outbuf_height Recommended height of scanline buffer.
1241
1242When quantizing colors, output_components is 1, indicating a single color map
1243index per pixel. Otherwise it equals out_color_components. The output arrays
1244are required to be output_width * output_components JSAMPLEs wide.
1245
1246rec_outbuf_height is the recommended minimum height (in scanlines) of the
1247buffer passed to jpeg_read_scanlines(). If the buffer is smaller, the
1248library will still work, but time will be wasted due to unnecessary data
1249copying. In high-quality modes, rec_outbuf_height is always 1, but some
1250faster, lower-quality modes set it to larger values (typically 2 to 4).
1251If you are going to ask for a high-speed processing mode, you may as well
1252go to the trouble of honoring rec_outbuf_height so as to avoid data copying.
1253(An output buffer larger than rec_outbuf_height lines is OK, but won't
1254provide any material speed improvement over that height.)
1255
1256
1257Special color spaces
1258--------------------
1259
1260The JPEG standard itself is "color blind" and doesn't specify any particular
1261color space. It is customary to convert color data to a luminance/chrominance
1262color space before compressing, since this permits greater compression. The
1263existing de-facto JPEG file format standards specify YCbCr or grayscale data
1264(JFIF), or grayscale, RGB, YCbCr, CMYK, or YCCK (Adobe). For special
1265applications such as multispectral images, other color spaces can be used,
1266but it must be understood that such files will be unportable.
1267
1268The JPEG library can handle the most common colorspace conversions (namely
1269RGB <=> YCbCr and CMYK <=> YCCK). It can also deal with data of an unknown
1270color space, passing it through without conversion. If you deal extensively
1271with an unusual color space, you can easily extend the library to understand
1272additional color spaces and perform appropriate conversions.
1273
1274For compression, the source data's color space is specified by field
1275in_color_space. This is transformed to the JPEG file's color space given
1276by jpeg_color_space. jpeg_set_defaults() chooses a reasonable JPEG color
1277space depending on in_color_space, but you can override this by calling
1278jpeg_set_colorspace(). Of course you must select a supported transformation.
1279jccolor.c currently supports the following transformations:
1280 RGB => YCbCr
1281 RGB => GRAYSCALE
1282 YCbCr => GRAYSCALE
1283 CMYK => YCCK
1284plus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB,
1285YCbCr => YCbCr, CMYK => CMYK, YCCK => YCCK, and UNKNOWN => UNKNOWN.
1286
1287The de-facto file format standards (JFIF and Adobe) specify APPn markers that
1288indicate the color space of the JPEG file. It is important to ensure that
1289these are written correctly, or omitted if the JPEG file's color space is not
1290one of the ones supported by the de-facto standards. jpeg_set_colorspace()
1291will set the compression parameters to include or omit the APPn markers
1292properly, so long as it is told the truth about the JPEG color space.
1293For example, if you are writing some random 3-component color space without
1294conversion, don't try to fake out the library by setting in_color_space and
1295jpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN. You may want to write an
1296APPn marker of your own devising to identify the colorspace --- see "Special
1297markers", below.
1298
1299When told that the color space is UNKNOWN, the library will default to using
1300luminance-quality compression parameters for all color components. You may
1301well want to change these parameters. See the source code for
1302jpeg_set_colorspace(), in jcparam.c, for details.
1303
1304For decompression, the JPEG file's color space is given in jpeg_color_space,
1305and this is transformed to the output color space out_color_space.
1306jpeg_read_header's setting of jpeg_color_space can be relied on if the file
1307conforms to JFIF or Adobe conventions, but otherwise it is no better than a
1308guess. If you know the JPEG file's color space for certain, you can override
1309jpeg_read_header's guess by setting jpeg_color_space. jpeg_read_header also
1310selects a default output color space based on (its guess of) jpeg_color_space;
1311set out_color_space to override this. Again, you must select a supported
1312transformation. jdcolor.c currently supports
1313 YCbCr => RGB
1314 YCbCr => GRAYSCALE
1315 RGB => GRAYSCALE
1316 GRAYSCALE => RGB
1317 YCCK => CMYK
1318as well as the null transforms. (Since GRAYSCALE=>RGB is provided, an
1319application can force grayscale JPEGs to look like color JPEGs if it only
1320wants to handle one case.)
1321
1322The two-pass color quantizer, jquant2.c, is specialized to handle RGB data
1323(it weights distances appropriately for RGB colors). You'll need to modify
1324the code if you want to use it for non-RGB output color spaces. Note that
1325jquant2.c is used to map to an application-supplied colormap as well as for
1326the normal two-pass colormap selection process.
1327
1328CAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG
1329files: 0 represents 100% ink coverage, rather than 0% ink as you'd expect.
1330This is arguably a bug in Photoshop, but if you need to work with Photoshop
1331CMYK files, you will have to deal with it in your application. We cannot
1332"fix" this in the library by inverting the data during the CMYK<=>YCCK
1333transform, because that would break other applications, notably Ghostscript.
1334Photoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK
1335data in the same inverted-YCCK representation used in bare JPEG files, but
1336the surrounding PostScript code performs an inversion using the PS image
1337operator. I am told that Photoshop 3.0 will write uninverted YCCK in
1338EPS/JPEG files, and will omit the PS-level inversion. (But the data
1339polarity used in bare JPEG files will not change in 3.0.) In either case,
1340the JPEG library must not invert the data itself, or else Ghostscript would
1341read these EPS files incorrectly.
1342
1343
1344Error handling
1345--------------
1346
1347When the default error handler is used, any error detected inside the JPEG
1348routines will cause a message to be printed on stderr, followed by exit().
1349You can supply your own error handling routines to override this behavior
1350and to control the treatment of nonfatal warnings and trace/debug messages.
1351The file example.c illustrates the most common case, which is to have the
1352application regain control after an error rather than exiting.
1353
1354The JPEG library never writes any message directly; it always goes through
1355the error handling routines. Three classes of messages are recognized:
1356 * Fatal errors: the library cannot continue.
1357 * Warnings: the library can continue, but the data is corrupt, and a
1358 damaged output image is likely to result.
1359 * Trace/informational messages. These come with a trace level indicating
1360 the importance of the message; you can control the verbosity of the
1361 program by adjusting the maximum trace level that will be displayed.
1362
1363You may, if you wish, simply replace the entire JPEG error handling module
1364(jerror.c) with your own code. However, you can avoid code duplication by
1365only replacing some of the routines depending on the behavior you need.
1366This is accomplished by calling jpeg_std_error() as usual, but then overriding
1367some of the method pointers in the jpeg_error_mgr struct, as illustrated by
1368example.c.
1369
1370All of the error handling routines will receive a pointer to the JPEG object
1371(a j_common_ptr which points to either a jpeg_compress_struct or a
1372jpeg_decompress_struct; if you need to tell which, test the is_decompressor
1373field). This struct includes a pointer to the error manager struct in its
1374"err" field. Frequently, custom error handler routines will need to access
1375additional data which is not known to the JPEG library or the standard error
1376handler. The most convenient way to do this is to embed either the JPEG
1377object or the jpeg_error_mgr struct in a larger structure that contains
1378additional fields; then casting the passed pointer provides access to the
1379additional fields. Again, see example.c for one way to do it. (Beginning
1380with IJG version 6b, there is also a void pointer "client_data" in each
1381JPEG object, which the application can also use to find related data.
1382The library does not touch client_data at all.)
1383
1384The individual methods that you might wish to override are:
1385
1386error_exit (j_common_ptr cinfo)
1387 Receives control for a fatal error. Information sufficient to
1388 generate the error message has been stored in cinfo->err; call
1389 output_message to display it. Control must NOT return to the caller;
1390 generally this routine will exit() or longjmp() somewhere.
1391 Typically you would override this routine to get rid of the exit()
1392 default behavior. Note that if you continue processing, you should
1393 clean up the JPEG object with jpeg_abort() or jpeg_destroy().
1394
1395output_message (j_common_ptr cinfo)
1396 Actual output of any JPEG message. Override this to send messages
1397 somewhere other than stderr. Note that this method does not know
1398 how to generate a message, only where to send it.
1399
1400format_message (j_common_ptr cinfo, char * buffer)
1401 Constructs a readable error message string based on the error info
1402 stored in cinfo->err. This method is called by output_message. Few
1403 applications should need to override this method. One possible
1404 reason for doing so is to implement dynamic switching of error message
1405 language.
1406
1407emit_message (j_common_ptr cinfo, int msg_level)
1408 Decide whether or not to emit a warning or trace message; if so,
1409 calls output_message. The main reason for overriding this method
1410 would be to abort on warnings. msg_level is -1 for warnings,
1411 0 and up for trace messages.
1412
1413Only error_exit() and emit_message() are called from the rest of the JPEG
1414library; the other two are internal to the error handler.
1415
1416The actual message texts are stored in an array of strings which is pointed to
1417by the field err->jpeg_message_table. The messages are numbered from 0 to
1418err->last_jpeg_message, and it is these code numbers that are used in the
1419JPEG library code. You could replace the message texts (for instance, with
1420messages in French or German) by changing the message table pointer. See
1421jerror.h for the default texts. CAUTION: this table will almost certainly
1422change or grow from one library version to the next.
1423
1424It may be useful for an application to add its own message texts that are
1425handled by the same mechanism. The error handler supports a second "add-on"
1426message table for this purpose. To define an addon table, set the pointer
1427err->addon_message_table and the message numbers err->first_addon_message and
1428err->last_addon_message. If you number the addon messages beginning at 1000
1429or so, you won't have to worry about conflicts with the library's built-in
1430messages. See the sample applications cjpeg/djpeg for an example of using
1431addon messages (the addon messages are defined in cderror.h).
1432
1433Actual invocation of the error handler is done via macros defined in jerror.h:
1434 ERREXITn(...) for fatal errors
1435 WARNMSn(...) for corrupt-data warnings
1436 TRACEMSn(...) for trace and informational messages.
1437These macros store the message code and any additional parameters into the
1438error handler struct, then invoke the error_exit() or emit_message() method.
1439The variants of each macro are for varying numbers of additional parameters.
1440The additional parameters are inserted into the generated message using
1441standard printf() format codes.
1442
1443See jerror.h and jerror.c for further details.
1444
1445
1446Compressed data handling (source and destination managers)
1447----------------------------------------------------------
1448
1449The JPEG compression library sends its compressed data to a "destination
1450manager" module. The default destination manager just writes the data to a
1451memory buffer or to a stdio stream, but you can provide your own manager to
1452do something else. Similarly, the decompression library calls a "source
1453manager" to obtain the compressed data; you can provide your own source
1454manager if you want the data to come from somewhere other than a memory
1455buffer or a stdio stream.
1456
1457In both cases, compressed data is processed a bufferload at a time: the
1458destination or source manager provides a work buffer, and the library invokes
1459the manager only when the buffer is filled or emptied. (You could define a
1460one-character buffer to force the manager to be invoked for each byte, but
1461that would be rather inefficient.) The buffer's size and location are
1462controlled by the manager, not by the library. For example, the memory
1463source manager just makes the buffer pointer and length point to the original
1464data in memory. In this case the buffer-reload procedure will be invoked
1465only if the decompressor ran off the end of the datastream, which would
1466indicate an erroneous datastream.
1467
1468The work buffer is defined as an array of datatype JOCTET, which is generally
1469"char" or "unsigned char". On a machine where char is not exactly 8 bits
1470wide, you must define JOCTET as a wider data type and then modify the data
1471source and destination modules to transcribe the work arrays into 8-bit units
1472on external storage.
1473
1474A data destination manager struct contains a pointer and count defining the
1475next byte to write in the work buffer and the remaining free space:
1476
1477 JOCTET * next_output_byte; /* => next byte to write in buffer */
1478 size_t free_in_buffer; /* # of byte spaces remaining in buffer */
1479
1480The library increments the pointer and decrements the count until the buffer
1481is filled. The manager's empty_output_buffer method must reset the pointer
1482and count. The manager is expected to remember the buffer's starting address
1483and total size in private fields not visible to the library.
1484
1485A data destination manager provides three methods:
1486
1487init_destination (j_compress_ptr cinfo)
1488 Initialize destination. This is called by jpeg_start_compress()
1489 before any data is actually written. It must initialize
1490 next_output_byte and free_in_buffer. free_in_buffer must be
1491 initialized to a positive value.
1492
1493empty_output_buffer (j_compress_ptr cinfo)
1494 This is called whenever the buffer has filled (free_in_buffer
1495 reaches zero). In typical applications, it should write out the
1496 *entire* buffer (use the saved start address and buffer length;
1497 ignore the current state of next_output_byte and free_in_buffer).
1498 Then reset the pointer & count to the start of the buffer, and
1499 return TRUE indicating that the buffer has been dumped.
1500 free_in_buffer must be set to a positive value when TRUE is
1501 returned. A FALSE return should only be used when I/O suspension is
1502 desired (this operating mode is discussed in the next section).
1503
1504term_destination (j_compress_ptr cinfo)
1505 Terminate destination --- called by jpeg_finish_compress() after all
1506 data has been written. In most applications, this must flush any
1507 data remaining in the buffer. Use either next_output_byte or
1508 free_in_buffer to determine how much data is in the buffer.
1509
1510term_destination() is NOT called by jpeg_abort() or jpeg_destroy(). If you
1511want the destination manager to be cleaned up during an abort, you must do it
1512yourself.
1513
1514You will also need code to create a jpeg_destination_mgr struct, fill in its
1515method pointers, and insert a pointer to the struct into the "dest" field of
1516the JPEG compression object. This can be done in-line in your setup code if
1517you like, but it's probably cleaner to provide a separate routine similar to
1518the jpeg_stdio_dest() or jpeg_mem_dest() routines of the supplied destination
1519managers.
1520
1521Decompression source managers follow a parallel design, but with some
1522additional frammishes. The source manager struct contains a pointer and count
1523defining the next byte to read from the work buffer and the number of bytes
1524remaining:
1525
1526 const JOCTET * next_input_byte; /* => next byte to read from buffer */
1527 size_t bytes_in_buffer; /* # of bytes remaining in buffer */
1528
1529The library increments the pointer and decrements the count until the buffer
1530is emptied. The manager's fill_input_buffer method must reset the pointer and
1531count. In most applications, the manager must remember the buffer's starting
1532address and total size in private fields not visible to the library.
1533
1534A data source manager provides five methods:
1535
1536init_source (j_decompress_ptr cinfo)
1537 Initialize source. This is called by jpeg_read_header() before any
1538 data is actually read. Unlike init_destination(), it may leave
1539 bytes_in_buffer set to 0 (in which case a fill_input_buffer() call
1540 will occur immediately).
1541
1542fill_input_buffer (j_decompress_ptr cinfo)
1543 This is called whenever bytes_in_buffer has reached zero and more
1544 data is wanted. In typical applications, it should read fresh data
1545 into the buffer (ignoring the current state of next_input_byte and
1546 bytes_in_buffer), reset the pointer & count to the start of the
1547 buffer, and return TRUE indicating that the buffer has been reloaded.
1548 It is not necessary to fill the buffer entirely, only to obtain at
1549 least one more byte. bytes_in_buffer MUST be set to a positive value
1550 if TRUE is returned. A FALSE return should only be used when I/O
1551 suspension is desired (this mode is discussed in the next section).
1552
1553skip_input_data (j_decompress_ptr cinfo, long num_bytes)
1554 Skip num_bytes worth of data. The buffer pointer and count should
1555 be advanced over num_bytes input bytes, refilling the buffer as
1556 needed. This is used to skip over a potentially large amount of
1557 uninteresting data (such as an APPn marker). In some applications
1558 it may be possible to optimize away the reading of the skipped data,
1559 but it's not clear that being smart is worth much trouble; large
1560 skips are uncommon. bytes_in_buffer may be zero on return.
1561 A zero or negative skip count should be treated as a no-op.
1562
1563resync_to_restart (j_decompress_ptr cinfo, int desired)
1564 This routine is called only when the decompressor has failed to find
1565 a restart (RSTn) marker where one is expected. Its mission is to
1566 find a suitable point for resuming decompression. For most
1567 applications, we recommend that you just use the default resync
1568 procedure, jpeg_resync_to_restart(). However, if you are able to back
1569 up in the input data stream, or if you have a-priori knowledge about
1570 the likely location of restart markers, you may be able to do better.
1571 Read the read_restart_marker() and jpeg_resync_to_restart() routines
1572 in jdmarker.c if you think you'd like to implement your own resync
1573 procedure.
1574
1575term_source (j_decompress_ptr cinfo)
1576 Terminate source --- called by jpeg_finish_decompress() after all
1577 data has been read. Often a no-op.
1578
1579For both fill_input_buffer() and skip_input_data(), there is no such thing
1580as an EOF return. If the end of the file has been reached, the routine has
1581a choice of exiting via ERREXIT() or inserting fake data into the buffer.
1582In most cases, generating a warning message and inserting a fake EOI marker
1583is the best course of action --- this will allow the decompressor to output
1584however much of the image is there. In pathological cases, the decompressor
1585may swallow the EOI and again demand data ... just keep feeding it fake EOIs.
1586jdatasrc.c illustrates the recommended error recovery behavior.
1587
1588term_source() is NOT called by jpeg_abort() or jpeg_destroy(). If you want
1589the source manager to be cleaned up during an abort, you must do it yourself.
1590
1591You will also need code to create a jpeg_source_mgr struct, fill in its method
1592pointers, and insert a pointer to the struct into the "src" field of the JPEG
1593decompression object. This can be done in-line in your setup code if you
1594like, but it's probably cleaner to provide a separate routine similar to the
1595jpeg_stdio_src() or jpeg_mem_src() routines of the supplied source managers.
1596
1597For more information, consult the memory and stdio source and destination
1598managers in jdatasrc.c and jdatadst.c.
1599
1600
1601I/O suspension
1602--------------
1603
1604Some applications need to use the JPEG library as an incremental memory-to-
1605memory filter: when the compressed data buffer is filled or emptied, they want
1606control to return to the outer loop, rather than expecting that the buffer can
1607be emptied or reloaded within the data source/destination manager subroutine.
1608The library supports this need by providing an "I/O suspension" mode, which we
1609describe in this section.
1610
1611The I/O suspension mode is not a panacea: nothing is guaranteed about the
1612maximum amount of time spent in any one call to the library, so it will not
1613eliminate response-time problems in single-threaded applications. If you
1614need guaranteed response time, we suggest you "bite the bullet" and implement
1615a real multi-tasking capability.
1616
1617To use I/O suspension, cooperation is needed between the calling application
1618and the data source or destination manager; you will always need a custom
1619source/destination manager. (Please read the previous section if you haven't
1620already.) The basic idea is that the empty_output_buffer() or
1621fill_input_buffer() routine is a no-op, merely returning FALSE to indicate
1622that it has done nothing. Upon seeing this, the JPEG library suspends
1623operation and returns to its caller. The surrounding application is
1624responsible for emptying or refilling the work buffer before calling the
1625JPEG library again.
1626
1627Compression suspension:
1628
1629For compression suspension, use an empty_output_buffer() routine that returns
1630FALSE; typically it will not do anything else. This will cause the
1631compressor to return to the caller of jpeg_write_scanlines(), with the return
1632value indicating that not all the supplied scanlines have been accepted.
1633The application must make more room in the output buffer, adjust the output
1634buffer pointer/count appropriately, and then call jpeg_write_scanlines()
1635again, pointing to the first unconsumed scanline.
1636
1637When forced to suspend, the compressor will backtrack to a convenient stopping
1638point (usually the start of the current MCU); it will regenerate some output
1639data when restarted. Therefore, although empty_output_buffer() is only
1640called when the buffer is filled, you should NOT write out the entire buffer
1641after a suspension. Write only the data up to the current position of
1642next_output_byte/free_in_buffer. The data beyond that point will be
1643regenerated after resumption.
1644
1645Because of the backtracking behavior, a good-size output buffer is essential
1646for efficiency; you don't want the compressor to suspend often. (In fact, an
1647overly small buffer could lead to infinite looping, if a single MCU required
1648more data than would fit in the buffer.) We recommend a buffer of at least
1649several Kbytes. You may want to insert explicit code to ensure that you don't
1650call jpeg_write_scanlines() unless there is a reasonable amount of space in
1651the output buffer; in other words, flush the buffer before trying to compress
1652more data.
1653
1654The compressor does not allow suspension while it is trying to write JPEG
1655markers at the beginning and end of the file. This means that:
1656 * At the beginning of a compression operation, there must be enough free
1657 space in the output buffer to hold the header markers (typically 600 or
1658 so bytes). The recommended buffer size is bigger than this anyway, so
1659 this is not a problem as long as you start with an empty buffer. However,
1660 this restriction might catch you if you insert large special markers, such
1661 as a JFIF thumbnail image, without flushing the buffer afterwards.
1662 * When you call jpeg_finish_compress(), there must be enough space in the
1663 output buffer to emit any buffered data and the final EOI marker. In the
1664 current implementation, half a dozen bytes should suffice for this, but
1665 for safety's sake we recommend ensuring that at least 100 bytes are free
1666 before calling jpeg_finish_compress().
1667
1668A more significant restriction is that jpeg_finish_compress() cannot suspend.
1669This means you cannot use suspension with multi-pass operating modes, namely
1670Huffman code optimization and multiple-scan output. Those modes write the
1671whole file during jpeg_finish_compress(), which will certainly result in
1672buffer overrun. (Note that this restriction applies only to compression,
1673not decompression. The decompressor supports input suspension in all of its
1674operating modes.)
1675
1676Decompression suspension:
1677
1678For decompression suspension, use a fill_input_buffer() routine that simply
1679returns FALSE (except perhaps during error recovery, as discussed below).
1680This will cause the decompressor to return to its caller with an indication
1681that suspension has occurred. This can happen at four places:
1682 * jpeg_read_header(): will return JPEG_SUSPENDED.
1683 * jpeg_start_decompress(): will return FALSE, rather than its usual TRUE.
1684 * jpeg_read_scanlines(): will return the number of scanlines already
1685 completed (possibly 0).
1686 * jpeg_finish_decompress(): will return FALSE, rather than its usual TRUE.
1687The surrounding application must recognize these cases, load more data into
1688the input buffer, and repeat the call. In the case of jpeg_read_scanlines(),
1689increment the passed pointers past any scanlines successfully read.
1690
1691Just as with compression, the decompressor will typically backtrack to a
1692convenient restart point before suspending. When fill_input_buffer() is
1693called, next_input_byte/bytes_in_buffer point to the current restart point,
1694which is where the decompressor will backtrack to if FALSE is returned.
1695The data beyond that position must NOT be discarded if you suspend; it needs
1696to be re-read upon resumption. In most implementations, you'll need to shift
1697this data down to the start of your work buffer and then load more data after
1698it. Again, this behavior means that a several-Kbyte work buffer is essential
1699for decent performance; furthermore, you should load a reasonable amount of
1700new data before resuming decompression. (If you loaded, say, only one new
1701byte each time around, you could waste a LOT of cycles.)
1702
1703The skip_input_data() source manager routine requires special care in a
1704suspension scenario. This routine is NOT granted the ability to suspend the
1705decompressor; it can decrement bytes_in_buffer to zero, but no more. If the
1706requested skip distance exceeds the amount of data currently in the input
1707buffer, then skip_input_data() must set bytes_in_buffer to zero and record the
1708additional skip distance somewhere else. The decompressor will immediately
1709call fill_input_buffer(), which should return FALSE, which will cause a
1710suspension return. The surrounding application must then arrange to discard
1711the recorded number of bytes before it resumes loading the input buffer.
1712(Yes, this design is rather baroque, but it avoids complexity in the far more
1713common case where a non-suspending source manager is used.)
1714
1715If the input data has been exhausted, we recommend that you emit a warning
1716and insert dummy EOI markers just as a non-suspending data source manager
1717would do. This can be handled either in the surrounding application logic or
1718within fill_input_buffer(); the latter is probably more efficient. If
1719fill_input_buffer() knows that no more data is available, it can set the
1720pointer/count to point to a dummy EOI marker and then return TRUE just as
1721though it had read more data in a non-suspending situation.
1722
1723The decompressor does not attempt to suspend within standard JPEG markers;
1724instead it will backtrack to the start of the marker and reprocess the whole
1725marker next time. Hence the input buffer must be large enough to hold the
1726longest standard marker in the file. Standard JPEG markers should normally
1727not exceed a few hundred bytes each (DHT tables are typically the longest).
1728We recommend at least a 2K buffer for performance reasons, which is much
1729larger than any correct marker is likely to be. For robustness against
1730damaged marker length counts, you may wish to insert a test in your
1731application for the case that the input buffer is completely full and yet
1732the decoder has suspended without consuming any data --- otherwise, if this
1733situation did occur, it would lead to an endless loop. (The library can't
1734provide this test since it has no idea whether "the buffer is full", or
1735even whether there is a fixed-size input buffer.)
1736
1737The input buffer would need to be 64K to allow for arbitrary COM or APPn
1738markers, but these are handled specially: they are either saved into allocated
1739memory, or skipped over by calling skip_input_data(). In the former case,
1740suspension is handled correctly, and in the latter case, the problem of
1741buffer overrun is placed on skip_input_data's shoulders, as explained above.
1742Note that if you provide your own marker handling routine for large markers,
1743you should consider how to deal with buffer overflow.
1744
1745Multiple-buffer management:
1746
1747In some applications it is desirable to store the compressed data in a linked
1748list of buffer areas, so as to avoid data copying. This can be handled by
1749having empty_output_buffer() or fill_input_buffer() set the pointer and count
1750to reference the next available buffer; FALSE is returned only if no more
1751buffers are available. Although seemingly straightforward, there is a
1752pitfall in this approach: the backtrack that occurs when FALSE is returned
1753could back up into an earlier buffer. For example, when fill_input_buffer()
1754is called, the current pointer & count indicate the backtrack restart point.
1755Since fill_input_buffer() will set the pointer and count to refer to a new
1756buffer, the restart position must be saved somewhere else. Suppose a second
1757call to fill_input_buffer() occurs in the same library call, and no
1758additional input data is available, so fill_input_buffer must return FALSE.
1759If the JPEG library has not moved the pointer/count forward in the current
1760buffer, then *the correct restart point is the saved position in the prior
1761buffer*. Prior buffers may be discarded only after the library establishes
1762a restart point within a later buffer. Similar remarks apply for output into
1763a chain of buffers.
1764
1765The library will never attempt to backtrack over a skip_input_data() call,
1766so any skipped data can be permanently discarded. You still have to deal
1767with the case of skipping not-yet-received data, however.
1768
1769It's much simpler to use only a single buffer; when fill_input_buffer() is
1770called, move any unconsumed data (beyond the current pointer/count) down to
1771the beginning of this buffer and then load new data into the remaining buffer
1772space. This approach requires a little more data copying but is far easier
1773to get right.
1774
1775
1776Progressive JPEG support
1777------------------------
1778
1779Progressive JPEG rearranges the stored data into a series of scans of
1780increasing quality. In situations where a JPEG file is transmitted across a
1781slow communications link, a decoder can generate a low-quality image very
1782quickly from the first scan, then gradually improve the displayed quality as
1783more scans are received. The final image after all scans are complete is
1784identical to that of a regular (sequential) JPEG file of the same quality
1785setting. Progressive JPEG files are often slightly smaller than equivalent
1786sequential JPEG files, but the possibility of incremental display is the main
1787reason for using progressive JPEG.
1788
1789The IJG encoder library generates progressive JPEG files when given a
1790suitable "scan script" defining how to divide the data into scans.
1791Creation of progressive JPEG files is otherwise transparent to the encoder.
1792Progressive JPEG files can also be read transparently by the decoder library.
1793If the decoding application simply uses the library as defined above, it
1794will receive a final decoded image without any indication that the file was
1795progressive. Of course, this approach does not allow incremental display.
1796To perform incremental display, an application needs to use the decoder
1797library's "buffered-image" mode, in which it receives a decoded image
1798multiple times.
1799
1800Each displayed scan requires about as much work to decode as a full JPEG
1801image of the same size, so the decoder must be fairly fast in relation to the
1802data transmission rate in order to make incremental display useful. However,
1803it is possible to skip displaying the image and simply add the incoming bits
1804to the decoder's coefficient buffer. This is fast because only Huffman
1805decoding need be done, not IDCT, upsampling, colorspace conversion, etc.
1806The IJG decoder library allows the application to switch dynamically between
1807displaying the image and simply absorbing the incoming bits. A properly
1808coded application can automatically adapt the number of display passes to
1809suit the time available as the image is received. Also, a final
1810higher-quality display cycle can be performed from the buffered data after
1811the end of the file is reached.
1812
1813Progressive compression:
1814
1815To create a progressive JPEG file (or a multiple-scan sequential JPEG file),
1816set the scan_info cinfo field to point to an array of scan descriptors, and
1817perform compression as usual. Instead of constructing your own scan list,
1818you can call the jpeg_simple_progression() helper routine to create a
1819recommended progression sequence; this method should be used by all
1820applications that don't want to get involved in the nitty-gritty of
1821progressive scan sequence design. (If you want to provide user control of
1822scan sequences, you may wish to borrow the scan script reading code found
1823in rdswitch.c, so that you can read scan script files just like cjpeg's.)
1824When scan_info is not NULL, the compression library will store DCT'd data
1825into a buffer array as jpeg_write_scanlines() is called, and will emit all
1826the requested scans during jpeg_finish_compress(). This implies that
1827multiple-scan output cannot be created with a suspending data destination
1828manager, since jpeg_finish_compress() does not support suspension. We
1829should also note that the compressor currently forces Huffman optimization
1830mode when creating a progressive JPEG file, because the default Huffman
1831tables are unsuitable for progressive files.
1832
1833Progressive decompression:
1834
1835When buffered-image mode is not used, the decoder library will read all of
1836a multi-scan file during jpeg_start_decompress(), so that it can provide a
1837final decoded image. (Here "multi-scan" means either progressive or
1838multi-scan sequential.) This makes multi-scan files transparent to the
1839decoding application. However, existing applications that used suspending
1840input with version 5 of the IJG library will need to be modified to check
1841for a suspension return from jpeg_start_decompress().
1842
1843To perform incremental display, an application must use the library's
1844buffered-image mode. This is described in the next section.
1845
1846
1847Buffered-image mode
1848-------------------
1849
1850In buffered-image mode, the library stores the partially decoded image in a
1851coefficient buffer, from which it can be read out as many times as desired.
1852This mode is typically used for incremental display of progressive JPEG files,
1853but it can be used with any JPEG file. Each scan of a progressive JPEG file
1854adds more data (more detail) to the buffered image. The application can
1855display in lockstep with the source file (one display pass per input scan),
1856or it can allow input processing to outrun display processing. By making
1857input and display processing run independently, it is possible for the
1858application to adapt progressive display to a wide range of data transmission
1859rates.
1860
1861The basic control flow for buffered-image decoding is
1862
1863 jpeg_create_decompress()
1864 set data source
1865 jpeg_read_header()
1866 set overall decompression parameters
1867 cinfo.buffered_image = TRUE; /* select buffered-image mode */
1868 jpeg_start_decompress()
1869 for (each output pass) {
1870 adjust output decompression parameters if required
1871 jpeg_start_output() /* start a new output pass */
1872 for (all scanlines in image) {
1873 jpeg_read_scanlines()
1874 display scanlines
1875 }
1876 jpeg_finish_output() /* terminate output pass */
1877 }
1878 jpeg_finish_decompress()
1879 jpeg_destroy_decompress()
1880
1881This differs from ordinary unbuffered decoding in that there is an additional
1882level of looping. The application can choose how many output passes to make
1883and how to display each pass.
1884
1885The simplest approach to displaying progressive images is to do one display
1886pass for each scan appearing in the input file. In this case the outer loop
1887condition is typically
1888 while (! jpeg_input_complete(&cinfo))
1889and the start-output call should read
1890 jpeg_start_output(&cinfo, cinfo.input_scan_number);
1891The second parameter to jpeg_start_output() indicates which scan of the input
1892file is to be displayed; the scans are numbered starting at 1 for this
1893purpose. (You can use a loop counter starting at 1 if you like, but using
1894the library's input scan counter is easier.) The library automatically reads
1895data as necessary to complete each requested scan, and jpeg_finish_output()
1896advances to the next scan or end-of-image marker (hence input_scan_number
1897will be incremented by the time control arrives back at jpeg_start_output()).
1898With this technique, data is read from the input file only as needed, and
1899input and output processing run in lockstep.
1900
1901After reading the final scan and reaching the end of the input file, the
1902buffered image remains available; it can be read additional times by
1903repeating the jpeg_start_output()/jpeg_read_scanlines()/jpeg_finish_output()
1904sequence. For example, a useful technique is to use fast one-pass color
1905quantization for display passes made while the image is arriving, followed by
1906a final display pass using two-pass quantization for highest quality. This
1907is done by changing the library parameters before the final output pass.
1908Changing parameters between passes is discussed in detail below.
1909
1910In general the last scan of a progressive file cannot be recognized as such
1911until after it is read, so a post-input display pass is the best approach if
1912you want special processing in the final pass.
1913
1914When done with the image, be sure to call jpeg_finish_decompress() to release
1915the buffered image (or just use jpeg_destroy_decompress()).
1916
1917If input data arrives faster than it can be displayed, the application can
1918cause the library to decode input data in advance of what's needed to produce
1919output. This is done by calling the routine jpeg_consume_input().
1920The return value is one of the following:
1921 JPEG_REACHED_SOS: reached an SOS marker (the start of a new scan)
1922 JPEG_REACHED_EOI: reached the EOI marker (end of image)
1923 JPEG_ROW_COMPLETED: completed reading one MCU row of compressed data
1924 JPEG_SCAN_COMPLETED: completed reading last MCU row of current scan
1925 JPEG_SUSPENDED: suspended before completing any of the above
1926(JPEG_SUSPENDED can occur only if a suspending data source is used.) This
1927routine can be called at any time after initializing the JPEG object. It
1928reads some additional data and returns when one of the indicated significant
1929events occurs. (If called after the EOI marker is reached, it will
1930immediately return JPEG_REACHED_EOI without attempting to read more data.)
1931
1932The library's output processing will automatically call jpeg_consume_input()
1933whenever the output processing overtakes the input; thus, simple lockstep
1934display requires no direct calls to jpeg_consume_input(). But by adding
1935calls to jpeg_consume_input(), you can absorb data in advance of what is
1936being displayed. This has two benefits:
1937 * You can limit buildup of unprocessed data in your input buffer.
1938 * You can eliminate extra display passes by paying attention to the
1939 state of the library's input processing.
1940
1941The first of these benefits only requires interspersing calls to
1942jpeg_consume_input() with your display operations and any other processing
1943you may be doing. To avoid wasting cycles due to backtracking, it's best to
1944call jpeg_consume_input() only after a hundred or so new bytes have arrived.
1945This is discussed further under "I/O suspension", above. (Note: the JPEG
1946library currently is not thread-safe. You must not call jpeg_consume_input()
1947from one thread of control if a different library routine is working on the
1948same JPEG object in another thread.)
1949
1950When input arrives fast enough that more than one new scan is available
1951before you start a new output pass, you may as well skip the output pass
1952corresponding to the completed scan. This occurs for free if you pass
1953cinfo.input_scan_number as the target scan number to jpeg_start_output().
1954The input_scan_number field is simply the index of the scan currently being
1955consumed by the input processor. You can ensure that this is up-to-date by
1956emptying the input buffer just before calling jpeg_start_output(): call
1957jpeg_consume_input() repeatedly until it returns JPEG_SUSPENDED or
1958JPEG_REACHED_EOI.
1959
1960The target scan number passed to jpeg_start_output() is saved in the
1961cinfo.output_scan_number field. The library's output processing calls
1962jpeg_consume_input() whenever the current input scan number and row within
1963that scan is less than or equal to the current output scan number and row.
1964Thus, input processing can "get ahead" of the output processing but is not
1965allowed to "fall behind". You can achieve several different effects by
1966manipulating this interlock rule. For example, if you pass a target scan
1967number greater than the current input scan number, the output processor will
1968wait until that scan starts to arrive before producing any output. (To avoid
1969an infinite loop, the target scan number is automatically reset to the last
1970scan number when the end of image is reached. Thus, if you specify a large
1971target scan number, the library will just absorb the entire input file and
1972then perform an output pass. This is effectively the same as what
1973jpeg_start_decompress() does when you don't select buffered-image mode.)
1974When you pass a target scan number equal to the current input scan number,
1975the image is displayed no faster than the current input scan arrives. The
1976final possibility is to pass a target scan number less than the current input
1977scan number; this disables the input/output interlock and causes the output
1978processor to simply display whatever it finds in the image buffer, without
1979waiting for input. (However, the library will not accept a target scan
1980number less than one, so you can't avoid waiting for the first scan.)
1981
1982When data is arriving faster than the output display processing can advance
1983through the image, jpeg_consume_input() will store data into the buffered
1984image beyond the point at which the output processing is reading data out
1985again. If the input arrives fast enough, it may "wrap around" the buffer to
1986the point where the input is more than one whole scan ahead of the output.
1987If the output processing simply proceeds through its display pass without
1988paying attention to the input, the effect seen on-screen is that the lower
1989part of the image is one or more scans better in quality than the upper part.
1990Then, when the next output scan is started, you have a choice of what target
1991scan number to use. The recommended choice is to use the current input scan
1992number at that time, which implies that you've skipped the output scans
1993corresponding to the input scans that were completed while you processed the
1994previous output scan. In this way, the decoder automatically adapts its
1995speed to the arriving data, by skipping output scans as necessary to keep up
1996with the arriving data.
1997
1998When using this strategy, you'll want to be sure that you perform a final
1999output pass after receiving all the data; otherwise your last display may not
2000be full quality across the whole screen. So the right outer loop logic is
2001something like this:
2002 do {
2003 absorb any waiting input by calling jpeg_consume_input()
2004 final_pass = jpeg_input_complete(&cinfo);
2005 adjust output decompression parameters if required
2006 jpeg_start_output(&cinfo, cinfo.input_scan_number);
2007 ...
2008 jpeg_finish_output()
2009 } while (! final_pass);
2010rather than quitting as soon as jpeg_input_complete() returns TRUE. This
2011arrangement makes it simple to use higher-quality decoding parameters
2012for the final pass. But if you don't want to use special parameters for
2013the final pass, the right loop logic is like this:
2014 for (;;) {
2015 absorb any waiting input by calling jpeg_consume_input()
2016 jpeg_start_output(&cinfo, cinfo.input_scan_number);
2017 ...
2018 jpeg_finish_output()
2019 if (jpeg_input_complete(&cinfo) &&
2020 cinfo.input_scan_number == cinfo.output_scan_number)
2021 break;
2022 }
2023In this case you don't need to know in advance whether an output pass is to
2024be the last one, so it's not necessary to have reached EOF before starting
2025the final output pass; rather, what you want to test is whether the output
2026pass was performed in sync with the final input scan. This form of the loop
2027will avoid an extra output pass whenever the decoder is able (or nearly able)
2028to keep up with the incoming data.
2029
2030When the data transmission speed is high, you might begin a display pass,
2031then find that much or all of the file has arrived before you can complete
2032the pass. (You can detect this by noting the JPEG_REACHED_EOI return code
2033from jpeg_consume_input(), or equivalently by testing jpeg_input_complete().)
2034In this situation you may wish to abort the current display pass and start a
2035new one using the newly arrived information. To do so, just call
2036jpeg_finish_output() and then start a new pass with jpeg_start_output().
2037
2038A variant strategy is to abort and restart display if more than one complete
2039scan arrives during an output pass; this can be detected by noting
2040JPEG_REACHED_SOS returns and/or examining cinfo.input_scan_number. This
2041idea should be employed with caution, however, since the display process
2042might never get to the bottom of the image before being aborted, resulting
2043in the lower part of the screen being several passes worse than the upper.
2044In most cases it's probably best to abort an output pass only if the whole
2045file has arrived and you want to begin the final output pass immediately.
2046
2047When receiving data across a communication link, we recommend always using
2048the current input scan number for the output target scan number; if a
2049higher-quality final pass is to be done, it should be started (aborting any
2050incomplete output pass) as soon as the end of file is received. However,
2051many other strategies are possible. For example, the application can examine
2052the parameters of the current input scan and decide whether to display it or
2053not. If the scan contains only chroma data, one might choose not to use it
2054as the target scan, expecting that the scan will be small and will arrive
2055quickly. To skip to the next scan, call jpeg_consume_input() until it
2056returns JPEG_REACHED_SOS or JPEG_REACHED_EOI. Or just use the next higher
2057number as the target scan for jpeg_start_output(); but that method doesn't
2058let you inspect the next scan's parameters before deciding to display it.
2059
2060
2061In buffered-image mode, jpeg_start_decompress() never performs input and
2062thus never suspends. An application that uses input suspension with
2063buffered-image mode must be prepared for suspension returns from these
2064routines:
2065* jpeg_start_output() performs input only if you request 2-pass quantization
2066 and the target scan isn't fully read yet. (This is discussed below.)
2067* jpeg_read_scanlines(), as always, returns the number of scanlines that it
2068 was able to produce before suspending.
2069* jpeg_finish_output() will read any markers following the target scan,
2070 up to the end of the file or the SOS marker that begins another scan.
2071 (But it reads no input if jpeg_consume_input() has already reached the
2072 end of the file or a SOS marker beyond the target output scan.)
2073* jpeg_finish_decompress() will read until the end of file, and thus can
2074 suspend if the end hasn't already been reached (as can be tested by
2075 calling jpeg_input_complete()).
2076jpeg_start_output(), jpeg_finish_output(), and jpeg_finish_decompress()
2077all return TRUE if they completed their tasks, FALSE if they had to suspend.
2078In the event of a FALSE return, the application must load more input data
2079and repeat the call. Applications that use non-suspending data sources need
2080not check the return values of these three routines.
2081
2082
2083It is possible to change decoding parameters between output passes in the
2084buffered-image mode. The decoder library currently supports only very
2085limited changes of parameters. ONLY THE FOLLOWING parameter changes are
2086allowed after jpeg_start_decompress() is called:
2087* dct_method can be changed before each call to jpeg_start_output().
2088 For example, one could use a fast DCT method for early scans, changing
2089 to a higher quality method for the final scan.
2090* dither_mode can be changed before each call to jpeg_start_output();
2091 of course this has no impact if not using color quantization. Typically
2092 one would use ordered dither for initial passes, then switch to
2093 Floyd-Steinberg dither for the final pass. Caution: changing dither mode
2094 can cause more memory to be allocated by the library. Although the amount
2095 of memory involved is not large (a scanline or so), it may cause the
2096 initial max_memory_to_use specification to be exceeded, which in the worst
2097 case would result in an out-of-memory failure.
2098* do_block_smoothing can be changed before each call to jpeg_start_output().
2099 This setting is relevant only when decoding a progressive JPEG image.
2100 During the first DC-only scan, block smoothing provides a very "fuzzy" look
2101 instead of the very "blocky" look seen without it; which is better seems a
2102 matter of personal taste. But block smoothing is nearly always a win
2103 during later stages, especially when decoding a successive-approximation
2104 image: smoothing helps to hide the slight blockiness that otherwise shows
2105 up on smooth gradients until the lowest coefficient bits are sent.
2106* Color quantization mode can be changed under the rules described below.
2107 You *cannot* change between full-color and quantized output (because that
2108 would alter the required I/O buffer sizes), but you can change which
2109 quantization method is used.
2110
2111When generating color-quantized output, changing quantization method is a
2112very useful way of switching between high-speed and high-quality display.
2113The library allows you to change among its three quantization methods:
21141. Single-pass quantization to a fixed color cube.
2115 Selected by cinfo.two_pass_quantize = FALSE and cinfo.colormap = NULL.
21162. Single-pass quantization to an application-supplied colormap.
2117 Selected by setting cinfo.colormap to point to the colormap (the value of
2118 two_pass_quantize is ignored); also set cinfo.actual_number_of_colors.
21193. Two-pass quantization to a colormap chosen specifically for the image.
2120 Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL.
2121 (This is the default setting selected by jpeg_read_header, but it is
2122 probably NOT what you want for the first pass of progressive display!)
2123These methods offer successively better quality and lesser speed. However,
2124only the first method is available for quantizing in non-RGB color spaces.
2125
2126IMPORTANT: because the different quantizer methods have very different
2127working-storage requirements, the library requires you to indicate which
2128one(s) you intend to use before you call jpeg_start_decompress(). (If we did
2129not require this, the max_memory_to_use setting would be a complete fiction.)
2130You do this by setting one or more of these three cinfo fields to TRUE:
2131 enable_1pass_quant Fixed color cube colormap
2132 enable_external_quant Externally-supplied colormap
2133 enable_2pass_quant Two-pass custom colormap
2134All three are initialized FALSE by jpeg_read_header(). But
2135jpeg_start_decompress() automatically sets TRUE the one selected by the
2136current two_pass_quantize and colormap settings, so you only need to set the
2137enable flags for any other quantization methods you plan to change to later.
2138
2139After setting the enable flags correctly at jpeg_start_decompress() time, you
2140can change to any enabled quantization method by setting two_pass_quantize
2141and colormap properly just before calling jpeg_start_output(). The following
2142special rules apply:
21431. You must explicitly set cinfo.colormap to NULL when switching to 1-pass
2144 or 2-pass mode from a different mode, or when you want the 2-pass
2145 quantizer to be re-run to generate a new colormap.
21462. To switch to an external colormap, or to change to a different external
2147 colormap than was used on the prior pass, you must call
2148 jpeg_new_colormap() after setting cinfo.colormap.
2149NOTE: if you want to use the same colormap as was used in the prior pass,
2150you should not do either of these things. This will save some nontrivial
2151switchover costs.
2152(These requirements exist because cinfo.colormap will always be non-NULL
2153after completing a prior output pass, since both the 1-pass and 2-pass
2154quantizers set it to point to their output colormaps. Thus you have to
2155do one of these two things to notify the library that something has changed.
2156Yup, it's a bit klugy, but it's necessary to do it this way for backwards
2157compatibility.)
2158
2159Note that in buffered-image mode, the library generates any requested colormap
2160during jpeg_start_output(), not during jpeg_start_decompress().
2161
2162When using two-pass quantization, jpeg_start_output() makes a pass over the
2163buffered image to determine the optimum color map; it therefore may take a
2164significant amount of time, whereas ordinarily it does little work. The
2165progress monitor hook is called during this pass, if defined. It is also
2166important to realize that if the specified target scan number is greater than
2167or equal to the current input scan number, jpeg_start_output() will attempt
2168to consume input as it makes this pass. If you use a suspending data source,
2169you need to check for a FALSE return from jpeg_start_output() under these
2170conditions. The combination of 2-pass quantization and a not-yet-fully-read
2171target scan is the only case in which jpeg_start_output() will consume input.
2172
2173
2174Application authors who support buffered-image mode may be tempted to use it
2175for all JPEG images, even single-scan ones. This will work, but it is
2176inefficient: there is no need to create an image-sized coefficient buffer for
2177single-scan images. Requesting buffered-image mode for such an image wastes
2178memory. Worse, it can cost time on large images, since the buffered data has
2179to be swapped out or written to a temporary file. If you are concerned about
2180maximum performance on baseline JPEG files, you should use buffered-image
2181mode only when the incoming file actually has multiple scans. This can be
2182tested by calling jpeg_has_multiple_scans(), which will return a correct
2183result at any time after jpeg_read_header() completes.
2184
2185It is also worth noting that when you use jpeg_consume_input() to let input
2186processing get ahead of output processing, the resulting pattern of access to
2187the coefficient buffer is quite nonsequential. It's best to use the memory
2188manager jmemnobs.c if you can (ie, if you have enough real or virtual main
2189memory). If not, at least make sure that max_memory_to_use is set as high as
2190possible. If the JPEG memory manager has to use a temporary file, you will
2191probably see a lot of disk traffic and poor performance. (This could be
2192improved with additional work on the memory manager, but we haven't gotten
2193around to it yet.)
2194
2195In some applications it may be convenient to use jpeg_consume_input() for all
2196input processing, including reading the initial markers; that is, you may
2197wish to call jpeg_consume_input() instead of jpeg_read_header() during
2198startup. This works, but note that you must check for JPEG_REACHED_SOS and
2199JPEG_REACHED_EOI return codes as the equivalent of jpeg_read_header's codes.
2200Once the first SOS marker has been reached, you must call
2201jpeg_start_decompress() before jpeg_consume_input() will consume more input;
2202it'll just keep returning JPEG_REACHED_SOS until you do. If you read a
2203tables-only file this way, jpeg_consume_input() will return JPEG_REACHED_EOI
2204without ever returning JPEG_REACHED_SOS; be sure to check for this case.
2205If this happens, the decompressor will not read any more input until you call
2206jpeg_abort() to reset it. It is OK to call jpeg_consume_input() even when not
2207using buffered-image mode, but in that case it's basically a no-op after the
2208initial markers have been read: it will just return JPEG_SUSPENDED.
2209
2210
2211Abbreviated datastreams and multiple images
2212-------------------------------------------
2213
2214A JPEG compression or decompression object can be reused to process multiple
2215images. This saves a small amount of time per image by eliminating the
2216"create" and "destroy" operations, but that isn't the real purpose of the
2217feature. Rather, reuse of an object provides support for abbreviated JPEG
2218datastreams. Object reuse can also simplify processing a series of images in
2219a single input or output file. This section explains these features.
2220
2221A JPEG file normally contains several hundred bytes worth of quantization
2222and Huffman tables. In a situation where many images will be stored or
2223transmitted with identical tables, this may represent an annoying overhead.
2224The JPEG standard therefore permits tables to be omitted. The standard
2225defines three classes of JPEG datastreams:
2226 * "Interchange" datastreams contain an image and all tables needed to decode
2227 the image. These are the usual kind of JPEG file.
2228 * "Abbreviated image" datastreams contain an image, but are missing some or
2229 all of the tables needed to decode that image.
2230 * "Abbreviated table specification" (henceforth "tables-only") datastreams
2231 contain only table specifications.
2232To decode an abbreviated image, it is necessary to load the missing table(s)
2233into the decoder beforehand. This can be accomplished by reading a separate
2234tables-only file. A variant scheme uses a series of images in which the first
2235image is an interchange (complete) datastream, while subsequent ones are
2236abbreviated and rely on the tables loaded by the first image. It is assumed
2237that once the decoder has read a table, it will remember that table until a
2238new definition for the same table number is encountered.
2239
2240It is the application designer's responsibility to figure out how to associate
2241the correct tables with an abbreviated image. While abbreviated datastreams
2242can be useful in a closed environment, their use is strongly discouraged in
2243any situation where data exchange with other applications might be needed.
2244Caveat designer.
2245
2246The JPEG library provides support for reading and writing any combination of
2247tables-only datastreams and abbreviated images. In both compression and
2248decompression objects, a quantization or Huffman table will be retained for
2249the lifetime of the object, unless it is overwritten by a new table definition.
2250
2251
2252To create abbreviated image datastreams, it is only necessary to tell the
2253compressor not to emit some or all of the tables it is using. Each
2254quantization and Huffman table struct contains a boolean field "sent_table",
2255which normally is initialized to FALSE. For each table used by the image, the
2256header-writing process emits the table and sets sent_table = TRUE unless it is
2257already TRUE. (In normal usage, this prevents outputting the same table
2258definition multiple times, as would otherwise occur because the chroma
2259components typically share tables.) Thus, setting this field to TRUE before
2260calling jpeg_start_compress() will prevent the table from being written at
2261all.
2262
2263If you want to create a "pure" abbreviated image file containing no tables,
2264just call "jpeg_suppress_tables(&cinfo, TRUE)" after constructing all the
2265tables. If you want to emit some but not all tables, you'll need to set the
2266individual sent_table fields directly.
2267
2268To create an abbreviated image, you must also call jpeg_start_compress()
2269with a second parameter of FALSE, not TRUE. Otherwise jpeg_start_compress()
2270will force all the sent_table fields to FALSE. (This is a safety feature to
2271prevent abbreviated images from being created accidentally.)
2272
2273To create a tables-only file, perform the same parameter setup that you
2274normally would, but instead of calling jpeg_start_compress() and so on, call
2275jpeg_write_tables(&cinfo). This will write an abbreviated datastream
2276containing only SOI, DQT and/or DHT markers, and EOI. All the quantization
2277and Huffman tables that are currently defined in the compression object will
2278be emitted unless their sent_tables flag is already TRUE, and then all the
2279sent_tables flags will be set TRUE.
2280
2281A sure-fire way to create matching tables-only and abbreviated image files
2282is to proceed as follows:
2283
2284 create JPEG compression object
2285 set JPEG parameters
2286 set destination to tables-only file
2287 jpeg_write_tables(&cinfo);
2288 set destination to image file
2289 jpeg_start_compress(&cinfo, FALSE);
2290 write data...
2291 jpeg_finish_compress(&cinfo);
2292
2293Since the JPEG parameters are not altered between writing the table file and
2294the abbreviated image file, the same tables are sure to be used. Of course,
2295you can repeat the jpeg_start_compress() ... jpeg_finish_compress() sequence
2296many times to produce many abbreviated image files matching the table file.
2297
2298You cannot suppress output of the computed Huffman tables when Huffman
2299optimization is selected. (If you could, there'd be no way to decode the
2300image...) Generally, you don't want to set optimize_coding = TRUE when
2301you are trying to produce abbreviated files.
2302
2303In some cases you might want to compress an image using tables which are
2304not stored in the application, but are defined in an interchange or
2305tables-only file readable by the application. This can be done by setting up
2306a JPEG decompression object to read the specification file, then copying the
2307tables into your compression object. See jpeg_copy_critical_parameters()
2308for an example of copying quantization tables.
2309
2310
2311To read abbreviated image files, you simply need to load the proper tables
2312into the decompression object before trying to read the abbreviated image.
2313If the proper tables are stored in the application program, you can just
2314allocate the table structs and fill in their contents directly. For example,
2315to load a fixed quantization table into table slot "n":
2316
2317 if (cinfo.quant_tbl_ptrs[n] == NULL)
2318 cinfo.quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);
2319 quant_ptr = cinfo.quant_tbl_ptrs[n]; /* quant_ptr is JQUANT_TBL* */
2320 for (i = 0; i < 64; i++) {
2321 /* Qtable[] is desired quantization table, in natural array order */
2322 quant_ptr->quantval[i] = Qtable[i];
2323 }
2324
2325Code to load a fixed Huffman table is typically (for AC table "n"):
2326
2327 if (cinfo.ac_huff_tbl_ptrs[n] == NULL)
2328 cinfo.ac_huff_tbl_ptrs[n] = jpeg_alloc_huff_table((j_common_ptr) &cinfo);
2329 huff_ptr = cinfo.ac_huff_tbl_ptrs[n]; /* huff_ptr is JHUFF_TBL* */
2330 for (i = 1; i <= 16; i++) {
2331 /* counts[i] is number of Huffman codes of length i bits, i=1..16 */
2332 huff_ptr->bits[i] = counts[i];
2333 }
2334 for (i = 0; i < 256; i++) {
2335 /* symbols[] is the list of Huffman symbols, in code-length order */
2336 huff_ptr->huffval[i] = symbols[i];
2337 }
2338
2339(Note that trying to set cinfo.quant_tbl_ptrs[n] to point directly at a
2340constant JQUANT_TBL object is not safe. If the incoming file happened to
2341contain a quantization table definition, your master table would get
2342overwritten! Instead allocate a working table copy and copy the master table
2343into it, as illustrated above. Ditto for Huffman tables, of course.)
2344
2345You might want to read the tables from a tables-only file, rather than
2346hard-wiring them into your application. The jpeg_read_header() call is
2347sufficient to read a tables-only file. You must pass a second parameter of
2348FALSE to indicate that you do not require an image to be present. Thus, the
2349typical scenario is
2350
2351 create JPEG decompression object
2352 set source to tables-only file
2353 jpeg_read_header(&cinfo, FALSE);
2354 set source to abbreviated image file
2355 jpeg_read_header(&cinfo, TRUE);
2356 set decompression parameters
2357 jpeg_start_decompress(&cinfo);
2358 read data...
2359 jpeg_finish_decompress(&cinfo);
2360
2361In some cases, you may want to read a file without knowing whether it contains
2362an image or just tables. In that case, pass FALSE and check the return value
2363from jpeg_read_header(): it will be JPEG_HEADER_OK if an image was found,
2364JPEG_HEADER_TABLES_ONLY if only tables were found. (A third return value,
2365JPEG_SUSPENDED, is possible when using a suspending data source manager.)
2366Note that jpeg_read_header() will not complain if you read an abbreviated
2367image for which you haven't loaded the missing tables; the missing-table check
2368occurs later, in jpeg_start_decompress().
2369
2370
2371It is possible to read a series of images from a single source file by
2372repeating the jpeg_read_header() ... jpeg_finish_decompress() sequence,
2373without releasing/recreating the JPEG object or the data source module.
2374(If you did reinitialize, any partial bufferload left in the data source
2375buffer at the end of one image would be discarded, causing you to lose the
2376start of the next image.) When you use this method, stored tables are
2377automatically carried forward, so some of the images can be abbreviated images
2378that depend on tables from earlier images.
2379
2380If you intend to write a series of images into a single destination file,
2381you might want to make a specialized data destination module that doesn't
2382flush the output buffer at term_destination() time. This would speed things
2383up by some trifling amount. Of course, you'd need to remember to flush the
2384buffer after the last image. You can make the later images be abbreviated
2385ones by passing FALSE to jpeg_start_compress().
2386
2387
2388Special markers
2389---------------
2390
2391Some applications may need to insert or extract special data in the JPEG
2392datastream. The JPEG standard provides marker types "COM" (comment) and
2393"APP0" through "APP15" (application) to hold application-specific data.
2394Unfortunately, the use of these markers is not specified by the standard.
2395COM markers are fairly widely used to hold user-supplied text. The JFIF file
2396format spec uses APP0 markers with specified initial strings to hold certain
2397data. Adobe applications use APP14 markers beginning with the string "Adobe"
2398for miscellaneous data. Other APPn markers are rarely seen, but might
2399contain almost anything.
2400
2401If you wish to store user-supplied text, we recommend you use COM markers
2402and place readable 7-bit ASCII text in them. Newline conventions are not
2403standardized --- expect to find LF (Unix style), CR/LF (DOS style), or CR
2404(Mac style). A robust COM reader should be able to cope with random binary
2405garbage, including nulls, since some applications generate COM markers
2406containing non-ASCII junk. (But yours should not be one of them.)
2407
2408For program-supplied data, use an APPn marker, and be sure to begin it with an
2409identifying string so that you can tell whether the marker is actually yours.
2410It's probably best to avoid using APP0 or APP14 for any private markers.
2411(NOTE: the upcoming SPIFF standard will use APP8 markers; we recommend you
2412not use APP8 markers for any private purposes, either.)
2413
2414Keep in mind that at most 65533 bytes can be put into one marker, but you
2415can have as many markers as you like.
2416
2417By default, the IJG compression library will write a JFIF APP0 marker if the
2418selected JPEG colorspace is grayscale or YCbCr, or an Adobe APP14 marker if
2419the selected colorspace is RGB, CMYK, or YCCK. You can disable this, but
2420we don't recommend it. The decompression library will recognize JFIF and
2421Adobe markers and will set the JPEG colorspace properly when one is found.
2422
2423
2424You can write special markers immediately following the datastream header by
2425calling jpeg_write_marker() after jpeg_start_compress() and before the first
2426call to jpeg_write_scanlines(). When you do this, the markers appear after
2427the SOI and the JFIF APP0 and Adobe APP14 markers (if written), but before
2428all else. Specify the marker type parameter as "JPEG_COM" for COM or
2429"JPEG_APP0 + n" for APPn. (Actually, jpeg_write_marker will let you write
2430any marker type, but we don't recommend writing any other kinds of marker.)
2431For example, to write a user comment string pointed to by comment_text:
2432 jpeg_write_marker(cinfo, JPEG_COM, comment_text, strlen(comment_text));
2433
2434If it's not convenient to store all the marker data in memory at once,
2435you can instead call jpeg_write_m_header() followed by multiple calls to
2436jpeg_write_m_byte(). If you do it this way, it's your responsibility to
2437call jpeg_write_m_byte() exactly the number of times given in the length
2438parameter to jpeg_write_m_header(). (This method lets you empty the
2439output buffer partway through a marker, which might be important when
2440using a suspending data destination module. In any case, if you are using
2441a suspending destination, you should flush its buffer after inserting
2442any special markers. See "I/O suspension".)
2443
2444Or, if you prefer to synthesize the marker byte sequence yourself,
2445you can just cram it straight into the data destination module.
2446
2447If you are writing JFIF 1.02 extension markers (thumbnail images), don't
2448forget to set cinfo.JFIF_minor_version = 2 so that the encoder will write the
2449correct JFIF version number in the JFIF header marker. The library's default
2450is to write version 1.01, but that's wrong if you insert any 1.02 extension
2451markers. (We could probably get away with just defaulting to 1.02, but there
2452used to be broken decoders that would complain about unknown minor version
2453numbers. To reduce compatibility risks it's safest not to write 1.02 unless
2454you are actually using 1.02 extensions.)
2455
2456
2457When reading, two methods of handling special markers are available:
24581. You can ask the library to save the contents of COM and/or APPn markers
2459into memory, and then examine them at your leisure afterwards.
24602. You can supply your own routine to process COM and/or APPn markers
2461on-the-fly as they are read.
2462The first method is simpler to use, especially if you are using a suspending
2463data source; writing a marker processor that copes with input suspension is
2464not easy (consider what happens if the marker is longer than your available
2465input buffer). However, the second method conserves memory since the marker
2466data need not be kept around after it's been processed.
2467
2468For either method, you'd normally set up marker handling after creating a
2469decompression object and before calling jpeg_read_header(), because the
2470markers of interest will typically be near the head of the file and so will
2471be scanned by jpeg_read_header. Once you've established a marker handling
2472method, it will be used for the life of that decompression object
2473(potentially many datastreams), unless you change it. Marker handling is
2474determined separately for COM markers and for each APPn marker code.
2475
2476
2477To save the contents of special markers in memory, call
2478 jpeg_save_markers(cinfo, marker_code, length_limit)
2479where marker_code is the marker type to save, JPEG_COM or JPEG_APP0+n.
2480(To arrange to save all the special marker types, you need to call this
2481routine 17 times, for COM and APP0-APP15.) If the incoming marker is longer
2482than length_limit data bytes, only length_limit bytes will be saved; this
2483parameter allows you to avoid chewing up memory when you only need to see the
2484first few bytes of a potentially large marker. If you want to save all the
2485data, set length_limit to 0xFFFF; that is enough since marker lengths are only
248616 bits. As a special case, setting length_limit to 0 prevents that marker
2487type from being saved at all. (That is the default behavior, in fact.)
2488
2489After jpeg_read_header() completes, you can examine the special markers by
2490following the cinfo->marker_list pointer chain. All the special markers in
2491the file appear in this list, in order of their occurrence in the file (but
2492omitting any markers of types you didn't ask for). Both the original data
2493length and the saved data length are recorded for each list entry; the latter
2494will not exceed length_limit for the particular marker type. Note that these
2495lengths exclude the marker length word, whereas the stored representation
2496within the JPEG file includes it. (Hence the maximum data length is really
2497only 65533.)
2498
2499It is possible that additional special markers appear in the file beyond the
2500SOS marker at which jpeg_read_header stops; if so, the marker list will be
2501extended during reading of the rest of the file. This is not expected to be
2502common, however. If you are short on memory you may want to reset the length
2503limit to zero for all marker types after finishing jpeg_read_header, to
2504ensure that the max_memory_to_use setting cannot be exceeded due to addition
2505of later markers.
2506
2507The marker list remains stored until you call jpeg_finish_decompress or
2508jpeg_abort, at which point the memory is freed and the list is set to empty.
2509(jpeg_destroy also releases the storage, of course.)
2510
2511Note that the library is internally interested in APP0 and APP14 markers;
2512if you try to set a small nonzero length limit on these types, the library
2513will silently force the length up to the minimum it wants. (But you can set
2514a zero length limit to prevent them from being saved at all.) Also, in a
251516-bit environment, the maximum length limit may be constrained to less than
251665533 by malloc() limitations. It is therefore best not to assume that the
2517effective length limit is exactly what you set it to be.
2518
2519
2520If you want to supply your own marker-reading routine, you do it by calling
2521jpeg_set_marker_processor(). A marker processor routine must have the
2522signature
2523 boolean jpeg_marker_parser_method (j_decompress_ptr cinfo)
2524Although the marker code is not explicitly passed, the routine can find it
2525in cinfo->unread_marker. At the time of call, the marker proper has been
2526read from the data source module. The processor routine is responsible for
2527reading the marker length word and the remaining parameter bytes, if any.
2528Return TRUE to indicate success. (FALSE should be returned only if you are
2529using a suspending data source and it tells you to suspend. See the standard
2530marker processors in jdmarker.c for appropriate coding methods if you need to
2531use a suspending data source.)
2532
2533If you override the default APP0 or APP14 processors, it is up to you to
2534recognize JFIF and Adobe markers if you want colorspace recognition to occur
2535properly. We recommend copying and extending the default processors if you
2536want to do that. (A better idea is to save these marker types for later
2537examination by calling jpeg_save_markers(); that method doesn't interfere
2538with the library's own processing of these markers.)
2539
2540jpeg_set_marker_processor() and jpeg_save_markers() are mutually exclusive
2541--- if you call one it overrides any previous call to the other, for the
2542particular marker type specified.
2543
2544A simple example of an external COM processor can be found in djpeg.c.
2545Also, see jpegtran.c for an example of using jpeg_save_markers.
2546
2547
2548Raw (downsampled) image data
2549----------------------------
2550
2551Some applications need to supply already-downsampled image data to the JPEG
2552compressor, or to receive raw downsampled data from the decompressor. The
2553library supports this requirement by allowing the application to write or
2554read raw data, bypassing the normal preprocessing or postprocessing steps.
2555The interface is different from the standard one and is somewhat harder to
2556use. If your interest is merely in bypassing color conversion, we recommend
2557that you use the standard interface and simply set jpeg_color_space =
2558in_color_space (or jpeg_color_space = out_color_space for decompression).
2559The mechanism described in this section is necessary only to supply or
2560receive downsampled image data, in which not all components have the same
2561dimensions.
2562
2563
2564To compress raw data, you must supply the data in the colorspace to be used
2565in the JPEG file (please read the earlier section on Special color spaces)
2566and downsampled to the sampling factors specified in the JPEG parameters.
2567You must supply the data in the format used internally by the JPEG library,
2568namely a JSAMPIMAGE array. This is an array of pointers to two-dimensional
2569arrays, each of type JSAMPARRAY. Each 2-D array holds the values for one
2570color component. This structure is necessary since the components are of
2571different sizes. If the image dimensions are not a multiple of the MCU size,
2572you must also pad the data correctly (usually, this is done by replicating
2573the last column and/or row). The data must be padded to a multiple of a DCT
2574block in each component: that is, each downsampled row must contain a
2575multiple of 8 valid samples, and there must be a multiple of 8 sample rows
2576for each component. (For applications such as conversion of digital TV
2577images, the standard image size is usually a multiple of the DCT block size,
2578so that no padding need actually be done.)
2579
2580The procedure for compression of raw data is basically the same as normal
2581compression, except that you call jpeg_write_raw_data() in place of
2582jpeg_write_scanlines(). Before calling jpeg_start_compress(), you must do
2583the following:
2584 * Set cinfo->raw_data_in to TRUE. (It is set FALSE by jpeg_set_defaults().)
2585 This notifies the library that you will be supplying raw data.
2586 Furthermore, set cinfo->do_fancy_downsampling to FALSE if you want to use
2587 real downsampled data. (It is set TRUE by jpeg_set_defaults().)
2588 * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace()
2589 call is a good idea. Note that since color conversion is bypassed,
2590 in_color_space is ignored, except that jpeg_set_defaults() uses it to
2591 choose the default jpeg_color_space setting.
2592 * Ensure the sampling factors, cinfo->comp_info[i].h_samp_factor and
2593 cinfo->comp_info[i].v_samp_factor, are correct. Since these indicate the
2594 dimensions of the data you are supplying, it's wise to set them
2595 explicitly, rather than assuming the library's defaults are what you want.
2596
2597To pass raw data to the library, call jpeg_write_raw_data() in place of
2598jpeg_write_scanlines(). The two routines work similarly except that
2599jpeg_write_raw_data takes a JSAMPIMAGE data array rather than JSAMPARRAY.
2600The scanlines count passed to and returned from jpeg_write_raw_data is
2601measured in terms of the component with the largest v_samp_factor.
2602
2603jpeg_write_raw_data() processes one MCU row per call, which is to say
2604v_samp_factor*DCTSIZE sample rows of each component. The passed num_lines
2605value must be at least max_v_samp_factor*DCTSIZE, and the return value will
2606be exactly that amount (or possibly some multiple of that amount, in future
2607library versions). This is true even on the last call at the bottom of the
2608image; don't forget to pad your data as necessary.
2609
2610The required dimensions of the supplied data can be computed for each
2611component as
2612 cinfo->comp_info[i].width_in_blocks*DCTSIZE samples per row
2613 cinfo->comp_info[i].height_in_blocks*DCTSIZE rows in image
2614after jpeg_start_compress() has initialized those fields. If the valid data
2615is smaller than this, it must be padded appropriately. For some sampling
2616factors and image sizes, additional dummy DCT blocks are inserted to make
2617the image a multiple of the MCU dimensions. The library creates such dummy
2618blocks itself; it does not read them from your supplied data. Therefore you
2619need never pad by more than DCTSIZE samples. An example may help here.
2620Assume 2h2v downsampling of YCbCr data, that is
2621 cinfo->comp_info[0].h_samp_factor = 2 for Y
2622 cinfo->comp_info[0].v_samp_factor = 2
2623 cinfo->comp_info[1].h_samp_factor = 1 for Cb
2624 cinfo->comp_info[1].v_samp_factor = 1
2625 cinfo->comp_info[2].h_samp_factor = 1 for Cr
2626 cinfo->comp_info[2].v_samp_factor = 1
2627and suppose that the nominal image dimensions (cinfo->image_width and
2628cinfo->image_height) are 101x101 pixels. Then jpeg_start_compress() will
2629compute downsampled_width = 101 and width_in_blocks = 13 for Y,
2630downsampled_width = 51 and width_in_blocks = 7 for Cb and Cr (and the same
2631for the height fields). You must pad the Y data to at least 13*8 = 104
2632columns and rows, the Cb/Cr data to at least 7*8 = 56 columns and rows. The
2633MCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16
2634scanlines on each call to jpeg_write_raw_data(), which is to say 16 actual
2635sample rows of Y and 8 each of Cb and Cr. A total of 7 MCU rows are needed,
2636so you must pass a total of 7*16 = 112 "scanlines". The last DCT block row
2637of Y data is dummy, so it doesn't matter what you pass for it in the data
2638arrays, but the scanlines count must total up to 112 so that all of the Cb
2639and Cr data gets passed.
2640
2641Output suspension is supported with raw-data compression: if the data
2642destination module suspends, jpeg_write_raw_data() will return 0.
2643In this case the same data rows must be passed again on the next call.
2644
2645
2646Decompression with raw data output implies bypassing all postprocessing.
2647You must deal with the color space and sampling factors present in the
2648incoming file. If your application only handles, say, 2h1v YCbCr data,
2649you must check for and fail on other color spaces or other sampling factors.
2650The library will not convert to a different color space for you.
2651
2652To obtain raw data output, set cinfo->raw_data_out = TRUE before
2653jpeg_start_decompress() (it is set FALSE by jpeg_read_header()). Be sure to
2654verify that the color space and sampling factors are ones you can handle.
2655Furthermore, set cinfo->do_fancy_upsampling = FALSE if you want to get real
2656downsampled data (it is set TRUE by jpeg_read_header()).
2657Then call jpeg_read_raw_data() in place of jpeg_read_scanlines(). The
2658decompression process is otherwise the same as usual.
2659
2660jpeg_read_raw_data() returns one MCU row per call, and thus you must pass a
2661buffer of at least max_v_samp_factor*DCTSIZE scanlines (scanline counting is
2662the same as for raw-data compression). The buffer you pass must be large
2663enough to hold the actual data plus padding to DCT-block boundaries. As with
2664compression, any entirely dummy DCT blocks are not processed so you need not
2665allocate space for them, but the total scanline count includes them. The
2666above example of computing buffer dimensions for raw-data compression is
2667equally valid for decompression.
2668
2669Input suspension is supported with raw-data decompression: if the data source
2670module suspends, jpeg_read_raw_data() will return 0. You can also use
2671buffered-image mode to read raw data in multiple passes.
2672
2673
2674Really raw data: DCT coefficients
2675---------------------------------
2676
2677It is possible to read or write the contents of a JPEG file as raw DCT
2678coefficients. This facility is mainly intended for use in lossless
2679transcoding between different JPEG file formats. Other possible applications
2680include lossless cropping of a JPEG image, lossless reassembly of a
2681multi-strip or multi-tile TIFF/JPEG file into a single JPEG datastream, etc.
2682
2683To read the contents of a JPEG file as DCT coefficients, open the file and do
2684jpeg_read_header() as usual. But instead of calling jpeg_start_decompress()
2685and jpeg_read_scanlines(), call jpeg_read_coefficients(). This will read the
2686entire image into a set of virtual coefficient-block arrays, one array per
2687component. The return value is a pointer to an array of virtual-array
2688descriptors. Each virtual array can be accessed directly using the JPEG
2689memory manager's access_virt_barray method (see Memory management, below,
2690and also read structure.txt's discussion of virtual array handling). Or,
2691for simple transcoding to a different JPEG file format, the array list can
2692just be handed directly to jpeg_write_coefficients().
2693
2694Each block in the block arrays contains quantized coefficient values in
2695normal array order (not JPEG zigzag order). The block arrays contain only
2696DCT blocks containing real data; any entirely-dummy blocks added to fill out
2697interleaved MCUs at the right or bottom edges of the image are discarded
2698during reading and are not stored in the block arrays. (The size of each
2699block array can be determined from the width_in_blocks and height_in_blocks
2700fields of the component's comp_info entry.) This is also the data format
2701expected by jpeg_write_coefficients().
2702
2703When you are done using the virtual arrays, call jpeg_finish_decompress()
2704to release the array storage and return the decompression object to an idle
2705state; or just call jpeg_destroy() if you don't need to reuse the object.
2706
2707If you use a suspending data source, jpeg_read_coefficients() will return
2708NULL if it is forced to suspend; a non-NULL return value indicates successful
2709completion. You need not test for a NULL return value when using a
2710non-suspending data source.
2711
2712It is also possible to call jpeg_read_coefficients() to obtain access to the
2713decoder's coefficient arrays during a normal decode cycle in buffered-image
2714mode. This frammish might be useful for progressively displaying an incoming
2715image and then re-encoding it without loss. To do this, decode in buffered-
2716image mode as discussed previously, then call jpeg_read_coefficients() after
2717the last jpeg_finish_output() call. The arrays will be available for your use
2718until you call jpeg_finish_decompress().
2719
2720
2721To write the contents of a JPEG file as DCT coefficients, you must provide
2722the DCT coefficients stored in virtual block arrays. You can either pass
2723block arrays read from an input JPEG file by jpeg_read_coefficients(), or
2724allocate virtual arrays from the JPEG compression object and fill them
2725yourself. In either case, jpeg_write_coefficients() is substituted for
2726jpeg_start_compress() and jpeg_write_scanlines(). Thus the sequence is
2727 * Create compression object
2728 * Set all compression parameters as necessary
2729 * Request virtual arrays if needed
2730 * jpeg_write_coefficients()
2731 * jpeg_finish_compress()
2732 * Destroy or re-use compression object
2733jpeg_write_coefficients() is passed a pointer to an array of virtual block
2734array descriptors; the number of arrays is equal to cinfo.num_components.
2735
2736The virtual arrays need only have been requested, not realized, before
2737jpeg_write_coefficients() is called. A side-effect of
2738jpeg_write_coefficients() is to realize any virtual arrays that have been
2739requested from the compression object's memory manager. Thus, when obtaining
2740the virtual arrays from the compression object, you should fill the arrays
2741after calling jpeg_write_coefficients(). The data is actually written out
2742when you call jpeg_finish_compress(); jpeg_write_coefficients() only writes
2743the file header.
2744
2745When writing raw DCT coefficients, it is crucial that the JPEG quantization
2746tables and sampling factors match the way the data was encoded, or the
2747resulting file will be invalid. For transcoding from an existing JPEG file,
2748we recommend using jpeg_copy_critical_parameters(). This routine initializes
2749all the compression parameters to default values (like jpeg_set_defaults()),
2750then copies the critical information from a source decompression object.
2751The decompression object should have just been used to read the entire
2752JPEG input file --- that is, it should be awaiting jpeg_finish_decompress().
2753
2754jpeg_write_coefficients() marks all tables stored in the compression object
2755as needing to be written to the output file (thus, it acts like
2756jpeg_start_compress(cinfo, TRUE)). This is for safety's sake, to avoid
2757emitting abbreviated JPEG files by accident. If you really want to emit an
2758abbreviated JPEG file, call jpeg_suppress_tables(), or set the tables'
2759individual sent_table flags, between calling jpeg_write_coefficients() and
2760jpeg_finish_compress().
2761
2762
2763Progress monitoring
2764-------------------
2765
2766Some applications may need to regain control from the JPEG library every so
2767often. The typical use of this feature is to produce a percent-done bar or
2768other progress display. (For a simple example, see cjpeg.c or djpeg.c.)
2769Although you do get control back frequently during the data-transferring pass
2770(the jpeg_read_scanlines or jpeg_write_scanlines loop), any additional passes
2771will occur inside jpeg_finish_compress or jpeg_start_decompress; those
2772routines may take a long time to execute, and you don't get control back
2773until they are done.
2774
2775You can define a progress-monitor routine which will be called periodically
2776by the library. No guarantees are made about how often this call will occur,
2777so we don't recommend you use it for mouse tracking or anything like that.
2778At present, a call will occur once per MCU row, scanline, or sample row
2779group, whichever unit is convenient for the current processing mode; so the
2780wider the image, the longer the time between calls. During the data
2781transferring pass, only one call occurs per call of jpeg_read_scanlines or
2782jpeg_write_scanlines, so don't pass a large number of scanlines at once if
2783you want fine resolution in the progress count. (If you really need to use
2784the callback mechanism for time-critical tasks like mouse tracking, you could
2785insert additional calls inside some of the library's inner loops.)
2786
2787To establish a progress-monitor callback, create a struct jpeg_progress_mgr,
2788fill in its progress_monitor field with a pointer to your callback routine,
2789and set cinfo->progress to point to the struct. The callback will be called
2790whenever cinfo->progress is non-NULL. (This pointer is set to NULL by
2791jpeg_create_compress or jpeg_create_decompress; the library will not change
2792it thereafter. So if you allocate dynamic storage for the progress struct,
2793make sure it will live as long as the JPEG object does. Allocating from the
2794JPEG memory manager with lifetime JPOOL_PERMANENT will work nicely.) You
2795can use the same callback routine for both compression and decompression.
2796
2797The jpeg_progress_mgr struct contains four fields which are set by the library:
2798 long pass_counter; /* work units completed in this pass */
2799 long pass_limit; /* total number of work units in this pass */
2800 int completed_passes; /* passes completed so far */
2801 int total_passes; /* total number of passes expected */
2802During any one pass, pass_counter increases from 0 up to (not including)
2803pass_limit; the step size is usually but not necessarily 1. The pass_limit
2804value may change from one pass to another. The expected total number of
2805passes is in total_passes, and the number of passes already completed is in
2806completed_passes. Thus the fraction of work completed may be estimated as
2807 completed_passes + (pass_counter/pass_limit)
2808 --------------------------------------------
2809 total_passes
2810ignoring the fact that the passes may not be equal amounts of work.
2811
2812When decompressing, pass_limit can even change within a pass, because it
2813depends on the number of scans in the JPEG file, which isn't always known in
2814advance. The computed fraction-of-work-done may jump suddenly (if the library
2815discovers it has overestimated the number of scans) or even decrease (in the
2816opposite case). It is not wise to put great faith in the work estimate.
2817
2818When using the decompressor's buffered-image mode, the progress monitor work
2819estimate is likely to be completely unhelpful, because the library has no way
2820to know how many output passes will be demanded of it. Currently, the library
2821sets total_passes based on the assumption that there will be one more output
2822pass if the input file end hasn't yet been read (jpeg_input_complete() isn't
2823TRUE), but no more output passes if the file end has been reached when the
2824output pass is started. This means that total_passes will rise as additional
2825output passes are requested. If you have a way of determining the input file
2826size, estimating progress based on the fraction of the file that's been read
2827will probably be more useful than using the library's value.
2828
2829
2830Memory management
2831-----------------
2832
2833This section covers some key facts about the JPEG library's built-in memory
2834manager. For more info, please read structure.txt's section about the memory
2835manager, and consult the source code if necessary.
2836
2837All memory and temporary file allocation within the library is done via the
2838memory manager. If necessary, you can replace the "back end" of the memory
2839manager to control allocation yourself (for example, if you don't want the
2840library to use malloc() and free() for some reason).
2841
2842Some data is allocated "permanently" and will not be freed until the JPEG
2843object is destroyed. Most data is allocated "per image" and is freed by
2844jpeg_finish_compress, jpeg_finish_decompress, or jpeg_abort. You can call the
2845memory manager yourself to allocate structures that will automatically be
2846freed at these times. Typical code for this is
2847 ptr = (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, size);
2848Use JPOOL_PERMANENT to get storage that lasts as long as the JPEG object.
2849Use alloc_large instead of alloc_small for anything bigger than a few Kbytes.
2850There are also alloc_sarray and alloc_barray routines that automatically
2851build 2-D sample or block arrays.
2852
2853The library's minimum space requirements to process an image depend on the
2854image's width, but not on its height, because the library ordinarily works
2855with "strip" buffers that are as wide as the image but just a few rows high.
2856Some operating modes (eg, two-pass color quantization) require full-image
2857buffers. Such buffers are treated as "virtual arrays": only the current strip
2858need be in memory, and the rest can be swapped out to a temporary file.
2859
2860If you use the simplest memory manager back end (jmemnobs.c), then no
2861temporary files are used; virtual arrays are simply malloc()'d. Images bigger
2862than memory can be processed only if your system supports virtual memory.
2863The other memory manager back ends support temporary files of various flavors
2864and thus work in machines without virtual memory. They may also be useful on
2865Unix machines if you need to process images that exceed available swap space.
2866
2867When using temporary files, the library will make the in-memory buffers for
2868its virtual arrays just big enough to stay within a "maximum memory" setting.
2869Your application can set this limit by setting cinfo->mem->max_memory_to_use
2870after creating the JPEG object. (Of course, there is still a minimum size for
2871the buffers, so the max-memory setting is effective only if it is bigger than
2872the minimum space needed.) If you allocate any large structures yourself, you
2873must allocate them before jpeg_start_compress() or jpeg_start_decompress() in
2874order to have them counted against the max memory limit. Also keep in mind
2875that space allocated with alloc_small() is ignored, on the assumption that
2876it's too small to be worth worrying about; so a reasonable safety margin
2877should be left when setting max_memory_to_use.
2878
2879If you use the jmemname.c or jmemdos.c memory manager back end, it is
2880important to clean up the JPEG object properly to ensure that the temporary
2881files get deleted. (This is especially crucial with jmemdos.c, where the
2882"temporary files" may be extended-memory segments; if they are not freed,
2883DOS will require a reboot to recover the memory.) Thus, with these memory
2884managers, it's a good idea to provide a signal handler that will trap any
2885early exit from your program. The handler should call either jpeg_abort()
2886or jpeg_destroy() for any active JPEG objects. A handler is not needed with
2887jmemnobs.c, and shouldn't be necessary with jmemansi.c or jmemmac.c either,
2888since the C library is supposed to take care of deleting files made with
2889tmpfile().
2890
2891
2892Memory usage
2893------------
2894
2895Working memory requirements while performing compression or decompression
2896depend on image dimensions, image characteristics (such as colorspace and
2897JPEG process), and operating mode (application-selected options).
2898
2899As of v6b, the decompressor requires:
2900 1. About 24K in more-or-less-fixed-size data. This varies a bit depending
2901 on operating mode and image characteristics (particularly color vs.
2902 grayscale), but it doesn't depend on image dimensions.
2903 2. Strip buffers (of size proportional to the image width) for IDCT and
2904 upsampling results. The worst case for commonly used sampling factors
2905 is about 34 bytes * width in pixels for a color image. A grayscale image
2906 only needs about 8 bytes per pixel column.
2907 3. A full-image DCT coefficient buffer is needed to decode a multi-scan JPEG
2908 file (including progressive JPEGs), or whenever you select buffered-image
2909 mode. This takes 2 bytes/coefficient. At typical 2x2 sampling, that's
2910 3 bytes per pixel for a color image. Worst case (1x1 sampling) requires
2911 6 bytes/pixel. For grayscale, figure 2 bytes/pixel.
2912 4. To perform 2-pass color quantization, the decompressor also needs a
2913 128K color lookup table and a full-image pixel buffer (3 bytes/pixel).
2914This does not count any memory allocated by the application, such as a
2915buffer to hold the final output image.
2916
2917The above figures are valid for 8-bit JPEG data precision and a machine with
291832-bit ints. For 12-bit JPEG data, double the size of the strip buffers and
2919quantization pixel buffer. The "fixed-size" data will be somewhat smaller
2920with 16-bit ints, larger with 64-bit ints. Also, CMYK or other unusual
2921color spaces will require different amounts of space.
2922
2923The full-image coefficient and pixel buffers, if needed at all, do not
2924have to be fully RAM resident; you can have the library use temporary
2925files instead when the total memory usage would exceed a limit you set.
2926(But if your OS supports virtual memory, it's probably better to just use
2927jmemnobs and let the OS do the swapping.)
2928
2929The compressor's memory requirements are similar, except that it has no need
2930for color quantization. Also, it needs a full-image DCT coefficient buffer
2931if Huffman-table optimization is asked for, even if progressive mode is not
2932requested.
2933
2934If you need more detailed information about memory usage in a particular
2935situation, you can enable the MEM_STATS code in jmemmgr.c.
2936
2937
2938Library compile-time options
2939----------------------------
2940
2941A number of compile-time options are available by modifying jmorecfg.h.
2942
2943The JPEG standard provides for both the baseline 8-bit DCT process and
2944a 12-bit DCT process. The IJG code supports 12-bit JPEG if you define
2945BITS_IN_JSAMPLE as 12 rather than 8. Note that this causes JSAMPLE to be
2946larger than a char, so it affects the surrounding application's image data.
2947The sample applications cjpeg and djpeg can support 12-bit mode only for PPM
2948and GIF file formats; you must disable the other file formats to compile a
294912-bit cjpeg or djpeg. (install.txt has more information about that.)
2950At present, a 12-bit library can handle *only* 12-bit images, not both
2951precisions. (If you need to include both 8- and 12-bit libraries in a single
2952application, you could probably do it by defining NEED_SHORT_EXTERNAL_NAMES
2953for just one of the copies. You'd have to access the 8-bit and 12-bit copies
2954from separate application source files. This is untested ... if you try it,
2955we'd like to hear whether it works!)
2956
2957Note that a 12-bit library always compresses in Huffman optimization mode,
2958in order to generate valid Huffman tables. This is necessary because our
2959default Huffman tables only cover 8-bit data. If you need to output 12-bit
2960files in one pass, you'll have to supply suitable default Huffman tables.
2961You may also want to supply your own DCT quantization tables; the existing
2962quality-scaling code has been developed for 8-bit use, and probably doesn't
2963generate especially good tables for 12-bit.
2964
2965The maximum number of components (color channels) in the image is determined
2966by MAX_COMPONENTS. The JPEG standard allows up to 255 components, but we
2967expect that few applications will need more than four or so.
2968
2969On machines with unusual data type sizes, you may be able to improve
2970performance or reduce memory space by tweaking the various typedefs in
2971jmorecfg.h. In particular, on some RISC CPUs, access to arrays of "short"s
2972is quite slow; consider trading memory for speed by making JCOEF, INT16, and
2973UINT16 be "int" or "unsigned int". UINT8 is also a candidate to become int.
2974You probably don't want to make JSAMPLE be int unless you have lots of memory
2975to burn.
2976
2977You can reduce the size of the library by compiling out various optional
2978functions. To do this, undefine xxx_SUPPORTED symbols as necessary.
2979
2980You can also save a few K by not having text error messages in the library;
2981the standard error message table occupies about 5Kb. This is particularly
2982reasonable for embedded applications where there's no good way to display
2983a message anyway. To do this, remove the creation of the message table
2984(jpeg_std_message_table[]) from jerror.c, and alter format_message to do
2985something reasonable without it. You could output the numeric value of the
2986message code number, for example. If you do this, you can also save a couple
2987more K by modifying the TRACEMSn() macros in jerror.h to expand to nothing;
2988you don't need trace capability anyway, right?
2989
2990
2991Portability considerations
2992--------------------------
2993
2994The JPEG library has been written to be extremely portable; the sample
2995applications cjpeg and djpeg are slightly less so. This section summarizes
2996the design goals in this area. (If you encounter any bugs that cause the
2997library to be less portable than is claimed here, we'd appreciate hearing
2998about them.)
2999
3000The code works fine on ANSI C, C++, and pre-ANSI C compilers, using any of
3001the popular system include file setups, and some not-so-popular ones too.
3002See install.txt for configuration procedures.
3003
3004The code is not dependent on the exact sizes of the C data types. As
3005distributed, we make the assumptions that
3006 char is at least 8 bits wide
3007 short is at least 16 bits wide
3008 int is at least 16 bits wide
3009 long is at least 32 bits wide
3010(These are the minimum requirements of the ANSI C standard.) Wider types will
3011work fine, although memory may be used inefficiently if char is much larger
3012than 8 bits or short is much bigger than 16 bits. The code should work
3013equally well with 16- or 32-bit ints.
3014
3015In a system where these assumptions are not met, you may be able to make the
3016code work by modifying the typedefs in jmorecfg.h. However, you will probably
3017have difficulty if int is less than 16 bits wide, since references to plain
3018int abound in the code.
3019
3020char can be either signed or unsigned, although the code runs faster if an
3021unsigned char type is available. If char is wider than 8 bits, you will need
3022to redefine JOCTET and/or provide custom data source/destination managers so
3023that JOCTET represents exactly 8 bits of data on external storage.
3024
3025The JPEG library proper does not assume ASCII representation of characters.
3026But some of the image file I/O modules in cjpeg/djpeg do have ASCII
3027dependencies in file-header manipulation; so does cjpeg's select_file_type()
3028routine.
3029
3030The JPEG library does not rely heavily on the C library. In particular, C
3031stdio is used only by the data source/destination modules and the error
3032handler, all of which are application-replaceable. (cjpeg/djpeg are more
3033heavily dependent on stdio.) malloc and free are called only from the memory
3034manager "back end" module, so you can use a different memory allocator by
3035replacing that one file.
3036
3037The code generally assumes that C names must be unique in the first 15
3038characters. However, global function names can be made unique in the
3039first 6 characters by defining NEED_SHORT_EXTERNAL_NAMES.
3040
3041More info about porting the code may be gleaned by reading jconfig.txt,
3042jmorecfg.h, and jinclude.h.
3043
3044
3045Notes for MS-DOS implementors
3046-----------------------------
3047
3048The IJG code is designed to work efficiently in 80x86 "small" or "medium"
3049memory models (i.e., data pointers are 16 bits unless explicitly declared
3050"far"; code pointers can be either size). You may be able to use small
3051model to compile cjpeg or djpeg by itself, but you will probably have to use
3052medium model for any larger application. This won't make much difference in
3053performance. You *will* take a noticeable performance hit if you use a
3054large-data memory model (perhaps 10%-25%), and you should avoid "huge" model
3055if at all possible.
3056
3057The JPEG library typically needs 2Kb-3Kb of stack space. It will also
3058malloc about 20K-30K of near heap space while executing (and lots of far
3059heap, but that doesn't count in this calculation). This figure will vary
3060depending on selected operating mode, and to a lesser extent on image size.
3061There is also about 5Kb-6Kb of constant data which will be allocated in the
3062near data segment (about 4Kb of this is the error message table).
3063Thus you have perhaps 20K available for other modules' static data and near
3064heap space before you need to go to a larger memory model. The C library's
3065static data will account for several K of this, but that still leaves a good
3066deal for your needs. (If you are tight on space, you could reduce the sizes
3067of the I/O buffers allocated by jdatasrc.c and jdatadst.c, say from 4K to
30681K. Another possibility is to move the error message table to far memory;
3069this should be doable with only localized hacking on jerror.c.)
3070
3071About 2K of the near heap space is "permanent" memory that will not be
3072released until you destroy the JPEG object. This is only an issue if you
3073save a JPEG object between compression or decompression operations.
3074
3075Far data space may also be a tight resource when you are dealing with large
3076images. The most memory-intensive case is decompression with two-pass color
3077quantization, or single-pass quantization to an externally supplied color
3078map. This requires a 128Kb color lookup table plus strip buffers amounting
3079to about 40 bytes per column for typical sampling ratios (eg, about 25600
3080bytes for a 640-pixel-wide image). You may not be able to process wide
3081images if you have large data structures of your own.
3082
3083Of course, all of these concerns vanish if you use a 32-bit flat-memory-model
3084compiler, such as DJGPP or Watcom C. We highly recommend flat model if you
3085can use it; the JPEG library is significantly faster in flat model.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ltmain.sh b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ltmain.sh
new file mode 100644
index 0000000..67a1327
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/ltmain.sh
@@ -0,0 +1,9655 @@
1
2# libtool (GNU libtool) 2.4.2
3# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
5# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
6# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
7# This is free software; see the source for copying conditions. There is NO
8# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
10# GNU Libtool is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# As a special exception to the GNU General Public License,
16# if you distribute this file as part of a program or library that
17# is built using GNU Libtool, you may include this file under the
18# same distribution terms that you use for the rest of that program.
19#
20# GNU Libtool is distributed in the hope that it will be useful, but
21# WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23# General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with GNU Libtool; see the file COPYING. If not, a copy
27# can be downloaded from http://www.gnu.org/licenses/gpl.html,
28# or obtained by writing to the Free Software Foundation, Inc.,
29# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
31# Usage: $progname [OPTION]... [MODE-ARG]...
32#
33# Provide generalized library-building support services.
34#
35# --config show all configuration variables
36# --debug enable verbose shell tracing
37# -n, --dry-run display commands without modifying any files
38# --features display basic configuration information and exit
39# --mode=MODE use operation mode MODE
40# --preserve-dup-deps don't remove duplicate dependency libraries
41# --quiet, --silent don't print informational messages
42# --no-quiet, --no-silent
43# print informational messages (default)
44# --no-warn don't display warning messages
45# --tag=TAG use configuration variables from tag TAG
46# -v, --verbose print more informational messages than default
47# --no-verbose don't print the extra informational messages
48# --version print version information
49# -h, --help, --help-all print short, long, or detailed help message
50#
51# MODE must be one of the following:
52#
53# clean remove files from the build directory
54# compile compile a source file into a libtool object
55# execute automatically set library path, then run a program
56# finish complete the installation of libtool libraries
57# install install libraries or executables
58# link create a library or an executable
59# uninstall remove libraries from an installed directory
60#
61# MODE-ARGS vary depending on the MODE. When passed as first option,
62# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
63# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
64#
65# When reporting a bug, please describe a test case to reproduce it and
66# include the following information:
67#
68# host-triplet: $host
69# shell: $SHELL
70# compiler: $LTCC
71# compiler flags: $LTCFLAGS
72# linker: $LD (gnu? $with_gnu_ld)
73# $progname: (GNU libtool) 2.4.2
74# automake: $automake_version
75# autoconf: $autoconf_version
76#
77# Report bugs to <bug-libtool@gnu.org>.
78# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
79# General help using GNU software: <http://www.gnu.org/gethelp/>.
80
81PROGRAM=libtool
82PACKAGE=libtool
83VERSION=2.4.2
84TIMESTAMP=""
85package_revision=1.3337
86
87# Be Bourne compatible
88if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
89 emulate sh
90 NULLCMD=:
91 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
92 # is contrary to our usage. Disable this feature.
93 alias -g '${1+"$@"}'='"$@"'
94 setopt NO_GLOB_SUBST
95else
96 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
97fi
98BIN_SH=xpg4; export BIN_SH # for Tru64
99DUALCASE=1; export DUALCASE # for MKS sh
100
101# A function that is used when there is no print builtin or printf.
102func_fallback_echo ()
103{
104 eval 'cat <<_LTECHO_EOF
105$1
106_LTECHO_EOF'
107}
108
109# NLS nuisances: We save the old values to restore during execute mode.
110lt_user_locale=
111lt_safe_locale=
112for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
113do
114 eval "if test \"\${$lt_var+set}\" = set; then
115 save_$lt_var=\$$lt_var
116 $lt_var=C
117 export $lt_var
118 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
119 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
120 fi"
121done
122LC_ALL=C
123LANGUAGE=C
124export LANGUAGE LC_ALL
125
126$lt_unset CDPATH
127
128
129# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
130# is ksh but when the shell is invoked as "sh" and the current value of
131# the _XPG environment variable is not equal to 1 (one), the special
132# positional parameter $0, within a function call, is the name of the
133# function.
134progpath="$0"
135
136
137
138: ${CP="cp -f"}
139test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
140: ${MAKE="make"}
141: ${MKDIR="mkdir"}
142: ${MV="mv -f"}
143: ${RM="rm -f"}
144: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
145: ${Xsed="$SED -e 1s/^X//"}
146
147# Global variables:
148EXIT_SUCCESS=0
149EXIT_FAILURE=1
150EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
151EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
152
153exit_status=$EXIT_SUCCESS
154
155# Make sure IFS has a sensible default
156lt_nl='
157'
158IFS=" $lt_nl"
159
160dirname="s,/[^/]*$,,"
161basename="s,^.*/,,"
162
163# func_dirname file append nondir_replacement
164# Compute the dirname of FILE. If nonempty, add APPEND to the result,
165# otherwise set result to NONDIR_REPLACEMENT.
166func_dirname ()
167{
168 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
169 if test "X$func_dirname_result" = "X${1}"; then
170 func_dirname_result="${3}"
171 else
172 func_dirname_result="$func_dirname_result${2}"
173 fi
174} # func_dirname may be replaced by extended shell implementation
175
176
177# func_basename file
178func_basename ()
179{
180 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
181} # func_basename may be replaced by extended shell implementation
182
183
184# func_dirname_and_basename file append nondir_replacement
185# perform func_basename and func_dirname in a single function
186# call:
187# dirname: Compute the dirname of FILE. If nonempty,
188# add APPEND to the result, otherwise set result
189# to NONDIR_REPLACEMENT.
190# value returned in "$func_dirname_result"
191# basename: Compute filename of FILE.
192# value retuned in "$func_basename_result"
193# Implementation must be kept synchronized with func_dirname
194# and func_basename. For efficiency, we do not delegate to
195# those functions but instead duplicate the functionality here.
196func_dirname_and_basename ()
197{
198 # Extract subdirectory from the argument.
199 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
200 if test "X$func_dirname_result" = "X${1}"; then
201 func_dirname_result="${3}"
202 else
203 func_dirname_result="$func_dirname_result${2}"
204 fi
205 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
206} # func_dirname_and_basename may be replaced by extended shell implementation
207
208
209# func_stripname prefix suffix name
210# strip PREFIX and SUFFIX off of NAME.
211# PREFIX and SUFFIX must not contain globbing or regex special
212# characters, hashes, percent signs, but SUFFIX may contain a leading
213# dot (in which case that matches only a dot).
214# func_strip_suffix prefix name
215func_stripname ()
216{
217 case ${2} in
218 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
219 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
220 esac
221} # func_stripname may be replaced by extended shell implementation
222
223
224# These SED scripts presuppose an absolute path with a trailing slash.
225pathcar='s,^/\([^/]*\).*$,\1,'
226pathcdr='s,^/[^/]*,,'
227removedotparts=':dotsl
228 s@/\./@/@g
229 t dotsl
230 s,/\.$,/,'
231collapseslashes='s@/\{1,\}@/@g'
232finalslash='s,/*$,/,'
233
234# func_normal_abspath PATH
235# Remove doubled-up and trailing slashes, "." path components,
236# and cancel out any ".." path components in PATH after making
237# it an absolute path.
238# value returned in "$func_normal_abspath_result"
239func_normal_abspath ()
240{
241 # Start from root dir and reassemble the path.
242 func_normal_abspath_result=
243 func_normal_abspath_tpath=$1
244 func_normal_abspath_altnamespace=
245 case $func_normal_abspath_tpath in
246 "")
247 # Empty path, that just means $cwd.
248 func_stripname '' '/' "`pwd`"
249 func_normal_abspath_result=$func_stripname_result
250 return
251 ;;
252 # The next three entries are used to spot a run of precisely
253 # two leading slashes without using negated character classes;
254 # we take advantage of case's first-match behaviour.
255 ///*)
256 # Unusual form of absolute path, do nothing.
257 ;;
258 //*)
259 # Not necessarily an ordinary path; POSIX reserves leading '//'
260 # and for example Cygwin uses it to access remote file shares
261 # over CIFS/SMB, so we conserve a leading double slash if found.
262 func_normal_abspath_altnamespace=/
263 ;;
264 /*)
265 # Absolute path, do nothing.
266 ;;
267 *)
268 # Relative path, prepend $cwd.
269 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
270 ;;
271 esac
272 # Cancel out all the simple stuff to save iterations. We also want
273 # the path to end with a slash for ease of parsing, so make sure
274 # there is one (and only one) here.
275 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
276 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
277 while :; do
278 # Processed it all yet?
279 if test "$func_normal_abspath_tpath" = / ; then
280 # If we ascended to the root using ".." the result may be empty now.
281 if test -z "$func_normal_abspath_result" ; then
282 func_normal_abspath_result=/
283 fi
284 break
285 fi
286 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
287 -e "$pathcar"`
288 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
289 -e "$pathcdr"`
290 # Figure out what to do with it
291 case $func_normal_abspath_tcomponent in
292 "")
293 # Trailing empty path component, ignore it.
294 ;;
295 ..)
296 # Parent dir; strip last assembled component from result.
297 func_dirname "$func_normal_abspath_result"
298 func_normal_abspath_result=$func_dirname_result
299 ;;
300 *)
301 # Actual path component, append it.
302 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
303 ;;
304 esac
305 done
306 # Restore leading double-slash if one was found on entry.
307 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
308}
309
310# func_relative_path SRCDIR DSTDIR
311# generates a relative path from SRCDIR to DSTDIR, with a trailing
312# slash if non-empty, suitable for immediately appending a filename
313# without needing to append a separator.
314# value returned in "$func_relative_path_result"
315func_relative_path ()
316{
317 func_relative_path_result=
318 func_normal_abspath "$1"
319 func_relative_path_tlibdir=$func_normal_abspath_result
320 func_normal_abspath "$2"
321 func_relative_path_tbindir=$func_normal_abspath_result
322
323 # Ascend the tree starting from libdir
324 while :; do
325 # check if we have found a prefix of bindir
326 case $func_relative_path_tbindir in
327 $func_relative_path_tlibdir)
328 # found an exact match
329 func_relative_path_tcancelled=
330 break
331 ;;
332 $func_relative_path_tlibdir*)
333 # found a matching prefix
334 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
335 func_relative_path_tcancelled=$func_stripname_result
336 if test -z "$func_relative_path_result"; then
337 func_relative_path_result=.
338 fi
339 break
340 ;;
341 *)
342 func_dirname $func_relative_path_tlibdir
343 func_relative_path_tlibdir=${func_dirname_result}
344 if test "x$func_relative_path_tlibdir" = x ; then
345 # Have to descend all the way to the root!
346 func_relative_path_result=../$func_relative_path_result
347 func_relative_path_tcancelled=$func_relative_path_tbindir
348 break
349 fi
350 func_relative_path_result=../$func_relative_path_result
351 ;;
352 esac
353 done
354
355 # Now calculate path; take care to avoid doubling-up slashes.
356 func_stripname '' '/' "$func_relative_path_result"
357 func_relative_path_result=$func_stripname_result
358 func_stripname '/' '/' "$func_relative_path_tcancelled"
359 if test "x$func_stripname_result" != x ; then
360 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
361 fi
362
363 # Normalisation. If bindir is libdir, return empty string,
364 # else relative path ending with a slash; either way, target
365 # file name can be directly appended.
366 if test ! -z "$func_relative_path_result"; then
367 func_stripname './' '' "$func_relative_path_result/"
368 func_relative_path_result=$func_stripname_result
369 fi
370}
371
372# The name of this program:
373func_dirname_and_basename "$progpath"
374progname=$func_basename_result
375
376# Make sure we have an absolute path for reexecution:
377case $progpath in
378 [\\/]*|[A-Za-z]:\\*) ;;
379 *[\\/]*)
380 progdir=$func_dirname_result
381 progdir=`cd "$progdir" && pwd`
382 progpath="$progdir/$progname"
383 ;;
384 *)
385 save_IFS="$IFS"
386 IFS=${PATH_SEPARATOR-:}
387 for progdir in $PATH; do
388 IFS="$save_IFS"
389 test -x "$progdir/$progname" && break
390 done
391 IFS="$save_IFS"
392 test -n "$progdir" || progdir=`pwd`
393 progpath="$progdir/$progname"
394 ;;
395esac
396
397# Sed substitution that helps us do robust quoting. It backslashifies
398# metacharacters that are still active within double-quoted strings.
399Xsed="${SED}"' -e 1s/^X//'
400sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
401
402# Same as above, but do not quote variable references.
403double_quote_subst='s/\(["`\\]\)/\\\1/g'
404
405# Sed substitution that turns a string into a regex matching for the
406# string literally.
407sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
408
409# Sed substitution that converts a w32 file name or path
410# which contains forward slashes, into one that contains
411# (escaped) backslashes. A very naive implementation.
412lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
413
414# Re-`\' parameter expansions in output of double_quote_subst that were
415# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
416# in input to double_quote_subst, that '$' was protected from expansion.
417# Since each input `\' is now two `\'s, look for any number of runs of
418# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
419bs='\\'
420bs2='\\\\'
421bs4='\\\\\\\\'
422dollar='\$'
423sed_double_backslash="\
424 s/$bs4/&\\
425/g
426 s/^$bs2$dollar/$bs&/
427 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
428 s/\n//g"
429
430# Standard options:
431opt_dry_run=false
432opt_help=false
433opt_quiet=false
434opt_verbose=false
435opt_warning=:
436
437# func_echo arg...
438# Echo program name prefixed message, along with the current mode
439# name if it has been set yet.
440func_echo ()
441{
442 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
443}
444
445# func_verbose arg...
446# Echo program name prefixed message in verbose mode only.
447func_verbose ()
448{
449 $opt_verbose && func_echo ${1+"$@"}
450
451 # A bug in bash halts the script if the last line of a function
452 # fails when set -e is in force, so we need another command to
453 # work around that:
454 :
455}
456
457# func_echo_all arg...
458# Invoke $ECHO with all args, space-separated.
459func_echo_all ()
460{
461 $ECHO "$*"
462}
463
464# func_error arg...
465# Echo program name prefixed message to standard error.
466func_error ()
467{
468 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
469}
470
471# func_warning arg...
472# Echo program name prefixed warning message to standard error.
473func_warning ()
474{
475 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
476
477 # bash bug again:
478 :
479}
480
481# func_fatal_error arg...
482# Echo program name prefixed message to standard error, and exit.
483func_fatal_error ()
484{
485 func_error ${1+"$@"}
486 exit $EXIT_FAILURE
487}
488
489# func_fatal_help arg...
490# Echo program name prefixed message to standard error, followed by
491# a help hint, and exit.
492func_fatal_help ()
493{
494 func_error ${1+"$@"}
495 func_fatal_error "$help"
496}
497help="Try \`$progname --help' for more information." ## default
498
499
500# func_grep expression filename
501# Check whether EXPRESSION matches any line of FILENAME, without output.
502func_grep ()
503{
504 $GREP "$1" "$2" >/dev/null 2>&1
505}
506
507
508# func_mkdir_p directory-path
509# Make sure the entire path to DIRECTORY-PATH is available.
510func_mkdir_p ()
511{
512 my_directory_path="$1"
513 my_dir_list=
514
515 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
516
517 # Protect directory names starting with `-'
518 case $my_directory_path in
519 -*) my_directory_path="./$my_directory_path" ;;
520 esac
521
522 # While some portion of DIR does not yet exist...
523 while test ! -d "$my_directory_path"; do
524 # ...make a list in topmost first order. Use a colon delimited
525 # list incase some portion of path contains whitespace.
526 my_dir_list="$my_directory_path:$my_dir_list"
527
528 # If the last portion added has no slash in it, the list is done
529 case $my_directory_path in */*) ;; *) break ;; esac
530
531 # ...otherwise throw away the child directory and loop
532 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
533 done
534 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
535
536 save_mkdir_p_IFS="$IFS"; IFS=':'
537 for my_dir in $my_dir_list; do
538 IFS="$save_mkdir_p_IFS"
539 # mkdir can fail with a `File exist' error if two processes
540 # try to create one of the directories concurrently. Don't
541 # stop in that case!
542 $MKDIR "$my_dir" 2>/dev/null || :
543 done
544 IFS="$save_mkdir_p_IFS"
545
546 # Bail out if we (or some other process) failed to create a directory.
547 test -d "$my_directory_path" || \
548 func_fatal_error "Failed to create \`$1'"
549 fi
550}
551
552
553# func_mktempdir [string]
554# Make a temporary directory that won't clash with other running
555# libtool processes, and avoids race conditions if possible. If
556# given, STRING is the basename for that directory.
557func_mktempdir ()
558{
559 my_template="${TMPDIR-/tmp}/${1-$progname}"
560
561 if test "$opt_dry_run" = ":"; then
562 # Return a directory name, but don't create it in dry-run mode
563 my_tmpdir="${my_template}-$$"
564 else
565
566 # If mktemp works, use that first and foremost
567 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
568
569 if test ! -d "$my_tmpdir"; then
570 # Failing that, at least try and use $RANDOM to avoid a race
571 my_tmpdir="${my_template}-${RANDOM-0}$$"
572
573 save_mktempdir_umask=`umask`
574 umask 0077
575 $MKDIR "$my_tmpdir"
576 umask $save_mktempdir_umask
577 fi
578
579 # If we're not in dry-run mode, bomb out on failure
580 test -d "$my_tmpdir" || \
581 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
582 fi
583
584 $ECHO "$my_tmpdir"
585}
586
587
588# func_quote_for_eval arg
589# Aesthetically quote ARG to be evaled later.
590# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
591# is double-quoted, suitable for a subsequent eval, whereas
592# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
593# which are still active within double quotes backslashified.
594func_quote_for_eval ()
595{
596 case $1 in
597 *[\\\`\"\$]*)
598 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
599 *)
600 func_quote_for_eval_unquoted_result="$1" ;;
601 esac
602
603 case $func_quote_for_eval_unquoted_result in
604 # Double-quote args containing shell metacharacters to delay
605 # word splitting, command substitution and and variable
606 # expansion for a subsequent eval.
607 # Many Bourne shells cannot handle close brackets correctly
608 # in scan sets, so we specify it separately.
609 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
610 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
611 ;;
612 *)
613 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
614 esac
615}
616
617
618# func_quote_for_expand arg
619# Aesthetically quote ARG to be evaled later; same as above,
620# but do not quote variable references.
621func_quote_for_expand ()
622{
623 case $1 in
624 *[\\\`\"]*)
625 my_arg=`$ECHO "$1" | $SED \
626 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
627 *)
628 my_arg="$1" ;;
629 esac
630
631 case $my_arg in
632 # Double-quote args containing shell metacharacters to delay
633 # word splitting and command substitution for a subsequent eval.
634 # Many Bourne shells cannot handle close brackets correctly
635 # in scan sets, so we specify it separately.
636 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
637 my_arg="\"$my_arg\""
638 ;;
639 esac
640
641 func_quote_for_expand_result="$my_arg"
642}
643
644
645# func_show_eval cmd [fail_exp]
646# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
647# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
648# is given, then evaluate it.
649func_show_eval ()
650{
651 my_cmd="$1"
652 my_fail_exp="${2-:}"
653
654 ${opt_silent-false} || {
655 func_quote_for_expand "$my_cmd"
656 eval "func_echo $func_quote_for_expand_result"
657 }
658
659 if ${opt_dry_run-false}; then :; else
660 eval "$my_cmd"
661 my_status=$?
662 if test "$my_status" -eq 0; then :; else
663 eval "(exit $my_status); $my_fail_exp"
664 fi
665 fi
666}
667
668
669# func_show_eval_locale cmd [fail_exp]
670# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
671# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
672# is given, then evaluate it. Use the saved locale for evaluation.
673func_show_eval_locale ()
674{
675 my_cmd="$1"
676 my_fail_exp="${2-:}"
677
678 ${opt_silent-false} || {
679 func_quote_for_expand "$my_cmd"
680 eval "func_echo $func_quote_for_expand_result"
681 }
682
683 if ${opt_dry_run-false}; then :; else
684 eval "$lt_user_locale
685 $my_cmd"
686 my_status=$?
687 eval "$lt_safe_locale"
688 if test "$my_status" -eq 0; then :; else
689 eval "(exit $my_status); $my_fail_exp"
690 fi
691 fi
692}
693
694# func_tr_sh
695# Turn $1 into a string suitable for a shell variable name.
696# Result is stored in $func_tr_sh_result. All characters
697# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
698# if $1 begins with a digit, a '_' is prepended as well.
699func_tr_sh ()
700{
701 case $1 in
702 [0-9]* | *[!a-zA-Z0-9_]*)
703 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
704 ;;
705 * )
706 func_tr_sh_result=$1
707 ;;
708 esac
709}
710
711
712# func_version
713# Echo version message to standard output and exit.
714func_version ()
715{
716 $opt_debug
717
718 $SED -n '/(C)/!b go
719 :more
720 /\./!{
721 N
722 s/\n# / /
723 b more
724 }
725 :go
726 /^# '$PROGRAM' (GNU /,/# warranty; / {
727 s/^# //
728 s/^# *$//
729 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
730 p
731 }' < "$progpath"
732 exit $?
733}
734
735# func_usage
736# Echo short help message to standard output and exit.
737func_usage ()
738{
739 $opt_debug
740
741 $SED -n '/^# Usage:/,/^# *.*--help/ {
742 s/^# //
743 s/^# *$//
744 s/\$progname/'$progname'/
745 p
746 }' < "$progpath"
747 echo
748 $ECHO "run \`$progname --help | more' for full usage"
749 exit $?
750}
751
752# func_help [NOEXIT]
753# Echo long help message to standard output and exit,
754# unless 'noexit' is passed as argument.
755func_help ()
756{
757 $opt_debug
758
759 $SED -n '/^# Usage:/,/# Report bugs to/ {
760 :print
761 s/^# //
762 s/^# *$//
763 s*\$progname*'$progname'*
764 s*\$host*'"$host"'*
765 s*\$SHELL*'"$SHELL"'*
766 s*\$LTCC*'"$LTCC"'*
767 s*\$LTCFLAGS*'"$LTCFLAGS"'*
768 s*\$LD*'"$LD"'*
769 s/\$with_gnu_ld/'"$with_gnu_ld"'/
770 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
771 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
772 p
773 d
774 }
775 /^# .* home page:/b print
776 /^# General help using/b print
777 ' < "$progpath"
778 ret=$?
779 if test -z "$1"; then
780 exit $ret
781 fi
782}
783
784# func_missing_arg argname
785# Echo program name prefixed message to standard error and set global
786# exit_cmd.
787func_missing_arg ()
788{
789 $opt_debug
790
791 func_error "missing argument for $1."
792 exit_cmd=exit
793}
794
795
796# func_split_short_opt shortopt
797# Set func_split_short_opt_name and func_split_short_opt_arg shell
798# variables after splitting SHORTOPT after the 2nd character.
799func_split_short_opt ()
800{
801 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
802 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
803
804 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
805 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
806} # func_split_short_opt may be replaced by extended shell implementation
807
808
809# func_split_long_opt longopt
810# Set func_split_long_opt_name and func_split_long_opt_arg shell
811# variables after splitting LONGOPT at the `=' sign.
812func_split_long_opt ()
813{
814 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
815 my_sed_long_arg='1s/^--[^=]*=//'
816
817 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
818 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
819} # func_split_long_opt may be replaced by extended shell implementation
820
821exit_cmd=:
822
823
824
825
826
827magic="%%%MAGIC variable%%%"
828magic_exe="%%%MAGIC EXE variable%%%"
829
830# Global variables.
831nonopt=
832preserve_args=
833lo2o="s/\\.lo\$/.${objext}/"
834o2lo="s/\\.${objext}\$/.lo/"
835extracted_archives=
836extracted_serial=0
837
838# If this variable is set in any of the actions, the command in it
839# will be execed at the end. This prevents here-documents from being
840# left over by shells.
841exec_cmd=
842
843# func_append var value
844# Append VALUE to the end of shell variable VAR.
845func_append ()
846{
847 eval "${1}=\$${1}\${2}"
848} # func_append may be replaced by extended shell implementation
849
850# func_append_quoted var value
851# Quote VALUE and append to the end of shell variable VAR, separated
852# by a space.
853func_append_quoted ()
854{
855 func_quote_for_eval "${2}"
856 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
857} # func_append_quoted may be replaced by extended shell implementation
858
859
860# func_arith arithmetic-term...
861func_arith ()
862{
863 func_arith_result=`expr "${@}"`
864} # func_arith may be replaced by extended shell implementation
865
866
867# func_len string
868# STRING may not start with a hyphen.
869func_len ()
870{
871 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
872} # func_len may be replaced by extended shell implementation
873
874
875# func_lo2o object
876func_lo2o ()
877{
878 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
879} # func_lo2o may be replaced by extended shell implementation
880
881
882# func_xform libobj-or-source
883func_xform ()
884{
885 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
886} # func_xform may be replaced by extended shell implementation
887
888
889# func_fatal_configuration arg...
890# Echo program name prefixed message to standard error, followed by
891# a configuration failure hint, and exit.
892func_fatal_configuration ()
893{
894 func_error ${1+"$@"}
895 func_error "See the $PACKAGE documentation for more information."
896 func_fatal_error "Fatal configuration error."
897}
898
899
900# func_config
901# Display the configuration for all the tags in this script.
902func_config ()
903{
904 re_begincf='^# ### BEGIN LIBTOOL'
905 re_endcf='^# ### END LIBTOOL'
906
907 # Default configuration.
908 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
909
910 # Now print the configurations for the tags.
911 for tagname in $taglist; do
912 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
913 done
914
915 exit $?
916}
917
918# func_features
919# Display the features supported by this script.
920func_features ()
921{
922 echo "host: $host"
923 if test "$build_libtool_libs" = yes; then
924 echo "enable shared libraries"
925 else
926 echo "disable shared libraries"
927 fi
928 if test "$build_old_libs" = yes; then
929 echo "enable static libraries"
930 else
931 echo "disable static libraries"
932 fi
933
934 exit $?
935}
936
937# func_enable_tag tagname
938# Verify that TAGNAME is valid, and either flag an error and exit, or
939# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
940# variable here.
941func_enable_tag ()
942{
943 # Global variable:
944 tagname="$1"
945
946 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
947 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
948 sed_extractcf="/$re_begincf/,/$re_endcf/p"
949
950 # Validate tagname.
951 case $tagname in
952 *[!-_A-Za-z0-9,/]*)
953 func_fatal_error "invalid tag name: $tagname"
954 ;;
955 esac
956
957 # Don't test for the "default" C tag, as we know it's
958 # there but not specially marked.
959 case $tagname in
960 CC) ;;
961 *)
962 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
963 taglist="$taglist $tagname"
964
965 # Evaluate the configuration. Be careful to quote the path
966 # and the sed script, to avoid splitting on whitespace, but
967 # also don't use non-portable quotes within backquotes within
968 # quotes we have to do it in 2 steps:
969 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
970 eval "$extractedcf"
971 else
972 func_error "ignoring unknown tag $tagname"
973 fi
974 ;;
975 esac
976}
977
978# func_check_version_match
979# Ensure that we are using m4 macros, and libtool script from the same
980# release of libtool.
981func_check_version_match ()
982{
983 if test "$package_revision" != "$macro_revision"; then
984 if test "$VERSION" != "$macro_version"; then
985 if test -z "$macro_version"; then
986 cat >&2 <<_LT_EOF
987$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
988$progname: definition of this LT_INIT comes from an older release.
989$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
990$progname: and run autoconf again.
991_LT_EOF
992 else
993 cat >&2 <<_LT_EOF
994$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
995$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
996$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
997$progname: and run autoconf again.
998_LT_EOF
999 fi
1000 else
1001 cat >&2 <<_LT_EOF
1002$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1003$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1004$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1005$progname: of $PACKAGE $VERSION and run autoconf again.
1006_LT_EOF
1007 fi
1008
1009 exit $EXIT_MISMATCH
1010 fi
1011}
1012
1013
1014# Shorthand for --mode=foo, only valid as the first argument
1015case $1 in
1016clean|clea|cle|cl)
1017 shift; set dummy --mode clean ${1+"$@"}; shift
1018 ;;
1019compile|compil|compi|comp|com|co|c)
1020 shift; set dummy --mode compile ${1+"$@"}; shift
1021 ;;
1022execute|execut|execu|exec|exe|ex|e)
1023 shift; set dummy --mode execute ${1+"$@"}; shift
1024 ;;
1025finish|finis|fini|fin|fi|f)
1026 shift; set dummy --mode finish ${1+"$@"}; shift
1027 ;;
1028install|instal|insta|inst|ins|in|i)
1029 shift; set dummy --mode install ${1+"$@"}; shift
1030 ;;
1031link|lin|li|l)
1032 shift; set dummy --mode link ${1+"$@"}; shift
1033 ;;
1034uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1035 shift; set dummy --mode uninstall ${1+"$@"}; shift
1036 ;;
1037esac
1038
1039
1040
1041# Option defaults:
1042opt_debug=:
1043opt_dry_run=false
1044opt_config=false
1045opt_preserve_dup_deps=false
1046opt_features=false
1047opt_finish=false
1048opt_help=false
1049opt_help_all=false
1050opt_silent=:
1051opt_warning=:
1052opt_verbose=:
1053opt_silent=false
1054opt_verbose=false
1055
1056
1057# Parse options once, thoroughly. This comes as soon as possible in the
1058# script to make things like `--version' happen as quickly as we can.
1059{
1060 # this just eases exit handling
1061 while test $# -gt 0; do
1062 opt="$1"
1063 shift
1064 case $opt in
1065 --debug|-x) opt_debug='set -x'
1066 func_echo "enabling shell trace mode"
1067 $opt_debug
1068 ;;
1069 --dry-run|--dryrun|-n)
1070 opt_dry_run=:
1071 ;;
1072 --config)
1073 opt_config=:
1074func_config
1075 ;;
1076 --dlopen|-dlopen)
1077 optarg="$1"
1078 opt_dlopen="${opt_dlopen+$opt_dlopen
1079}$optarg"
1080 shift
1081 ;;
1082 --preserve-dup-deps)
1083 opt_preserve_dup_deps=:
1084 ;;
1085 --features)
1086 opt_features=:
1087func_features
1088 ;;
1089 --finish)
1090 opt_finish=:
1091set dummy --mode finish ${1+"$@"}; shift
1092 ;;
1093 --help)
1094 opt_help=:
1095 ;;
1096 --help-all)
1097 opt_help_all=:
1098opt_help=': help-all'
1099 ;;
1100 --mode)
1101 test $# = 0 && func_missing_arg $opt && break
1102 optarg="$1"
1103 opt_mode="$optarg"
1104case $optarg in
1105 # Valid mode arguments:
1106 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1107
1108 # Catch anything else as an error
1109 *) func_error "invalid argument for $opt"
1110 exit_cmd=exit
1111 break
1112 ;;
1113esac
1114 shift
1115 ;;
1116 --no-silent|--no-quiet)
1117 opt_silent=false
1118func_append preserve_args " $opt"
1119 ;;
1120 --no-warning|--no-warn)
1121 opt_warning=false
1122func_append preserve_args " $opt"
1123 ;;
1124 --no-verbose)
1125 opt_verbose=false
1126func_append preserve_args " $opt"
1127 ;;
1128 --silent|--quiet)
1129 opt_silent=:
1130func_append preserve_args " $opt"
1131 opt_verbose=false
1132 ;;
1133 --verbose|-v)
1134 opt_verbose=:
1135func_append preserve_args " $opt"
1136opt_silent=false
1137 ;;
1138 --tag)
1139 test $# = 0 && func_missing_arg $opt && break
1140 optarg="$1"
1141 opt_tag="$optarg"
1142func_append preserve_args " $opt $optarg"
1143func_enable_tag "$optarg"
1144 shift
1145 ;;
1146
1147 -\?|-h) func_usage ;;
1148 --help) func_help ;;
1149 --version) func_version ;;
1150
1151 # Separate optargs to long options:
1152 --*=*)
1153 func_split_long_opt "$opt"
1154 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1155 shift
1156 ;;
1157
1158 # Separate non-argument short options:
1159 -\?*|-h*|-n*|-v*)
1160 func_split_short_opt "$opt"
1161 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1162 shift
1163 ;;
1164
1165 --) break ;;
1166 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1167 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1168 esac
1169 done
1170
1171 # Validate options:
1172
1173 # save first non-option argument
1174 if test "$#" -gt 0; then
1175 nonopt="$opt"
1176 shift
1177 fi
1178
1179 # preserve --debug
1180 test "$opt_debug" = : || func_append preserve_args " --debug"
1181
1182 case $host in
1183 *cygwin* | *mingw* | *pw32* | *cegcc*)
1184 # don't eliminate duplications in $postdeps and $predeps
1185 opt_duplicate_compiler_generated_deps=:
1186 ;;
1187 *)
1188 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1189 ;;
1190 esac
1191
1192 $opt_help || {
1193 # Sanity checks first:
1194 func_check_version_match
1195
1196 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1197 func_fatal_configuration "not configured to build any kind of library"
1198 fi
1199
1200 # Darwin sucks
1201 eval std_shrext=\"$shrext_cmds\"
1202
1203 # Only execute mode is allowed to have -dlopen flags.
1204 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1205 func_error "unrecognized option \`-dlopen'"
1206 $ECHO "$help" 1>&2
1207 exit $EXIT_FAILURE
1208 fi
1209
1210 # Change the help message to a mode-specific one.
1211 generic_help="$help"
1212 help="Try \`$progname --help --mode=$opt_mode' for more information."
1213 }
1214
1215
1216 # Bail if the options were screwed
1217 $exit_cmd $EXIT_FAILURE
1218}
1219
1220
1221
1222
1223## ----------- ##
1224## Main. ##
1225## ----------- ##
1226
1227# func_lalib_p file
1228# True iff FILE is a libtool `.la' library or `.lo' object file.
1229# This function is only a basic sanity check; it will hardly flush out
1230# determined imposters.
1231func_lalib_p ()
1232{
1233 test -f "$1" &&
1234 $SED -e 4q "$1" 2>/dev/null \
1235 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1236}
1237
1238# func_lalib_unsafe_p file
1239# True iff FILE is a libtool `.la' library or `.lo' object file.
1240# This function implements the same check as func_lalib_p without
1241# resorting to external programs. To this end, it redirects stdin and
1242# closes it afterwards, without saving the original file descriptor.
1243# As a safety measure, use it only where a negative result would be
1244# fatal anyway. Works if `file' does not exist.
1245func_lalib_unsafe_p ()
1246{
1247 lalib_p=no
1248 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1249 for lalib_p_l in 1 2 3 4
1250 do
1251 read lalib_p_line
1252 case "$lalib_p_line" in
1253 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1254 esac
1255 done
1256 exec 0<&5 5<&-
1257 fi
1258 test "$lalib_p" = yes
1259}
1260
1261# func_ltwrapper_script_p file
1262# True iff FILE is a libtool wrapper script
1263# This function is only a basic sanity check; it will hardly flush out
1264# determined imposters.
1265func_ltwrapper_script_p ()
1266{
1267 func_lalib_p "$1"
1268}
1269
1270# func_ltwrapper_executable_p file
1271# True iff FILE is a libtool wrapper executable
1272# This function is only a basic sanity check; it will hardly flush out
1273# determined imposters.
1274func_ltwrapper_executable_p ()
1275{
1276 func_ltwrapper_exec_suffix=
1277 case $1 in
1278 *.exe) ;;
1279 *) func_ltwrapper_exec_suffix=.exe ;;
1280 esac
1281 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1282}
1283
1284# func_ltwrapper_scriptname file
1285# Assumes file is an ltwrapper_executable
1286# uses $file to determine the appropriate filename for a
1287# temporary ltwrapper_script.
1288func_ltwrapper_scriptname ()
1289{
1290 func_dirname_and_basename "$1" "" "."
1291 func_stripname '' '.exe' "$func_basename_result"
1292 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1293}
1294
1295# func_ltwrapper_p file
1296# True iff FILE is a libtool wrapper script or wrapper executable
1297# This function is only a basic sanity check; it will hardly flush out
1298# determined imposters.
1299func_ltwrapper_p ()
1300{
1301 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1302}
1303
1304
1305# func_execute_cmds commands fail_cmd
1306# Execute tilde-delimited COMMANDS.
1307# If FAIL_CMD is given, eval that upon failure.
1308# FAIL_CMD may read-access the current command in variable CMD!
1309func_execute_cmds ()
1310{
1311 $opt_debug
1312 save_ifs=$IFS; IFS='~'
1313 for cmd in $1; do
1314 IFS=$save_ifs
1315 eval cmd=\"$cmd\"
1316 func_show_eval "$cmd" "${2-:}"
1317 done
1318 IFS=$save_ifs
1319}
1320
1321
1322# func_source file
1323# Source FILE, adding directory component if necessary.
1324# Note that it is not necessary on cygwin/mingw to append a dot to
1325# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1326# behavior happens only for exec(3), not for open(2)! Also, sourcing
1327# `FILE.' does not work on cygwin managed mounts.
1328func_source ()
1329{
1330 $opt_debug
1331 case $1 in
1332 */* | *\\*) . "$1" ;;
1333 *) . "./$1" ;;
1334 esac
1335}
1336
1337
1338# func_resolve_sysroot PATH
1339# Replace a leading = in PATH with a sysroot. Store the result into
1340# func_resolve_sysroot_result
1341func_resolve_sysroot ()
1342{
1343 func_resolve_sysroot_result=$1
1344 case $func_resolve_sysroot_result in
1345 =*)
1346 func_stripname '=' '' "$func_resolve_sysroot_result"
1347 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1348 ;;
1349 esac
1350}
1351
1352# func_replace_sysroot PATH
1353# If PATH begins with the sysroot, replace it with = and
1354# store the result into func_replace_sysroot_result.
1355func_replace_sysroot ()
1356{
1357 case "$lt_sysroot:$1" in
1358 ?*:"$lt_sysroot"*)
1359 func_stripname "$lt_sysroot" '' "$1"
1360 func_replace_sysroot_result="=$func_stripname_result"
1361 ;;
1362 *)
1363 # Including no sysroot.
1364 func_replace_sysroot_result=$1
1365 ;;
1366 esac
1367}
1368
1369# func_infer_tag arg
1370# Infer tagged configuration to use if any are available and
1371# if one wasn't chosen via the "--tag" command line option.
1372# Only attempt this if the compiler in the base compile
1373# command doesn't match the default compiler.
1374# arg is usually of the form 'gcc ...'
1375func_infer_tag ()
1376{
1377 $opt_debug
1378 if test -n "$available_tags" && test -z "$tagname"; then
1379 CC_quoted=
1380 for arg in $CC; do
1381 func_append_quoted CC_quoted "$arg"
1382 done
1383 CC_expanded=`func_echo_all $CC`
1384 CC_quoted_expanded=`func_echo_all $CC_quoted`
1385 case $@ in
1386 # Blanks in the command may have been stripped by the calling shell,
1387 # but not from the CC environment variable when configure was run.
1388 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1389 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1390 # Blanks at the start of $base_compile will cause this to fail
1391 # if we don't check for them as well.
1392 *)
1393 for z in $available_tags; do
1394 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1395 # Evaluate the configuration.
1396 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1397 CC_quoted=
1398 for arg in $CC; do
1399 # Double-quote args containing other shell metacharacters.
1400 func_append_quoted CC_quoted "$arg"
1401 done
1402 CC_expanded=`func_echo_all $CC`
1403 CC_quoted_expanded=`func_echo_all $CC_quoted`
1404 case "$@ " in
1405 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1406 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1407 # The compiler in the base compile command matches
1408 # the one in the tagged configuration.
1409 # Assume this is the tagged configuration we want.
1410 tagname=$z
1411 break
1412 ;;
1413 esac
1414 fi
1415 done
1416 # If $tagname still isn't set, then no tagged configuration
1417 # was found and let the user know that the "--tag" command
1418 # line option must be used.
1419 if test -z "$tagname"; then
1420 func_echo "unable to infer tagged configuration"
1421 func_fatal_error "specify a tag with \`--tag'"
1422# else
1423# func_verbose "using $tagname tagged configuration"
1424 fi
1425 ;;
1426 esac
1427 fi
1428}
1429
1430
1431
1432# func_write_libtool_object output_name pic_name nonpic_name
1433# Create a libtool object file (analogous to a ".la" file),
1434# but don't create it if we're doing a dry run.
1435func_write_libtool_object ()
1436{
1437 write_libobj=${1}
1438 if test "$build_libtool_libs" = yes; then
1439 write_lobj=\'${2}\'
1440 else
1441 write_lobj=none
1442 fi
1443
1444 if test "$build_old_libs" = yes; then
1445 write_oldobj=\'${3}\'
1446 else
1447 write_oldobj=none
1448 fi
1449
1450 $opt_dry_run || {
1451 cat >${write_libobj}T <<EOF
1452# $write_libobj - a libtool object file
1453# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1454#
1455# Please DO NOT delete this file!
1456# It is necessary for linking the library.
1457
1458# Name of the PIC object.
1459pic_object=$write_lobj
1460
1461# Name of the non-PIC object
1462non_pic_object=$write_oldobj
1463
1464EOF
1465 $MV "${write_libobj}T" "${write_libobj}"
1466 }
1467}
1468
1469
1470##################################################
1471# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1472##################################################
1473
1474# func_convert_core_file_wine_to_w32 ARG
1475# Helper function used by file name conversion functions when $build is *nix,
1476# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1477# correctly configured wine environment available, with the winepath program
1478# in $build's $PATH.
1479#
1480# ARG is the $build file name to be converted to w32 format.
1481# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1482# be empty on error (or when ARG is empty)
1483func_convert_core_file_wine_to_w32 ()
1484{
1485 $opt_debug
1486 func_convert_core_file_wine_to_w32_result="$1"
1487 if test -n "$1"; then
1488 # Unfortunately, winepath does not exit with a non-zero error code, so we
1489 # are forced to check the contents of stdout. On the other hand, if the
1490 # command is not found, the shell will set an exit code of 127 and print
1491 # *an error message* to stdout. So we must check for both error code of
1492 # zero AND non-empty stdout, which explains the odd construction:
1493 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1494 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1495 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1496 $SED -e "$lt_sed_naive_backslashify"`
1497 else
1498 func_convert_core_file_wine_to_w32_result=
1499 fi
1500 fi
1501}
1502# end: func_convert_core_file_wine_to_w32
1503
1504
1505# func_convert_core_path_wine_to_w32 ARG
1506# Helper function used by path conversion functions when $build is *nix, and
1507# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1508# configured wine environment available, with the winepath program in $build's
1509# $PATH. Assumes ARG has no leading or trailing path separator characters.
1510#
1511# ARG is path to be converted from $build format to win32.
1512# Result is available in $func_convert_core_path_wine_to_w32_result.
1513# Unconvertible file (directory) names in ARG are skipped; if no directory names
1514# are convertible, then the result may be empty.
1515func_convert_core_path_wine_to_w32 ()
1516{
1517 $opt_debug
1518 # unfortunately, winepath doesn't convert paths, only file names
1519 func_convert_core_path_wine_to_w32_result=""
1520 if test -n "$1"; then
1521 oldIFS=$IFS
1522 IFS=:
1523 for func_convert_core_path_wine_to_w32_f in $1; do
1524 IFS=$oldIFS
1525 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1526 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1527 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1528 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1529 else
1530 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1531 fi
1532 fi
1533 done
1534 IFS=$oldIFS
1535 fi
1536}
1537# end: func_convert_core_path_wine_to_w32
1538
1539
1540# func_cygpath ARGS...
1541# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1542# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1543# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1544# (2), returns the Cygwin file name or path in func_cygpath_result (input
1545# file name or path is assumed to be in w32 format, as previously converted
1546# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1547# or path in func_cygpath_result (input file name or path is assumed to be in
1548# Cygwin format). Returns an empty string on error.
1549#
1550# ARGS are passed to cygpath, with the last one being the file name or path to
1551# be converted.
1552#
1553# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1554# environment variable; do not put it in $PATH.
1555func_cygpath ()
1556{
1557 $opt_debug
1558 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1559 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1560 if test "$?" -ne 0; then
1561 # on failure, ensure result is empty
1562 func_cygpath_result=
1563 fi
1564 else
1565 func_cygpath_result=
1566 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1567 fi
1568}
1569#end: func_cygpath
1570
1571
1572# func_convert_core_msys_to_w32 ARG
1573# Convert file name or path ARG from MSYS format to w32 format. Return
1574# result in func_convert_core_msys_to_w32_result.
1575func_convert_core_msys_to_w32 ()
1576{
1577 $opt_debug
1578 # awkward: cmd appends spaces to result
1579 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1580 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1581}
1582#end: func_convert_core_msys_to_w32
1583
1584
1585# func_convert_file_check ARG1 ARG2
1586# Verify that ARG1 (a file name in $build format) was converted to $host
1587# format in ARG2. Otherwise, emit an error message, but continue (resetting
1588# func_to_host_file_result to ARG1).
1589func_convert_file_check ()
1590{
1591 $opt_debug
1592 if test -z "$2" && test -n "$1" ; then
1593 func_error "Could not determine host file name corresponding to"
1594 func_error " \`$1'"
1595 func_error "Continuing, but uninstalled executables may not work."
1596 # Fallback:
1597 func_to_host_file_result="$1"
1598 fi
1599}
1600# end func_convert_file_check
1601
1602
1603# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1604# Verify that FROM_PATH (a path in $build format) was converted to $host
1605# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1606# func_to_host_file_result to a simplistic fallback value (see below).
1607func_convert_path_check ()
1608{
1609 $opt_debug
1610 if test -z "$4" && test -n "$3"; then
1611 func_error "Could not determine the host path corresponding to"
1612 func_error " \`$3'"
1613 func_error "Continuing, but uninstalled executables may not work."
1614 # Fallback. This is a deliberately simplistic "conversion" and
1615 # should not be "improved". See libtool.info.
1616 if test "x$1" != "x$2"; then
1617 lt_replace_pathsep_chars="s|$1|$2|g"
1618 func_to_host_path_result=`echo "$3" |
1619 $SED -e "$lt_replace_pathsep_chars"`
1620 else
1621 func_to_host_path_result="$3"
1622 fi
1623 fi
1624}
1625# end func_convert_path_check
1626
1627
1628# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1629# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1630# and appending REPL if ORIG matches BACKPAT.
1631func_convert_path_front_back_pathsep ()
1632{
1633 $opt_debug
1634 case $4 in
1635 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1636 ;;
1637 esac
1638 case $4 in
1639 $2 ) func_append func_to_host_path_result "$3"
1640 ;;
1641 esac
1642}
1643# end func_convert_path_front_back_pathsep
1644
1645
1646##################################################
1647# $build to $host FILE NAME CONVERSION FUNCTIONS #
1648##################################################
1649# invoked via `$to_host_file_cmd ARG'
1650#
1651# In each case, ARG is the path to be converted from $build to $host format.
1652# Result will be available in $func_to_host_file_result.
1653
1654
1655# func_to_host_file ARG
1656# Converts the file name ARG from $build format to $host format. Return result
1657# in func_to_host_file_result.
1658func_to_host_file ()
1659{
1660 $opt_debug
1661 $to_host_file_cmd "$1"
1662}
1663# end func_to_host_file
1664
1665
1666# func_to_tool_file ARG LAZY
1667# converts the file name ARG from $build format to toolchain format. Return
1668# result in func_to_tool_file_result. If the conversion in use is listed
1669# in (the comma separated) LAZY, no conversion takes place.
1670func_to_tool_file ()
1671{
1672 $opt_debug
1673 case ,$2, in
1674 *,"$to_tool_file_cmd",*)
1675 func_to_tool_file_result=$1
1676 ;;
1677 *)
1678 $to_tool_file_cmd "$1"
1679 func_to_tool_file_result=$func_to_host_file_result
1680 ;;
1681 esac
1682}
1683# end func_to_tool_file
1684
1685
1686# func_convert_file_noop ARG
1687# Copy ARG to func_to_host_file_result.
1688func_convert_file_noop ()
1689{
1690 func_to_host_file_result="$1"
1691}
1692# end func_convert_file_noop
1693
1694
1695# func_convert_file_msys_to_w32 ARG
1696# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1697# conversion to w32 is not available inside the cwrapper. Returns result in
1698# func_to_host_file_result.
1699func_convert_file_msys_to_w32 ()
1700{
1701 $opt_debug
1702 func_to_host_file_result="$1"
1703 if test -n "$1"; then
1704 func_convert_core_msys_to_w32 "$1"
1705 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1706 fi
1707 func_convert_file_check "$1" "$func_to_host_file_result"
1708}
1709# end func_convert_file_msys_to_w32
1710
1711
1712# func_convert_file_cygwin_to_w32 ARG
1713# Convert file name ARG from Cygwin to w32 format. Returns result in
1714# func_to_host_file_result.
1715func_convert_file_cygwin_to_w32 ()
1716{
1717 $opt_debug
1718 func_to_host_file_result="$1"
1719 if test -n "$1"; then
1720 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1721 # LT_CYGPATH in this case.
1722 func_to_host_file_result=`cygpath -m "$1"`
1723 fi
1724 func_convert_file_check "$1" "$func_to_host_file_result"
1725}
1726# end func_convert_file_cygwin_to_w32
1727
1728
1729# func_convert_file_nix_to_w32 ARG
1730# Convert file name ARG from *nix to w32 format. Requires a wine environment
1731# and a working winepath. Returns result in func_to_host_file_result.
1732func_convert_file_nix_to_w32 ()
1733{
1734 $opt_debug
1735 func_to_host_file_result="$1"
1736 if test -n "$1"; then
1737 func_convert_core_file_wine_to_w32 "$1"
1738 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1739 fi
1740 func_convert_file_check "$1" "$func_to_host_file_result"
1741}
1742# end func_convert_file_nix_to_w32
1743
1744
1745# func_convert_file_msys_to_cygwin ARG
1746# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1747# Returns result in func_to_host_file_result.
1748func_convert_file_msys_to_cygwin ()
1749{
1750 $opt_debug
1751 func_to_host_file_result="$1"
1752 if test -n "$1"; then
1753 func_convert_core_msys_to_w32 "$1"
1754 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1755 func_to_host_file_result="$func_cygpath_result"
1756 fi
1757 func_convert_file_check "$1" "$func_to_host_file_result"
1758}
1759# end func_convert_file_msys_to_cygwin
1760
1761
1762# func_convert_file_nix_to_cygwin ARG
1763# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1764# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1765# in func_to_host_file_result.
1766func_convert_file_nix_to_cygwin ()
1767{
1768 $opt_debug
1769 func_to_host_file_result="$1"
1770 if test -n "$1"; then
1771 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1772 func_convert_core_file_wine_to_w32 "$1"
1773 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1774 func_to_host_file_result="$func_cygpath_result"
1775 fi
1776 func_convert_file_check "$1" "$func_to_host_file_result"
1777}
1778# end func_convert_file_nix_to_cygwin
1779
1780
1781#############################################
1782# $build to $host PATH CONVERSION FUNCTIONS #
1783#############################################
1784# invoked via `$to_host_path_cmd ARG'
1785#
1786# In each case, ARG is the path to be converted from $build to $host format.
1787# The result will be available in $func_to_host_path_result.
1788#
1789# Path separators are also converted from $build format to $host format. If
1790# ARG begins or ends with a path separator character, it is preserved (but
1791# converted to $host format) on output.
1792#
1793# All path conversion functions are named using the following convention:
1794# file name conversion function : func_convert_file_X_to_Y ()
1795# path conversion function : func_convert_path_X_to_Y ()
1796# where, for any given $build/$host combination the 'X_to_Y' value is the
1797# same. If conversion functions are added for new $build/$host combinations,
1798# the two new functions must follow this pattern, or func_init_to_host_path_cmd
1799# will break.
1800
1801
1802# func_init_to_host_path_cmd
1803# Ensures that function "pointer" variable $to_host_path_cmd is set to the
1804# appropriate value, based on the value of $to_host_file_cmd.
1805to_host_path_cmd=
1806func_init_to_host_path_cmd ()
1807{
1808 $opt_debug
1809 if test -z "$to_host_path_cmd"; then
1810 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1811 to_host_path_cmd="func_convert_path_${func_stripname_result}"
1812 fi
1813}
1814
1815
1816# func_to_host_path ARG
1817# Converts the path ARG from $build format to $host format. Return result
1818# in func_to_host_path_result.
1819func_to_host_path ()
1820{
1821 $opt_debug
1822 func_init_to_host_path_cmd
1823 $to_host_path_cmd "$1"
1824}
1825# end func_to_host_path
1826
1827
1828# func_convert_path_noop ARG
1829# Copy ARG to func_to_host_path_result.
1830func_convert_path_noop ()
1831{
1832 func_to_host_path_result="$1"
1833}
1834# end func_convert_path_noop
1835
1836
1837# func_convert_path_msys_to_w32 ARG
1838# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1839# conversion to w32 is not available inside the cwrapper. Returns result in
1840# func_to_host_path_result.
1841func_convert_path_msys_to_w32 ()
1842{
1843 $opt_debug
1844 func_to_host_path_result="$1"
1845 if test -n "$1"; then
1846 # Remove leading and trailing path separator characters from ARG. MSYS
1847 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1848 # and winepath ignores them completely.
1849 func_stripname : : "$1"
1850 func_to_host_path_tmp1=$func_stripname_result
1851 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1852 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1853 func_convert_path_check : ";" \
1854 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1855 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1856 fi
1857}
1858# end func_convert_path_msys_to_w32
1859
1860
1861# func_convert_path_cygwin_to_w32 ARG
1862# Convert path ARG from Cygwin to w32 format. Returns result in
1863# func_to_host_file_result.
1864func_convert_path_cygwin_to_w32 ()
1865{
1866 $opt_debug
1867 func_to_host_path_result="$1"
1868 if test -n "$1"; then
1869 # See func_convert_path_msys_to_w32:
1870 func_stripname : : "$1"
1871 func_to_host_path_tmp1=$func_stripname_result
1872 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1873 func_convert_path_check : ";" \
1874 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1875 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1876 fi
1877}
1878# end func_convert_path_cygwin_to_w32
1879
1880
1881# func_convert_path_nix_to_w32 ARG
1882# Convert path ARG from *nix to w32 format. Requires a wine environment and
1883# a working winepath. Returns result in func_to_host_file_result.
1884func_convert_path_nix_to_w32 ()
1885{
1886 $opt_debug
1887 func_to_host_path_result="$1"
1888 if test -n "$1"; then
1889 # See func_convert_path_msys_to_w32:
1890 func_stripname : : "$1"
1891 func_to_host_path_tmp1=$func_stripname_result
1892 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1893 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1894 func_convert_path_check : ";" \
1895 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1896 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1897 fi
1898}
1899# end func_convert_path_nix_to_w32
1900
1901
1902# func_convert_path_msys_to_cygwin ARG
1903# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1904# Returns result in func_to_host_file_result.
1905func_convert_path_msys_to_cygwin ()
1906{
1907 $opt_debug
1908 func_to_host_path_result="$1"
1909 if test -n "$1"; then
1910 # See func_convert_path_msys_to_w32:
1911 func_stripname : : "$1"
1912 func_to_host_path_tmp1=$func_stripname_result
1913 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1914 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1915 func_to_host_path_result="$func_cygpath_result"
1916 func_convert_path_check : : \
1917 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1918 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1919 fi
1920}
1921# end func_convert_path_msys_to_cygwin
1922
1923
1924# func_convert_path_nix_to_cygwin ARG
1925# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1926# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1927# func_to_host_file_result.
1928func_convert_path_nix_to_cygwin ()
1929{
1930 $opt_debug
1931 func_to_host_path_result="$1"
1932 if test -n "$1"; then
1933 # Remove leading and trailing path separator characters from
1934 # ARG. msys behavior is inconsistent here, cygpath turns them
1935 # into '.;' and ';.', and winepath ignores them completely.
1936 func_stripname : : "$1"
1937 func_to_host_path_tmp1=$func_stripname_result
1938 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1939 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1940 func_to_host_path_result="$func_cygpath_result"
1941 func_convert_path_check : : \
1942 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1943 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1944 fi
1945}
1946# end func_convert_path_nix_to_cygwin
1947
1948
1949# func_mode_compile arg...
1950func_mode_compile ()
1951{
1952 $opt_debug
1953 # Get the compilation command and the source file.
1954 base_compile=
1955 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1956 suppress_opt=yes
1957 suppress_output=
1958 arg_mode=normal
1959 libobj=
1960 later=
1961 pie_flag=
1962
1963 for arg
1964 do
1965 case $arg_mode in
1966 arg )
1967 # do not "continue". Instead, add this to base_compile
1968 lastarg="$arg"
1969 arg_mode=normal
1970 ;;
1971
1972 target )
1973 libobj="$arg"
1974 arg_mode=normal
1975 continue
1976 ;;
1977
1978 normal )
1979 # Accept any command-line options.
1980 case $arg in
1981 -o)
1982 test -n "$libobj" && \
1983 func_fatal_error "you cannot specify \`-o' more than once"
1984 arg_mode=target
1985 continue
1986 ;;
1987
1988 -pie | -fpie | -fPIE)
1989 func_append pie_flag " $arg"
1990 continue
1991 ;;
1992
1993 -shared | -static | -prefer-pic | -prefer-non-pic)
1994 func_append later " $arg"
1995 continue
1996 ;;
1997
1998 -no-suppress)
1999 suppress_opt=no
2000 continue
2001 ;;
2002
2003 -Xcompiler)
2004 arg_mode=arg # the next one goes into the "base_compile" arg list
2005 continue # The current "srcfile" will either be retained or
2006 ;; # replaced later. I would guess that would be a bug.
2007
2008 -Wc,*)
2009 func_stripname '-Wc,' '' "$arg"
2010 args=$func_stripname_result
2011 lastarg=
2012 save_ifs="$IFS"; IFS=','
2013 for arg in $args; do
2014 IFS="$save_ifs"
2015 func_append_quoted lastarg "$arg"
2016 done
2017 IFS="$save_ifs"
2018 func_stripname ' ' '' "$lastarg"
2019 lastarg=$func_stripname_result
2020
2021 # Add the arguments to base_compile.
2022 func_append base_compile " $lastarg"
2023 continue
2024 ;;
2025
2026 *)
2027 # Accept the current argument as the source file.
2028 # The previous "srcfile" becomes the current argument.
2029 #
2030 lastarg="$srcfile"
2031 srcfile="$arg"
2032 ;;
2033 esac # case $arg
2034 ;;
2035 esac # case $arg_mode
2036
2037 # Aesthetically quote the previous argument.
2038 func_append_quoted base_compile "$lastarg"
2039 done # for arg
2040
2041 case $arg_mode in
2042 arg)
2043 func_fatal_error "you must specify an argument for -Xcompile"
2044 ;;
2045 target)
2046 func_fatal_error "you must specify a target with \`-o'"
2047 ;;
2048 *)
2049 # Get the name of the library object.
2050 test -z "$libobj" && {
2051 func_basename "$srcfile"
2052 libobj="$func_basename_result"
2053 }
2054 ;;
2055 esac
2056
2057 # Recognize several different file suffixes.
2058 # If the user specifies -o file.o, it is replaced with file.lo
2059 case $libobj in
2060 *.[cCFSifmso] | \
2061 *.ada | *.adb | *.ads | *.asm | \
2062 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2063 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2064 func_xform "$libobj"
2065 libobj=$func_xform_result
2066 ;;
2067 esac
2068
2069 case $libobj in
2070 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2071 *)
2072 func_fatal_error "cannot determine name of library object from \`$libobj'"
2073 ;;
2074 esac
2075
2076 func_infer_tag $base_compile
2077
2078 for arg in $later; do
2079 case $arg in
2080 -shared)
2081 test "$build_libtool_libs" != yes && \
2082 func_fatal_configuration "can not build a shared library"
2083 build_old_libs=no
2084 continue
2085 ;;
2086
2087 -static)
2088 build_libtool_libs=no
2089 build_old_libs=yes
2090 continue
2091 ;;
2092
2093 -prefer-pic)
2094 pic_mode=yes
2095 continue
2096 ;;
2097
2098 -prefer-non-pic)
2099 pic_mode=no
2100 continue
2101 ;;
2102 esac
2103 done
2104
2105 func_quote_for_eval "$libobj"
2106 test "X$libobj" != "X$func_quote_for_eval_result" \
2107 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2108 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2109 func_dirname_and_basename "$obj" "/" ""
2110 objname="$func_basename_result"
2111 xdir="$func_dirname_result"
2112 lobj=${xdir}$objdir/$objname
2113
2114 test -z "$base_compile" && \
2115 func_fatal_help "you must specify a compilation command"
2116
2117 # Delete any leftover library objects.
2118 if test "$build_old_libs" = yes; then
2119 removelist="$obj $lobj $libobj ${libobj}T"
2120 else
2121 removelist="$lobj $libobj ${libobj}T"
2122 fi
2123
2124 # On Cygwin there's no "real" PIC flag so we must build both object types
2125 case $host_os in
2126 cygwin* | mingw* | pw32* | os2* | cegcc*)
2127 pic_mode=default
2128 ;;
2129 esac
2130 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2131 # non-PIC code in shared libraries is not supported
2132 pic_mode=default
2133 fi
2134
2135 # Calculate the filename of the output object if compiler does
2136 # not support -o with -c
2137 if test "$compiler_c_o" = no; then
2138 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2139 lockfile="$output_obj.lock"
2140 else
2141 output_obj=
2142 need_locks=no
2143 lockfile=
2144 fi
2145
2146 # Lock this critical section if it is needed
2147 # We use this script file to make the link, it avoids creating a new file
2148 if test "$need_locks" = yes; then
2149 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2150 func_echo "Waiting for $lockfile to be removed"
2151 sleep 2
2152 done
2153 elif test "$need_locks" = warn; then
2154 if test -f "$lockfile"; then
2155 $ECHO "\
2156*** ERROR, $lockfile exists and contains:
2157`cat $lockfile 2>/dev/null`
2158
2159This indicates that another process is trying to use the same
2160temporary object file, and libtool could not work around it because
2161your compiler does not support \`-c' and \`-o' together. If you
2162repeat this compilation, it may succeed, by chance, but you had better
2163avoid parallel builds (make -j) in this platform, or get a better
2164compiler."
2165
2166 $opt_dry_run || $RM $removelist
2167 exit $EXIT_FAILURE
2168 fi
2169 func_append removelist " $output_obj"
2170 $ECHO "$srcfile" > "$lockfile"
2171 fi
2172
2173 $opt_dry_run || $RM $removelist
2174 func_append removelist " $lockfile"
2175 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2176
2177 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2178 srcfile=$func_to_tool_file_result
2179 func_quote_for_eval "$srcfile"
2180 qsrcfile=$func_quote_for_eval_result
2181
2182 # Only build a PIC object if we are building libtool libraries.
2183 if test "$build_libtool_libs" = yes; then
2184 # Without this assignment, base_compile gets emptied.
2185 fbsd_hideous_sh_bug=$base_compile
2186
2187 if test "$pic_mode" != no; then
2188 command="$base_compile $qsrcfile $pic_flag"
2189 else
2190 # Don't build PIC code
2191 command="$base_compile $qsrcfile"
2192 fi
2193
2194 func_mkdir_p "$xdir$objdir"
2195
2196 if test -z "$output_obj"; then
2197 # Place PIC objects in $objdir
2198 func_append command " -o $lobj"
2199 fi
2200
2201 func_show_eval_locale "$command" \
2202 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2203
2204 if test "$need_locks" = warn &&
2205 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2206 $ECHO "\
2207*** ERROR, $lockfile contains:
2208`cat $lockfile 2>/dev/null`
2209
2210but it should contain:
2211$srcfile
2212
2213This indicates that another process is trying to use the same
2214temporary object file, and libtool could not work around it because
2215your compiler does not support \`-c' and \`-o' together. If you
2216repeat this compilation, it may succeed, by chance, but you had better
2217avoid parallel builds (make -j) in this platform, or get a better
2218compiler."
2219
2220 $opt_dry_run || $RM $removelist
2221 exit $EXIT_FAILURE
2222 fi
2223
2224 # Just move the object if needed, then go on to compile the next one
2225 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2226 func_show_eval '$MV "$output_obj" "$lobj"' \
2227 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2228 fi
2229
2230 # Allow error messages only from the first compilation.
2231 if test "$suppress_opt" = yes; then
2232 suppress_output=' >/dev/null 2>&1'
2233 fi
2234 fi
2235
2236 # Only build a position-dependent object if we build old libraries.
2237 if test "$build_old_libs" = yes; then
2238 if test "$pic_mode" != yes; then
2239 # Don't build PIC code
2240 command="$base_compile $qsrcfile$pie_flag"
2241 else
2242 command="$base_compile $qsrcfile $pic_flag"
2243 fi
2244 if test "$compiler_c_o" = yes; then
2245 func_append command " -o $obj"
2246 fi
2247
2248 # Suppress compiler output if we already did a PIC compilation.
2249 func_append command "$suppress_output"
2250 func_show_eval_locale "$command" \
2251 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2252
2253 if test "$need_locks" = warn &&
2254 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2255 $ECHO "\
2256*** ERROR, $lockfile contains:
2257`cat $lockfile 2>/dev/null`
2258
2259but it should contain:
2260$srcfile
2261
2262This indicates that another process is trying to use the same
2263temporary object file, and libtool could not work around it because
2264your compiler does not support \`-c' and \`-o' together. If you
2265repeat this compilation, it may succeed, by chance, but you had better
2266avoid parallel builds (make -j) in this platform, or get a better
2267compiler."
2268
2269 $opt_dry_run || $RM $removelist
2270 exit $EXIT_FAILURE
2271 fi
2272
2273 # Just move the object if needed
2274 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2275 func_show_eval '$MV "$output_obj" "$obj"' \
2276 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2277 fi
2278 fi
2279
2280 $opt_dry_run || {
2281 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2282
2283 # Unlock the critical section if it was locked
2284 if test "$need_locks" != no; then
2285 removelist=$lockfile
2286 $RM "$lockfile"
2287 fi
2288 }
2289
2290 exit $EXIT_SUCCESS
2291}
2292
2293$opt_help || {
2294 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2295}
2296
2297func_mode_help ()
2298{
2299 # We need to display help for each of the modes.
2300 case $opt_mode in
2301 "")
2302 # Generic help is extracted from the usage comments
2303 # at the start of this file.
2304 func_help
2305 ;;
2306
2307 clean)
2308 $ECHO \
2309"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2310
2311Remove files from the build directory.
2312
2313RM is the name of the program to use to delete files associated with each FILE
2314(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2315to RM.
2316
2317If FILE is a libtool library, object or program, all the files associated
2318with it are deleted. Otherwise, only FILE itself is deleted using RM."
2319 ;;
2320
2321 compile)
2322 $ECHO \
2323"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2324
2325Compile a source file into a libtool library object.
2326
2327This mode accepts the following additional options:
2328
2329 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2330 -no-suppress do not suppress compiler output for multiple passes
2331 -prefer-pic try to build PIC objects only
2332 -prefer-non-pic try to build non-PIC objects only
2333 -shared do not build a \`.o' file suitable for static linking
2334 -static only build a \`.o' file suitable for static linking
2335 -Wc,FLAG pass FLAG directly to the compiler
2336
2337COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2338from the given SOURCEFILE.
2339
2340The output file name is determined by removing the directory component from
2341SOURCEFILE, then substituting the C source code suffix \`.c' with the
2342library object suffix, \`.lo'."
2343 ;;
2344
2345 execute)
2346 $ECHO \
2347"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2348
2349Automatically set library path, then run a program.
2350
2351This mode accepts the following additional options:
2352
2353 -dlopen FILE add the directory containing FILE to the library path
2354
2355This mode sets the library path environment variable according to \`-dlopen'
2356flags.
2357
2358If any of the ARGS are libtool executable wrappers, then they are translated
2359into their corresponding uninstalled binary, and any of their required library
2360directories are added to the library path.
2361
2362Then, COMMAND is executed, with ARGS as arguments."
2363 ;;
2364
2365 finish)
2366 $ECHO \
2367"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2368
2369Complete the installation of libtool libraries.
2370
2371Each LIBDIR is a directory that contains libtool libraries.
2372
2373The commands that this mode executes may require superuser privileges. Use
2374the \`--dry-run' option if you just want to see what would be executed."
2375 ;;
2376
2377 install)
2378 $ECHO \
2379"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2380
2381Install executables or libraries.
2382
2383INSTALL-COMMAND is the installation command. The first component should be
2384either the \`install' or \`cp' program.
2385
2386The following components of INSTALL-COMMAND are treated specially:
2387
2388 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2389
2390The rest of the components are interpreted as arguments to that command (only
2391BSD-compatible install options are recognized)."
2392 ;;
2393
2394 link)
2395 $ECHO \
2396"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2397
2398Link object files or libraries together to form another library, or to
2399create an executable program.
2400
2401LINK-COMMAND is a command using the C compiler that you would use to create
2402a program from several object files.
2403
2404The following components of LINK-COMMAND are treated specially:
2405
2406 -all-static do not do any dynamic linking at all
2407 -avoid-version do not add a version suffix if possible
2408 -bindir BINDIR specify path to binaries directory (for systems where
2409 libraries must be found in the PATH setting at runtime)
2410 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2411 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2412 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2413 -export-symbols SYMFILE
2414 try to export only the symbols listed in SYMFILE
2415 -export-symbols-regex REGEX
2416 try to export only the symbols matching REGEX
2417 -LLIBDIR search LIBDIR for required installed libraries
2418 -lNAME OUTPUT-FILE requires the installed library libNAME
2419 -module build a library that can dlopened
2420 -no-fast-install disable the fast-install mode
2421 -no-install link a not-installable executable
2422 -no-undefined declare that a library does not refer to external symbols
2423 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2424 -objectlist FILE Use a list of object files found in FILE to specify objects
2425 -precious-files-regex REGEX
2426 don't remove output files matching REGEX
2427 -release RELEASE specify package release information
2428 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2429 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2430 -shared only do dynamic linking of libtool libraries
2431 -shrext SUFFIX override the standard shared library file extension
2432 -static do not do any dynamic linking of uninstalled libtool libraries
2433 -static-libtool-libs
2434 do not do any dynamic linking of libtool libraries
2435 -version-info CURRENT[:REVISION[:AGE]]
2436 specify library version info [each variable defaults to 0]
2437 -weak LIBNAME declare that the target provides the LIBNAME interface
2438 -Wc,FLAG
2439 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2440 -Wl,FLAG
2441 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2442 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2443
2444All other options (arguments beginning with \`-') are ignored.
2445
2446Every other argument is treated as a filename. Files ending in \`.la' are
2447treated as uninstalled libtool libraries, other files are standard or library
2448object files.
2449
2450If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2451only library objects (\`.lo' files) may be specified, and \`-rpath' is
2452required, except when creating a convenience library.
2453
2454If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2455using \`ar' and \`ranlib', or on Windows using \`lib'.
2456
2457If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2458is created, otherwise an executable program is created."
2459 ;;
2460
2461 uninstall)
2462 $ECHO \
2463"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2464
2465Remove libraries from an installation directory.
2466
2467RM is the name of the program to use to delete files associated with each FILE
2468(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2469to RM.
2470
2471If FILE is a libtool library, all the files associated with it are deleted.
2472Otherwise, only FILE itself is deleted using RM."
2473 ;;
2474
2475 *)
2476 func_fatal_help "invalid operation mode \`$opt_mode'"
2477 ;;
2478 esac
2479
2480 echo
2481 $ECHO "Try \`$progname --help' for more information about other modes."
2482}
2483
2484# Now that we've collected a possible --mode arg, show help if necessary
2485if $opt_help; then
2486 if test "$opt_help" = :; then
2487 func_mode_help
2488 else
2489 {
2490 func_help noexit
2491 for opt_mode in compile link execute install finish uninstall clean; do
2492 func_mode_help
2493 done
2494 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2495 {
2496 func_help noexit
2497 for opt_mode in compile link execute install finish uninstall clean; do
2498 echo
2499 func_mode_help
2500 done
2501 } |
2502 sed '1d
2503 /^When reporting/,/^Report/{
2504 H
2505 d
2506 }
2507 $x
2508 /information about other modes/d
2509 /more detailed .*MODE/d
2510 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2511 fi
2512 exit $?
2513fi
2514
2515
2516# func_mode_execute arg...
2517func_mode_execute ()
2518{
2519 $opt_debug
2520 # The first argument is the command name.
2521 cmd="$nonopt"
2522 test -z "$cmd" && \
2523 func_fatal_help "you must specify a COMMAND"
2524
2525 # Handle -dlopen flags immediately.
2526 for file in $opt_dlopen; do
2527 test -f "$file" \
2528 || func_fatal_help "\`$file' is not a file"
2529
2530 dir=
2531 case $file in
2532 *.la)
2533 func_resolve_sysroot "$file"
2534 file=$func_resolve_sysroot_result
2535
2536 # Check to see that this really is a libtool archive.
2537 func_lalib_unsafe_p "$file" \
2538 || func_fatal_help "\`$lib' is not a valid libtool archive"
2539
2540 # Read the libtool library.
2541 dlname=
2542 library_names=
2543 func_source "$file"
2544
2545 # Skip this library if it cannot be dlopened.
2546 if test -z "$dlname"; then
2547 # Warn if it was a shared library.
2548 test -n "$library_names" && \
2549 func_warning "\`$file' was not linked with \`-export-dynamic'"
2550 continue
2551 fi
2552
2553 func_dirname "$file" "" "."
2554 dir="$func_dirname_result"
2555
2556 if test -f "$dir/$objdir/$dlname"; then
2557 func_append dir "/$objdir"
2558 else
2559 if test ! -f "$dir/$dlname"; then
2560 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2561 fi
2562 fi
2563 ;;
2564
2565 *.lo)
2566 # Just add the directory containing the .lo file.
2567 func_dirname "$file" "" "."
2568 dir="$func_dirname_result"
2569 ;;
2570
2571 *)
2572 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2573 continue
2574 ;;
2575 esac
2576
2577 # Get the absolute pathname.
2578 absdir=`cd "$dir" && pwd`
2579 test -n "$absdir" && dir="$absdir"
2580
2581 # Now add the directory to shlibpath_var.
2582 if eval "test -z \"\$$shlibpath_var\""; then
2583 eval "$shlibpath_var=\"\$dir\""
2584 else
2585 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2586 fi
2587 done
2588
2589 # This variable tells wrapper scripts just to set shlibpath_var
2590 # rather than running their programs.
2591 libtool_execute_magic="$magic"
2592
2593 # Check if any of the arguments is a wrapper script.
2594 args=
2595 for file
2596 do
2597 case $file in
2598 -* | *.la | *.lo ) ;;
2599 *)
2600 # Do a test to see if this is really a libtool program.
2601 if func_ltwrapper_script_p "$file"; then
2602 func_source "$file"
2603 # Transform arg to wrapped name.
2604 file="$progdir/$program"
2605 elif func_ltwrapper_executable_p "$file"; then
2606 func_ltwrapper_scriptname "$file"
2607 func_source "$func_ltwrapper_scriptname_result"
2608 # Transform arg to wrapped name.
2609 file="$progdir/$program"
2610 fi
2611 ;;
2612 esac
2613 # Quote arguments (to preserve shell metacharacters).
2614 func_append_quoted args "$file"
2615 done
2616
2617 if test "X$opt_dry_run" = Xfalse; then
2618 if test -n "$shlibpath_var"; then
2619 # Export the shlibpath_var.
2620 eval "export $shlibpath_var"
2621 fi
2622
2623 # Restore saved environment variables
2624 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2625 do
2626 eval "if test \"\${save_$lt_var+set}\" = set; then
2627 $lt_var=\$save_$lt_var; export $lt_var
2628 else
2629 $lt_unset $lt_var
2630 fi"
2631 done
2632
2633 # Now prepare to actually exec the command.
2634 exec_cmd="\$cmd$args"
2635 else
2636 # Display what would be done.
2637 if test -n "$shlibpath_var"; then
2638 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2639 echo "export $shlibpath_var"
2640 fi
2641 $ECHO "$cmd$args"
2642 exit $EXIT_SUCCESS
2643 fi
2644}
2645
2646test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
2647
2648
2649# func_mode_finish arg...
2650func_mode_finish ()
2651{
2652 $opt_debug
2653 libs=
2654 libdirs=
2655 admincmds=
2656
2657 for opt in "$nonopt" ${1+"$@"}
2658 do
2659 if test -d "$opt"; then
2660 func_append libdirs " $opt"
2661
2662 elif test -f "$opt"; then
2663 if func_lalib_unsafe_p "$opt"; then
2664 func_append libs " $opt"
2665 else
2666 func_warning "\`$opt' is not a valid libtool archive"
2667 fi
2668
2669 else
2670 func_fatal_error "invalid argument \`$opt'"
2671 fi
2672 done
2673
2674 if test -n "$libs"; then
2675 if test -n "$lt_sysroot"; then
2676 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2677 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2678 else
2679 sysroot_cmd=
2680 fi
2681
2682 # Remove sysroot references
2683 if $opt_dry_run; then
2684 for lib in $libs; do
2685 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2686 done
2687 else
2688 tmpdir=`func_mktempdir`
2689 for lib in $libs; do
2690 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2691 > $tmpdir/tmp-la
2692 mv -f $tmpdir/tmp-la $lib
2693 done
2694 ${RM}r "$tmpdir"
2695 fi
2696 fi
2697
2698 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2699 for libdir in $libdirs; do
2700 if test -n "$finish_cmds"; then
2701 # Do each command in the finish commands.
2702 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2703'"$cmd"'"'
2704 fi
2705 if test -n "$finish_eval"; then
2706 # Do the single finish_eval.
2707 eval cmds=\"$finish_eval\"
2708 $opt_dry_run || eval "$cmds" || func_append admincmds "
2709 $cmds"
2710 fi
2711 done
2712 fi
2713
2714 # Exit here if they wanted silent mode.
2715 $opt_silent && exit $EXIT_SUCCESS
2716
2717 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2718 echo "----------------------------------------------------------------------"
2719 echo "Libraries have been installed in:"
2720 for libdir in $libdirs; do
2721 $ECHO " $libdir"
2722 done
2723 echo
2724 echo "If you ever happen to want to link against installed libraries"
2725 echo "in a given directory, LIBDIR, you must either use libtool, and"
2726 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2727 echo "flag during linking and do at least one of the following:"
2728 if test -n "$shlibpath_var"; then
2729 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2730 echo " during execution"
2731 fi
2732 if test -n "$runpath_var"; then
2733 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2734 echo " during linking"
2735 fi
2736 if test -n "$hardcode_libdir_flag_spec"; then
2737 libdir=LIBDIR
2738 eval flag=\"$hardcode_libdir_flag_spec\"
2739
2740 $ECHO " - use the \`$flag' linker flag"
2741 fi
2742 if test -n "$admincmds"; then
2743 $ECHO " - have your system administrator run these commands:$admincmds"
2744 fi
2745 if test -f /etc/ld.so.conf; then
2746 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2747 fi
2748 echo
2749
2750 echo "See any operating system documentation about shared libraries for"
2751 case $host in
2752 solaris2.[6789]|solaris2.1[0-9])
2753 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2754 echo "pages."
2755 ;;
2756 *)
2757 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2758 ;;
2759 esac
2760 echo "----------------------------------------------------------------------"
2761 fi
2762 exit $EXIT_SUCCESS
2763}
2764
2765test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2766
2767
2768# func_mode_install arg...
2769func_mode_install ()
2770{
2771 $opt_debug
2772 # There may be an optional sh(1) argument at the beginning of
2773 # install_prog (especially on Windows NT).
2774 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2775 # Allow the use of GNU shtool's install command.
2776 case $nonopt in *shtool*) :;; *) false;; esac; then
2777 # Aesthetically quote it.
2778 func_quote_for_eval "$nonopt"
2779 install_prog="$func_quote_for_eval_result "
2780 arg=$1
2781 shift
2782 else
2783 install_prog=
2784 arg=$nonopt
2785 fi
2786
2787 # The real first argument should be the name of the installation program.
2788 # Aesthetically quote it.
2789 func_quote_for_eval "$arg"
2790 func_append install_prog "$func_quote_for_eval_result"
2791 install_shared_prog=$install_prog
2792 case " $install_prog " in
2793 *[\\\ /]cp\ *) install_cp=: ;;
2794 *) install_cp=false ;;
2795 esac
2796
2797 # We need to accept at least all the BSD install flags.
2798 dest=
2799 files=
2800 opts=
2801 prev=
2802 install_type=
2803 isdir=no
2804 stripme=
2805 no_mode=:
2806 for arg
2807 do
2808 arg2=
2809 if test -n "$dest"; then
2810 func_append files " $dest"
2811 dest=$arg
2812 continue
2813 fi
2814
2815 case $arg in
2816 -d) isdir=yes ;;
2817 -f)
2818 if $install_cp; then :; else
2819 prev=$arg
2820 fi
2821 ;;
2822 -g | -m | -o)
2823 prev=$arg
2824 ;;
2825 -s)
2826 stripme=" -s"
2827 continue
2828 ;;
2829 -*)
2830 ;;
2831 *)
2832 # If the previous option needed an argument, then skip it.
2833 if test -n "$prev"; then
2834 if test "x$prev" = x-m && test -n "$install_override_mode"; then
2835 arg2=$install_override_mode
2836 no_mode=false
2837 fi
2838 prev=
2839 else
2840 dest=$arg
2841 continue
2842 fi
2843 ;;
2844 esac
2845
2846 # Aesthetically quote the argument.
2847 func_quote_for_eval "$arg"
2848 func_append install_prog " $func_quote_for_eval_result"
2849 if test -n "$arg2"; then
2850 func_quote_for_eval "$arg2"
2851 fi
2852 func_append install_shared_prog " $func_quote_for_eval_result"
2853 done
2854
2855 test -z "$install_prog" && \
2856 func_fatal_help "you must specify an install program"
2857
2858 test -n "$prev" && \
2859 func_fatal_help "the \`$prev' option requires an argument"
2860
2861 if test -n "$install_override_mode" && $no_mode; then
2862 if $install_cp; then :; else
2863 func_quote_for_eval "$install_override_mode"
2864 func_append install_shared_prog " -m $func_quote_for_eval_result"
2865 fi
2866 fi
2867
2868 if test -z "$files"; then
2869 if test -z "$dest"; then
2870 func_fatal_help "no file or destination specified"
2871 else
2872 func_fatal_help "you must specify a destination"
2873 fi
2874 fi
2875
2876 # Strip any trailing slash from the destination.
2877 func_stripname '' '/' "$dest"
2878 dest=$func_stripname_result
2879
2880 # Check to see that the destination is a directory.
2881 test -d "$dest" && isdir=yes
2882 if test "$isdir" = yes; then
2883 destdir="$dest"
2884 destname=
2885 else
2886 func_dirname_and_basename "$dest" "" "."
2887 destdir="$func_dirname_result"
2888 destname="$func_basename_result"
2889
2890 # Not a directory, so check to see that there is only one file specified.
2891 set dummy $files; shift
2892 test "$#" -gt 1 && \
2893 func_fatal_help "\`$dest' is not a directory"
2894 fi
2895 case $destdir in
2896 [\\/]* | [A-Za-z]:[\\/]*) ;;
2897 *)
2898 for file in $files; do
2899 case $file in
2900 *.lo) ;;
2901 *)
2902 func_fatal_help "\`$destdir' must be an absolute directory name"
2903 ;;
2904 esac
2905 done
2906 ;;
2907 esac
2908
2909 # This variable tells wrapper scripts just to set variables rather
2910 # than running their programs.
2911 libtool_install_magic="$magic"
2912
2913 staticlibs=
2914 future_libdirs=
2915 current_libdirs=
2916 for file in $files; do
2917
2918 # Do each installation.
2919 case $file in
2920 *.$libext)
2921 # Do the static libraries later.
2922 func_append staticlibs " $file"
2923 ;;
2924
2925 *.la)
2926 func_resolve_sysroot "$file"
2927 file=$func_resolve_sysroot_result
2928
2929 # Check to see that this really is a libtool archive.
2930 func_lalib_unsafe_p "$file" \
2931 || func_fatal_help "\`$file' is not a valid libtool archive"
2932
2933 library_names=
2934 old_library=
2935 relink_command=
2936 func_source "$file"
2937
2938 # Add the libdir to current_libdirs if it is the destination.
2939 if test "X$destdir" = "X$libdir"; then
2940 case "$current_libdirs " in
2941 *" $libdir "*) ;;
2942 *) func_append current_libdirs " $libdir" ;;
2943 esac
2944 else
2945 # Note the libdir as a future libdir.
2946 case "$future_libdirs " in
2947 *" $libdir "*) ;;
2948 *) func_append future_libdirs " $libdir" ;;
2949 esac
2950 fi
2951
2952 func_dirname "$file" "/" ""
2953 dir="$func_dirname_result"
2954 func_append dir "$objdir"
2955
2956 if test -n "$relink_command"; then
2957 # Determine the prefix the user has applied to our future dir.
2958 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2959
2960 # Don't allow the user to place us outside of our expected
2961 # location b/c this prevents finding dependent libraries that
2962 # are installed to the same prefix.
2963 # At present, this check doesn't affect windows .dll's that
2964 # are installed into $libdir/../bin (currently, that works fine)
2965 # but it's something to keep an eye on.
2966 test "$inst_prefix_dir" = "$destdir" && \
2967 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2968
2969 if test -n "$inst_prefix_dir"; then
2970 # Stick the inst_prefix_dir data into the link command.
2971 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2972 else
2973 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2974 fi
2975
2976 func_warning "relinking \`$file'"
2977 func_show_eval "$relink_command" \
2978 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2979 fi
2980
2981 # See the names of the shared library.
2982 set dummy $library_names; shift
2983 if test -n "$1"; then
2984 realname="$1"
2985 shift
2986
2987 srcname="$realname"
2988 test -n "$relink_command" && srcname="$realname"T
2989
2990 # Install the shared library and build the symlinks.
2991 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2992 'exit $?'
2993 tstripme="$stripme"
2994 case $host_os in
2995 cygwin* | mingw* | pw32* | cegcc*)
2996 case $realname in
2997 *.dll.a)
2998 tstripme=""
2999 ;;
3000 esac
3001 ;;
3002 esac
3003 if test -n "$tstripme" && test -n "$striplib"; then
3004 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3005 fi
3006
3007 if test "$#" -gt 0; then
3008 # Delete the old symlinks, and create new ones.
3009 # Try `ln -sf' first, because the `ln' binary might depend on
3010 # the symlink we replace! Solaris /bin/ln does not understand -f,
3011 # so we also need to try rm && ln -s.
3012 for linkname
3013 do
3014 test "$linkname" != "$realname" \
3015 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3016 done
3017 fi
3018
3019 # Do each command in the postinstall commands.
3020 lib="$destdir/$realname"
3021 func_execute_cmds "$postinstall_cmds" 'exit $?'
3022 fi
3023
3024 # Install the pseudo-library for information purposes.
3025 func_basename "$file"
3026 name="$func_basename_result"
3027 instname="$dir/$name"i
3028 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3029
3030 # Maybe install the static library, too.
3031 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3032 ;;
3033
3034 *.lo)
3035 # Install (i.e. copy) a libtool object.
3036
3037 # Figure out destination file name, if it wasn't already specified.
3038 if test -n "$destname"; then
3039 destfile="$destdir/$destname"
3040 else
3041 func_basename "$file"
3042 destfile="$func_basename_result"
3043 destfile="$destdir/$destfile"
3044 fi
3045
3046 # Deduce the name of the destination old-style object file.
3047 case $destfile in
3048 *.lo)
3049 func_lo2o "$destfile"
3050 staticdest=$func_lo2o_result
3051 ;;
3052 *.$objext)
3053 staticdest="$destfile"
3054 destfile=
3055 ;;
3056 *)
3057 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3058 ;;
3059 esac
3060
3061 # Install the libtool object if requested.
3062 test -n "$destfile" && \
3063 func_show_eval "$install_prog $file $destfile" 'exit $?'
3064
3065 # Install the old object if enabled.
3066 if test "$build_old_libs" = yes; then
3067 # Deduce the name of the old-style object file.
3068 func_lo2o "$file"
3069 staticobj=$func_lo2o_result
3070 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3071 fi
3072 exit $EXIT_SUCCESS
3073 ;;
3074
3075 *)
3076 # Figure out destination file name, if it wasn't already specified.
3077 if test -n "$destname"; then
3078 destfile="$destdir/$destname"
3079 else
3080 func_basename "$file"
3081 destfile="$func_basename_result"
3082 destfile="$destdir/$destfile"
3083 fi
3084
3085 # If the file is missing, and there is a .exe on the end, strip it
3086 # because it is most likely a libtool script we actually want to
3087 # install
3088 stripped_ext=""
3089 case $file in
3090 *.exe)
3091 if test ! -f "$file"; then
3092 func_stripname '' '.exe' "$file"
3093 file=$func_stripname_result
3094 stripped_ext=".exe"
3095 fi
3096 ;;
3097 esac
3098
3099 # Do a test to see if this is really a libtool program.
3100 case $host in
3101 *cygwin* | *mingw*)
3102 if func_ltwrapper_executable_p "$file"; then
3103 func_ltwrapper_scriptname "$file"
3104 wrapper=$func_ltwrapper_scriptname_result
3105 else
3106 func_stripname '' '.exe' "$file"
3107 wrapper=$func_stripname_result
3108 fi
3109 ;;
3110 *)
3111 wrapper=$file
3112 ;;
3113 esac
3114 if func_ltwrapper_script_p "$wrapper"; then
3115 notinst_deplibs=
3116 relink_command=
3117
3118 func_source "$wrapper"
3119
3120 # Check the variables that should have been set.
3121 test -z "$generated_by_libtool_version" && \
3122 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3123
3124 finalize=yes
3125 for lib in $notinst_deplibs; do
3126 # Check to see that each library is installed.
3127 libdir=
3128 if test -f "$lib"; then
3129 func_source "$lib"
3130 fi
3131 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3132 if test -n "$libdir" && test ! -f "$libfile"; then
3133 func_warning "\`$lib' has not been installed in \`$libdir'"
3134 finalize=no
3135 fi
3136 done
3137
3138 relink_command=
3139 func_source "$wrapper"
3140
3141 outputname=
3142 if test "$fast_install" = no && test -n "$relink_command"; then
3143 $opt_dry_run || {
3144 if test "$finalize" = yes; then
3145 tmpdir=`func_mktempdir`
3146 func_basename "$file$stripped_ext"
3147 file="$func_basename_result"
3148 outputname="$tmpdir/$file"
3149 # Replace the output file specification.
3150 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3151
3152 $opt_silent || {
3153 func_quote_for_expand "$relink_command"
3154 eval "func_echo $func_quote_for_expand_result"
3155 }
3156 if eval "$relink_command"; then :
3157 else
3158 func_error "error: relink \`$file' with the above command before installing it"
3159 $opt_dry_run || ${RM}r "$tmpdir"
3160 continue
3161 fi
3162 file="$outputname"
3163 else
3164 func_warning "cannot relink \`$file'"
3165 fi
3166 }
3167 else
3168 # Install the binary that we compiled earlier.
3169 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3170 fi
3171 fi
3172
3173 # remove .exe since cygwin /usr/bin/install will append another
3174 # one anyway
3175 case $install_prog,$host in
3176 */usr/bin/install*,*cygwin*)
3177 case $file:$destfile in
3178 *.exe:*.exe)
3179 # this is ok
3180 ;;
3181 *.exe:*)
3182 destfile=$destfile.exe
3183 ;;
3184 *:*.exe)
3185 func_stripname '' '.exe' "$destfile"
3186 destfile=$func_stripname_result
3187 ;;
3188 esac
3189 ;;
3190 esac
3191 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3192 $opt_dry_run || if test -n "$outputname"; then
3193 ${RM}r "$tmpdir"
3194 fi
3195 ;;
3196 esac
3197 done
3198
3199 for file in $staticlibs; do
3200 func_basename "$file"
3201 name="$func_basename_result"
3202
3203 # Set up the ranlib parameters.
3204 oldlib="$destdir/$name"
3205 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3206 tool_oldlib=$func_to_tool_file_result
3207
3208 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3209
3210 if test -n "$stripme" && test -n "$old_striplib"; then
3211 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3212 fi
3213
3214 # Do each command in the postinstall commands.
3215 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3216 done
3217
3218 test -n "$future_libdirs" && \
3219 func_warning "remember to run \`$progname --finish$future_libdirs'"
3220
3221 if test -n "$current_libdirs"; then
3222 # Maybe just do a dry run.
3223 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3224 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3225 else
3226 exit $EXIT_SUCCESS
3227 fi
3228}
3229
3230test "$opt_mode" = install && func_mode_install ${1+"$@"}
3231
3232
3233# func_generate_dlsyms outputname originator pic_p
3234# Extract symbols from dlprefiles and create ${outputname}S.o with
3235# a dlpreopen symbol table.
3236func_generate_dlsyms ()
3237{
3238 $opt_debug
3239 my_outputname="$1"
3240 my_originator="$2"
3241 my_pic_p="${3-no}"
3242 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3243 my_dlsyms=
3244
3245 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3246 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3247 my_dlsyms="${my_outputname}S.c"
3248 else
3249 func_error "not configured to extract global symbols from dlpreopened files"
3250 fi
3251 fi
3252
3253 if test -n "$my_dlsyms"; then
3254 case $my_dlsyms in
3255 "") ;;
3256 *.c)
3257 # Discover the nlist of each of the dlfiles.
3258 nlist="$output_objdir/${my_outputname}.nm"
3259
3260 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3261
3262 # Parse the name list into a source file.
3263 func_verbose "creating $output_objdir/$my_dlsyms"
3264
3265 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3266/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3267/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3268
3269#ifdef __cplusplus
3270extern \"C\" {
3271#endif
3272
3273#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3274#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3275#endif
3276
3277/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3278#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3279/* DATA imports from DLLs on WIN32 con't be const, because runtime
3280 relocations are performed -- see ld's documentation on pseudo-relocs. */
3281# define LT_DLSYM_CONST
3282#elif defined(__osf__)
3283/* This system does not cope well with relocations in const data. */
3284# define LT_DLSYM_CONST
3285#else
3286# define LT_DLSYM_CONST const
3287#endif
3288
3289/* External symbol declarations for the compiler. */\
3290"
3291
3292 if test "$dlself" = yes; then
3293 func_verbose "generating symbol list for \`$output'"
3294
3295 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3296
3297 # Add our own program objects to the symbol list.
3298 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3299 for progfile in $progfiles; do
3300 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3301 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3302 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3303 done
3304
3305 if test -n "$exclude_expsyms"; then
3306 $opt_dry_run || {
3307 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3308 eval '$MV "$nlist"T "$nlist"'
3309 }
3310 fi
3311
3312 if test -n "$export_symbols_regex"; then
3313 $opt_dry_run || {
3314 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3315 eval '$MV "$nlist"T "$nlist"'
3316 }
3317 fi
3318
3319 # Prepare the list of exported symbols
3320 if test -z "$export_symbols"; then
3321 export_symbols="$output_objdir/$outputname.exp"
3322 $opt_dry_run || {
3323 $RM $export_symbols
3324 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3325 case $host in
3326 *cygwin* | *mingw* | *cegcc* )
3327 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3328 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3329 ;;
3330 esac
3331 }
3332 else
3333 $opt_dry_run || {
3334 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3335 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3336 eval '$MV "$nlist"T "$nlist"'
3337 case $host in
3338 *cygwin* | *mingw* | *cegcc* )
3339 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3340 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3341 ;;
3342 esac
3343 }
3344 fi
3345 fi
3346
3347 for dlprefile in $dlprefiles; do
3348 func_verbose "extracting global C symbols from \`$dlprefile'"
3349 func_basename "$dlprefile"
3350 name="$func_basename_result"
3351 case $host in
3352 *cygwin* | *mingw* | *cegcc* )
3353 # if an import library, we need to obtain dlname
3354 if func_win32_import_lib_p "$dlprefile"; then
3355 func_tr_sh "$dlprefile"
3356 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3357 dlprefile_dlbasename=""
3358 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3359 # Use subshell, to avoid clobbering current variable values
3360 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3361 if test -n "$dlprefile_dlname" ; then
3362 func_basename "$dlprefile_dlname"
3363 dlprefile_dlbasename="$func_basename_result"
3364 else
3365 # no lafile. user explicitly requested -dlpreopen <import library>.
3366 $sharedlib_from_linklib_cmd "$dlprefile"
3367 dlprefile_dlbasename=$sharedlib_from_linklib_result
3368 fi
3369 fi
3370 $opt_dry_run || {
3371 if test -n "$dlprefile_dlbasename" ; then
3372 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3373 else
3374 func_warning "Could not compute DLL name from $name"
3375 eval '$ECHO ": $name " >> "$nlist"'
3376 fi
3377 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3378 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3379 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3380 }
3381 else # not an import lib
3382 $opt_dry_run || {
3383 eval '$ECHO ": $name " >> "$nlist"'
3384 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3385 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3386 }
3387 fi
3388 ;;
3389 *)
3390 $opt_dry_run || {
3391 eval '$ECHO ": $name " >> "$nlist"'
3392 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3393 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3394 }
3395 ;;
3396 esac
3397 done
3398
3399 $opt_dry_run || {
3400 # Make sure we have at least an empty file.
3401 test -f "$nlist" || : > "$nlist"
3402
3403 if test -n "$exclude_expsyms"; then
3404 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3405 $MV "$nlist"T "$nlist"
3406 fi
3407
3408 # Try sorting and uniquifying the output.
3409 if $GREP -v "^: " < "$nlist" |
3410 if sort -k 3 </dev/null >/dev/null 2>&1; then
3411 sort -k 3
3412 else
3413 sort +2
3414 fi |
3415 uniq > "$nlist"S; then
3416 :
3417 else
3418 $GREP -v "^: " < "$nlist" > "$nlist"S
3419 fi
3420
3421 if test -f "$nlist"S; then
3422 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3423 else
3424 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3425 fi
3426
3427 echo >> "$output_objdir/$my_dlsyms" "\
3428
3429/* The mapping between symbol names and symbols. */
3430typedef struct {
3431 const char *name;
3432 void *address;
3433} lt_dlsymlist;
3434extern LT_DLSYM_CONST lt_dlsymlist
3435lt_${my_prefix}_LTX_preloaded_symbols[];
3436LT_DLSYM_CONST lt_dlsymlist
3437lt_${my_prefix}_LTX_preloaded_symbols[] =
3438{\
3439 { \"$my_originator\", (void *) 0 },"
3440
3441 case $need_lib_prefix in
3442 no)
3443 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3444 ;;
3445 *)
3446 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3447 ;;
3448 esac
3449 echo >> "$output_objdir/$my_dlsyms" "\
3450 {0, (void *) 0}
3451};
3452
3453/* This works around a problem in FreeBSD linker */
3454#ifdef FREEBSD_WORKAROUND
3455static const void *lt_preloaded_setup() {
3456 return lt_${my_prefix}_LTX_preloaded_symbols;
3457}
3458#endif
3459
3460#ifdef __cplusplus
3461}
3462#endif\
3463"
3464 } # !$opt_dry_run
3465
3466 pic_flag_for_symtable=
3467 case "$compile_command " in
3468 *" -static "*) ;;
3469 *)
3470 case $host in
3471 # compiling the symbol table file with pic_flag works around
3472 # a FreeBSD bug that causes programs to crash when -lm is
3473 # linked before any other PIC object. But we must not use
3474 # pic_flag when linking with -static. The problem exists in
3475 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3476 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3477 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3478 *-*-hpux*)
3479 pic_flag_for_symtable=" $pic_flag" ;;
3480 *)
3481 if test "X$my_pic_p" != Xno; then
3482 pic_flag_for_symtable=" $pic_flag"
3483 fi
3484 ;;
3485 esac
3486 ;;
3487 esac
3488 symtab_cflags=
3489 for arg in $LTCFLAGS; do
3490 case $arg in
3491 -pie | -fpie | -fPIE) ;;
3492 *) func_append symtab_cflags " $arg" ;;
3493 esac
3494 done
3495
3496 # Now compile the dynamic symbol file.
3497 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3498
3499 # Clean up the generated files.
3500 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3501
3502 # Transform the symbol file into the correct name.
3503 symfileobj="$output_objdir/${my_outputname}S.$objext"
3504 case $host in
3505 *cygwin* | *mingw* | *cegcc* )
3506 if test -f "$output_objdir/$my_outputname.def"; then
3507 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3508 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3509 else
3510 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3511 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3512 fi
3513 ;;
3514 *)
3515 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3516 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3517 ;;
3518 esac
3519 ;;
3520 *)
3521 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3522 ;;
3523 esac
3524 else
3525 # We keep going just in case the user didn't refer to
3526 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3527 # really was required.
3528
3529 # Nullify the symbol file.
3530 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3531 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3532 fi
3533}
3534
3535# func_win32_libid arg
3536# return the library type of file 'arg'
3537#
3538# Need a lot of goo to handle *both* DLLs and import libs
3539# Has to be a shell function in order to 'eat' the argument
3540# that is supplied when $file_magic_command is called.
3541# Despite the name, also deal with 64 bit binaries.
3542func_win32_libid ()
3543{
3544 $opt_debug
3545 win32_libid_type="unknown"
3546 win32_fileres=`file -L $1 2>/dev/null`
3547 case $win32_fileres in
3548 *ar\ archive\ import\ library*) # definitely import
3549 win32_libid_type="x86 archive import"
3550 ;;
3551 *ar\ archive*) # could be an import, or static
3552 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3553 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3554 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3555 func_to_tool_file "$1" func_convert_file_msys_to_w32
3556 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3557 $SED -n -e '
3558 1,100{
3559 / I /{
3560 s,.*,import,
3561 p
3562 q
3563 }
3564 }'`
3565 case $win32_nmres in
3566 import*) win32_libid_type="x86 archive import";;
3567 *) win32_libid_type="x86 archive static";;
3568 esac
3569 fi
3570 ;;
3571 *DLL*)
3572 win32_libid_type="x86 DLL"
3573 ;;
3574 *executable*) # but shell scripts are "executable" too...
3575 case $win32_fileres in
3576 *MS\ Windows\ PE\ Intel*)
3577 win32_libid_type="x86 DLL"
3578 ;;
3579 esac
3580 ;;
3581 esac
3582 $ECHO "$win32_libid_type"
3583}
3584
3585# func_cygming_dll_for_implib ARG
3586#
3587# Platform-specific function to extract the
3588# name of the DLL associated with the specified
3589# import library ARG.
3590# Invoked by eval'ing the libtool variable
3591# $sharedlib_from_linklib_cmd
3592# Result is available in the variable
3593# $sharedlib_from_linklib_result
3594func_cygming_dll_for_implib ()
3595{
3596 $opt_debug
3597 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3598}
3599
3600# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3601#
3602# The is the core of a fallback implementation of a
3603# platform-specific function to extract the name of the
3604# DLL associated with the specified import library LIBNAME.
3605#
3606# SECTION_NAME is either .idata$6 or .idata$7, depending
3607# on the platform and compiler that created the implib.
3608#
3609# Echos the name of the DLL associated with the
3610# specified import library.
3611func_cygming_dll_for_implib_fallback_core ()
3612{
3613 $opt_debug
3614 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3615 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3616 $SED '/^Contents of section '"$match_literal"':/{
3617 # Place marker at beginning of archive member dllname section
3618 s/.*/====MARK====/
3619 p
3620 d
3621 }
3622 # These lines can sometimes be longer than 43 characters, but
3623 # are always uninteresting
3624 /:[ ]*file format pe[i]\{,1\}-/d
3625 /^In archive [^:]*:/d
3626 # Ensure marker is printed
3627 /^====MARK====/p
3628 # Remove all lines with less than 43 characters
3629 /^.\{43\}/!d
3630 # From remaining lines, remove first 43 characters
3631 s/^.\{43\}//' |
3632 $SED -n '
3633 # Join marker and all lines until next marker into a single line
3634 /^====MARK====/ b para
3635 H
3636 $ b para
3637 b
3638 :para
3639 x
3640 s/\n//g
3641 # Remove the marker
3642 s/^====MARK====//
3643 # Remove trailing dots and whitespace
3644 s/[\. \t]*$//
3645 # Print
3646 /./p' |
3647 # we now have a list, one entry per line, of the stringified
3648 # contents of the appropriate section of all members of the
3649 # archive which possess that section. Heuristic: eliminate
3650 # all those which have a first or second character that is
3651 # a '.' (that is, objdump's representation of an unprintable
3652 # character.) This should work for all archives with less than
3653 # 0x302f exports -- but will fail for DLLs whose name actually
3654 # begins with a literal '.' or a single character followed by
3655 # a '.'.
3656 #
3657 # Of those that remain, print the first one.
3658 $SED -e '/^\./d;/^.\./d;q'
3659}
3660
3661# func_cygming_gnu_implib_p ARG
3662# This predicate returns with zero status (TRUE) if
3663# ARG is a GNU/binutils-style import library. Returns
3664# with nonzero status (FALSE) otherwise.
3665func_cygming_gnu_implib_p ()
3666{
3667 $opt_debug
3668 func_to_tool_file "$1" func_convert_file_msys_to_w32
3669 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3670 test -n "$func_cygming_gnu_implib_tmp"
3671}
3672
3673# func_cygming_ms_implib_p ARG
3674# This predicate returns with zero status (TRUE) if
3675# ARG is an MS-style import library. Returns
3676# with nonzero status (FALSE) otherwise.
3677func_cygming_ms_implib_p ()
3678{
3679 $opt_debug
3680 func_to_tool_file "$1" func_convert_file_msys_to_w32
3681 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3682 test -n "$func_cygming_ms_implib_tmp"
3683}
3684
3685# func_cygming_dll_for_implib_fallback ARG
3686# Platform-specific function to extract the
3687# name of the DLL associated with the specified
3688# import library ARG.
3689#
3690# This fallback implementation is for use when $DLLTOOL
3691# does not support the --identify-strict option.
3692# Invoked by eval'ing the libtool variable
3693# $sharedlib_from_linklib_cmd
3694# Result is available in the variable
3695# $sharedlib_from_linklib_result
3696func_cygming_dll_for_implib_fallback ()
3697{
3698 $opt_debug
3699 if func_cygming_gnu_implib_p "$1" ; then
3700 # binutils import library
3701 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3702 elif func_cygming_ms_implib_p "$1" ; then
3703 # ms-generated import library
3704 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3705 else
3706 # unknown
3707 sharedlib_from_linklib_result=""
3708 fi
3709}
3710
3711
3712# func_extract_an_archive dir oldlib
3713func_extract_an_archive ()
3714{
3715 $opt_debug
3716 f_ex_an_ar_dir="$1"; shift
3717 f_ex_an_ar_oldlib="$1"
3718 if test "$lock_old_archive_extraction" = yes; then
3719 lockfile=$f_ex_an_ar_oldlib.lock
3720 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3721 func_echo "Waiting for $lockfile to be removed"
3722 sleep 2
3723 done
3724 fi
3725 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3726 'stat=$?; rm -f "$lockfile"; exit $stat'
3727 if test "$lock_old_archive_extraction" = yes; then
3728 $opt_dry_run || rm -f "$lockfile"
3729 fi
3730 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3731 :
3732 else
3733 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3734 fi
3735}
3736
3737
3738# func_extract_archives gentop oldlib ...
3739func_extract_archives ()
3740{
3741 $opt_debug
3742 my_gentop="$1"; shift
3743 my_oldlibs=${1+"$@"}
3744 my_oldobjs=""
3745 my_xlib=""
3746 my_xabs=""
3747 my_xdir=""
3748
3749 for my_xlib in $my_oldlibs; do
3750 # Extract the objects.
3751 case $my_xlib in
3752 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3753 *) my_xabs=`pwd`"/$my_xlib" ;;
3754 esac
3755 func_basename "$my_xlib"
3756 my_xlib="$func_basename_result"
3757 my_xlib_u=$my_xlib
3758 while :; do
3759 case " $extracted_archives " in
3760 *" $my_xlib_u "*)
3761 func_arith $extracted_serial + 1
3762 extracted_serial=$func_arith_result
3763 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3764 *) break ;;
3765 esac
3766 done
3767 extracted_archives="$extracted_archives $my_xlib_u"
3768 my_xdir="$my_gentop/$my_xlib_u"
3769
3770 func_mkdir_p "$my_xdir"
3771
3772 case $host in
3773 *-darwin*)
3774 func_verbose "Extracting $my_xabs"
3775 # Do not bother doing anything if just a dry run
3776 $opt_dry_run || {
3777 darwin_orig_dir=`pwd`
3778 cd $my_xdir || exit $?
3779 darwin_archive=$my_xabs
3780 darwin_curdir=`pwd`
3781 darwin_base_archive=`basename "$darwin_archive"`
3782 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3783 if test -n "$darwin_arches"; then
3784 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3785 darwin_arch=
3786 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3787 for darwin_arch in $darwin_arches ; do
3788 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3789 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3790 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3791 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3792 cd "$darwin_curdir"
3793 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3794 done # $darwin_arches
3795 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3796 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3797 darwin_file=
3798 darwin_files=
3799 for darwin_file in $darwin_filelist; do
3800 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
3801 $LIPO -create -output "$darwin_file" $darwin_files
3802 done # $darwin_filelist
3803 $RM -rf unfat-$$
3804 cd "$darwin_orig_dir"
3805 else
3806 cd $darwin_orig_dir
3807 func_extract_an_archive "$my_xdir" "$my_xabs"
3808 fi # $darwin_arches
3809 } # !$opt_dry_run
3810 ;;
3811 *)
3812 func_extract_an_archive "$my_xdir" "$my_xabs"
3813 ;;
3814 esac
3815 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3816 done
3817
3818 func_extract_archives_result="$my_oldobjs"
3819}
3820
3821
3822# func_emit_wrapper [arg=no]
3823#
3824# Emit a libtool wrapper script on stdout.
3825# Don't directly open a file because we may want to
3826# incorporate the script contents within a cygwin/mingw
3827# wrapper executable. Must ONLY be called from within
3828# func_mode_link because it depends on a number of variables
3829# set therein.
3830#
3831# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3832# variable will take. If 'yes', then the emitted script
3833# will assume that the directory in which it is stored is
3834# the $objdir directory. This is a cygwin/mingw-specific
3835# behavior.
3836func_emit_wrapper ()
3837{
3838 func_emit_wrapper_arg1=${1-no}
3839
3840 $ECHO "\
3841#! $SHELL
3842
3843# $output - temporary wrapper script for $objdir/$outputname
3844# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3845#
3846# The $output program cannot be directly executed until all the libtool
3847# libraries that it depends on are installed.
3848#
3849# This wrapper script should never be moved out of the build directory.
3850# If it is, it will not operate correctly.
3851
3852# Sed substitution that helps us do robust quoting. It backslashifies
3853# metacharacters that are still active within double-quoted strings.
3854sed_quote_subst='$sed_quote_subst'
3855
3856# Be Bourne compatible
3857if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3858 emulate sh
3859 NULLCMD=:
3860 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3861 # is contrary to our usage. Disable this feature.
3862 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3863 setopt NO_GLOB_SUBST
3864else
3865 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3866fi
3867BIN_SH=xpg4; export BIN_SH # for Tru64
3868DUALCASE=1; export DUALCASE # for MKS sh
3869
3870# The HP-UX ksh and POSIX shell print the target directory to stdout
3871# if CDPATH is set.
3872(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3873
3874relink_command=\"$relink_command\"
3875
3876# This environment variable determines our operation mode.
3877if test \"\$libtool_install_magic\" = \"$magic\"; then
3878 # install mode needs the following variables:
3879 generated_by_libtool_version='$macro_version'
3880 notinst_deplibs='$notinst_deplibs'
3881else
3882 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3883 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3884 file=\"\$0\""
3885
3886 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3887 $ECHO "\
3888
3889# A function that is used when there is no print builtin or printf.
3890func_fallback_echo ()
3891{
3892 eval 'cat <<_LTECHO_EOF
3893\$1
3894_LTECHO_EOF'
3895}
3896 ECHO=\"$qECHO\"
3897 fi
3898
3899# Very basic option parsing. These options are (a) specific to
3900# the libtool wrapper, (b) are identical between the wrapper
3901# /script/ and the wrapper /executable/ which is used only on
3902# windows platforms, and (c) all begin with the string "--lt-"
3903# (application programs are unlikely to have options which match
3904# this pattern).
3905#
3906# There are only two supported options: --lt-debug and
3907# --lt-dump-script. There is, deliberately, no --lt-help.
3908#
3909# The first argument to this parsing function should be the
3910# script's $0 value, followed by "$@".
3911lt_option_debug=
3912func_parse_lt_options ()
3913{
3914 lt_script_arg0=\$0
3915 shift
3916 for lt_opt
3917 do
3918 case \"\$lt_opt\" in
3919 --lt-debug) lt_option_debug=1 ;;
3920 --lt-dump-script)
3921 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3922 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3923 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3924 cat \"\$lt_dump_D/\$lt_dump_F\"
3925 exit 0
3926 ;;
3927 --lt-*)
3928 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3929 exit 1
3930 ;;
3931 esac
3932 done
3933
3934 # Print the debug banner immediately:
3935 if test -n \"\$lt_option_debug\"; then
3936 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3937 fi
3938}
3939
3940# Used when --lt-debug. Prints its arguments to stdout
3941# (redirection is the responsibility of the caller)
3942func_lt_dump_args ()
3943{
3944 lt_dump_args_N=1;
3945 for lt_arg
3946 do
3947 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3948 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3949 done
3950}
3951
3952# Core function for launching the target application
3953func_exec_program_core ()
3954{
3955"
3956 case $host in
3957 # Backslashes separate directories on plain windows
3958 *-*-mingw | *-*-os2* | *-cegcc*)
3959 $ECHO "\
3960 if test -n \"\$lt_option_debug\"; then
3961 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3962 func_lt_dump_args \${1+\"\$@\"} 1>&2
3963 fi
3964 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3965"
3966 ;;
3967
3968 *)
3969 $ECHO "\
3970 if test -n \"\$lt_option_debug\"; then
3971 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3972 func_lt_dump_args \${1+\"\$@\"} 1>&2
3973 fi
3974 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3975"
3976 ;;
3977 esac
3978 $ECHO "\
3979 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3980 exit 1
3981}
3982
3983# A function to encapsulate launching the target application
3984# Strips options in the --lt-* namespace from \$@ and
3985# launches target application with the remaining arguments.
3986func_exec_program ()
3987{
3988 case \" \$* \" in
3989 *\\ --lt-*)
3990 for lt_wr_arg
3991 do
3992 case \$lt_wr_arg in
3993 --lt-*) ;;
3994 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3995 esac
3996 shift
3997 done ;;
3998 esac
3999 func_exec_program_core \${1+\"\$@\"}
4000}
4001
4002 # Parse options
4003 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4004
4005 # Find the directory that this script lives in.
4006 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4007 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4008
4009 # Follow symbolic links until we get to the real thisdir.
4010 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4011 while test -n \"\$file\"; do
4012 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4013
4014 # If there was a directory component, then change thisdir.
4015 if test \"x\$destdir\" != \"x\$file\"; then
4016 case \"\$destdir\" in
4017 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4018 *) thisdir=\"\$thisdir/\$destdir\" ;;
4019 esac
4020 fi
4021
4022 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4023 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4024 done
4025
4026 # Usually 'no', except on cygwin/mingw when embedded into
4027 # the cwrapper.
4028 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4029 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4030 # special case for '.'
4031 if test \"\$thisdir\" = \".\"; then
4032 thisdir=\`pwd\`
4033 fi
4034 # remove .libs from thisdir
4035 case \"\$thisdir\" in
4036 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4037 $objdir ) thisdir=. ;;
4038 esac
4039 fi
4040
4041 # Try to get the absolute directory name.
4042 absdir=\`cd \"\$thisdir\" && pwd\`
4043 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4044"
4045
4046 if test "$fast_install" = yes; then
4047 $ECHO "\
4048 program=lt-'$outputname'$exeext
4049 progdir=\"\$thisdir/$objdir\"
4050
4051 if test ! -f \"\$progdir/\$program\" ||
4052 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4053 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4054
4055 file=\"\$\$-\$program\"
4056
4057 if test ! -d \"\$progdir\"; then
4058 $MKDIR \"\$progdir\"
4059 else
4060 $RM \"\$progdir/\$file\"
4061 fi"
4062
4063 $ECHO "\
4064
4065 # relink executable if necessary
4066 if test -n \"\$relink_command\"; then
4067 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4068 else
4069 $ECHO \"\$relink_command_output\" >&2
4070 $RM \"\$progdir/\$file\"
4071 exit 1
4072 fi
4073 fi
4074
4075 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4076 { $RM \"\$progdir/\$program\";
4077 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4078 $RM \"\$progdir/\$file\"
4079 fi"
4080 else
4081 $ECHO "\
4082 program='$outputname'
4083 progdir=\"\$thisdir/$objdir\"
4084"
4085 fi
4086
4087 $ECHO "\
4088
4089 if test -f \"\$progdir/\$program\"; then"
4090
4091 # fixup the dll searchpath if we need to.
4092 #
4093 # Fix the DLL searchpath if we need to. Do this before prepending
4094 # to shlibpath, because on Windows, both are PATH and uninstalled
4095 # libraries must come first.
4096 if test -n "$dllsearchpath"; then
4097 $ECHO "\
4098 # Add the dll search path components to the executable PATH
4099 PATH=$dllsearchpath:\$PATH
4100"
4101 fi
4102
4103 # Export our shlibpath_var if we have one.
4104 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4105 $ECHO "\
4106 # Add our own library path to $shlibpath_var
4107 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4108
4109 # Some systems cannot cope with colon-terminated $shlibpath_var
4110 # The second colon is a workaround for a bug in BeOS R4 sed
4111 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4112
4113 export $shlibpath_var
4114"
4115 fi
4116
4117 $ECHO "\
4118 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4119 # Run the actual program with our arguments.
4120 func_exec_program \${1+\"\$@\"}
4121 fi
4122 else
4123 # The program doesn't exist.
4124 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4125 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4126 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4127 exit 1
4128 fi
4129fi\
4130"
4131}
4132
4133
4134# func_emit_cwrapperexe_src
4135# emit the source code for a wrapper executable on stdout
4136# Must ONLY be called from within func_mode_link because
4137# it depends on a number of variable set therein.
4138func_emit_cwrapperexe_src ()
4139{
4140 cat <<EOF
4141
4142/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4143 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4144
4145 The $output program cannot be directly executed until all the libtool
4146 libraries that it depends on are installed.
4147
4148 This wrapper executable should never be moved out of the build directory.
4149 If it is, it will not operate correctly.
4150*/
4151EOF
4152 cat <<"EOF"
4153#ifdef _MSC_VER
4154# define _CRT_SECURE_NO_DEPRECATE 1
4155#endif
4156#include <stdio.h>
4157#include <stdlib.h>
4158#ifdef _MSC_VER
4159# include <direct.h>
4160# include <process.h>
4161# include <io.h>
4162#else
4163# include <unistd.h>
4164# include <stdint.h>
4165# ifdef __CYGWIN__
4166# include <io.h>
4167# endif
4168#endif
4169#include <malloc.h>
4170#include <stdarg.h>
4171#include <assert.h>
4172#include <string.h>
4173#include <ctype.h>
4174#include <errno.h>
4175#include <fcntl.h>
4176#include <sys/stat.h>
4177
4178/* declarations of non-ANSI functions */
4179#if defined(__MINGW32__)
4180# ifdef __STRICT_ANSI__
4181int _putenv (const char *);
4182# endif
4183#elif defined(__CYGWIN__)
4184# ifdef __STRICT_ANSI__
4185char *realpath (const char *, char *);
4186int putenv (char *);
4187int setenv (const char *, const char *, int);
4188# endif
4189/* #elif defined (other platforms) ... */
4190#endif
4191
4192/* portability defines, excluding path handling macros */
4193#if defined(_MSC_VER)
4194# define setmode _setmode
4195# define stat _stat
4196# define chmod _chmod
4197# define getcwd _getcwd
4198# define putenv _putenv
4199# define S_IXUSR _S_IEXEC
4200# ifndef _INTPTR_T_DEFINED
4201# define _INTPTR_T_DEFINED
4202# define intptr_t int
4203# endif
4204#elif defined(__MINGW32__)
4205# define setmode _setmode
4206# define stat _stat
4207# define chmod _chmod
4208# define getcwd _getcwd
4209# define putenv _putenv
4210#elif defined(__CYGWIN__)
4211# define HAVE_SETENV
4212# define FOPEN_WB "wb"
4213/* #elif defined (other platforms) ... */
4214#endif
4215
4216#if defined(PATH_MAX)
4217# define LT_PATHMAX PATH_MAX
4218#elif defined(MAXPATHLEN)
4219# define LT_PATHMAX MAXPATHLEN
4220#else
4221# define LT_PATHMAX 1024
4222#endif
4223
4224#ifndef S_IXOTH
4225# define S_IXOTH 0
4226#endif
4227#ifndef S_IXGRP
4228# define S_IXGRP 0
4229#endif
4230
4231/* path handling portability macros */
4232#ifndef DIR_SEPARATOR
4233# define DIR_SEPARATOR '/'
4234# define PATH_SEPARATOR ':'
4235#endif
4236
4237#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4238 defined (__OS2__)
4239# define HAVE_DOS_BASED_FILE_SYSTEM
4240# define FOPEN_WB "wb"
4241# ifndef DIR_SEPARATOR_2
4242# define DIR_SEPARATOR_2 '\\'
4243# endif
4244# ifndef PATH_SEPARATOR_2
4245# define PATH_SEPARATOR_2 ';'
4246# endif
4247#endif
4248
4249#ifndef DIR_SEPARATOR_2
4250# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4251#else /* DIR_SEPARATOR_2 */
4252# define IS_DIR_SEPARATOR(ch) \
4253 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4254#endif /* DIR_SEPARATOR_2 */
4255
4256#ifndef PATH_SEPARATOR_2
4257# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4258#else /* PATH_SEPARATOR_2 */
4259# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4260#endif /* PATH_SEPARATOR_2 */
4261
4262#ifndef FOPEN_WB
4263# define FOPEN_WB "w"
4264#endif
4265#ifndef _O_BINARY
4266# define _O_BINARY 0
4267#endif
4268
4269#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4270#define XFREE(stale) do { \
4271 if (stale) { free ((void *) stale); stale = 0; } \
4272} while (0)
4273
4274#if defined(LT_DEBUGWRAPPER)
4275static int lt_debug = 1;
4276#else
4277static int lt_debug = 0;
4278#endif
4279
4280const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4281
4282void *xmalloc (size_t num);
4283char *xstrdup (const char *string);
4284const char *base_name (const char *name);
4285char *find_executable (const char *wrapper);
4286char *chase_symlinks (const char *pathspec);
4287int make_executable (const char *path);
4288int check_executable (const char *path);
4289char *strendzap (char *str, const char *pat);
4290void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4291void lt_fatal (const char *file, int line, const char *message, ...);
4292static const char *nonnull (const char *s);
4293static const char *nonempty (const char *s);
4294void lt_setenv (const char *name, const char *value);
4295char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4296void lt_update_exe_path (const char *name, const char *value);
4297void lt_update_lib_path (const char *name, const char *value);
4298char **prepare_spawn (char **argv);
4299void lt_dump_script (FILE *f);
4300EOF
4301
4302 cat <<EOF
4303volatile const char * MAGIC_EXE = "$magic_exe";
4304const char * LIB_PATH_VARNAME = "$shlibpath_var";
4305EOF
4306
4307 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4308 func_to_host_path "$temp_rpath"
4309 cat <<EOF
4310const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4311EOF
4312 else
4313 cat <<"EOF"
4314const char * LIB_PATH_VALUE = "";
4315EOF
4316 fi
4317
4318 if test -n "$dllsearchpath"; then
4319 func_to_host_path "$dllsearchpath:"
4320 cat <<EOF
4321const char * EXE_PATH_VARNAME = "PATH";
4322const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4323EOF
4324 else
4325 cat <<"EOF"
4326const char * EXE_PATH_VARNAME = "";
4327const char * EXE_PATH_VALUE = "";
4328EOF
4329 fi
4330
4331 if test "$fast_install" = yes; then
4332 cat <<EOF
4333const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4334EOF
4335 else
4336 cat <<EOF
4337const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4338EOF
4339 fi
4340
4341
4342 cat <<"EOF"
4343
4344#define LTWRAPPER_OPTION_PREFIX "--lt-"
4345
4346static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4347static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4348static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4349
4350int
4351main (int argc, char *argv[])
4352{
4353 char **newargz;
4354 int newargc;
4355 char *tmp_pathspec;
4356 char *actual_cwrapper_path;
4357 char *actual_cwrapper_name;
4358 char *target_name;
4359 char *lt_argv_zero;
4360 intptr_t rval = 127;
4361
4362 int i;
4363
4364 program_name = (char *) xstrdup (base_name (argv[0]));
4365 newargz = XMALLOC (char *, argc + 1);
4366
4367 /* very simple arg parsing; don't want to rely on getopt
4368 * also, copy all non cwrapper options to newargz, except
4369 * argz[0], which is handled differently
4370 */
4371 newargc=0;
4372 for (i = 1; i < argc; i++)
4373 {
4374 if (strcmp (argv[i], dumpscript_opt) == 0)
4375 {
4376EOF
4377 case "$host" in
4378 *mingw* | *cygwin* )
4379 # make stdout use "unix" line endings
4380 echo " setmode(1,_O_BINARY);"
4381 ;;
4382 esac
4383
4384 cat <<"EOF"
4385 lt_dump_script (stdout);
4386 return 0;
4387 }
4388 if (strcmp (argv[i], debug_opt) == 0)
4389 {
4390 lt_debug = 1;
4391 continue;
4392 }
4393 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4394 {
4395 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4396 namespace, but it is not one of the ones we know about and
4397 have already dealt with, above (inluding dump-script), then
4398 report an error. Otherwise, targets might begin to believe
4399 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4400 namespace. The first time any user complains about this, we'll
4401 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4402 or a configure.ac-settable value.
4403 */
4404 lt_fatal (__FILE__, __LINE__,
4405 "unrecognized %s option: '%s'",
4406 ltwrapper_option_prefix, argv[i]);
4407 }
4408 /* otherwise ... */
4409 newargz[++newargc] = xstrdup (argv[i]);
4410 }
4411 newargz[++newargc] = NULL;
4412
4413EOF
4414 cat <<EOF
4415 /* The GNU banner must be the first non-error debug message */
4416 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4417EOF
4418 cat <<"EOF"
4419 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4420 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4421
4422 tmp_pathspec = find_executable (argv[0]);
4423 if (tmp_pathspec == NULL)
4424 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4425 lt_debugprintf (__FILE__, __LINE__,
4426 "(main) found exe (before symlink chase) at: %s\n",
4427 tmp_pathspec);
4428
4429 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4430 lt_debugprintf (__FILE__, __LINE__,
4431 "(main) found exe (after symlink chase) at: %s\n",
4432 actual_cwrapper_path);
4433 XFREE (tmp_pathspec);
4434
4435 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4436 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4437
4438 /* wrapper name transforms */
4439 strendzap (actual_cwrapper_name, ".exe");
4440 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4441 XFREE (actual_cwrapper_name);
4442 actual_cwrapper_name = tmp_pathspec;
4443 tmp_pathspec = 0;
4444
4445 /* target_name transforms -- use actual target program name; might have lt- prefix */
4446 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4447 strendzap (target_name, ".exe");
4448 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4449 XFREE (target_name);
4450 target_name = tmp_pathspec;
4451 tmp_pathspec = 0;
4452
4453 lt_debugprintf (__FILE__, __LINE__,
4454 "(main) libtool target name: %s\n",
4455 target_name);
4456EOF
4457
4458 cat <<EOF
4459 newargz[0] =
4460 XMALLOC (char, (strlen (actual_cwrapper_path) +
4461 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4462 strcpy (newargz[0], actual_cwrapper_path);
4463 strcat (newargz[0], "$objdir");
4464 strcat (newargz[0], "/");
4465EOF
4466
4467 cat <<"EOF"
4468 /* stop here, and copy so we don't have to do this twice */
4469 tmp_pathspec = xstrdup (newargz[0]);
4470
4471 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4472 strcat (newargz[0], actual_cwrapper_name);
4473
4474 /* DO want the lt- prefix here if it exists, so use target_name */
4475 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4476 XFREE (tmp_pathspec);
4477 tmp_pathspec = NULL;
4478EOF
4479
4480 case $host_os in
4481 mingw*)
4482 cat <<"EOF"
4483 {
4484 char* p;
4485 while ((p = strchr (newargz[0], '\\')) != NULL)
4486 {
4487 *p = '/';
4488 }
4489 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4490 {
4491 *p = '/';
4492 }
4493 }
4494EOF
4495 ;;
4496 esac
4497
4498 cat <<"EOF"
4499 XFREE (target_name);
4500 XFREE (actual_cwrapper_path);
4501 XFREE (actual_cwrapper_name);
4502
4503 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4504 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4505 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4506 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4507 because on Windows, both *_VARNAMEs are PATH but uninstalled
4508 libraries must come first. */
4509 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4510 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4511
4512 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4513 nonnull (lt_argv_zero));
4514 for (i = 0; i < newargc; i++)
4515 {
4516 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4517 i, nonnull (newargz[i]));
4518 }
4519
4520EOF
4521
4522 case $host_os in
4523 mingw*)
4524 cat <<"EOF"
4525 /* execv doesn't actually work on mingw as expected on unix */
4526 newargz = prepare_spawn (newargz);
4527 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4528 if (rval == -1)
4529 {
4530 /* failed to start process */
4531 lt_debugprintf (__FILE__, __LINE__,
4532 "(main) failed to launch target \"%s\": %s\n",
4533 lt_argv_zero, nonnull (strerror (errno)));
4534 return 127;
4535 }
4536 return rval;
4537EOF
4538 ;;
4539 *)
4540 cat <<"EOF"
4541 execv (lt_argv_zero, newargz);
4542 return rval; /* =127, but avoids unused variable warning */
4543EOF
4544 ;;
4545 esac
4546
4547 cat <<"EOF"
4548}
4549
4550void *
4551xmalloc (size_t num)
4552{
4553 void *p = (void *) malloc (num);
4554 if (!p)
4555 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4556
4557 return p;
4558}
4559
4560char *
4561xstrdup (const char *string)
4562{
4563 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4564 string) : NULL;
4565}
4566
4567const char *
4568base_name (const char *name)
4569{
4570 const char *base;
4571
4572#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4573 /* Skip over the disk name in MSDOS pathnames. */
4574 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4575 name += 2;
4576#endif
4577
4578 for (base = name; *name; name++)
4579 if (IS_DIR_SEPARATOR (*name))
4580 base = name + 1;
4581 return base;
4582}
4583
4584int
4585check_executable (const char *path)
4586{
4587 struct stat st;
4588
4589 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
4590 nonempty (path));
4591 if ((!path) || (!*path))
4592 return 0;
4593
4594 if ((stat (path, &st) >= 0)
4595 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4596 return 1;
4597 else
4598 return 0;
4599}
4600
4601int
4602make_executable (const char *path)
4603{
4604 int rval = 0;
4605 struct stat st;
4606
4607 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
4608 nonempty (path));
4609 if ((!path) || (!*path))
4610 return 0;
4611
4612 if (stat (path, &st) >= 0)
4613 {
4614 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4615 }
4616 return rval;
4617}
4618
4619/* Searches for the full path of the wrapper. Returns
4620 newly allocated full path name if found, NULL otherwise
4621 Does not chase symlinks, even on platforms that support them.
4622*/
4623char *
4624find_executable (const char *wrapper)
4625{
4626 int has_slash = 0;
4627 const char *p;
4628 const char *p_next;
4629 /* static buffer for getcwd */
4630 char tmp[LT_PATHMAX + 1];
4631 int tmp_len;
4632 char *concat_name;
4633
4634 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4635 nonempty (wrapper));
4636
4637 if ((wrapper == NULL) || (*wrapper == '\0'))
4638 return NULL;
4639
4640 /* Absolute path? */
4641#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4642 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4643 {
4644 concat_name = xstrdup (wrapper);
4645 if (check_executable (concat_name))
4646 return concat_name;
4647 XFREE (concat_name);
4648 }
4649 else
4650 {
4651#endif
4652 if (IS_DIR_SEPARATOR (wrapper[0]))
4653 {
4654 concat_name = xstrdup (wrapper);
4655 if (check_executable (concat_name))
4656 return concat_name;
4657 XFREE (concat_name);
4658 }
4659#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4660 }
4661#endif
4662
4663 for (p = wrapper; *p; p++)
4664 if (*p == '/')
4665 {
4666 has_slash = 1;
4667 break;
4668 }
4669 if (!has_slash)
4670 {
4671 /* no slashes; search PATH */
4672 const char *path = getenv ("PATH");
4673 if (path != NULL)
4674 {
4675 for (p = path; *p; p = p_next)
4676 {
4677 const char *q;
4678 size_t p_len;
4679 for (q = p; *q; q++)
4680 if (IS_PATH_SEPARATOR (*q))
4681 break;
4682 p_len = q - p;
4683 p_next = (*q == '\0' ? q : q + 1);
4684 if (p_len == 0)
4685 {
4686 /* empty path: current directory */
4687 if (getcwd (tmp, LT_PATHMAX) == NULL)
4688 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4689 nonnull (strerror (errno)));
4690 tmp_len = strlen (tmp);
4691 concat_name =
4692 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4693 memcpy (concat_name, tmp, tmp_len);
4694 concat_name[tmp_len] = '/';
4695 strcpy (concat_name + tmp_len + 1, wrapper);
4696 }
4697 else
4698 {
4699 concat_name =
4700 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
4701 memcpy (concat_name, p, p_len);
4702 concat_name[p_len] = '/';
4703 strcpy (concat_name + p_len + 1, wrapper);
4704 }
4705 if (check_executable (concat_name))
4706 return concat_name;
4707 XFREE (concat_name);
4708 }
4709 }
4710 /* not found in PATH; assume curdir */
4711 }
4712 /* Relative path | not found in path: prepend cwd */
4713 if (getcwd (tmp, LT_PATHMAX) == NULL)
4714 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4715 nonnull (strerror (errno)));
4716 tmp_len = strlen (tmp);
4717 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4718 memcpy (concat_name, tmp, tmp_len);
4719 concat_name[tmp_len] = '/';
4720 strcpy (concat_name + tmp_len + 1, wrapper);
4721
4722 if (check_executable (concat_name))
4723 return concat_name;
4724 XFREE (concat_name);
4725 return NULL;
4726}
4727
4728char *
4729chase_symlinks (const char *pathspec)
4730{
4731#ifndef S_ISLNK
4732 return xstrdup (pathspec);
4733#else
4734 char buf[LT_PATHMAX];
4735 struct stat s;
4736 char *tmp_pathspec = xstrdup (pathspec);
4737 char *p;
4738 int has_symlinks = 0;
4739 while (strlen (tmp_pathspec) && !has_symlinks)
4740 {
4741 lt_debugprintf (__FILE__, __LINE__,
4742 "checking path component for symlinks: %s\n",
4743 tmp_pathspec);
4744 if (lstat (tmp_pathspec, &s) == 0)
4745 {
4746 if (S_ISLNK (s.st_mode) != 0)
4747 {
4748 has_symlinks = 1;
4749 break;
4750 }
4751
4752 /* search backwards for last DIR_SEPARATOR */
4753 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
4754 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4755 p--;
4756 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4757 {
4758 /* no more DIR_SEPARATORS left */
4759 break;
4760 }
4761 *p = '\0';
4762 }
4763 else
4764 {
4765 lt_fatal (__FILE__, __LINE__,
4766 "error accessing file \"%s\": %s",
4767 tmp_pathspec, nonnull (strerror (errno)));
4768 }
4769 }
4770 XFREE (tmp_pathspec);
4771
4772 if (!has_symlinks)
4773 {
4774 return xstrdup (pathspec);
4775 }
4776
4777 tmp_pathspec = realpath (pathspec, buf);
4778 if (tmp_pathspec == 0)
4779 {
4780 lt_fatal (__FILE__, __LINE__,
4781 "could not follow symlinks for %s", pathspec);
4782 }
4783 return xstrdup (tmp_pathspec);
4784#endif
4785}
4786
4787char *
4788strendzap (char *str, const char *pat)
4789{
4790 size_t len, patlen;
4791
4792 assert (str != NULL);
4793 assert (pat != NULL);
4794
4795 len = strlen (str);
4796 patlen = strlen (pat);
4797
4798 if (patlen <= len)
4799 {
4800 str += len - patlen;
4801 if (strcmp (str, pat) == 0)
4802 *str = '\0';
4803 }
4804 return str;
4805}
4806
4807void
4808lt_debugprintf (const char *file, int line, const char *fmt, ...)
4809{
4810 va_list args;
4811 if (lt_debug)
4812 {
4813 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4814 va_start (args, fmt);
4815 (void) vfprintf (stderr, fmt, args);
4816 va_end (args);
4817 }
4818}
4819
4820static void
4821lt_error_core (int exit_status, const char *file,
4822 int line, const char *mode,
4823 const char *message, va_list ap)
4824{
4825 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
4826 vfprintf (stderr, message, ap);
4827 fprintf (stderr, ".\n");
4828
4829 if (exit_status >= 0)
4830 exit (exit_status);
4831}
4832
4833void
4834lt_fatal (const char *file, int line, const char *message, ...)
4835{
4836 va_list ap;
4837 va_start (ap, message);
4838 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
4839 va_end (ap);
4840}
4841
4842static const char *
4843nonnull (const char *s)
4844{
4845 return s ? s : "(null)";
4846}
4847
4848static const char *
4849nonempty (const char *s)
4850{
4851 return (s && !*s) ? "(empty)" : nonnull (s);
4852}
4853
4854void
4855lt_setenv (const char *name, const char *value)
4856{
4857 lt_debugprintf (__FILE__, __LINE__,
4858 "(lt_setenv) setting '%s' to '%s'\n",
4859 nonnull (name), nonnull (value));
4860 {
4861#ifdef HAVE_SETENV
4862 /* always make a copy, for consistency with !HAVE_SETENV */
4863 char *str = xstrdup (value);
4864 setenv (name, str, 1);
4865#else
4866 int len = strlen (name) + 1 + strlen (value) + 1;
4867 char *str = XMALLOC (char, len);
4868 sprintf (str, "%s=%s", name, value);
4869 if (putenv (str) != EXIT_SUCCESS)
4870 {
4871 XFREE (str);
4872 }
4873#endif
4874 }
4875}
4876
4877char *
4878lt_extend_str (const char *orig_value, const char *add, int to_end)
4879{
4880 char *new_value;
4881 if (orig_value && *orig_value)
4882 {
4883 int orig_value_len = strlen (orig_value);
4884 int add_len = strlen (add);
4885 new_value = XMALLOC (char, add_len + orig_value_len + 1);
4886 if (to_end)
4887 {
4888 strcpy (new_value, orig_value);
4889 strcpy (new_value + orig_value_len, add);
4890 }
4891 else
4892 {
4893 strcpy (new_value, add);
4894 strcpy (new_value + add_len, orig_value);
4895 }
4896 }
4897 else
4898 {
4899 new_value = xstrdup (add);
4900 }
4901 return new_value;
4902}
4903
4904void
4905lt_update_exe_path (const char *name, const char *value)
4906{
4907 lt_debugprintf (__FILE__, __LINE__,
4908 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4909 nonnull (name), nonnull (value));
4910
4911 if (name && *name && value && *value)
4912 {
4913 char *new_value = lt_extend_str (getenv (name), value, 0);
4914 /* some systems can't cope with a ':'-terminated path #' */
4915 int len = strlen (new_value);
4916 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4917 {
4918 new_value[len-1] = '\0';
4919 }
4920 lt_setenv (name, new_value);
4921 XFREE (new_value);
4922 }
4923}
4924
4925void
4926lt_update_lib_path (const char *name, const char *value)
4927{
4928 lt_debugprintf (__FILE__, __LINE__,
4929 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4930 nonnull (name), nonnull (value));
4931
4932 if (name && *name && value && *value)
4933 {
4934 char *new_value = lt_extend_str (getenv (name), value, 0);
4935 lt_setenv (name, new_value);
4936 XFREE (new_value);
4937 }
4938}
4939
4940EOF
4941 case $host_os in
4942 mingw*)
4943 cat <<"EOF"
4944
4945/* Prepares an argument vector before calling spawn().
4946 Note that spawn() does not by itself call the command interpreter
4947 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4948 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4949 GetVersionEx(&v);
4950 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4951 }) ? "cmd.exe" : "command.com").
4952 Instead it simply concatenates the arguments, separated by ' ', and calls
4953 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4954 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4955 special way:
4956 - Space and tab are interpreted as delimiters. They are not treated as
4957 delimiters if they are surrounded by double quotes: "...".
4958 - Unescaped double quotes are removed from the input. Their only effect is
4959 that within double quotes, space and tab are treated like normal
4960 characters.
4961 - Backslashes not followed by double quotes are not special.
4962 - But 2*n+1 backslashes followed by a double quote become
4963 n backslashes followed by a double quote (n >= 0):
4964 \" -> "
4965 \\\" -> \"
4966 \\\\\" -> \\"
4967 */
4968#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4969#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4970char **
4971prepare_spawn (char **argv)
4972{
4973 size_t argc;
4974 char **new_argv;
4975 size_t i;
4976
4977 /* Count number of arguments. */
4978 for (argc = 0; argv[argc] != NULL; argc++)
4979 ;
4980
4981 /* Allocate new argument vector. */
4982 new_argv = XMALLOC (char *, argc + 1);
4983
4984 /* Put quoted arguments into the new argument vector. */
4985 for (i = 0; i < argc; i++)
4986 {
4987 const char *string = argv[i];
4988
4989 if (string[0] == '\0')
4990 new_argv[i] = xstrdup ("\"\"");
4991 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4992 {
4993 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4994 size_t length;
4995 unsigned int backslashes;
4996 const char *s;
4997 char *quoted_string;
4998 char *p;
4999
5000 length = 0;
5001 backslashes = 0;
5002 if (quote_around)
5003 length++;
5004 for (s = string; *s != '\0'; s++)
5005 {
5006 char c = *s;
5007 if (c == '"')
5008 length += backslashes + 1;
5009 length++;
5010 if (c == '\\')
5011 backslashes++;
5012 else
5013 backslashes = 0;
5014 }
5015 if (quote_around)
5016 length += backslashes + 1;
5017
5018 quoted_string = XMALLOC (char, length + 1);
5019
5020 p = quoted_string;
5021 backslashes = 0;
5022 if (quote_around)
5023 *p++ = '"';
5024 for (s = string; *s != '\0'; s++)
5025 {
5026 char c = *s;
5027 if (c == '"')
5028 {
5029 unsigned int j;
5030 for (j = backslashes + 1; j > 0; j--)
5031 *p++ = '\\';
5032 }
5033 *p++ = c;
5034 if (c == '\\')
5035 backslashes++;
5036 else
5037 backslashes = 0;
5038 }
5039 if (quote_around)
5040 {
5041 unsigned int j;
5042 for (j = backslashes; j > 0; j--)
5043 *p++ = '\\';
5044 *p++ = '"';
5045 }
5046 *p = '\0';
5047
5048 new_argv[i] = quoted_string;
5049 }
5050 else
5051 new_argv[i] = (char *) string;
5052 }
5053 new_argv[argc] = NULL;
5054
5055 return new_argv;
5056}
5057EOF
5058 ;;
5059 esac
5060
5061 cat <<"EOF"
5062void lt_dump_script (FILE* f)
5063{
5064EOF
5065 func_emit_wrapper yes |
5066 $SED -n -e '
5067s/^\(.\{79\}\)\(..*\)/\1\
5068\2/
5069h
5070s/\([\\"]\)/\\\1/g
5071s/$/\\n/
5072s/\([^\n]*\).*/ fputs ("\1", f);/p
5073g
5074D'
5075 cat <<"EOF"
5076}
5077EOF
5078}
5079# end: func_emit_cwrapperexe_src
5080
5081# func_win32_import_lib_p ARG
5082# True if ARG is an import lib, as indicated by $file_magic_cmd
5083func_win32_import_lib_p ()
5084{
5085 $opt_debug
5086 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5087 *import*) : ;;
5088 *) false ;;
5089 esac
5090}
5091
5092# func_mode_link arg...
5093func_mode_link ()
5094{
5095 $opt_debug
5096 case $host in
5097 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5098 # It is impossible to link a dll without this setting, and
5099 # we shouldn't force the makefile maintainer to figure out
5100 # which system we are compiling for in order to pass an extra
5101 # flag for every libtool invocation.
5102 # allow_undefined=no
5103
5104 # FIXME: Unfortunately, there are problems with the above when trying
5105 # to make a dll which has undefined symbols, in which case not
5106 # even a static library is built. For now, we need to specify
5107 # -no-undefined on the libtool link line when we can be certain
5108 # that all symbols are satisfied, otherwise we get a static library.
5109 allow_undefined=yes
5110 ;;
5111 *)
5112 allow_undefined=yes
5113 ;;
5114 esac
5115 libtool_args=$nonopt
5116 base_compile="$nonopt $@"
5117 compile_command=$nonopt
5118 finalize_command=$nonopt
5119
5120 compile_rpath=
5121 finalize_rpath=
5122 compile_shlibpath=
5123 finalize_shlibpath=
5124 convenience=
5125 old_convenience=
5126 deplibs=
5127 old_deplibs=
5128 compiler_flags=
5129 linker_flags=
5130 dllsearchpath=
5131 lib_search_path=`pwd`
5132 inst_prefix_dir=
5133 new_inherited_linker_flags=
5134
5135 avoid_version=no
5136 bindir=
5137 dlfiles=
5138 dlprefiles=
5139 dlself=no
5140 export_dynamic=no
5141 export_symbols=
5142 export_symbols_regex=
5143 generated=
5144 libobjs=
5145 ltlibs=
5146 module=no
5147 no_install=no
5148 objs=
5149 non_pic_objects=
5150 precious_files_regex=
5151 prefer_static_libs=no
5152 preload=no
5153 prev=
5154 prevarg=
5155 release=
5156 rpath=
5157 xrpath=
5158 perm_rpath=
5159 temp_rpath=
5160 thread_safe=no
5161 vinfo=
5162 vinfo_number=no
5163 weak_libs=
5164 single_module="${wl}-single_module"
5165 func_infer_tag $base_compile
5166
5167 # We need to know -static, to get the right output filenames.
5168 for arg
5169 do
5170 case $arg in
5171 -shared)
5172 test "$build_libtool_libs" != yes && \
5173 func_fatal_configuration "can not build a shared library"
5174 build_old_libs=no
5175 break
5176 ;;
5177 -all-static | -static | -static-libtool-libs)
5178 case $arg in
5179 -all-static)
5180 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5181 func_warning "complete static linking is impossible in this configuration"
5182 fi
5183 if test -n "$link_static_flag"; then
5184 dlopen_self=$dlopen_self_static
5185 fi
5186 prefer_static_libs=yes
5187 ;;
5188 -static)
5189 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5190 dlopen_self=$dlopen_self_static
5191 fi
5192 prefer_static_libs=built
5193 ;;
5194 -static-libtool-libs)
5195 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5196 dlopen_self=$dlopen_self_static
5197 fi
5198 prefer_static_libs=yes
5199 ;;
5200 esac
5201 build_libtool_libs=no
5202 build_old_libs=yes
5203 break
5204 ;;
5205 esac
5206 done
5207
5208 # See if our shared archives depend on static archives.
5209 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5210
5211 # Go through the arguments, transforming them on the way.
5212 while test "$#" -gt 0; do
5213 arg="$1"
5214 shift
5215 func_quote_for_eval "$arg"
5216 qarg=$func_quote_for_eval_unquoted_result
5217 func_append libtool_args " $func_quote_for_eval_result"
5218
5219 # If the previous option needs an argument, assign it.
5220 if test -n "$prev"; then
5221 case $prev in
5222 output)
5223 func_append compile_command " @OUTPUT@"
5224 func_append finalize_command " @OUTPUT@"
5225 ;;
5226 esac
5227
5228 case $prev in
5229 bindir)
5230 bindir="$arg"
5231 prev=
5232 continue
5233 ;;
5234 dlfiles|dlprefiles)
5235 if test "$preload" = no; then
5236 # Add the symbol object into the linking commands.
5237 func_append compile_command " @SYMFILE@"
5238 func_append finalize_command " @SYMFILE@"
5239 preload=yes
5240 fi
5241 case $arg in
5242 *.la | *.lo) ;; # We handle these cases below.
5243 force)
5244 if test "$dlself" = no; then
5245 dlself=needless
5246 export_dynamic=yes
5247 fi
5248 prev=
5249 continue
5250 ;;
5251 self)
5252 if test "$prev" = dlprefiles; then
5253 dlself=yes
5254 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5255 dlself=yes
5256 else
5257 dlself=needless
5258 export_dynamic=yes
5259 fi
5260 prev=
5261 continue
5262 ;;
5263 *)
5264 if test "$prev" = dlfiles; then
5265 func_append dlfiles " $arg"
5266 else
5267 func_append dlprefiles " $arg"
5268 fi
5269 prev=
5270 continue
5271 ;;
5272 esac
5273 ;;
5274 expsyms)
5275 export_symbols="$arg"
5276 test -f "$arg" \
5277 || func_fatal_error "symbol file \`$arg' does not exist"
5278 prev=
5279 continue
5280 ;;
5281 expsyms_regex)
5282 export_symbols_regex="$arg"
5283 prev=
5284 continue
5285 ;;
5286 framework)
5287 case $host in
5288 *-*-darwin*)
5289 case "$deplibs " in
5290 *" $qarg.ltframework "*) ;;
5291 *) func_append deplibs " $qarg.ltframework" # this is fixed later
5292 ;;
5293 esac
5294 ;;
5295 esac
5296 prev=
5297 continue
5298 ;;
5299 inst_prefix)
5300 inst_prefix_dir="$arg"
5301 prev=
5302 continue
5303 ;;
5304 objectlist)
5305 if test -f "$arg"; then
5306 save_arg=$arg
5307 moreargs=
5308 for fil in `cat "$save_arg"`
5309 do
5310# func_append moreargs " $fil"
5311 arg=$fil
5312 # A libtool-controlled object.
5313
5314 # Check to see that this really is a libtool object.
5315 if func_lalib_unsafe_p "$arg"; then
5316 pic_object=
5317 non_pic_object=
5318
5319 # Read the .lo file
5320 func_source "$arg"
5321
5322 if test -z "$pic_object" ||
5323 test -z "$non_pic_object" ||
5324 test "$pic_object" = none &&
5325 test "$non_pic_object" = none; then
5326 func_fatal_error "cannot find name of object for \`$arg'"
5327 fi
5328
5329 # Extract subdirectory from the argument.
5330 func_dirname "$arg" "/" ""
5331 xdir="$func_dirname_result"
5332
5333 if test "$pic_object" != none; then
5334 # Prepend the subdirectory the object is found in.
5335 pic_object="$xdir$pic_object"
5336
5337 if test "$prev" = dlfiles; then
5338 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5339 func_append dlfiles " $pic_object"
5340 prev=
5341 continue
5342 else
5343 # If libtool objects are unsupported, then we need to preload.
5344 prev=dlprefiles
5345 fi
5346 fi
5347
5348 # CHECK ME: I think I busted this. -Ossama
5349 if test "$prev" = dlprefiles; then
5350 # Preload the old-style object.
5351 func_append dlprefiles " $pic_object"
5352 prev=
5353 fi
5354
5355 # A PIC object.
5356 func_append libobjs " $pic_object"
5357 arg="$pic_object"
5358 fi
5359
5360 # Non-PIC object.
5361 if test "$non_pic_object" != none; then
5362 # Prepend the subdirectory the object is found in.
5363 non_pic_object="$xdir$non_pic_object"
5364
5365 # A standard non-PIC object
5366 func_append non_pic_objects " $non_pic_object"
5367 if test -z "$pic_object" || test "$pic_object" = none ; then
5368 arg="$non_pic_object"
5369 fi
5370 else
5371 # If the PIC object exists, use it instead.
5372 # $xdir was prepended to $pic_object above.
5373 non_pic_object="$pic_object"
5374 func_append non_pic_objects " $non_pic_object"
5375 fi
5376 else
5377 # Only an error if not doing a dry-run.
5378 if $opt_dry_run; then
5379 # Extract subdirectory from the argument.
5380 func_dirname "$arg" "/" ""
5381 xdir="$func_dirname_result"
5382
5383 func_lo2o "$arg"
5384 pic_object=$xdir$objdir/$func_lo2o_result
5385 non_pic_object=$xdir$func_lo2o_result
5386 func_append libobjs " $pic_object"
5387 func_append non_pic_objects " $non_pic_object"
5388 else
5389 func_fatal_error "\`$arg' is not a valid libtool object"
5390 fi
5391 fi
5392 done
5393 else
5394 func_fatal_error "link input file \`$arg' does not exist"
5395 fi
5396 arg=$save_arg
5397 prev=
5398 continue
5399 ;;
5400 precious_regex)
5401 precious_files_regex="$arg"
5402 prev=
5403 continue
5404 ;;
5405 release)
5406 release="-$arg"
5407 prev=
5408 continue
5409 ;;
5410 rpath | xrpath)
5411 # We need an absolute path.
5412 case $arg in
5413 [\\/]* | [A-Za-z]:[\\/]*) ;;
5414 *)
5415 func_fatal_error "only absolute run-paths are allowed"
5416 ;;
5417 esac
5418 if test "$prev" = rpath; then
5419 case "$rpath " in
5420 *" $arg "*) ;;
5421 *) func_append rpath " $arg" ;;
5422 esac
5423 else
5424 case "$xrpath " in
5425 *" $arg "*) ;;
5426 *) func_append xrpath " $arg" ;;
5427 esac
5428 fi
5429 prev=
5430 continue
5431 ;;
5432 shrext)
5433 shrext_cmds="$arg"
5434 prev=
5435 continue
5436 ;;
5437 weak)
5438 func_append weak_libs " $arg"
5439 prev=
5440 continue
5441 ;;
5442 xcclinker)
5443 func_append linker_flags " $qarg"
5444 func_append compiler_flags " $qarg"
5445 prev=
5446 func_append compile_command " $qarg"
5447 func_append finalize_command " $qarg"
5448 continue
5449 ;;
5450 xcompiler)
5451 func_append compiler_flags " $qarg"
5452 prev=
5453 func_append compile_command " $qarg"
5454 func_append finalize_command " $qarg"
5455 continue
5456 ;;
5457 xlinker)
5458 func_append linker_flags " $qarg"
5459 func_append compiler_flags " $wl$qarg"
5460 prev=
5461 func_append compile_command " $wl$qarg"
5462 func_append finalize_command " $wl$qarg"
5463 continue
5464 ;;
5465 *)
5466 eval "$prev=\"\$arg\""
5467 prev=
5468 continue
5469 ;;
5470 esac
5471 fi # test -n "$prev"
5472
5473 prevarg="$arg"
5474
5475 case $arg in
5476 -all-static)
5477 if test -n "$link_static_flag"; then
5478 # See comment for -static flag below, for more details.
5479 func_append compile_command " $link_static_flag"
5480 func_append finalize_command " $link_static_flag"
5481 fi
5482 continue
5483 ;;
5484
5485 -allow-undefined)
5486 # FIXME: remove this flag sometime in the future.
5487 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5488 ;;
5489
5490 -avoid-version)
5491 avoid_version=yes
5492 continue
5493 ;;
5494
5495 -bindir)
5496 prev=bindir
5497 continue
5498 ;;
5499
5500 -dlopen)
5501 prev=dlfiles
5502 continue
5503 ;;
5504
5505 -dlpreopen)
5506 prev=dlprefiles
5507 continue
5508 ;;
5509
5510 -export-dynamic)
5511 export_dynamic=yes
5512 continue
5513 ;;
5514
5515 -export-symbols | -export-symbols-regex)
5516 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5517 func_fatal_error "more than one -exported-symbols argument is not allowed"
5518 fi
5519 if test "X$arg" = "X-export-symbols"; then
5520 prev=expsyms
5521 else
5522 prev=expsyms_regex
5523 fi
5524 continue
5525 ;;
5526
5527 -framework)
5528 prev=framework
5529 continue
5530 ;;
5531
5532 -inst-prefix-dir)
5533 prev=inst_prefix
5534 continue
5535 ;;
5536
5537 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5538 # so, if we see these flags be careful not to treat them like -L
5539 -L[A-Z][A-Z]*:*)
5540 case $with_gcc/$host in
5541 no/*-*-irix* | /*-*-irix*)
5542 func_append compile_command " $arg"
5543 func_append finalize_command " $arg"
5544 ;;
5545 esac
5546 continue
5547 ;;
5548
5549 -L*)
5550 func_stripname "-L" '' "$arg"
5551 if test -z "$func_stripname_result"; then
5552 if test "$#" -gt 0; then
5553 func_fatal_error "require no space between \`-L' and \`$1'"
5554 else
5555 func_fatal_error "need path for \`-L' option"
5556 fi
5557 fi
5558 func_resolve_sysroot "$func_stripname_result"
5559 dir=$func_resolve_sysroot_result
5560 # We need an absolute path.
5561 case $dir in
5562 [\\/]* | [A-Za-z]:[\\/]*) ;;
5563 *)
5564 absdir=`cd "$dir" && pwd`
5565 test -z "$absdir" && \
5566 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5567 dir="$absdir"
5568 ;;
5569 esac
5570 case "$deplibs " in
5571 *" -L$dir "* | *" $arg "*)
5572 # Will only happen for absolute or sysroot arguments
5573 ;;
5574 *)
5575 # Preserve sysroot, but never include relative directories
5576 case $dir in
5577 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5578 *) func_append deplibs " -L$dir" ;;
5579 esac
5580 func_append lib_search_path " $dir"
5581 ;;
5582 esac
5583 case $host in
5584 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5585 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
5586 case :$dllsearchpath: in
5587 *":$dir:"*) ;;
5588 ::) dllsearchpath=$dir;;
5589 *) func_append dllsearchpath ":$dir";;
5590 esac
5591 case :$dllsearchpath: in
5592 *":$testbindir:"*) ;;
5593 ::) dllsearchpath=$testbindir;;
5594 *) func_append dllsearchpath ":$testbindir";;
5595 esac
5596 ;;
5597 esac
5598 continue
5599 ;;
5600
5601 -l*)
5602 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5603 case $host in
5604 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5605 # These systems don't actually have a C or math library (as such)
5606 continue
5607 ;;
5608 *-*-os2*)
5609 # These systems don't actually have a C library (as such)
5610 test "X$arg" = "X-lc" && continue
5611 ;;
5612 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5613 # Do not include libc due to us having libc/libc_r.
5614 test "X$arg" = "X-lc" && continue
5615 ;;
5616 *-*-rhapsody* | *-*-darwin1.[012])
5617 # Rhapsody C and math libraries are in the System framework
5618 func_append deplibs " System.ltframework"
5619 continue
5620 ;;
5621 *-*-sco3.2v5* | *-*-sco5v6*)
5622 # Causes problems with __ctype
5623 test "X$arg" = "X-lc" && continue
5624 ;;
5625 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5626 # Compiler inserts libc in the correct place for threads to work
5627 test "X$arg" = "X-lc" && continue
5628 ;;
5629 esac
5630 elif test "X$arg" = "X-lc_r"; then
5631 case $host in
5632 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5633 # Do not include libc_r directly, use -pthread flag.
5634 continue
5635 ;;
5636 esac
5637 fi
5638 func_append deplibs " $arg"
5639 continue
5640 ;;
5641
5642 -module)
5643 module=yes
5644 continue
5645 ;;
5646
5647 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5648 # classes, name mangling, and exception handling.
5649 # Darwin uses the -arch flag to determine output architecture.
5650 -model|-arch|-isysroot|--sysroot)
5651 func_append compiler_flags " $arg"
5652 func_append compile_command " $arg"
5653 func_append finalize_command " $arg"
5654 prev=xcompiler
5655 continue
5656 ;;
5657
5658 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
5659 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5660 func_append compiler_flags " $arg"
5661 func_append compile_command " $arg"
5662 func_append finalize_command " $arg"
5663 case "$new_inherited_linker_flags " in
5664 *" $arg "*) ;;
5665 * ) func_append new_inherited_linker_flags " $arg" ;;
5666 esac
5667 continue
5668 ;;
5669
5670 -multi_module)
5671 single_module="${wl}-multi_module"
5672 continue
5673 ;;
5674
5675 -no-fast-install)
5676 fast_install=no
5677 continue
5678 ;;
5679
5680 -no-install)
5681 case $host in
5682 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5683 # The PATH hackery in wrapper scripts is required on Windows
5684 # and Darwin in order for the loader to find any dlls it needs.
5685 func_warning "\`-no-install' is ignored for $host"
5686 func_warning "assuming \`-no-fast-install' instead"
5687 fast_install=no
5688 ;;
5689 *) no_install=yes ;;
5690 esac
5691 continue
5692 ;;
5693
5694 -no-undefined)
5695 allow_undefined=no
5696 continue
5697 ;;
5698
5699 -objectlist)
5700 prev=objectlist
5701 continue
5702 ;;
5703
5704 -o) prev=output ;;
5705
5706 -precious-files-regex)
5707 prev=precious_regex
5708 continue
5709 ;;
5710
5711 -release)
5712 prev=release
5713 continue
5714 ;;
5715
5716 -rpath)
5717 prev=rpath
5718 continue
5719 ;;
5720
5721 -R)
5722 prev=xrpath
5723 continue
5724 ;;
5725
5726 -R*)
5727 func_stripname '-R' '' "$arg"
5728 dir=$func_stripname_result
5729 # We need an absolute path.
5730 case $dir in
5731 [\\/]* | [A-Za-z]:[\\/]*) ;;
5732 =*)
5733 func_stripname '=' '' "$dir"
5734 dir=$lt_sysroot$func_stripname_result
5735 ;;
5736 *)
5737 func_fatal_error "only absolute run-paths are allowed"
5738 ;;
5739 esac
5740 case "$xrpath " in
5741 *" $dir "*) ;;
5742 *) func_append xrpath " $dir" ;;
5743 esac
5744 continue
5745 ;;
5746
5747 -shared)
5748 # The effects of -shared are defined in a previous loop.
5749 continue
5750 ;;
5751
5752 -shrext)
5753 prev=shrext
5754 continue
5755 ;;
5756
5757 -static | -static-libtool-libs)
5758 # The effects of -static are defined in a previous loop.
5759 # We used to do the same as -all-static on platforms that
5760 # didn't have a PIC flag, but the assumption that the effects
5761 # would be equivalent was wrong. It would break on at least
5762 # Digital Unix and AIX.
5763 continue
5764 ;;
5765
5766 -thread-safe)
5767 thread_safe=yes
5768 continue
5769 ;;
5770
5771 -version-info)
5772 prev=vinfo
5773 continue
5774 ;;
5775
5776 -version-number)
5777 prev=vinfo
5778 vinfo_number=yes
5779 continue
5780 ;;
5781
5782 -weak)
5783 prev=weak
5784 continue
5785 ;;
5786
5787 -Wc,*)
5788 func_stripname '-Wc,' '' "$arg"
5789 args=$func_stripname_result
5790 arg=
5791 save_ifs="$IFS"; IFS=','
5792 for flag in $args; do
5793 IFS="$save_ifs"
5794 func_quote_for_eval "$flag"
5795 func_append arg " $func_quote_for_eval_result"
5796 func_append compiler_flags " $func_quote_for_eval_result"
5797 done
5798 IFS="$save_ifs"
5799 func_stripname ' ' '' "$arg"
5800 arg=$func_stripname_result
5801 ;;
5802
5803 -Wl,*)
5804 func_stripname '-Wl,' '' "$arg"
5805 args=$func_stripname_result
5806 arg=
5807 save_ifs="$IFS"; IFS=','
5808 for flag in $args; do
5809 IFS="$save_ifs"
5810 func_quote_for_eval "$flag"
5811 func_append arg " $wl$func_quote_for_eval_result"
5812 func_append compiler_flags " $wl$func_quote_for_eval_result"
5813 func_append linker_flags " $func_quote_for_eval_result"
5814 done
5815 IFS="$save_ifs"
5816 func_stripname ' ' '' "$arg"
5817 arg=$func_stripname_result
5818 ;;
5819
5820 -Xcompiler)
5821 prev=xcompiler
5822 continue
5823 ;;
5824
5825 -Xlinker)
5826 prev=xlinker
5827 continue
5828 ;;
5829
5830 -XCClinker)
5831 prev=xcclinker
5832 continue
5833 ;;
5834
5835 # -msg_* for osf cc
5836 -msg_*)
5837 func_quote_for_eval "$arg"
5838 arg="$func_quote_for_eval_result"
5839 ;;
5840
5841 # Flags to be passed through unchanged, with rationale:
5842 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5843 # -r[0-9][0-9]* specify processor for the SGI compiler
5844 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5845 # +DA*, +DD* enable 64-bit mode for the HP compiler
5846 # -q* compiler args for the IBM compiler
5847 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5848 # -F/path path to uninstalled frameworks, gcc on darwin
5849 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5850 # @file GCC response files
5851 # -tp=* Portland pgcc target processor selection
5852 # --sysroot=* for sysroot support
5853 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5854 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5855 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5856 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5857 func_quote_for_eval "$arg"
5858 arg="$func_quote_for_eval_result"
5859 func_append compile_command " $arg"
5860 func_append finalize_command " $arg"
5861 func_append compiler_flags " $arg"
5862 continue
5863 ;;
5864
5865 # Some other compiler flag.
5866 -* | +*)
5867 func_quote_for_eval "$arg"
5868 arg="$func_quote_for_eval_result"
5869 ;;
5870
5871 *.$objext)
5872 # A standard object.
5873 func_append objs " $arg"
5874 ;;
5875
5876 *.lo)
5877 # A libtool-controlled object.
5878
5879 # Check to see that this really is a libtool object.
5880 if func_lalib_unsafe_p "$arg"; then
5881 pic_object=
5882 non_pic_object=
5883
5884 # Read the .lo file
5885 func_source "$arg"
5886
5887 if test -z "$pic_object" ||
5888 test -z "$non_pic_object" ||
5889 test "$pic_object" = none &&
5890 test "$non_pic_object" = none; then
5891 func_fatal_error "cannot find name of object for \`$arg'"
5892 fi
5893
5894 # Extract subdirectory from the argument.
5895 func_dirname "$arg" "/" ""
5896 xdir="$func_dirname_result"
5897
5898 if test "$pic_object" != none; then
5899 # Prepend the subdirectory the object is found in.
5900 pic_object="$xdir$pic_object"
5901
5902 if test "$prev" = dlfiles; then
5903 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5904 func_append dlfiles " $pic_object"
5905 prev=
5906 continue
5907 else
5908 # If libtool objects are unsupported, then we need to preload.
5909 prev=dlprefiles
5910 fi
5911 fi
5912
5913 # CHECK ME: I think I busted this. -Ossama
5914 if test "$prev" = dlprefiles; then
5915 # Preload the old-style object.
5916 func_append dlprefiles " $pic_object"
5917 prev=
5918 fi
5919
5920 # A PIC object.
5921 func_append libobjs " $pic_object"
5922 arg="$pic_object"
5923 fi
5924
5925 # Non-PIC object.
5926 if test "$non_pic_object" != none; then
5927 # Prepend the subdirectory the object is found in.
5928 non_pic_object="$xdir$non_pic_object"
5929
5930 # A standard non-PIC object
5931 func_append non_pic_objects " $non_pic_object"
5932 if test -z "$pic_object" || test "$pic_object" = none ; then
5933 arg="$non_pic_object"
5934 fi
5935 else
5936 # If the PIC object exists, use it instead.
5937 # $xdir was prepended to $pic_object above.
5938 non_pic_object="$pic_object"
5939 func_append non_pic_objects " $non_pic_object"
5940 fi
5941 else
5942 # Only an error if not doing a dry-run.
5943 if $opt_dry_run; then
5944 # Extract subdirectory from the argument.
5945 func_dirname "$arg" "/" ""
5946 xdir="$func_dirname_result"
5947
5948 func_lo2o "$arg"
5949 pic_object=$xdir$objdir/$func_lo2o_result
5950 non_pic_object=$xdir$func_lo2o_result
5951 func_append libobjs " $pic_object"
5952 func_append non_pic_objects " $non_pic_object"
5953 else
5954 func_fatal_error "\`$arg' is not a valid libtool object"
5955 fi
5956 fi
5957 ;;
5958
5959 *.$libext)
5960 # An archive.
5961 func_append deplibs " $arg"
5962 func_append old_deplibs " $arg"
5963 continue
5964 ;;
5965
5966 *.la)
5967 # A libtool-controlled library.
5968
5969 func_resolve_sysroot "$arg"
5970 if test "$prev" = dlfiles; then
5971 # This library was specified with -dlopen.
5972 func_append dlfiles " $func_resolve_sysroot_result"
5973 prev=
5974 elif test "$prev" = dlprefiles; then
5975 # The library was specified with -dlpreopen.
5976 func_append dlprefiles " $func_resolve_sysroot_result"
5977 prev=
5978 else
5979 func_append deplibs " $func_resolve_sysroot_result"
5980 fi
5981 continue
5982 ;;
5983
5984 # Some other compiler argument.
5985 *)
5986 # Unknown arguments in both finalize_command and compile_command need
5987 # to be aesthetically quoted because they are evaled later.
5988 func_quote_for_eval "$arg"
5989 arg="$func_quote_for_eval_result"
5990 ;;
5991 esac # arg
5992
5993 # Now actually substitute the argument into the commands.
5994 if test -n "$arg"; then
5995 func_append compile_command " $arg"
5996 func_append finalize_command " $arg"
5997 fi
5998 done # argument parsing loop
5999
6000 test -n "$prev" && \
6001 func_fatal_help "the \`$prevarg' option requires an argument"
6002
6003 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6004 eval arg=\"$export_dynamic_flag_spec\"
6005 func_append compile_command " $arg"
6006 func_append finalize_command " $arg"
6007 fi
6008
6009 oldlibs=
6010 # calculate the name of the file, without its directory
6011 func_basename "$output"
6012 outputname="$func_basename_result"
6013 libobjs_save="$libobjs"
6014
6015 if test -n "$shlibpath_var"; then
6016 # get the directories listed in $shlibpath_var
6017 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6018 else
6019 shlib_search_path=
6020 fi
6021 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6022 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6023
6024 func_dirname "$output" "/" ""
6025 output_objdir="$func_dirname_result$objdir"
6026 func_to_tool_file "$output_objdir/"
6027 tool_output_objdir=$func_to_tool_file_result
6028 # Create the object directory.
6029 func_mkdir_p "$output_objdir"
6030
6031 # Determine the type of output
6032 case $output in
6033 "")
6034 func_fatal_help "you must specify an output file"
6035 ;;
6036 *.$libext) linkmode=oldlib ;;
6037 *.lo | *.$objext) linkmode=obj ;;
6038 *.la) linkmode=lib ;;
6039 *) linkmode=prog ;; # Anything else should be a program.
6040 esac
6041
6042 specialdeplibs=
6043
6044 libs=
6045 # Find all interdependent deplibs by searching for libraries
6046 # that are linked more than once (e.g. -la -lb -la)
6047 for deplib in $deplibs; do
6048 if $opt_preserve_dup_deps ; then
6049 case "$libs " in
6050 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6051 esac
6052 fi
6053 func_append libs " $deplib"
6054 done
6055
6056 if test "$linkmode" = lib; then
6057 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6058
6059 # Compute libraries that are listed more than once in $predeps
6060 # $postdeps and mark them as special (i.e., whose duplicates are
6061 # not to be eliminated).
6062 pre_post_deps=
6063 if $opt_duplicate_compiler_generated_deps; then
6064 for pre_post_dep in $predeps $postdeps; do
6065 case "$pre_post_deps " in
6066 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6067 esac
6068 func_append pre_post_deps " $pre_post_dep"
6069 done
6070 fi
6071 pre_post_deps=
6072 fi
6073
6074 deplibs=
6075 newdependency_libs=
6076 newlib_search_path=
6077 need_relink=no # whether we're linking any uninstalled libtool libraries
6078 notinst_deplibs= # not-installed libtool libraries
6079 notinst_path= # paths that contain not-installed libtool libraries
6080
6081 case $linkmode in
6082 lib)
6083 passes="conv dlpreopen link"
6084 for file in $dlfiles $dlprefiles; do
6085 case $file in
6086 *.la) ;;
6087 *)
6088 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6089 ;;
6090 esac
6091 done
6092 ;;
6093 prog)
6094 compile_deplibs=
6095 finalize_deplibs=
6096 alldeplibs=no
6097 newdlfiles=
6098 newdlprefiles=
6099 passes="conv scan dlopen dlpreopen link"
6100 ;;
6101 *) passes="conv"
6102 ;;
6103 esac
6104
6105 for pass in $passes; do
6106 # The preopen pass in lib mode reverses $deplibs; put it back here
6107 # so that -L comes before libs that need it for instance...
6108 if test "$linkmode,$pass" = "lib,link"; then
6109 ## FIXME: Find the place where the list is rebuilt in the wrong
6110 ## order, and fix it there properly
6111 tmp_deplibs=
6112 for deplib in $deplibs; do
6113 tmp_deplibs="$deplib $tmp_deplibs"
6114 done
6115 deplibs="$tmp_deplibs"
6116 fi
6117
6118 if test "$linkmode,$pass" = "lib,link" ||
6119 test "$linkmode,$pass" = "prog,scan"; then
6120 libs="$deplibs"
6121 deplibs=
6122 fi
6123 if test "$linkmode" = prog; then
6124 case $pass in
6125 dlopen) libs="$dlfiles" ;;
6126 dlpreopen) libs="$dlprefiles" ;;
6127 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6128 esac
6129 fi
6130 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6131 # Collect and forward deplibs of preopened libtool libs
6132 for lib in $dlprefiles; do
6133 # Ignore non-libtool-libs
6134 dependency_libs=
6135 func_resolve_sysroot "$lib"
6136 case $lib in
6137 *.la) func_source "$func_resolve_sysroot_result" ;;
6138 esac
6139
6140 # Collect preopened libtool deplibs, except any this library
6141 # has declared as weak libs
6142 for deplib in $dependency_libs; do
6143 func_basename "$deplib"
6144 deplib_base=$func_basename_result
6145 case " $weak_libs " in
6146 *" $deplib_base "*) ;;
6147 *) func_append deplibs " $deplib" ;;
6148 esac
6149 done
6150 done
6151 libs="$dlprefiles"
6152 fi
6153 if test "$pass" = dlopen; then
6154 # Collect dlpreopened libraries
6155 save_deplibs="$deplibs"
6156 deplibs=
6157 fi
6158
6159 for deplib in $libs; do
6160 lib=
6161 found=no
6162 case $deplib in
6163 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6164 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6165 if test "$linkmode,$pass" = "prog,link"; then
6166 compile_deplibs="$deplib $compile_deplibs"
6167 finalize_deplibs="$deplib $finalize_deplibs"
6168 else
6169 func_append compiler_flags " $deplib"
6170 if test "$linkmode" = lib ; then
6171 case "$new_inherited_linker_flags " in
6172 *" $deplib "*) ;;
6173 * ) func_append new_inherited_linker_flags " $deplib" ;;
6174 esac
6175 fi
6176 fi
6177 continue
6178 ;;
6179 -l*)
6180 if test "$linkmode" != lib && test "$linkmode" != prog; then
6181 func_warning "\`-l' is ignored for archives/objects"
6182 continue
6183 fi
6184 func_stripname '-l' '' "$deplib"
6185 name=$func_stripname_result
6186 if test "$linkmode" = lib; then
6187 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6188 else
6189 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6190 fi
6191 for searchdir in $searchdirs; do
6192 for search_ext in .la $std_shrext .so .a; do
6193 # Search the libtool library
6194 lib="$searchdir/lib${name}${search_ext}"
6195 if test -f "$lib"; then
6196 if test "$search_ext" = ".la"; then
6197 found=yes
6198 else
6199 found=no
6200 fi
6201 break 2
6202 fi
6203 done
6204 done
6205 if test "$found" != yes; then
6206 # deplib doesn't seem to be a libtool library
6207 if test "$linkmode,$pass" = "prog,link"; then
6208 compile_deplibs="$deplib $compile_deplibs"
6209 finalize_deplibs="$deplib $finalize_deplibs"
6210 else
6211 deplibs="$deplib $deplibs"
6212 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6213 fi
6214 continue
6215 else # deplib is a libtool library
6216 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6217 # We need to do some special things here, and not later.
6218 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6219 case " $predeps $postdeps " in
6220 *" $deplib "*)
6221 if func_lalib_p "$lib"; then
6222 library_names=
6223 old_library=
6224 func_source "$lib"
6225 for l in $old_library $library_names; do
6226 ll="$l"
6227 done
6228 if test "X$ll" = "X$old_library" ; then # only static version available
6229 found=no
6230 func_dirname "$lib" "" "."
6231 ladir="$func_dirname_result"
6232 lib=$ladir/$old_library
6233 if test "$linkmode,$pass" = "prog,link"; then
6234 compile_deplibs="$deplib $compile_deplibs"
6235 finalize_deplibs="$deplib $finalize_deplibs"
6236 else
6237 deplibs="$deplib $deplibs"
6238 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6239 fi
6240 continue
6241 fi
6242 fi
6243 ;;
6244 *) ;;
6245 esac
6246 fi
6247 fi
6248 ;; # -l
6249 *.ltframework)
6250 if test "$linkmode,$pass" = "prog,link"; then
6251 compile_deplibs="$deplib $compile_deplibs"
6252 finalize_deplibs="$deplib $finalize_deplibs"
6253 else
6254 deplibs="$deplib $deplibs"
6255 if test "$linkmode" = lib ; then
6256 case "$new_inherited_linker_flags " in
6257 *" $deplib "*) ;;
6258 * ) func_append new_inherited_linker_flags " $deplib" ;;
6259 esac
6260 fi
6261 fi
6262 continue
6263 ;;
6264 -L*)
6265 case $linkmode in
6266 lib)
6267 deplibs="$deplib $deplibs"
6268 test "$pass" = conv && continue
6269 newdependency_libs="$deplib $newdependency_libs"
6270 func_stripname '-L' '' "$deplib"
6271 func_resolve_sysroot "$func_stripname_result"
6272 func_append newlib_search_path " $func_resolve_sysroot_result"
6273 ;;
6274 prog)
6275 if test "$pass" = conv; then
6276 deplibs="$deplib $deplibs"
6277 continue
6278 fi
6279 if test "$pass" = scan; then
6280 deplibs="$deplib $deplibs"
6281 else
6282 compile_deplibs="$deplib $compile_deplibs"
6283 finalize_deplibs="$deplib $finalize_deplibs"
6284 fi
6285 func_stripname '-L' '' "$deplib"
6286 func_resolve_sysroot "$func_stripname_result"
6287 func_append newlib_search_path " $func_resolve_sysroot_result"
6288 ;;
6289 *)
6290 func_warning "\`-L' is ignored for archives/objects"
6291 ;;
6292 esac # linkmode
6293 continue
6294 ;; # -L
6295 -R*)
6296 if test "$pass" = link; then
6297 func_stripname '-R' '' "$deplib"
6298 func_resolve_sysroot "$func_stripname_result"
6299 dir=$func_resolve_sysroot_result
6300 # Make sure the xrpath contains only unique directories.
6301 case "$xrpath " in
6302 *" $dir "*) ;;
6303 *) func_append xrpath " $dir" ;;
6304 esac
6305 fi
6306 deplibs="$deplib $deplibs"
6307 continue
6308 ;;
6309 *.la)
6310 func_resolve_sysroot "$deplib"
6311 lib=$func_resolve_sysroot_result
6312 ;;
6313 *.$libext)
6314 if test "$pass" = conv; then
6315 deplibs="$deplib $deplibs"
6316 continue
6317 fi
6318 case $linkmode in
6319 lib)
6320 # Linking convenience modules into shared libraries is allowed,
6321 # but linking other static libraries is non-portable.
6322 case " $dlpreconveniencelibs " in
6323 *" $deplib "*) ;;
6324 *)
6325 valid_a_lib=no
6326 case $deplibs_check_method in
6327 match_pattern*)
6328 set dummy $deplibs_check_method; shift
6329 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6330 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6331 | $EGREP "$match_pattern_regex" > /dev/null; then
6332 valid_a_lib=yes
6333 fi
6334 ;;
6335 pass_all)
6336 valid_a_lib=yes
6337 ;;
6338 esac
6339 if test "$valid_a_lib" != yes; then
6340 echo
6341 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6342 echo "*** I have the capability to make that library automatically link in when"
6343 echo "*** you link to this library. But I can only do this if you have a"
6344 echo "*** shared version of the library, which you do not appear to have"
6345 echo "*** because the file extensions .$libext of this argument makes me believe"
6346 echo "*** that it is just a static archive that I should not use here."
6347 else
6348 echo
6349 $ECHO "*** Warning: Linking the shared library $output against the"
6350 $ECHO "*** static library $deplib is not portable!"
6351 deplibs="$deplib $deplibs"
6352 fi
6353 ;;
6354 esac
6355 continue
6356 ;;
6357 prog)
6358 if test "$pass" != link; then
6359 deplibs="$deplib $deplibs"
6360 else
6361 compile_deplibs="$deplib $compile_deplibs"
6362 finalize_deplibs="$deplib $finalize_deplibs"
6363 fi
6364 continue
6365 ;;
6366 esac # linkmode
6367 ;; # *.$libext
6368 *.lo | *.$objext)
6369 if test "$pass" = conv; then
6370 deplibs="$deplib $deplibs"
6371 elif test "$linkmode" = prog; then
6372 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6373 # If there is no dlopen support or we're linking statically,
6374 # we need to preload.
6375 func_append newdlprefiles " $deplib"
6376 compile_deplibs="$deplib $compile_deplibs"
6377 finalize_deplibs="$deplib $finalize_deplibs"
6378 else
6379 func_append newdlfiles " $deplib"
6380 fi
6381 fi
6382 continue
6383 ;;
6384 %DEPLIBS%)
6385 alldeplibs=yes
6386 continue
6387 ;;
6388 esac # case $deplib
6389
6390 if test "$found" = yes || test -f "$lib"; then :
6391 else
6392 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6393 fi
6394
6395 # Check to see that this really is a libtool archive.
6396 func_lalib_unsafe_p "$lib" \
6397 || func_fatal_error "\`$lib' is not a valid libtool archive"
6398
6399 func_dirname "$lib" "" "."
6400 ladir="$func_dirname_result"
6401
6402 dlname=
6403 dlopen=
6404 dlpreopen=
6405 libdir=
6406 library_names=
6407 old_library=
6408 inherited_linker_flags=
6409 # If the library was installed with an old release of libtool,
6410 # it will not redefine variables installed, or shouldnotlink
6411 installed=yes
6412 shouldnotlink=no
6413 avoidtemprpath=
6414
6415
6416 # Read the .la file
6417 func_source "$lib"
6418
6419 # Convert "-framework foo" to "foo.ltframework"
6420 if test -n "$inherited_linker_flags"; then
6421 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6422 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6423 case " $new_inherited_linker_flags " in
6424 *" $tmp_inherited_linker_flag "*) ;;
6425 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6426 esac
6427 done
6428 fi
6429 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6430 if test "$linkmode,$pass" = "lib,link" ||
6431 test "$linkmode,$pass" = "prog,scan" ||
6432 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6433 test -n "$dlopen" && func_append dlfiles " $dlopen"
6434 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6435 fi
6436
6437 if test "$pass" = conv; then
6438 # Only check for convenience libraries
6439 deplibs="$lib $deplibs"
6440 if test -z "$libdir"; then
6441 if test -z "$old_library"; then
6442 func_fatal_error "cannot find name of link library for \`$lib'"
6443 fi
6444 # It is a libtool convenience library, so add in its objects.
6445 func_append convenience " $ladir/$objdir/$old_library"
6446 func_append old_convenience " $ladir/$objdir/$old_library"
6447 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6448 func_fatal_error "\`$lib' is not a convenience library"
6449 fi
6450 tmp_libs=
6451 for deplib in $dependency_libs; do
6452 deplibs="$deplib $deplibs"
6453 if $opt_preserve_dup_deps ; then
6454 case "$tmp_libs " in
6455 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6456 esac
6457 fi
6458 func_append tmp_libs " $deplib"
6459 done
6460 continue
6461 fi # $pass = conv
6462
6463
6464 # Get the name of the library we link against.
6465 linklib=
6466 if test -n "$old_library" &&
6467 { test "$prefer_static_libs" = yes ||
6468 test "$prefer_static_libs,$installed" = "built,no"; }; then
6469 linklib=$old_library
6470 else
6471 for l in $old_library $library_names; do
6472 linklib="$l"
6473 done
6474 fi
6475 if test -z "$linklib"; then
6476 func_fatal_error "cannot find name of link library for \`$lib'"
6477 fi
6478
6479 # This library was specified with -dlopen.
6480 if test "$pass" = dlopen; then
6481 if test -z "$libdir"; then
6482 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6483 fi
6484 if test -z "$dlname" ||
6485 test "$dlopen_support" != yes ||
6486 test "$build_libtool_libs" = no; then
6487 # If there is no dlname, no dlopen support or we're linking
6488 # statically, we need to preload. We also need to preload any
6489 # dependent libraries so libltdl's deplib preloader doesn't
6490 # bomb out in the load deplibs phase.
6491 func_append dlprefiles " $lib $dependency_libs"
6492 else
6493 func_append newdlfiles " $lib"
6494 fi
6495 continue
6496 fi # $pass = dlopen
6497
6498 # We need an absolute path.
6499 case $ladir in
6500 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6501 *)
6502 abs_ladir=`cd "$ladir" && pwd`
6503 if test -z "$abs_ladir"; then
6504 func_warning "cannot determine absolute directory name of \`$ladir'"
6505 func_warning "passing it literally to the linker, although it might fail"
6506 abs_ladir="$ladir"
6507 fi
6508 ;;
6509 esac
6510 func_basename "$lib"
6511 laname="$func_basename_result"
6512
6513 # Find the relevant object directory and library name.
6514 if test "X$installed" = Xyes; then
6515 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6516 func_warning "library \`$lib' was moved."
6517 dir="$ladir"
6518 absdir="$abs_ladir"
6519 libdir="$abs_ladir"
6520 else
6521 dir="$lt_sysroot$libdir"
6522 absdir="$lt_sysroot$libdir"
6523 fi
6524 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6525 else
6526 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6527 dir="$ladir"
6528 absdir="$abs_ladir"
6529 # Remove this search path later
6530 func_append notinst_path " $abs_ladir"
6531 else
6532 dir="$ladir/$objdir"
6533 absdir="$abs_ladir/$objdir"
6534 # Remove this search path later
6535 func_append notinst_path " $abs_ladir"
6536 fi
6537 fi # $installed = yes
6538 func_stripname 'lib' '.la' "$laname"
6539 name=$func_stripname_result
6540
6541 # This library was specified with -dlpreopen.
6542 if test "$pass" = dlpreopen; then
6543 if test -z "$libdir" && test "$linkmode" = prog; then
6544 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6545 fi
6546 case "$host" in
6547 # special handling for platforms with PE-DLLs.
6548 *cygwin* | *mingw* | *cegcc* )
6549 # Linker will automatically link against shared library if both
6550 # static and shared are present. Therefore, ensure we extract
6551 # symbols from the import library if a shared library is present
6552 # (otherwise, the dlopen module name will be incorrect). We do
6553 # this by putting the import library name into $newdlprefiles.
6554 # We recover the dlopen module name by 'saving' the la file
6555 # name in a special purpose variable, and (later) extracting the
6556 # dlname from the la file.
6557 if test -n "$dlname"; then
6558 func_tr_sh "$dir/$linklib"
6559 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6560 func_append newdlprefiles " $dir/$linklib"
6561 else
6562 func_append newdlprefiles " $dir/$old_library"
6563 # Keep a list of preopened convenience libraries to check
6564 # that they are being used correctly in the link pass.
6565 test -z "$libdir" && \
6566 func_append dlpreconveniencelibs " $dir/$old_library"
6567 fi
6568 ;;
6569 * )
6570 # Prefer using a static library (so that no silly _DYNAMIC symbols
6571 # are required to link).
6572 if test -n "$old_library"; then
6573 func_append newdlprefiles " $dir/$old_library"
6574 # Keep a list of preopened convenience libraries to check
6575 # that they are being used correctly in the link pass.
6576 test -z "$libdir" && \
6577 func_append dlpreconveniencelibs " $dir/$old_library"
6578 # Otherwise, use the dlname, so that lt_dlopen finds it.
6579 elif test -n "$dlname"; then
6580 func_append newdlprefiles " $dir/$dlname"
6581 else
6582 func_append newdlprefiles " $dir/$linklib"
6583 fi
6584 ;;
6585 esac
6586 fi # $pass = dlpreopen
6587
6588 if test -z "$libdir"; then
6589 # Link the convenience library
6590 if test "$linkmode" = lib; then
6591 deplibs="$dir/$old_library $deplibs"
6592 elif test "$linkmode,$pass" = "prog,link"; then
6593 compile_deplibs="$dir/$old_library $compile_deplibs"
6594 finalize_deplibs="$dir/$old_library $finalize_deplibs"
6595 else
6596 deplibs="$lib $deplibs" # used for prog,scan pass
6597 fi
6598 continue
6599 fi
6600
6601
6602 if test "$linkmode" = prog && test "$pass" != link; then
6603 func_append newlib_search_path " $ladir"
6604 deplibs="$lib $deplibs"
6605
6606 linkalldeplibs=no
6607 if test "$link_all_deplibs" != no || test -z "$library_names" ||
6608 test "$build_libtool_libs" = no; then
6609 linkalldeplibs=yes
6610 fi
6611
6612 tmp_libs=
6613 for deplib in $dependency_libs; do
6614 case $deplib in
6615 -L*) func_stripname '-L' '' "$deplib"
6616 func_resolve_sysroot "$func_stripname_result"
6617 func_append newlib_search_path " $func_resolve_sysroot_result"
6618 ;;
6619 esac
6620 # Need to link against all dependency_libs?
6621 if test "$linkalldeplibs" = yes; then
6622 deplibs="$deplib $deplibs"
6623 else
6624 # Need to hardcode shared library paths
6625 # or/and link against static libraries
6626 newdependency_libs="$deplib $newdependency_libs"
6627 fi
6628 if $opt_preserve_dup_deps ; then
6629 case "$tmp_libs " in
6630 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6631 esac
6632 fi
6633 func_append tmp_libs " $deplib"
6634 done # for deplib
6635 continue
6636 fi # $linkmode = prog...
6637
6638 if test "$linkmode,$pass" = "prog,link"; then
6639 if test -n "$library_names" &&
6640 { { test "$prefer_static_libs" = no ||
6641 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6642 test -z "$old_library"; }; then
6643 # We need to hardcode the library path
6644 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6645 # Make sure the rpath contains only unique directories.
6646 case "$temp_rpath:" in
6647 *"$absdir:"*) ;;
6648 *) func_append temp_rpath "$absdir:" ;;
6649 esac
6650 fi
6651
6652 # Hardcode the library path.
6653 # Skip directories that are in the system default run-time
6654 # search path.
6655 case " $sys_lib_dlsearch_path " in
6656 *" $absdir "*) ;;
6657 *)
6658 case "$compile_rpath " in
6659 *" $absdir "*) ;;
6660 *) func_append compile_rpath " $absdir" ;;
6661 esac
6662 ;;
6663 esac
6664 case " $sys_lib_dlsearch_path " in
6665 *" $libdir "*) ;;
6666 *)
6667 case "$finalize_rpath " in
6668 *" $libdir "*) ;;
6669 *) func_append finalize_rpath " $libdir" ;;
6670 esac
6671 ;;
6672 esac
6673 fi # $linkmode,$pass = prog,link...
6674
6675 if test "$alldeplibs" = yes &&
6676 { test "$deplibs_check_method" = pass_all ||
6677 { test "$build_libtool_libs" = yes &&
6678 test -n "$library_names"; }; }; then
6679 # We only need to search for static libraries
6680 continue
6681 fi
6682 fi
6683
6684 link_static=no # Whether the deplib will be linked statically
6685 use_static_libs=$prefer_static_libs
6686 if test "$use_static_libs" = built && test "$installed" = yes; then
6687 use_static_libs=no
6688 fi
6689 if test -n "$library_names" &&
6690 { test "$use_static_libs" = no || test -z "$old_library"; }; then
6691 case $host in
6692 *cygwin* | *mingw* | *cegcc*)
6693 # No point in relinking DLLs because paths are not encoded
6694 func_append notinst_deplibs " $lib"
6695 need_relink=no
6696 ;;
6697 *)
6698 if test "$installed" = no; then
6699 func_append notinst_deplibs " $lib"
6700 need_relink=yes
6701 fi
6702 ;;
6703 esac
6704 # This is a shared library
6705
6706 # Warn about portability, can't link against -module's on some
6707 # systems (darwin). Don't bleat about dlopened modules though!
6708 dlopenmodule=""
6709 for dlpremoduletest in $dlprefiles; do
6710 if test "X$dlpremoduletest" = "X$lib"; then
6711 dlopenmodule="$dlpremoduletest"
6712 break
6713 fi
6714 done
6715 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6716 echo
6717 if test "$linkmode" = prog; then
6718 $ECHO "*** Warning: Linking the executable $output against the loadable module"
6719 else
6720 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6721 fi
6722 $ECHO "*** $linklib is not portable!"
6723 fi
6724 if test "$linkmode" = lib &&
6725 test "$hardcode_into_libs" = yes; then
6726 # Hardcode the library path.
6727 # Skip directories that are in the system default run-time
6728 # search path.
6729 case " $sys_lib_dlsearch_path " in
6730 *" $absdir "*) ;;
6731 *)
6732 case "$compile_rpath " in
6733 *" $absdir "*) ;;
6734 *) func_append compile_rpath " $absdir" ;;
6735 esac
6736 ;;
6737 esac
6738 case " $sys_lib_dlsearch_path " in
6739 *" $libdir "*) ;;
6740 *)
6741 case "$finalize_rpath " in
6742 *" $libdir "*) ;;
6743 *) func_append finalize_rpath " $libdir" ;;
6744 esac
6745 ;;
6746 esac
6747 fi
6748
6749 if test -n "$old_archive_from_expsyms_cmds"; then
6750 # figure out the soname
6751 set dummy $library_names
6752 shift
6753 realname="$1"
6754 shift
6755 libname=`eval "\\$ECHO \"$libname_spec\""`
6756 # use dlname if we got it. it's perfectly good, no?
6757 if test -n "$dlname"; then
6758 soname="$dlname"
6759 elif test -n "$soname_spec"; then
6760 # bleh windows
6761 case $host in
6762 *cygwin* | mingw* | *cegcc*)
6763 func_arith $current - $age
6764 major=$func_arith_result
6765 versuffix="-$major"
6766 ;;
6767 esac
6768 eval soname=\"$soname_spec\"
6769 else
6770 soname="$realname"
6771 fi
6772
6773 # Make a new name for the extract_expsyms_cmds to use
6774 soroot="$soname"
6775 func_basename "$soroot"
6776 soname="$func_basename_result"
6777 func_stripname 'lib' '.dll' "$soname"
6778 newlib=libimp-$func_stripname_result.a
6779
6780 # If the library has no export list, then create one now
6781 if test -f "$output_objdir/$soname-def"; then :
6782 else
6783 func_verbose "extracting exported symbol list from \`$soname'"
6784 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6785 fi
6786
6787 # Create $newlib
6788 if test -f "$output_objdir/$newlib"; then :; else
6789 func_verbose "generating import library for \`$soname'"
6790 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6791 fi
6792 # make sure the library variables are pointing to the new library
6793 dir=$output_objdir
6794 linklib=$newlib
6795 fi # test -n "$old_archive_from_expsyms_cmds"
6796
6797 if test "$linkmode" = prog || test "$opt_mode" != relink; then
6798 add_shlibpath=
6799 add_dir=
6800 add=
6801 lib_linked=yes
6802 case $hardcode_action in
6803 immediate | unsupported)
6804 if test "$hardcode_direct" = no; then
6805 add="$dir/$linklib"
6806 case $host in
6807 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6808 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6809 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6810 *-*-unixware7*) add_dir="-L$dir" ;;
6811 *-*-darwin* )
6812 # if the lib is a (non-dlopened) module then we can not
6813 # link against it, someone is ignoring the earlier warnings
6814 if /usr/bin/file -L $add 2> /dev/null |
6815 $GREP ": [^:]* bundle" >/dev/null ; then
6816 if test "X$dlopenmodule" != "X$lib"; then
6817 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6818 if test -z "$old_library" ; then
6819 echo
6820 echo "*** And there doesn't seem to be a static archive available"
6821 echo "*** The link will probably fail, sorry"
6822 else
6823 add="$dir/$old_library"
6824 fi
6825 elif test -n "$old_library"; then
6826 add="$dir/$old_library"
6827 fi
6828 fi
6829 esac
6830 elif test "$hardcode_minus_L" = no; then
6831 case $host in
6832 *-*-sunos*) add_shlibpath="$dir" ;;
6833 esac
6834 add_dir="-L$dir"
6835 add="-l$name"
6836 elif test "$hardcode_shlibpath_var" = no; then
6837 add_shlibpath="$dir"
6838 add="-l$name"
6839 else
6840 lib_linked=no
6841 fi
6842 ;;
6843 relink)
6844 if test "$hardcode_direct" = yes &&
6845 test "$hardcode_direct_absolute" = no; then
6846 add="$dir/$linklib"
6847 elif test "$hardcode_minus_L" = yes; then
6848 add_dir="-L$absdir"
6849 # Try looking first in the location we're being installed to.
6850 if test -n "$inst_prefix_dir"; then
6851 case $libdir in
6852 [\\/]*)
6853 func_append add_dir " -L$inst_prefix_dir$libdir"
6854 ;;
6855 esac
6856 fi
6857 add="-l$name"
6858 elif test "$hardcode_shlibpath_var" = yes; then
6859 add_shlibpath="$dir"
6860 add="-l$name"
6861 else
6862 lib_linked=no
6863 fi
6864 ;;
6865 *) lib_linked=no ;;
6866 esac
6867
6868 if test "$lib_linked" != yes; then
6869 func_fatal_configuration "unsupported hardcode properties"
6870 fi
6871
6872 if test -n "$add_shlibpath"; then
6873 case :$compile_shlibpath: in
6874 *":$add_shlibpath:"*) ;;
6875 *) func_append compile_shlibpath "$add_shlibpath:" ;;
6876 esac
6877 fi
6878 if test "$linkmode" = prog; then
6879 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6880 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6881 else
6882 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6883 test -n "$add" && deplibs="$add $deplibs"
6884 if test "$hardcode_direct" != yes &&
6885 test "$hardcode_minus_L" != yes &&
6886 test "$hardcode_shlibpath_var" = yes; then
6887 case :$finalize_shlibpath: in
6888 *":$libdir:"*) ;;
6889 *) func_append finalize_shlibpath "$libdir:" ;;
6890 esac
6891 fi
6892 fi
6893 fi
6894
6895 if test "$linkmode" = prog || test "$opt_mode" = relink; then
6896 add_shlibpath=
6897 add_dir=
6898 add=
6899 # Finalize command for both is simple: just hardcode it.
6900 if test "$hardcode_direct" = yes &&
6901 test "$hardcode_direct_absolute" = no; then
6902 add="$libdir/$linklib"
6903 elif test "$hardcode_minus_L" = yes; then
6904 add_dir="-L$libdir"
6905 add="-l$name"
6906 elif test "$hardcode_shlibpath_var" = yes; then
6907 case :$finalize_shlibpath: in
6908 *":$libdir:"*) ;;
6909 *) func_append finalize_shlibpath "$libdir:" ;;
6910 esac
6911 add="-l$name"
6912 elif test "$hardcode_automatic" = yes; then
6913 if test -n "$inst_prefix_dir" &&
6914 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6915 add="$inst_prefix_dir$libdir/$linklib"
6916 else
6917 add="$libdir/$linklib"
6918 fi
6919 else
6920 # We cannot seem to hardcode it, guess we'll fake it.
6921 add_dir="-L$libdir"
6922 # Try looking first in the location we're being installed to.
6923 if test -n "$inst_prefix_dir"; then
6924 case $libdir in
6925 [\\/]*)
6926 func_append add_dir " -L$inst_prefix_dir$libdir"
6927 ;;
6928 esac
6929 fi
6930 add="-l$name"
6931 fi
6932
6933 if test "$linkmode" = prog; then
6934 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6935 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6936 else
6937 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6938 test -n "$add" && deplibs="$add $deplibs"
6939 fi
6940 fi
6941 elif test "$linkmode" = prog; then
6942 # Here we assume that one of hardcode_direct or hardcode_minus_L
6943 # is not unsupported. This is valid on all known static and
6944 # shared platforms.
6945 if test "$hardcode_direct" != unsupported; then
6946 test -n "$old_library" && linklib="$old_library"
6947 compile_deplibs="$dir/$linklib $compile_deplibs"
6948 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6949 else
6950 compile_deplibs="-l$name -L$dir $compile_deplibs"
6951 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6952 fi
6953 elif test "$build_libtool_libs" = yes; then
6954 # Not a shared library
6955 if test "$deplibs_check_method" != pass_all; then
6956 # We're trying link a shared library against a static one
6957 # but the system doesn't support it.
6958
6959 # Just print a warning and add the library to dependency_libs so
6960 # that the program can be linked against the static library.
6961 echo
6962 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6963 echo "*** I have the capability to make that library automatically link in when"
6964 echo "*** you link to this library. But I can only do this if you have a"
6965 echo "*** shared version of the library, which you do not appear to have."
6966 if test "$module" = yes; then
6967 echo "*** But as you try to build a module library, libtool will still create "
6968 echo "*** a static module, that should work as long as the dlopening application"
6969 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6970 if test -z "$global_symbol_pipe"; then
6971 echo
6972 echo "*** However, this would only work if libtool was able to extract symbol"
6973 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6974 echo "*** not find such a program. So, this module is probably useless."
6975 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6976 fi
6977 if test "$build_old_libs" = no; then
6978 build_libtool_libs=module
6979 build_old_libs=yes
6980 else
6981 build_libtool_libs=no
6982 fi
6983 fi
6984 else
6985 deplibs="$dir/$old_library $deplibs"
6986 link_static=yes
6987 fi
6988 fi # link shared/static library?
6989
6990 if test "$linkmode" = lib; then
6991 if test -n "$dependency_libs" &&
6992 { test "$hardcode_into_libs" != yes ||
6993 test "$build_old_libs" = yes ||
6994 test "$link_static" = yes; }; then
6995 # Extract -R from dependency_libs
6996 temp_deplibs=
6997 for libdir in $dependency_libs; do
6998 case $libdir in
6999 -R*) func_stripname '-R' '' "$libdir"
7000 temp_xrpath=$func_stripname_result
7001 case " $xrpath " in
7002 *" $temp_xrpath "*) ;;
7003 *) func_append xrpath " $temp_xrpath";;
7004 esac;;
7005 *) func_append temp_deplibs " $libdir";;
7006 esac
7007 done
7008 dependency_libs="$temp_deplibs"
7009 fi
7010
7011 func_append newlib_search_path " $absdir"
7012 # Link against this library
7013 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7014 # ... and its dependency_libs
7015 tmp_libs=
7016 for deplib in $dependency_libs; do
7017 newdependency_libs="$deplib $newdependency_libs"
7018 case $deplib in
7019 -L*) func_stripname '-L' '' "$deplib"
7020 func_resolve_sysroot "$func_stripname_result";;
7021 *) func_resolve_sysroot "$deplib" ;;
7022 esac
7023 if $opt_preserve_dup_deps ; then
7024 case "$tmp_libs " in
7025 *" $func_resolve_sysroot_result "*)
7026 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7027 esac
7028 fi
7029 func_append tmp_libs " $func_resolve_sysroot_result"
7030 done
7031
7032 if test "$link_all_deplibs" != no; then
7033 # Add the search paths of all dependency libraries
7034 for deplib in $dependency_libs; do
7035 path=
7036 case $deplib in
7037 -L*) path="$deplib" ;;
7038 *.la)
7039 func_resolve_sysroot "$deplib"
7040 deplib=$func_resolve_sysroot_result
7041 func_dirname "$deplib" "" "."
7042 dir=$func_dirname_result
7043 # We need an absolute path.
7044 case $dir in
7045 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7046 *)
7047 absdir=`cd "$dir" && pwd`
7048 if test -z "$absdir"; then
7049 func_warning "cannot determine absolute directory name of \`$dir'"
7050 absdir="$dir"
7051 fi
7052 ;;
7053 esac
7054 if $GREP "^installed=no" $deplib > /dev/null; then
7055 case $host in
7056 *-*-darwin*)
7057 depdepl=
7058 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7059 if test -n "$deplibrary_names" ; then
7060 for tmp in $deplibrary_names ; do
7061 depdepl=$tmp
7062 done
7063 if test -f "$absdir/$objdir/$depdepl" ; then
7064 depdepl="$absdir/$objdir/$depdepl"
7065 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7066 if test -z "$darwin_install_name"; then
7067 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7068 fi
7069 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7070 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
7071 path=
7072 fi
7073 fi
7074 ;;
7075 *)
7076 path="-L$absdir/$objdir"
7077 ;;
7078 esac
7079 else
7080 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7081 test -z "$libdir" && \
7082 func_fatal_error "\`$deplib' is not a valid libtool archive"
7083 test "$absdir" != "$libdir" && \
7084 func_warning "\`$deplib' seems to be moved"
7085
7086 path="-L$absdir"
7087 fi
7088 ;;
7089 esac
7090 case " $deplibs " in
7091 *" $path "*) ;;
7092 *) deplibs="$path $deplibs" ;;
7093 esac
7094 done
7095 fi # link_all_deplibs != no
7096 fi # linkmode = lib
7097 done # for deplib in $libs
7098 if test "$pass" = link; then
7099 if test "$linkmode" = "prog"; then
7100 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7101 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7102 else
7103 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7104 fi
7105 fi
7106 dependency_libs="$newdependency_libs"
7107 if test "$pass" = dlpreopen; then
7108 # Link the dlpreopened libraries before other libraries
7109 for deplib in $save_deplibs; do
7110 deplibs="$deplib $deplibs"
7111 done
7112 fi
7113 if test "$pass" != dlopen; then
7114 if test "$pass" != conv; then
7115 # Make sure lib_search_path contains only unique directories.
7116 lib_search_path=
7117 for dir in $newlib_search_path; do
7118 case "$lib_search_path " in
7119 *" $dir "*) ;;
7120 *) func_append lib_search_path " $dir" ;;
7121 esac
7122 done
7123 newlib_search_path=
7124 fi
7125
7126 if test "$linkmode,$pass" != "prog,link"; then
7127 vars="deplibs"
7128 else
7129 vars="compile_deplibs finalize_deplibs"
7130 fi
7131 for var in $vars dependency_libs; do
7132 # Add libraries to $var in reverse order
7133 eval tmp_libs=\"\$$var\"
7134 new_libs=
7135 for deplib in $tmp_libs; do
7136 # FIXME: Pedantically, this is the right thing to do, so
7137 # that some nasty dependency loop isn't accidentally
7138 # broken:
7139 #new_libs="$deplib $new_libs"
7140 # Pragmatically, this seems to cause very few problems in
7141 # practice:
7142 case $deplib in
7143 -L*) new_libs="$deplib $new_libs" ;;
7144 -R*) ;;
7145 *)
7146 # And here is the reason: when a library appears more
7147 # than once as an explicit dependence of a library, or
7148 # is implicitly linked in more than once by the
7149 # compiler, it is considered special, and multiple
7150 # occurrences thereof are not removed. Compare this
7151 # with having the same library being listed as a
7152 # dependency of multiple other libraries: in this case,
7153 # we know (pedantically, we assume) the library does not
7154 # need to be listed more than once, so we keep only the
7155 # last copy. This is not always right, but it is rare
7156 # enough that we require users that really mean to play
7157 # such unportable linking tricks to link the library
7158 # using -Wl,-lname, so that libtool does not consider it
7159 # for duplicate removal.
7160 case " $specialdeplibs " in
7161 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7162 *)
7163 case " $new_libs " in
7164 *" $deplib "*) ;;
7165 *) new_libs="$deplib $new_libs" ;;
7166 esac
7167 ;;
7168 esac
7169 ;;
7170 esac
7171 done
7172 tmp_libs=
7173 for deplib in $new_libs; do
7174 case $deplib in
7175 -L*)
7176 case " $tmp_libs " in
7177 *" $deplib "*) ;;
7178 *) func_append tmp_libs " $deplib" ;;
7179 esac
7180 ;;
7181 *) func_append tmp_libs " $deplib" ;;
7182 esac
7183 done
7184 eval $var=\"$tmp_libs\"
7185 done # for var
7186 fi
7187 # Last step: remove runtime libs from dependency_libs
7188 # (they stay in deplibs)
7189 tmp_libs=
7190 for i in $dependency_libs ; do
7191 case " $predeps $postdeps $compiler_lib_search_path " in
7192 *" $i "*)
7193 i=""
7194 ;;
7195 esac
7196 if test -n "$i" ; then
7197 func_append tmp_libs " $i"
7198 fi
7199 done
7200 dependency_libs=$tmp_libs
7201 done # for pass
7202 if test "$linkmode" = prog; then
7203 dlfiles="$newdlfiles"
7204 fi
7205 if test "$linkmode" = prog || test "$linkmode" = lib; then
7206 dlprefiles="$newdlprefiles"
7207 fi
7208
7209 case $linkmode in
7210 oldlib)
7211 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7212 func_warning "\`-dlopen' is ignored for archives"
7213 fi
7214
7215 case " $deplibs" in
7216 *\ -l* | *\ -L*)
7217 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7218 esac
7219
7220 test -n "$rpath" && \
7221 func_warning "\`-rpath' is ignored for archives"
7222
7223 test -n "$xrpath" && \
7224 func_warning "\`-R' is ignored for archives"
7225
7226 test -n "$vinfo" && \
7227 func_warning "\`-version-info/-version-number' is ignored for archives"
7228
7229 test -n "$release" && \
7230 func_warning "\`-release' is ignored for archives"
7231
7232 test -n "$export_symbols$export_symbols_regex" && \
7233 func_warning "\`-export-symbols' is ignored for archives"
7234
7235 # Now set the variables for building old libraries.
7236 build_libtool_libs=no
7237 oldlibs="$output"
7238 func_append objs "$old_deplibs"
7239 ;;
7240
7241 lib)
7242 # Make sure we only generate libraries of the form `libNAME.la'.
7243 case $outputname in
7244 lib*)
7245 func_stripname 'lib' '.la' "$outputname"
7246 name=$func_stripname_result
7247 eval shared_ext=\"$shrext_cmds\"
7248 eval libname=\"$libname_spec\"
7249 ;;
7250 *)
7251 test "$module" = no && \
7252 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7253
7254 if test "$need_lib_prefix" != no; then
7255 # Add the "lib" prefix for modules if required
7256 func_stripname '' '.la' "$outputname"
7257 name=$func_stripname_result
7258 eval shared_ext=\"$shrext_cmds\"
7259 eval libname=\"$libname_spec\"
7260 else
7261 func_stripname '' '.la' "$outputname"
7262 libname=$func_stripname_result
7263 fi
7264 ;;
7265 esac
7266
7267 if test -n "$objs"; then
7268 if test "$deplibs_check_method" != pass_all; then
7269 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7270 else
7271 echo
7272 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7273 $ECHO "*** objects $objs is not portable!"
7274 func_append libobjs " $objs"
7275 fi
7276 fi
7277
7278 test "$dlself" != no && \
7279 func_warning "\`-dlopen self' is ignored for libtool libraries"
7280
7281 set dummy $rpath
7282 shift
7283 test "$#" -gt 1 && \
7284 func_warning "ignoring multiple \`-rpath's for a libtool library"
7285
7286 install_libdir="$1"
7287
7288 oldlibs=
7289 if test -z "$rpath"; then
7290 if test "$build_libtool_libs" = yes; then
7291 # Building a libtool convenience library.
7292 # Some compilers have problems with a `.al' extension so
7293 # convenience libraries should have the same extension an
7294 # archive normally would.
7295 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7296 build_libtool_libs=convenience
7297 build_old_libs=yes
7298 fi
7299
7300 test -n "$vinfo" && \
7301 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7302
7303 test -n "$release" && \
7304 func_warning "\`-release' is ignored for convenience libraries"
7305 else
7306
7307 # Parse the version information argument.
7308 save_ifs="$IFS"; IFS=':'
7309 set dummy $vinfo 0 0 0
7310 shift
7311 IFS="$save_ifs"
7312
7313 test -n "$7" && \
7314 func_fatal_help "too many parameters to \`-version-info'"
7315
7316 # convert absolute version numbers to libtool ages
7317 # this retains compatibility with .la files and attempts
7318 # to make the code below a bit more comprehensible
7319
7320 case $vinfo_number in
7321 yes)
7322 number_major="$1"
7323 number_minor="$2"
7324 number_revision="$3"
7325 #
7326 # There are really only two kinds -- those that
7327 # use the current revision as the major version
7328 # and those that subtract age and use age as
7329 # a minor version. But, then there is irix
7330 # which has an extra 1 added just for fun
7331 #
7332 case $version_type in
7333 # correct linux to gnu/linux during the next big refactor
7334 darwin|linux|osf|windows|none)
7335 func_arith $number_major + $number_minor
7336 current=$func_arith_result
7337 age="$number_minor"
7338 revision="$number_revision"
7339 ;;
7340 freebsd-aout|freebsd-elf|qnx|sunos)
7341 current="$number_major"
7342 revision="$number_minor"
7343 age="0"
7344 ;;
7345 irix|nonstopux)
7346 func_arith $number_major + $number_minor
7347 current=$func_arith_result
7348 age="$number_minor"
7349 revision="$number_minor"
7350 lt_irix_increment=no
7351 ;;
7352 esac
7353 ;;
7354 no)
7355 current="$1"
7356 revision="$2"
7357 age="$3"
7358 ;;
7359 esac
7360
7361 # Check that each of the things are valid numbers.
7362 case $current in
7363 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7364 *)
7365 func_error "CURRENT \`$current' must be a nonnegative integer"
7366 func_fatal_error "\`$vinfo' is not valid version information"
7367 ;;
7368 esac
7369
7370 case $revision in
7371 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7372 *)
7373 func_error "REVISION \`$revision' must be a nonnegative integer"
7374 func_fatal_error "\`$vinfo' is not valid version information"
7375 ;;
7376 esac
7377
7378 case $age in
7379 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7380 *)
7381 func_error "AGE \`$age' must be a nonnegative integer"
7382 func_fatal_error "\`$vinfo' is not valid version information"
7383 ;;
7384 esac
7385
7386 if test "$age" -gt "$current"; then
7387 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7388 func_fatal_error "\`$vinfo' is not valid version information"
7389 fi
7390
7391 # Calculate the version variables.
7392 major=
7393 versuffix=
7394 verstring=
7395 case $version_type in
7396 none) ;;
7397
7398 darwin)
7399 # Like Linux, but with the current version available in
7400 # verstring for coding it into the library header
7401 func_arith $current - $age
7402 major=.$func_arith_result
7403 versuffix="$major.$age.$revision"
7404 # Darwin ld doesn't like 0 for these options...
7405 func_arith $current + 1
7406 minor_current=$func_arith_result
7407 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7408 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7409 ;;
7410
7411 freebsd-aout)
7412 major=".$current"
7413 versuffix=".$current.$revision";
7414 ;;
7415
7416 freebsd-elf)
7417 major=".$current"
7418 versuffix=".$current"
7419 ;;
7420
7421 irix | nonstopux)
7422 if test "X$lt_irix_increment" = "Xno"; then
7423 func_arith $current - $age
7424 else
7425 func_arith $current - $age + 1
7426 fi
7427 major=$func_arith_result
7428
7429 case $version_type in
7430 nonstopux) verstring_prefix=nonstopux ;;
7431 *) verstring_prefix=sgi ;;
7432 esac
7433 verstring="$verstring_prefix$major.$revision"
7434
7435 # Add in all the interfaces that we are compatible with.
7436 loop=$revision
7437 while test "$loop" -ne 0; do
7438 func_arith $revision - $loop
7439 iface=$func_arith_result
7440 func_arith $loop - 1
7441 loop=$func_arith_result
7442 verstring="$verstring_prefix$major.$iface:$verstring"
7443 done
7444
7445 # Before this point, $major must not contain `.'.
7446 major=.$major
7447 versuffix="$major.$revision"
7448 ;;
7449
7450 linux) # correct to gnu/linux during the next big refactor
7451 func_arith $current - $age
7452 major=.$func_arith_result
7453 versuffix="$major.$age.$revision"
7454 ;;
7455
7456 osf)
7457 func_arith $current - $age
7458 major=.$func_arith_result
7459 versuffix=".$current.$age.$revision"
7460 verstring="$current.$age.$revision"
7461
7462 # Add in all the interfaces that we are compatible with.
7463 loop=$age
7464 while test "$loop" -ne 0; do
7465 func_arith $current - $loop
7466 iface=$func_arith_result
7467 func_arith $loop - 1
7468 loop=$func_arith_result
7469 verstring="$verstring:${iface}.0"
7470 done
7471
7472 # Make executables depend on our current version.
7473 func_append verstring ":${current}.0"
7474 ;;
7475
7476 qnx)
7477 major=".$current"
7478 versuffix=".$current"
7479 ;;
7480
7481 sunos)
7482 major=".$current"
7483 versuffix=".$current.$revision"
7484 ;;
7485
7486 windows)
7487 # Use '-' rather than '.', since we only want one
7488 # extension on DOS 8.3 filesystems.
7489 func_arith $current - $age
7490 major=$func_arith_result
7491 versuffix="-$major"
7492 ;;
7493
7494 *)
7495 func_fatal_configuration "unknown library version type \`$version_type'"
7496 ;;
7497 esac
7498
7499 # Clear the version info if we defaulted, and they specified a release.
7500 if test -z "$vinfo" && test -n "$release"; then
7501 major=
7502 case $version_type in
7503 darwin)
7504 # we can't check for "0.0" in archive_cmds due to quoting
7505 # problems, so we reset it completely
7506 verstring=
7507 ;;
7508 *)
7509 verstring="0.0"
7510 ;;
7511 esac
7512 if test "$need_version" = no; then
7513 versuffix=
7514 else
7515 versuffix=".0.0"
7516 fi
7517 fi
7518
7519 # Remove version info from name if versioning should be avoided
7520 if test "$avoid_version" = yes && test "$need_version" = no; then
7521 major=
7522 versuffix=
7523 verstring=""
7524 fi
7525
7526 # Check to see if the archive will have undefined symbols.
7527 if test "$allow_undefined" = yes; then
7528 if test "$allow_undefined_flag" = unsupported; then
7529 func_warning "undefined symbols not allowed in $host shared libraries"
7530 build_libtool_libs=no
7531 build_old_libs=yes
7532 fi
7533 else
7534 # Don't allow undefined symbols.
7535 allow_undefined_flag="$no_undefined_flag"
7536 fi
7537
7538 fi
7539
7540 func_generate_dlsyms "$libname" "$libname" "yes"
7541 func_append libobjs " $symfileobj"
7542 test "X$libobjs" = "X " && libobjs=
7543
7544 if test "$opt_mode" != relink; then
7545 # Remove our outputs, but don't remove object files since they
7546 # may have been created when compiling PIC objects.
7547 removelist=
7548 tempremovelist=`$ECHO "$output_objdir/*"`
7549 for p in $tempremovelist; do
7550 case $p in
7551 *.$objext | *.gcno)
7552 ;;
7553 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7554 if test "X$precious_files_regex" != "X"; then
7555 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7556 then
7557 continue
7558 fi
7559 fi
7560 func_append removelist " $p"
7561 ;;
7562 *) ;;
7563 esac
7564 done
7565 test -n "$removelist" && \
7566 func_show_eval "${RM}r \$removelist"
7567 fi
7568
7569 # Now set the variables for building old libraries.
7570 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7571 func_append oldlibs " $output_objdir/$libname.$libext"
7572
7573 # Transform .lo files to .o files.
7574 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7575 fi
7576
7577 # Eliminate all temporary directories.
7578 #for path in $notinst_path; do
7579 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7580 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7581 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7582 #done
7583
7584 if test -n "$xrpath"; then
7585 # If the user specified any rpath flags, then add them.
7586 temp_xrpath=
7587 for libdir in $xrpath; do
7588 func_replace_sysroot "$libdir"
7589 func_append temp_xrpath " -R$func_replace_sysroot_result"
7590 case "$finalize_rpath " in
7591 *" $libdir "*) ;;
7592 *) func_append finalize_rpath " $libdir" ;;
7593 esac
7594 done
7595 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7596 dependency_libs="$temp_xrpath $dependency_libs"
7597 fi
7598 fi
7599
7600 # Make sure dlfiles contains only unique files that won't be dlpreopened
7601 old_dlfiles="$dlfiles"
7602 dlfiles=
7603 for lib in $old_dlfiles; do
7604 case " $dlprefiles $dlfiles " in
7605 *" $lib "*) ;;
7606 *) func_append dlfiles " $lib" ;;
7607 esac
7608 done
7609
7610 # Make sure dlprefiles contains only unique files
7611 old_dlprefiles="$dlprefiles"
7612 dlprefiles=
7613 for lib in $old_dlprefiles; do
7614 case "$dlprefiles " in
7615 *" $lib "*) ;;
7616 *) func_append dlprefiles " $lib" ;;
7617 esac
7618 done
7619
7620 if test "$build_libtool_libs" = yes; then
7621 if test -n "$rpath"; then
7622 case $host in
7623 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7624 # these systems don't actually have a c library (as such)!
7625 ;;
7626 *-*-rhapsody* | *-*-darwin1.[012])
7627 # Rhapsody C library is in the System framework
7628 func_append deplibs " System.ltframework"
7629 ;;
7630 *-*-netbsd*)
7631 # Don't link with libc until the a.out ld.so is fixed.
7632 ;;
7633 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7634 # Do not include libc due to us having libc/libc_r.
7635 ;;
7636 *-*-sco3.2v5* | *-*-sco5v6*)
7637 # Causes problems with __ctype
7638 ;;
7639 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7640 # Compiler inserts libc in the correct place for threads to work
7641 ;;
7642 *)
7643 # Add libc to deplibs on all other systems if necessary.
7644 if test "$build_libtool_need_lc" = "yes"; then
7645 func_append deplibs " -lc"
7646 fi
7647 ;;
7648 esac
7649 fi
7650
7651 # Transform deplibs into only deplibs that can be linked in shared.
7652 name_save=$name
7653 libname_save=$libname
7654 release_save=$release
7655 versuffix_save=$versuffix
7656 major_save=$major
7657 # I'm not sure if I'm treating the release correctly. I think
7658 # release should show up in the -l (ie -lgmp5) so we don't want to
7659 # add it in twice. Is that correct?
7660 release=""
7661 versuffix=""
7662 major=""
7663 newdeplibs=
7664 droppeddeps=no
7665 case $deplibs_check_method in
7666 pass_all)
7667 # Don't check for shared/static. Everything works.
7668 # This might be a little naive. We might want to check
7669 # whether the library exists or not. But this is on
7670 # osf3 & osf4 and I'm not really sure... Just
7671 # implementing what was already the behavior.
7672 newdeplibs=$deplibs
7673 ;;
7674 test_compile)
7675 # This code stresses the "libraries are programs" paradigm to its
7676 # limits. Maybe even breaks it. We compile a program, linking it
7677 # against the deplibs as a proxy for the library. Then we can check
7678 # whether they linked in statically or dynamically with ldd.
7679 $opt_dry_run || $RM conftest.c
7680 cat > conftest.c <<EOF
7681 int main() { return 0; }
7682EOF
7683 $opt_dry_run || $RM conftest
7684 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7685 ldd_output=`ldd conftest`
7686 for i in $deplibs; do
7687 case $i in
7688 -l*)
7689 func_stripname -l '' "$i"
7690 name=$func_stripname_result
7691 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7692 case " $predeps $postdeps " in
7693 *" $i "*)
7694 func_append newdeplibs " $i"
7695 i=""
7696 ;;
7697 esac
7698 fi
7699 if test -n "$i" ; then
7700 libname=`eval "\\$ECHO \"$libname_spec\""`
7701 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7702 set dummy $deplib_matches; shift
7703 deplib_match=$1
7704 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7705 func_append newdeplibs " $i"
7706 else
7707 droppeddeps=yes
7708 echo
7709 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7710 echo "*** I have the capability to make that library automatically link in when"
7711 echo "*** you link to this library. But I can only do this if you have a"
7712 echo "*** shared version of the library, which I believe you do not have"
7713 echo "*** because a test_compile did reveal that the linker did not use it for"
7714 echo "*** its dynamic dependency list that programs get resolved with at runtime."
7715 fi
7716 fi
7717 ;;
7718 *)
7719 func_append newdeplibs " $i"
7720 ;;
7721 esac
7722 done
7723 else
7724 # Error occurred in the first compile. Let's try to salvage
7725 # the situation: Compile a separate program for each library.
7726 for i in $deplibs; do
7727 case $i in
7728 -l*)
7729 func_stripname -l '' "$i"
7730 name=$func_stripname_result
7731 $opt_dry_run || $RM conftest
7732 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7733 ldd_output=`ldd conftest`
7734 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7735 case " $predeps $postdeps " in
7736 *" $i "*)
7737 func_append newdeplibs " $i"
7738 i=""
7739 ;;
7740 esac
7741 fi
7742 if test -n "$i" ; then
7743 libname=`eval "\\$ECHO \"$libname_spec\""`
7744 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7745 set dummy $deplib_matches; shift
7746 deplib_match=$1
7747 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7748 func_append newdeplibs " $i"
7749 else
7750 droppeddeps=yes
7751 echo
7752 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7753 echo "*** I have the capability to make that library automatically link in when"
7754 echo "*** you link to this library. But I can only do this if you have a"
7755 echo "*** shared version of the library, which you do not appear to have"
7756 echo "*** because a test_compile did reveal that the linker did not use this one"
7757 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7758 fi
7759 fi
7760 else
7761 droppeddeps=yes
7762 echo
7763 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
7764 echo "*** make it link in! You will probably need to install it or some"
7765 echo "*** library that it depends on before this library will be fully"
7766 echo "*** functional. Installing it before continuing would be even better."
7767 fi
7768 ;;
7769 *)
7770 func_append newdeplibs " $i"
7771 ;;
7772 esac
7773 done
7774 fi
7775 ;;
7776 file_magic*)
7777 set dummy $deplibs_check_method; shift
7778 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7779 for a_deplib in $deplibs; do
7780 case $a_deplib in
7781 -l*)
7782 func_stripname -l '' "$a_deplib"
7783 name=$func_stripname_result
7784 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7785 case " $predeps $postdeps " in
7786 *" $a_deplib "*)
7787 func_append newdeplibs " $a_deplib"
7788 a_deplib=""
7789 ;;
7790 esac
7791 fi
7792 if test -n "$a_deplib" ; then
7793 libname=`eval "\\$ECHO \"$libname_spec\""`
7794 if test -n "$file_magic_glob"; then
7795 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7796 else
7797 libnameglob=$libname
7798 fi
7799 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
7800 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7801 if test "$want_nocaseglob" = yes; then
7802 shopt -s nocaseglob
7803 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7804 $nocaseglob
7805 else
7806 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7807 fi
7808 for potent_lib in $potential_libs; do
7809 # Follow soft links.
7810 if ls -lLd "$potent_lib" 2>/dev/null |
7811 $GREP " -> " >/dev/null; then
7812 continue
7813 fi
7814 # The statement above tries to avoid entering an
7815 # endless loop below, in case of cyclic links.
7816 # We might still enter an endless loop, since a link
7817 # loop can be closed while we follow links,
7818 # but so what?
7819 potlib="$potent_lib"
7820 while test -h "$potlib" 2>/dev/null; do
7821 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7822 case $potliblink in
7823 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7824 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7825 esac
7826 done
7827 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7828 $SED -e 10q |
7829 $EGREP "$file_magic_regex" > /dev/null; then
7830 func_append newdeplibs " $a_deplib"
7831 a_deplib=""
7832 break 2
7833 fi
7834 done
7835 done
7836 fi
7837 if test -n "$a_deplib" ; then
7838 droppeddeps=yes
7839 echo
7840 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7841 echo "*** I have the capability to make that library automatically link in when"
7842 echo "*** you link to this library. But I can only do this if you have a"
7843 echo "*** shared version of the library, which you do not appear to have"
7844 echo "*** because I did check the linker path looking for a file starting"
7845 if test -z "$potlib" ; then
7846 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7847 else
7848 $ECHO "*** with $libname and none of the candidates passed a file format test"
7849 $ECHO "*** using a file magic. Last file checked: $potlib"
7850 fi
7851 fi
7852 ;;
7853 *)
7854 # Add a -L argument.
7855 func_append newdeplibs " $a_deplib"
7856 ;;
7857 esac
7858 done # Gone through all deplibs.
7859 ;;
7860 match_pattern*)
7861 set dummy $deplibs_check_method; shift
7862 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7863 for a_deplib in $deplibs; do
7864 case $a_deplib in
7865 -l*)
7866 func_stripname -l '' "$a_deplib"
7867 name=$func_stripname_result
7868 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7869 case " $predeps $postdeps " in
7870 *" $a_deplib "*)
7871 func_append newdeplibs " $a_deplib"
7872 a_deplib=""
7873 ;;
7874 esac
7875 fi
7876 if test -n "$a_deplib" ; then
7877 libname=`eval "\\$ECHO \"$libname_spec\""`
7878 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7879 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7880 for potent_lib in $potential_libs; do
7881 potlib="$potent_lib" # see symlink-check above in file_magic test
7882 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7883 $EGREP "$match_pattern_regex" > /dev/null; then
7884 func_append newdeplibs " $a_deplib"
7885 a_deplib=""
7886 break 2
7887 fi
7888 done
7889 done
7890 fi
7891 if test -n "$a_deplib" ; then
7892 droppeddeps=yes
7893 echo
7894 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7895 echo "*** I have the capability to make that library automatically link in when"
7896 echo "*** you link to this library. But I can only do this if you have a"
7897 echo "*** shared version of the library, which you do not appear to have"
7898 echo "*** because I did check the linker path looking for a file starting"
7899 if test -z "$potlib" ; then
7900 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7901 else
7902 $ECHO "*** with $libname and none of the candidates passed a file format test"
7903 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7904 fi
7905 fi
7906 ;;
7907 *)
7908 # Add a -L argument.
7909 func_append newdeplibs " $a_deplib"
7910 ;;
7911 esac
7912 done # Gone through all deplibs.
7913 ;;
7914 none | unknown | *)
7915 newdeplibs=""
7916 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7917 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7918 for i in $predeps $postdeps ; do
7919 # can't use Xsed below, because $i might contain '/'
7920 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7921 done
7922 fi
7923 case $tmp_deplibs in
7924 *[!\ \ ]*)
7925 echo
7926 if test "X$deplibs_check_method" = "Xnone"; then
7927 echo "*** Warning: inter-library dependencies are not supported in this platform."
7928 else
7929 echo "*** Warning: inter-library dependencies are not known to be supported."
7930 fi
7931 echo "*** All declared inter-library dependencies are being dropped."
7932 droppeddeps=yes
7933 ;;
7934 esac
7935 ;;
7936 esac
7937 versuffix=$versuffix_save
7938 major=$major_save
7939 release=$release_save
7940 libname=$libname_save
7941 name=$name_save
7942
7943 case $host in
7944 *-*-rhapsody* | *-*-darwin1.[012])
7945 # On Rhapsody replace the C library with the System framework
7946 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7947 ;;
7948 esac
7949
7950 if test "$droppeddeps" = yes; then
7951 if test "$module" = yes; then
7952 echo
7953 echo "*** Warning: libtool could not satisfy all declared inter-library"
7954 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7955 echo "*** a static module, that should work as long as the dlopening"
7956 echo "*** application is linked with the -dlopen flag."
7957 if test -z "$global_symbol_pipe"; then
7958 echo
7959 echo "*** However, this would only work if libtool was able to extract symbol"
7960 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7961 echo "*** not find such a program. So, this module is probably useless."
7962 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7963 fi
7964 if test "$build_old_libs" = no; then
7965 oldlibs="$output_objdir/$libname.$libext"
7966 build_libtool_libs=module
7967 build_old_libs=yes
7968 else
7969 build_libtool_libs=no
7970 fi
7971 else
7972 echo "*** The inter-library dependencies that have been dropped here will be"
7973 echo "*** automatically added whenever a program is linked with this library"
7974 echo "*** or is declared to -dlopen it."
7975
7976 if test "$allow_undefined" = no; then
7977 echo
7978 echo "*** Since this library must not contain undefined symbols,"
7979 echo "*** because either the platform does not support them or"
7980 echo "*** it was explicitly requested with -no-undefined,"
7981 echo "*** libtool will only create a static version of it."
7982 if test "$build_old_libs" = no; then
7983 oldlibs="$output_objdir/$libname.$libext"
7984 build_libtool_libs=module
7985 build_old_libs=yes
7986 else
7987 build_libtool_libs=no
7988 fi
7989 fi
7990 fi
7991 fi
7992 # Done checking deplibs!
7993 deplibs=$newdeplibs
7994 fi
7995 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7996 case $host in
7997 *-*-darwin*)
7998 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7999 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8000 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8001 ;;
8002 esac
8003
8004 # move library search paths that coincide with paths to not yet
8005 # installed libraries to the beginning of the library search list
8006 new_libs=
8007 for path in $notinst_path; do
8008 case " $new_libs " in
8009 *" -L$path/$objdir "*) ;;
8010 *)
8011 case " $deplibs " in
8012 *" -L$path/$objdir "*)
8013 func_append new_libs " -L$path/$objdir" ;;
8014 esac
8015 ;;
8016 esac
8017 done
8018 for deplib in $deplibs; do
8019 case $deplib in
8020 -L*)
8021 case " $new_libs " in
8022 *" $deplib "*) ;;
8023 *) func_append new_libs " $deplib" ;;
8024 esac
8025 ;;
8026 *) func_append new_libs " $deplib" ;;
8027 esac
8028 done
8029 deplibs="$new_libs"
8030
8031 # All the library-specific variables (install_libdir is set above).
8032 library_names=
8033 old_library=
8034 dlname=
8035
8036 # Test again, we may have decided not to build it any more
8037 if test "$build_libtool_libs" = yes; then
8038 # Remove ${wl} instances when linking with ld.
8039 # FIXME: should test the right _cmds variable.
8040 case $archive_cmds in
8041 *\$LD\ *) wl= ;;
8042 esac
8043 if test "$hardcode_into_libs" = yes; then
8044 # Hardcode the library paths
8045 hardcode_libdirs=
8046 dep_rpath=
8047 rpath="$finalize_rpath"
8048 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8049 for libdir in $rpath; do
8050 if test -n "$hardcode_libdir_flag_spec"; then
8051 if test -n "$hardcode_libdir_separator"; then
8052 func_replace_sysroot "$libdir"
8053 libdir=$func_replace_sysroot_result
8054 if test -z "$hardcode_libdirs"; then
8055 hardcode_libdirs="$libdir"
8056 else
8057 # Just accumulate the unique libdirs.
8058 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8059 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8060 ;;
8061 *)
8062 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8063 ;;
8064 esac
8065 fi
8066 else
8067 eval flag=\"$hardcode_libdir_flag_spec\"
8068 func_append dep_rpath " $flag"
8069 fi
8070 elif test -n "$runpath_var"; then
8071 case "$perm_rpath " in
8072 *" $libdir "*) ;;
8073 *) func_append perm_rpath " $libdir" ;;
8074 esac
8075 fi
8076 done
8077 # Substitute the hardcoded libdirs into the rpath.
8078 if test -n "$hardcode_libdir_separator" &&
8079 test -n "$hardcode_libdirs"; then
8080 libdir="$hardcode_libdirs"
8081 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8082 fi
8083 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8084 # We should set the runpath_var.
8085 rpath=
8086 for dir in $perm_rpath; do
8087 func_append rpath "$dir:"
8088 done
8089 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8090 fi
8091 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8092 fi
8093
8094 shlibpath="$finalize_shlibpath"
8095 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8096 if test -n "$shlibpath"; then
8097 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8098 fi
8099
8100 # Get the real and link names of the library.
8101 eval shared_ext=\"$shrext_cmds\"
8102 eval library_names=\"$library_names_spec\"
8103 set dummy $library_names
8104 shift
8105 realname="$1"
8106 shift
8107
8108 if test -n "$soname_spec"; then
8109 eval soname=\"$soname_spec\"
8110 else
8111 soname="$realname"
8112 fi
8113 if test -z "$dlname"; then
8114 dlname=$soname
8115 fi
8116
8117 lib="$output_objdir/$realname"
8118 linknames=
8119 for link
8120 do
8121 func_append linknames " $link"
8122 done
8123
8124 # Use standard objects if they are pic
8125 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8126 test "X$libobjs" = "X " && libobjs=
8127
8128 delfiles=
8129 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8130 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8131 export_symbols="$output_objdir/$libname.uexp"
8132 func_append delfiles " $export_symbols"
8133 fi
8134
8135 orig_export_symbols=
8136 case $host_os in
8137 cygwin* | mingw* | cegcc*)
8138 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8139 # exporting using user supplied symfile
8140 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8141 # and it's NOT already a .def file. Must figure out
8142 # which of the given symbols are data symbols and tag
8143 # them as such. So, trigger use of export_symbols_cmds.
8144 # export_symbols gets reassigned inside the "prepare
8145 # the list of exported symbols" if statement, so the
8146 # include_expsyms logic still works.
8147 orig_export_symbols="$export_symbols"
8148 export_symbols=
8149 always_export_symbols=yes
8150 fi
8151 fi
8152 ;;
8153 esac
8154
8155 # Prepare the list of exported symbols
8156 if test -z "$export_symbols"; then
8157 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8158 func_verbose "generating symbol list for \`$libname.la'"
8159 export_symbols="$output_objdir/$libname.exp"
8160 $opt_dry_run || $RM $export_symbols
8161 cmds=$export_symbols_cmds
8162 save_ifs="$IFS"; IFS='~'
8163 for cmd1 in $cmds; do
8164 IFS="$save_ifs"
8165 # Take the normal branch if the nm_file_list_spec branch
8166 # doesn't work or if tool conversion is not needed.
8167 case $nm_file_list_spec~$to_tool_file_cmd in
8168 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8169 try_normal_branch=yes
8170 eval cmd=\"$cmd1\"
8171 func_len " $cmd"
8172 len=$func_len_result
8173 ;;
8174 *)
8175 try_normal_branch=no
8176 ;;
8177 esac
8178 if test "$try_normal_branch" = yes \
8179 && { test "$len" -lt "$max_cmd_len" \
8180 || test "$max_cmd_len" -le -1; }
8181 then
8182 func_show_eval "$cmd" 'exit $?'
8183 skipped_export=false
8184 elif test -n "$nm_file_list_spec"; then
8185 func_basename "$output"
8186 output_la=$func_basename_result
8187 save_libobjs=$libobjs
8188 save_output=$output
8189 output=${output_objdir}/${output_la}.nm
8190 func_to_tool_file "$output"
8191 libobjs=$nm_file_list_spec$func_to_tool_file_result
8192 func_append delfiles " $output"
8193 func_verbose "creating $NM input file list: $output"
8194 for obj in $save_libobjs; do
8195 func_to_tool_file "$obj"
8196 $ECHO "$func_to_tool_file_result"
8197 done > "$output"
8198 eval cmd=\"$cmd1\"
8199 func_show_eval "$cmd" 'exit $?'
8200 output=$save_output
8201 libobjs=$save_libobjs
8202 skipped_export=false
8203 else
8204 # The command line is too long to execute in one step.
8205 func_verbose "using reloadable object file for export list..."
8206 skipped_export=:
8207 # Break out early, otherwise skipped_export may be
8208 # set to false by a later but shorter cmd.
8209 break
8210 fi
8211 done
8212 IFS="$save_ifs"
8213 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8214 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8215 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8216 fi
8217 fi
8218 fi
8219
8220 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8221 tmp_export_symbols="$export_symbols"
8222 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8223 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8224 fi
8225
8226 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8227 # The given exports_symbols file has to be filtered, so filter it.
8228 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8229 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8230 # 's' commands which not all seds can handle. GNU sed should be fine
8231 # though. Also, the filter scales superlinearly with the number of
8232 # global variables. join(1) would be nice here, but unfortunately
8233 # isn't a blessed tool.
8234 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8235 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8236 export_symbols=$output_objdir/$libname.def
8237 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8238 fi
8239
8240 tmp_deplibs=
8241 for test_deplib in $deplibs; do
8242 case " $convenience " in
8243 *" $test_deplib "*) ;;
8244 *)
8245 func_append tmp_deplibs " $test_deplib"
8246 ;;
8247 esac
8248 done
8249 deplibs="$tmp_deplibs"
8250
8251 if test -n "$convenience"; then
8252 if test -n "$whole_archive_flag_spec" &&
8253 test "$compiler_needs_object" = yes &&
8254 test -z "$libobjs"; then
8255 # extract the archives, so we have objects to list.
8256 # TODO: could optimize this to just extract one archive.
8257 whole_archive_flag_spec=
8258 fi
8259 if test -n "$whole_archive_flag_spec"; then
8260 save_libobjs=$libobjs
8261 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8262 test "X$libobjs" = "X " && libobjs=
8263 else
8264 gentop="$output_objdir/${outputname}x"
8265 func_append generated " $gentop"
8266
8267 func_extract_archives $gentop $convenience
8268 func_append libobjs " $func_extract_archives_result"
8269 test "X$libobjs" = "X " && libobjs=
8270 fi
8271 fi
8272
8273 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8274 eval flag=\"$thread_safe_flag_spec\"
8275 func_append linker_flags " $flag"
8276 fi
8277
8278 # Make a backup of the uninstalled library when relinking
8279 if test "$opt_mode" = relink; then
8280 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8281 fi
8282
8283 # Do each of the archive commands.
8284 if test "$module" = yes && test -n "$module_cmds" ; then
8285 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8286 eval test_cmds=\"$module_expsym_cmds\"
8287 cmds=$module_expsym_cmds
8288 else
8289 eval test_cmds=\"$module_cmds\"
8290 cmds=$module_cmds
8291 fi
8292 else
8293 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8294 eval test_cmds=\"$archive_expsym_cmds\"
8295 cmds=$archive_expsym_cmds
8296 else
8297 eval test_cmds=\"$archive_cmds\"
8298 cmds=$archive_cmds
8299 fi
8300 fi
8301
8302 if test "X$skipped_export" != "X:" &&
8303 func_len " $test_cmds" &&
8304 len=$func_len_result &&
8305 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8306 :
8307 else
8308 # The command line is too long to link in one step, link piecewise
8309 # or, if using GNU ld and skipped_export is not :, use a linker
8310 # script.
8311
8312 # Save the value of $output and $libobjs because we want to
8313 # use them later. If we have whole_archive_flag_spec, we
8314 # want to use save_libobjs as it was before
8315 # whole_archive_flag_spec was expanded, because we can't
8316 # assume the linker understands whole_archive_flag_spec.
8317 # This may have to be revisited, in case too many
8318 # convenience libraries get linked in and end up exceeding
8319 # the spec.
8320 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8321 save_libobjs=$libobjs
8322 fi
8323 save_output=$output
8324 func_basename "$output"
8325 output_la=$func_basename_result
8326
8327 # Clear the reloadable object creation command queue and
8328 # initialize k to one.
8329 test_cmds=
8330 concat_cmds=
8331 objlist=
8332 last_robj=
8333 k=1
8334
8335 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8336 output=${output_objdir}/${output_la}.lnkscript
8337 func_verbose "creating GNU ld script: $output"
8338 echo 'INPUT (' > $output
8339 for obj in $save_libobjs
8340 do
8341 func_to_tool_file "$obj"
8342 $ECHO "$func_to_tool_file_result" >> $output
8343 done
8344 echo ')' >> $output
8345 func_append delfiles " $output"
8346 func_to_tool_file "$output"
8347 output=$func_to_tool_file_result
8348 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8349 output=${output_objdir}/${output_la}.lnk
8350 func_verbose "creating linker input file list: $output"
8351 : > $output
8352 set x $save_libobjs
8353 shift
8354 firstobj=
8355 if test "$compiler_needs_object" = yes; then
8356 firstobj="$1 "
8357 shift
8358 fi
8359 for obj
8360 do
8361 func_to_tool_file "$obj"
8362 $ECHO "$func_to_tool_file_result" >> $output
8363 done
8364 func_append delfiles " $output"
8365 func_to_tool_file "$output"
8366 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8367 else
8368 if test -n "$save_libobjs"; then
8369 func_verbose "creating reloadable object files..."
8370 output=$output_objdir/$output_la-${k}.$objext
8371 eval test_cmds=\"$reload_cmds\"
8372 func_len " $test_cmds"
8373 len0=$func_len_result
8374 len=$len0
8375
8376 # Loop over the list of objects to be linked.
8377 for obj in $save_libobjs
8378 do
8379 func_len " $obj"
8380 func_arith $len + $func_len_result
8381 len=$func_arith_result
8382 if test "X$objlist" = X ||
8383 test "$len" -lt "$max_cmd_len"; then
8384 func_append objlist " $obj"
8385 else
8386 # The command $test_cmds is almost too long, add a
8387 # command to the queue.
8388 if test "$k" -eq 1 ; then
8389 # The first file doesn't have a previous command to add.
8390 reload_objs=$objlist
8391 eval concat_cmds=\"$reload_cmds\"
8392 else
8393 # All subsequent reloadable object files will link in
8394 # the last one created.
8395 reload_objs="$objlist $last_robj"
8396 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8397 fi
8398 last_robj=$output_objdir/$output_la-${k}.$objext
8399 func_arith $k + 1
8400 k=$func_arith_result
8401 output=$output_objdir/$output_la-${k}.$objext
8402 objlist=" $obj"
8403 func_len " $last_robj"
8404 func_arith $len0 + $func_len_result
8405 len=$func_arith_result
8406 fi
8407 done
8408 # Handle the remaining objects by creating one last
8409 # reloadable object file. All subsequent reloadable object
8410 # files will link in the last one created.
8411 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8412 reload_objs="$objlist $last_robj"
8413 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8414 if test -n "$last_robj"; then
8415 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8416 fi
8417 func_append delfiles " $output"
8418
8419 else
8420 output=
8421 fi
8422
8423 if ${skipped_export-false}; then
8424 func_verbose "generating symbol list for \`$libname.la'"
8425 export_symbols="$output_objdir/$libname.exp"
8426 $opt_dry_run || $RM $export_symbols
8427 libobjs=$output
8428 # Append the command to create the export file.
8429 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8430 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8431 if test -n "$last_robj"; then
8432 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8433 fi
8434 fi
8435
8436 test -n "$save_libobjs" &&
8437 func_verbose "creating a temporary reloadable object file: $output"
8438
8439 # Loop through the commands generated above and execute them.
8440 save_ifs="$IFS"; IFS='~'
8441 for cmd in $concat_cmds; do
8442 IFS="$save_ifs"
8443 $opt_silent || {
8444 func_quote_for_expand "$cmd"
8445 eval "func_echo $func_quote_for_expand_result"
8446 }
8447 $opt_dry_run || eval "$cmd" || {
8448 lt_exit=$?
8449
8450 # Restore the uninstalled library and exit
8451 if test "$opt_mode" = relink; then
8452 ( cd "$output_objdir" && \
8453 $RM "${realname}T" && \
8454 $MV "${realname}U" "$realname" )
8455 fi
8456
8457 exit $lt_exit
8458 }
8459 done
8460 IFS="$save_ifs"
8461
8462 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8463 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8464 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8465 fi
8466 fi
8467
8468 if ${skipped_export-false}; then
8469 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8470 tmp_export_symbols="$export_symbols"
8471 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8472 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8473 fi
8474
8475 if test -n "$orig_export_symbols"; then
8476 # The given exports_symbols file has to be filtered, so filter it.
8477 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8478 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8479 # 's' commands which not all seds can handle. GNU sed should be fine
8480 # though. Also, the filter scales superlinearly with the number of
8481 # global variables. join(1) would be nice here, but unfortunately
8482 # isn't a blessed tool.
8483 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8484 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8485 export_symbols=$output_objdir/$libname.def
8486 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8487 fi
8488 fi
8489
8490 libobjs=$output
8491 # Restore the value of output.
8492 output=$save_output
8493
8494 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8495 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8496 test "X$libobjs" = "X " && libobjs=
8497 fi
8498 # Expand the library linking commands again to reset the
8499 # value of $libobjs for piecewise linking.
8500
8501 # Do each of the archive commands.
8502 if test "$module" = yes && test -n "$module_cmds" ; then
8503 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8504 cmds=$module_expsym_cmds
8505 else
8506 cmds=$module_cmds
8507 fi
8508 else
8509 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8510 cmds=$archive_expsym_cmds
8511 else
8512 cmds=$archive_cmds
8513 fi
8514 fi
8515 fi
8516
8517 if test -n "$delfiles"; then
8518 # Append the command to remove temporary files to $cmds.
8519 eval cmds=\"\$cmds~\$RM $delfiles\"
8520 fi
8521
8522 # Add any objects from preloaded convenience libraries
8523 if test -n "$dlprefiles"; then
8524 gentop="$output_objdir/${outputname}x"
8525 func_append generated " $gentop"
8526
8527 func_extract_archives $gentop $dlprefiles
8528 func_append libobjs " $func_extract_archives_result"
8529 test "X$libobjs" = "X " && libobjs=
8530 fi
8531
8532 save_ifs="$IFS"; IFS='~'
8533 for cmd in $cmds; do
8534 IFS="$save_ifs"
8535 eval cmd=\"$cmd\"
8536 $opt_silent || {
8537 func_quote_for_expand "$cmd"
8538 eval "func_echo $func_quote_for_expand_result"
8539 }
8540 $opt_dry_run || eval "$cmd" || {
8541 lt_exit=$?
8542
8543 # Restore the uninstalled library and exit
8544 if test "$opt_mode" = relink; then
8545 ( cd "$output_objdir" && \
8546 $RM "${realname}T" && \
8547 $MV "${realname}U" "$realname" )
8548 fi
8549
8550 exit $lt_exit
8551 }
8552 done
8553 IFS="$save_ifs"
8554
8555 # Restore the uninstalled library and exit
8556 if test "$opt_mode" = relink; then
8557 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8558
8559 if test -n "$convenience"; then
8560 if test -z "$whole_archive_flag_spec"; then
8561 func_show_eval '${RM}r "$gentop"'
8562 fi
8563 fi
8564
8565 exit $EXIT_SUCCESS
8566 fi
8567
8568 # Create links to the real library.
8569 for linkname in $linknames; do
8570 if test "$realname" != "$linkname"; then
8571 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
8572 fi
8573 done
8574
8575 # If -module or -export-dynamic was specified, set the dlname.
8576 if test "$module" = yes || test "$export_dynamic" = yes; then
8577 # On all known operating systems, these are identical.
8578 dlname="$soname"
8579 fi
8580 fi
8581 ;;
8582
8583 obj)
8584 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8585 func_warning "\`-dlopen' is ignored for objects"
8586 fi
8587
8588 case " $deplibs" in
8589 *\ -l* | *\ -L*)
8590 func_warning "\`-l' and \`-L' are ignored for objects" ;;
8591 esac
8592
8593 test -n "$rpath" && \
8594 func_warning "\`-rpath' is ignored for objects"
8595
8596 test -n "$xrpath" && \
8597 func_warning "\`-R' is ignored for objects"
8598
8599 test -n "$vinfo" && \
8600 func_warning "\`-version-info' is ignored for objects"
8601
8602 test -n "$release" && \
8603 func_warning "\`-release' is ignored for objects"
8604
8605 case $output in
8606 *.lo)
8607 test -n "$objs$old_deplibs" && \
8608 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
8609
8610 libobj=$output
8611 func_lo2o "$libobj"
8612 obj=$func_lo2o_result
8613 ;;
8614 *)
8615 libobj=
8616 obj="$output"
8617 ;;
8618 esac
8619
8620 # Delete the old objects.
8621 $opt_dry_run || $RM $obj $libobj
8622
8623 # Objects from convenience libraries. This assumes
8624 # single-version convenience libraries. Whenever we create
8625 # different ones for PIC/non-PIC, this we'll have to duplicate
8626 # the extraction.
8627 reload_conv_objs=
8628 gentop=
8629 # reload_cmds runs $LD directly, so let us get rid of
8630 # -Wl from whole_archive_flag_spec and hope we can get by with
8631 # turning comma into space..
8632 wl=
8633
8634 if test -n "$convenience"; then
8635 if test -n "$whole_archive_flag_spec"; then
8636 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8637 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8638 else
8639 gentop="$output_objdir/${obj}x"
8640 func_append generated " $gentop"
8641
8642 func_extract_archives $gentop $convenience
8643 reload_conv_objs="$reload_objs $func_extract_archives_result"
8644 fi
8645 fi
8646
8647 # If we're not building shared, we need to use non_pic_objs
8648 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
8649
8650 # Create the old-style object.
8651 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8652
8653 output="$obj"
8654 func_execute_cmds "$reload_cmds" 'exit $?'
8655
8656 # Exit if we aren't doing a library object file.
8657 if test -z "$libobj"; then
8658 if test -n "$gentop"; then
8659 func_show_eval '${RM}r "$gentop"'
8660 fi
8661
8662 exit $EXIT_SUCCESS
8663 fi
8664
8665 if test "$build_libtool_libs" != yes; then
8666 if test -n "$gentop"; then
8667 func_show_eval '${RM}r "$gentop"'
8668 fi
8669
8670 # Create an invalid libtool object if no PIC, so that we don't
8671 # accidentally link it into a program.
8672 # $show "echo timestamp > $libobj"
8673 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8674 exit $EXIT_SUCCESS
8675 fi
8676
8677 if test -n "$pic_flag" || test "$pic_mode" != default; then
8678 # Only do commands if we really have different PIC objects.
8679 reload_objs="$libobjs $reload_conv_objs"
8680 output="$libobj"
8681 func_execute_cmds "$reload_cmds" 'exit $?'
8682 fi
8683
8684 if test -n "$gentop"; then
8685 func_show_eval '${RM}r "$gentop"'
8686 fi
8687
8688 exit $EXIT_SUCCESS
8689 ;;
8690
8691 prog)
8692 case $host in
8693 *cygwin*) func_stripname '' '.exe' "$output"
8694 output=$func_stripname_result.exe;;
8695 esac
8696 test -n "$vinfo" && \
8697 func_warning "\`-version-info' is ignored for programs"
8698
8699 test -n "$release" && \
8700 func_warning "\`-release' is ignored for programs"
8701
8702 test "$preload" = yes \
8703 && test "$dlopen_support" = unknown \
8704 && test "$dlopen_self" = unknown \
8705 && test "$dlopen_self_static" = unknown && \
8706 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8707
8708 case $host in
8709 *-*-rhapsody* | *-*-darwin1.[012])
8710 # On Rhapsody replace the C library is the System framework
8711 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
8712 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
8713 ;;
8714 esac
8715
8716 case $host in
8717 *-*-darwin*)
8718 # Don't allow lazy linking, it breaks C++ global constructors
8719 # But is supposedly fixed on 10.4 or later (yay!).
8720 if test "$tagname" = CXX ; then
8721 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8722 10.[0123])
8723 func_append compile_command " ${wl}-bind_at_load"
8724 func_append finalize_command " ${wl}-bind_at_load"
8725 ;;
8726 esac
8727 fi
8728 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8729 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8730 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8731 ;;
8732 esac
8733
8734
8735 # move library search paths that coincide with paths to not yet
8736 # installed libraries to the beginning of the library search list
8737 new_libs=
8738 for path in $notinst_path; do
8739 case " $new_libs " in
8740 *" -L$path/$objdir "*) ;;
8741 *)
8742 case " $compile_deplibs " in
8743 *" -L$path/$objdir "*)
8744 func_append new_libs " -L$path/$objdir" ;;
8745 esac
8746 ;;
8747 esac
8748 done
8749 for deplib in $compile_deplibs; do
8750 case $deplib in
8751 -L*)
8752 case " $new_libs " in
8753 *" $deplib "*) ;;
8754 *) func_append new_libs " $deplib" ;;
8755 esac
8756 ;;
8757 *) func_append new_libs " $deplib" ;;
8758 esac
8759 done
8760 compile_deplibs="$new_libs"
8761
8762
8763 func_append compile_command " $compile_deplibs"
8764 func_append finalize_command " $finalize_deplibs"
8765
8766 if test -n "$rpath$xrpath"; then
8767 # If the user specified any rpath flags, then add them.
8768 for libdir in $rpath $xrpath; do
8769 # This is the magic to use -rpath.
8770 case "$finalize_rpath " in
8771 *" $libdir "*) ;;
8772 *) func_append finalize_rpath " $libdir" ;;
8773 esac
8774 done
8775 fi
8776
8777 # Now hardcode the library paths
8778 rpath=
8779 hardcode_libdirs=
8780 for libdir in $compile_rpath $finalize_rpath; do
8781 if test -n "$hardcode_libdir_flag_spec"; then
8782 if test -n "$hardcode_libdir_separator"; then
8783 if test -z "$hardcode_libdirs"; then
8784 hardcode_libdirs="$libdir"
8785 else
8786 # Just accumulate the unique libdirs.
8787 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8788 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8789 ;;
8790 *)
8791 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8792 ;;
8793 esac
8794 fi
8795 else
8796 eval flag=\"$hardcode_libdir_flag_spec\"
8797 func_append rpath " $flag"
8798 fi
8799 elif test -n "$runpath_var"; then
8800 case "$perm_rpath " in
8801 *" $libdir "*) ;;
8802 *) func_append perm_rpath " $libdir" ;;
8803 esac
8804 fi
8805 case $host in
8806 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8807 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8808 case :$dllsearchpath: in
8809 *":$libdir:"*) ;;
8810 ::) dllsearchpath=$libdir;;
8811 *) func_append dllsearchpath ":$libdir";;
8812 esac
8813 case :$dllsearchpath: in
8814 *":$testbindir:"*) ;;
8815 ::) dllsearchpath=$testbindir;;
8816 *) func_append dllsearchpath ":$testbindir";;
8817 esac
8818 ;;
8819 esac
8820 done
8821 # Substitute the hardcoded libdirs into the rpath.
8822 if test -n "$hardcode_libdir_separator" &&
8823 test -n "$hardcode_libdirs"; then
8824 libdir="$hardcode_libdirs"
8825 eval rpath=\" $hardcode_libdir_flag_spec\"
8826 fi
8827 compile_rpath="$rpath"
8828
8829 rpath=
8830 hardcode_libdirs=
8831 for libdir in $finalize_rpath; do
8832 if test -n "$hardcode_libdir_flag_spec"; then
8833 if test -n "$hardcode_libdir_separator"; then
8834 if test -z "$hardcode_libdirs"; then
8835 hardcode_libdirs="$libdir"
8836 else
8837 # Just accumulate the unique libdirs.
8838 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8839 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8840 ;;
8841 *)
8842 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8843 ;;
8844 esac
8845 fi
8846 else
8847 eval flag=\"$hardcode_libdir_flag_spec\"
8848 func_append rpath " $flag"
8849 fi
8850 elif test -n "$runpath_var"; then
8851 case "$finalize_perm_rpath " in
8852 *" $libdir "*) ;;
8853 *) func_append finalize_perm_rpath " $libdir" ;;
8854 esac
8855 fi
8856 done
8857 # Substitute the hardcoded libdirs into the rpath.
8858 if test -n "$hardcode_libdir_separator" &&
8859 test -n "$hardcode_libdirs"; then
8860 libdir="$hardcode_libdirs"
8861 eval rpath=\" $hardcode_libdir_flag_spec\"
8862 fi
8863 finalize_rpath="$rpath"
8864
8865 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8866 # Transform all the library objects into standard objects.
8867 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8868 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8869 fi
8870
8871 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8872
8873 # template prelinking step
8874 if test -n "$prelink_cmds"; then
8875 func_execute_cmds "$prelink_cmds" 'exit $?'
8876 fi
8877
8878 wrappers_required=yes
8879 case $host in
8880 *cegcc* | *mingw32ce*)
8881 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8882 wrappers_required=no
8883 ;;
8884 *cygwin* | *mingw* )
8885 if test "$build_libtool_libs" != yes; then
8886 wrappers_required=no
8887 fi
8888 ;;
8889 *)
8890 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8891 wrappers_required=no
8892 fi
8893 ;;
8894 esac
8895 if test "$wrappers_required" = no; then
8896 # Replace the output file specification.
8897 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8898 link_command="$compile_command$compile_rpath"
8899
8900 # We have no uninstalled library dependencies, so finalize right now.
8901 exit_status=0
8902 func_show_eval "$link_command" 'exit_status=$?'
8903
8904 if test -n "$postlink_cmds"; then
8905 func_to_tool_file "$output"
8906 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8907 func_execute_cmds "$postlink_cmds" 'exit $?'
8908 fi
8909
8910 # Delete the generated files.
8911 if test -f "$output_objdir/${outputname}S.${objext}"; then
8912 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8913 fi
8914
8915 exit $exit_status
8916 fi
8917
8918 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8919 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8920 fi
8921 if test -n "$finalize_shlibpath"; then
8922 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8923 fi
8924
8925 compile_var=
8926 finalize_var=
8927 if test -n "$runpath_var"; then
8928 if test -n "$perm_rpath"; then
8929 # We should set the runpath_var.
8930 rpath=
8931 for dir in $perm_rpath; do
8932 func_append rpath "$dir:"
8933 done
8934 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8935 fi
8936 if test -n "$finalize_perm_rpath"; then
8937 # We should set the runpath_var.
8938 rpath=
8939 for dir in $finalize_perm_rpath; do
8940 func_append rpath "$dir:"
8941 done
8942 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8943 fi
8944 fi
8945
8946 if test "$no_install" = yes; then
8947 # We don't need to create a wrapper script.
8948 link_command="$compile_var$compile_command$compile_rpath"
8949 # Replace the output file specification.
8950 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8951 # Delete the old output file.
8952 $opt_dry_run || $RM $output
8953 # Link the executable and exit
8954 func_show_eval "$link_command" 'exit $?'
8955
8956 if test -n "$postlink_cmds"; then
8957 func_to_tool_file "$output"
8958 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8959 func_execute_cmds "$postlink_cmds" 'exit $?'
8960 fi
8961
8962 exit $EXIT_SUCCESS
8963 fi
8964
8965 if test "$hardcode_action" = relink; then
8966 # Fast installation is not supported
8967 link_command="$compile_var$compile_command$compile_rpath"
8968 relink_command="$finalize_var$finalize_command$finalize_rpath"
8969
8970 func_warning "this platform does not like uninstalled shared libraries"
8971 func_warning "\`$output' will be relinked during installation"
8972 else
8973 if test "$fast_install" != no; then
8974 link_command="$finalize_var$compile_command$finalize_rpath"
8975 if test "$fast_install" = yes; then
8976 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8977 else
8978 # fast_install is set to needless
8979 relink_command=
8980 fi
8981 else
8982 link_command="$compile_var$compile_command$compile_rpath"
8983 relink_command="$finalize_var$finalize_command$finalize_rpath"
8984 fi
8985 fi
8986
8987 # Replace the output file specification.
8988 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8989
8990 # Delete the old output files.
8991 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8992
8993 func_show_eval "$link_command" 'exit $?'
8994
8995 if test -n "$postlink_cmds"; then
8996 func_to_tool_file "$output_objdir/$outputname"
8997 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8998 func_execute_cmds "$postlink_cmds" 'exit $?'
8999 fi
9000
9001 # Now create the wrapper script.
9002 func_verbose "creating $output"
9003
9004 # Quote the relink command for shipping.
9005 if test -n "$relink_command"; then
9006 # Preserve any variables that may affect compiler behavior
9007 for var in $variables_saved_for_relink; do
9008 if eval test -z \"\${$var+set}\"; then
9009 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9010 elif eval var_value=\$$var; test -z "$var_value"; then
9011 relink_command="$var=; export $var; $relink_command"
9012 else
9013 func_quote_for_eval "$var_value"
9014 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9015 fi
9016 done
9017 relink_command="(cd `pwd`; $relink_command)"
9018 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9019 fi
9020
9021 # Only actually do things if not in dry run mode.
9022 $opt_dry_run || {
9023 # win32 will think the script is a binary if it has
9024 # a .exe suffix, so we strip it off here.
9025 case $output in
9026 *.exe) func_stripname '' '.exe' "$output"
9027 output=$func_stripname_result ;;
9028 esac
9029 # test for cygwin because mv fails w/o .exe extensions
9030 case $host in
9031 *cygwin*)
9032 exeext=.exe
9033 func_stripname '' '.exe' "$outputname"
9034 outputname=$func_stripname_result ;;
9035 *) exeext= ;;
9036 esac
9037 case $host in
9038 *cygwin* | *mingw* )
9039 func_dirname_and_basename "$output" "" "."
9040 output_name=$func_basename_result
9041 output_path=$func_dirname_result
9042 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9043 cwrapper="$output_path/$output_name.exe"
9044 $RM $cwrappersource $cwrapper
9045 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9046
9047 func_emit_cwrapperexe_src > $cwrappersource
9048
9049 # The wrapper executable is built using the $host compiler,
9050 # because it contains $host paths and files. If cross-
9051 # compiling, it, like the target executable, must be
9052 # executed on the $host or under an emulation environment.
9053 $opt_dry_run || {
9054 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9055 $STRIP $cwrapper
9056 }
9057
9058 # Now, create the wrapper script for func_source use:
9059 func_ltwrapper_scriptname $cwrapper
9060 $RM $func_ltwrapper_scriptname_result
9061 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9062 $opt_dry_run || {
9063 # note: this script will not be executed, so do not chmod.
9064 if test "x$build" = "x$host" ; then
9065 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9066 else
9067 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9068 fi
9069 }
9070 ;;
9071 * )
9072 $RM $output
9073 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9074
9075 func_emit_wrapper no > $output
9076 chmod +x $output
9077 ;;
9078 esac
9079 }
9080 exit $EXIT_SUCCESS
9081 ;;
9082 esac
9083
9084 # See if we need to build an old-fashioned archive.
9085 for oldlib in $oldlibs; do
9086
9087 if test "$build_libtool_libs" = convenience; then
9088 oldobjs="$libobjs_save $symfileobj"
9089 addlibs="$convenience"
9090 build_libtool_libs=no
9091 else
9092 if test "$build_libtool_libs" = module; then
9093 oldobjs="$libobjs_save"
9094 build_libtool_libs=no
9095 else
9096 oldobjs="$old_deplibs $non_pic_objects"
9097 if test "$preload" = yes && test -f "$symfileobj"; then
9098 func_append oldobjs " $symfileobj"
9099 fi
9100 fi
9101 addlibs="$old_convenience"
9102 fi
9103
9104 if test -n "$addlibs"; then
9105 gentop="$output_objdir/${outputname}x"
9106 func_append generated " $gentop"
9107
9108 func_extract_archives $gentop $addlibs
9109 func_append oldobjs " $func_extract_archives_result"
9110 fi
9111
9112 # Do each command in the archive commands.
9113 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9114 cmds=$old_archive_from_new_cmds
9115 else
9116
9117 # Add any objects from preloaded convenience libraries
9118 if test -n "$dlprefiles"; then
9119 gentop="$output_objdir/${outputname}x"
9120 func_append generated " $gentop"
9121
9122 func_extract_archives $gentop $dlprefiles
9123 func_append oldobjs " $func_extract_archives_result"
9124 fi
9125
9126 # POSIX demands no paths to be encoded in archives. We have
9127 # to avoid creating archives with duplicate basenames if we
9128 # might have to extract them afterwards, e.g., when creating a
9129 # static archive out of a convenience library, or when linking
9130 # the entirety of a libtool archive into another (currently
9131 # not supported by libtool).
9132 if (for obj in $oldobjs
9133 do
9134 func_basename "$obj"
9135 $ECHO "$func_basename_result"
9136 done | sort | sort -uc >/dev/null 2>&1); then
9137 :
9138 else
9139 echo "copying selected object files to avoid basename conflicts..."
9140 gentop="$output_objdir/${outputname}x"
9141 func_append generated " $gentop"
9142 func_mkdir_p "$gentop"
9143 save_oldobjs=$oldobjs
9144 oldobjs=
9145 counter=1
9146 for obj in $save_oldobjs
9147 do
9148 func_basename "$obj"
9149 objbase="$func_basename_result"
9150 case " $oldobjs " in
9151 " ") oldobjs=$obj ;;
9152 *[\ /]"$objbase "*)
9153 while :; do
9154 # Make sure we don't pick an alternate name that also
9155 # overlaps.
9156 newobj=lt$counter-$objbase
9157 func_arith $counter + 1
9158 counter=$func_arith_result
9159 case " $oldobjs " in
9160 *[\ /]"$newobj "*) ;;
9161 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9162 esac
9163 done
9164 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9165 func_append oldobjs " $gentop/$newobj"
9166 ;;
9167 *) func_append oldobjs " $obj" ;;
9168 esac
9169 done
9170 fi
9171 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
9172 tool_oldlib=$func_to_tool_file_result
9173 eval cmds=\"$old_archive_cmds\"
9174
9175 func_len " $cmds"
9176 len=$func_len_result
9177 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9178 cmds=$old_archive_cmds
9179 elif test -n "$archiver_list_spec"; then
9180 func_verbose "using command file archive linking..."
9181 for obj in $oldobjs
9182 do
9183 func_to_tool_file "$obj"
9184 $ECHO "$func_to_tool_file_result"
9185 done > $output_objdir/$libname.libcmd
9186 func_to_tool_file "$output_objdir/$libname.libcmd"
9187 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9188 cmds=$old_archive_cmds
9189 else
9190 # the command line is too long to link in one step, link in parts
9191 func_verbose "using piecewise archive linking..."
9192 save_RANLIB=$RANLIB
9193 RANLIB=:
9194 objlist=
9195 concat_cmds=
9196 save_oldobjs=$oldobjs
9197 oldobjs=
9198 # Is there a better way of finding the last object in the list?
9199 for obj in $save_oldobjs
9200 do
9201 last_oldobj=$obj
9202 done
9203 eval test_cmds=\"$old_archive_cmds\"
9204 func_len " $test_cmds"
9205 len0=$func_len_result
9206 len=$len0
9207 for obj in $save_oldobjs
9208 do
9209 func_len " $obj"
9210 func_arith $len + $func_len_result
9211 len=$func_arith_result
9212 func_append objlist " $obj"
9213 if test "$len" -lt "$max_cmd_len"; then
9214 :
9215 else
9216 # the above command should be used before it gets too long
9217 oldobjs=$objlist
9218 if test "$obj" = "$last_oldobj" ; then
9219 RANLIB=$save_RANLIB
9220 fi
9221 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9222 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9223 objlist=
9224 len=$len0
9225 fi
9226 done
9227 RANLIB=$save_RANLIB
9228 oldobjs=$objlist
9229 if test "X$oldobjs" = "X" ; then
9230 eval cmds=\"\$concat_cmds\"
9231 else
9232 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9233 fi
9234 fi
9235 fi
9236 func_execute_cmds "$cmds" 'exit $?'
9237 done
9238
9239 test -n "$generated" && \
9240 func_show_eval "${RM}r$generated"
9241
9242 # Now create the libtool archive.
9243 case $output in
9244 *.la)
9245 old_library=
9246 test "$build_old_libs" = yes && old_library="$libname.$libext"
9247 func_verbose "creating $output"
9248
9249 # Preserve any variables that may affect compiler behavior
9250 for var in $variables_saved_for_relink; do
9251 if eval test -z \"\${$var+set}\"; then
9252 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9253 elif eval var_value=\$$var; test -z "$var_value"; then
9254 relink_command="$var=; export $var; $relink_command"
9255 else
9256 func_quote_for_eval "$var_value"
9257 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9258 fi
9259 done
9260 # Quote the link command for shipping.
9261 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9262 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9263 if test "$hardcode_automatic" = yes ; then
9264 relink_command=
9265 fi
9266
9267 # Only create the output if not a dry run.
9268 $opt_dry_run || {
9269 for installed in no yes; do
9270 if test "$installed" = yes; then
9271 if test -z "$install_libdir"; then
9272 break
9273 fi
9274 output="$output_objdir/$outputname"i
9275 # Replace all uninstalled libtool libraries with the installed ones
9276 newdependency_libs=
9277 for deplib in $dependency_libs; do
9278 case $deplib in
9279 *.la)
9280 func_basename "$deplib"
9281 name="$func_basename_result"
9282 func_resolve_sysroot "$deplib"
9283 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9284 test -z "$libdir" && \
9285 func_fatal_error "\`$deplib' is not a valid libtool archive"
9286 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9287 ;;
9288 -L*)
9289 func_stripname -L '' "$deplib"
9290 func_replace_sysroot "$func_stripname_result"
9291 func_append newdependency_libs " -L$func_replace_sysroot_result"
9292 ;;
9293 -R*)
9294 func_stripname -R '' "$deplib"
9295 func_replace_sysroot "$func_stripname_result"
9296 func_append newdependency_libs " -R$func_replace_sysroot_result"
9297 ;;
9298 *) func_append newdependency_libs " $deplib" ;;
9299 esac
9300 done
9301 dependency_libs="$newdependency_libs"
9302 newdlfiles=
9303
9304 for lib in $dlfiles; do
9305 case $lib in
9306 *.la)
9307 func_basename "$lib"
9308 name="$func_basename_result"
9309 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9310 test -z "$libdir" && \
9311 func_fatal_error "\`$lib' is not a valid libtool archive"
9312 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9313 ;;
9314 *) func_append newdlfiles " $lib" ;;
9315 esac
9316 done
9317 dlfiles="$newdlfiles"
9318 newdlprefiles=
9319 for lib in $dlprefiles; do
9320 case $lib in
9321 *.la)
9322 # Only pass preopened files to the pseudo-archive (for
9323 # eventual linking with the app. that links it) if we
9324 # didn't already link the preopened objects directly into
9325 # the library:
9326 func_basename "$lib"
9327 name="$func_basename_result"
9328 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9329 test -z "$libdir" && \
9330 func_fatal_error "\`$lib' is not a valid libtool archive"
9331 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9332 ;;
9333 esac
9334 done
9335 dlprefiles="$newdlprefiles"
9336 else
9337 newdlfiles=
9338 for lib in $dlfiles; do
9339 case $lib in
9340 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9341 *) abs=`pwd`"/$lib" ;;
9342 esac
9343 func_append newdlfiles " $abs"
9344 done
9345 dlfiles="$newdlfiles"
9346 newdlprefiles=
9347 for lib in $dlprefiles; do
9348 case $lib in
9349 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9350 *) abs=`pwd`"/$lib" ;;
9351 esac
9352 func_append newdlprefiles " $abs"
9353 done
9354 dlprefiles="$newdlprefiles"
9355 fi
9356 $RM $output
9357 # place dlname in correct position for cygwin
9358 # In fact, it would be nice if we could use this code for all target
9359 # systems that can't hard-code library paths into their executables
9360 # and that have no shared library path variable independent of PATH,
9361 # but it turns out we can't easily determine that from inspecting
9362 # libtool variables, so we have to hard-code the OSs to which it
9363 # applies here; at the moment, that means platforms that use the PE
9364 # object format with DLL files. See the long comment at the top of
9365 # tests/bindir.at for full details.
9366 tdlname=$dlname
9367 case $host,$output,$installed,$module,$dlname in
9368 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9369 # If a -bindir argument was supplied, place the dll there.
9370 if test "x$bindir" != x ;
9371 then
9372 func_relative_path "$install_libdir" "$bindir"
9373 tdlname=$func_relative_path_result$dlname
9374 else
9375 # Otherwise fall back on heuristic.
9376 tdlname=../bin/$dlname
9377 fi
9378 ;;
9379 esac
9380 $ECHO > $output "\
9381# $outputname - a libtool library file
9382# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9383#
9384# Please DO NOT delete this file!
9385# It is necessary for linking the library.
9386
9387# The name that we can dlopen(3).
9388dlname='$tdlname'
9389
9390# Names of this library.
9391library_names='$library_names'
9392
9393# The name of the static archive.
9394old_library='$old_library'
9395
9396# Linker flags that can not go in dependency_libs.
9397inherited_linker_flags='$new_inherited_linker_flags'
9398
9399# Libraries that this one depends upon.
9400dependency_libs='$dependency_libs'
9401
9402# Names of additional weak libraries provided by this library
9403weak_library_names='$weak_libs'
9404
9405# Version information for $libname.
9406current=$current
9407age=$age
9408revision=$revision
9409
9410# Is this an already installed library?
9411installed=$installed
9412
9413# Should we warn about portability when linking against -modules?
9414shouldnotlink=$module
9415
9416# Files to dlopen/dlpreopen
9417dlopen='$dlfiles'
9418dlpreopen='$dlprefiles'
9419
9420# Directory that this library needs to be installed in:
9421libdir='$install_libdir'"
9422 if test "$installed" = no && test "$need_relink" = yes; then
9423 $ECHO >> $output "\
9424relink_command=\"$relink_command\""
9425 fi
9426 done
9427 }
9428
9429 # Do a symbolic link so that the libtool archive can be found in
9430 # LD_LIBRARY_PATH before the program is installed.
9431 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9432 ;;
9433 esac
9434 exit $EXIT_SUCCESS
9435}
9436
9437{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9438 func_mode_link ${1+"$@"}
9439
9440
9441# func_mode_uninstall arg...
9442func_mode_uninstall ()
9443{
9444 $opt_debug
9445 RM="$nonopt"
9446 files=
9447 rmforce=
9448 exit_status=0
9449
9450 # This variable tells wrapper scripts just to set variables rather
9451 # than running their programs.
9452 libtool_install_magic="$magic"
9453
9454 for arg
9455 do
9456 case $arg in
9457 -f) func_append RM " $arg"; rmforce=yes ;;
9458 -*) func_append RM " $arg" ;;
9459 *) func_append files " $arg" ;;
9460 esac
9461 done
9462
9463 test -z "$RM" && \
9464 func_fatal_help "you must specify an RM program"
9465
9466 rmdirs=
9467
9468 for file in $files; do
9469 func_dirname "$file" "" "."
9470 dir="$func_dirname_result"
9471 if test "X$dir" = X.; then
9472 odir="$objdir"
9473 else
9474 odir="$dir/$objdir"
9475 fi
9476 func_basename "$file"
9477 name="$func_basename_result"
9478 test "$opt_mode" = uninstall && odir="$dir"
9479
9480 # Remember odir for removal later, being careful to avoid duplicates
9481 if test "$opt_mode" = clean; then
9482 case " $rmdirs " in
9483 *" $odir "*) ;;
9484 *) func_append rmdirs " $odir" ;;
9485 esac
9486 fi
9487
9488 # Don't error if the file doesn't exist and rm -f was used.
9489 if { test -L "$file"; } >/dev/null 2>&1 ||
9490 { test -h "$file"; } >/dev/null 2>&1 ||
9491 test -f "$file"; then
9492 :
9493 elif test -d "$file"; then
9494 exit_status=1
9495 continue
9496 elif test "$rmforce" = yes; then
9497 continue
9498 fi
9499
9500 rmfiles="$file"
9501
9502 case $name in
9503 *.la)
9504 # Possibly a libtool archive, so verify it.
9505 if func_lalib_p "$file"; then
9506 func_source $dir/$name
9507
9508 # Delete the libtool libraries and symlinks.
9509 for n in $library_names; do
9510 func_append rmfiles " $odir/$n"
9511 done
9512 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9513
9514 case "$opt_mode" in
9515 clean)
9516 case " $library_names " in
9517 *" $dlname "*) ;;
9518 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9519 esac
9520 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9521 ;;
9522 uninstall)
9523 if test -n "$library_names"; then
9524 # Do each command in the postuninstall commands.
9525 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9526 fi
9527
9528 if test -n "$old_library"; then
9529 # Do each command in the old_postuninstall commands.
9530 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9531 fi
9532 # FIXME: should reinstall the best remaining shared library.
9533 ;;
9534 esac
9535 fi
9536 ;;
9537
9538 *.lo)
9539 # Possibly a libtool object, so verify it.
9540 if func_lalib_p "$file"; then
9541
9542 # Read the .lo file
9543 func_source $dir/$name
9544
9545 # Add PIC object to the list of files to remove.
9546 if test -n "$pic_object" &&
9547 test "$pic_object" != none; then
9548 func_append rmfiles " $dir/$pic_object"
9549 fi
9550
9551 # Add non-PIC object to the list of files to remove.
9552 if test -n "$non_pic_object" &&
9553 test "$non_pic_object" != none; then
9554 func_append rmfiles " $dir/$non_pic_object"
9555 fi
9556 fi
9557 ;;
9558
9559 *)
9560 if test "$opt_mode" = clean ; then
9561 noexename=$name
9562 case $file in
9563 *.exe)
9564 func_stripname '' '.exe' "$file"
9565 file=$func_stripname_result
9566 func_stripname '' '.exe' "$name"
9567 noexename=$func_stripname_result
9568 # $file with .exe has already been added to rmfiles,
9569 # add $file without .exe
9570 func_append rmfiles " $file"
9571 ;;
9572 esac
9573 # Do a test to see if this is a libtool program.
9574 if func_ltwrapper_p "$file"; then
9575 if func_ltwrapper_executable_p "$file"; then
9576 func_ltwrapper_scriptname "$file"
9577 relink_command=
9578 func_source $func_ltwrapper_scriptname_result
9579 func_append rmfiles " $func_ltwrapper_scriptname_result"
9580 else
9581 relink_command=
9582 func_source $dir/$noexename
9583 fi
9584
9585 # note $name still contains .exe if it was in $file originally
9586 # as does the version of $file that was added into $rmfiles
9587 func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
9588 if test "$fast_install" = yes && test -n "$relink_command"; then
9589 func_append rmfiles " $odir/lt-$name"
9590 fi
9591 if test "X$noexename" != "X$name" ; then
9592 func_append rmfiles " $odir/lt-${noexename}.c"
9593 fi
9594 fi
9595 fi
9596 ;;
9597 esac
9598 func_show_eval "$RM $rmfiles" 'exit_status=1'
9599 done
9600
9601 # Try to remove the ${objdir}s in the directories where we deleted files
9602 for dir in $rmdirs; do
9603 if test -d "$dir"; then
9604 func_show_eval "rmdir $dir >/dev/null 2>&1"
9605 fi
9606 done
9607
9608 exit $exit_status
9609}
9610
9611{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
9612 func_mode_uninstall ${1+"$@"}
9613
9614test -z "$opt_mode" && {
9615 help="$generic_help"
9616 func_fatal_help "you must specify a MODE"
9617}
9618
9619test -z "$exec_cmd" && \
9620 func_fatal_help "invalid operation mode \`$opt_mode'"
9621
9622if test -n "$exec_cmd"; then
9623 eval exec "$exec_cmd"
9624 exit $EXIT_FAILURE
9625fi
9626
9627exit $exit_status
9628
9629
9630# The TAGs below are defined such that we never get into a situation
9631# in which we disable both kinds of libraries. Given conflicting
9632# choices, we go for a static library, that is the most portable,
9633# since we can't tell whether shared libraries were disabled because
9634# the user asked for that or because the platform doesn't support
9635# them. This is particularly important on AIX, because we don't
9636# support having both static and shared libraries enabled at the same
9637# time on that platform, so we default to a shared-only configuration.
9638# If a disable-shared tag is given, we'll fallback to a static-only
9639# configuration. But we'll never go from static-only to shared-only.
9640
9641# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9642build_libtool_libs=no
9643build_old_libs=yes
9644# ### END LIBTOOL TAG CONFIG: disable-shared
9645
9646# ### BEGIN LIBTOOL TAG CONFIG: disable-static
9647build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9648# ### END LIBTOOL TAG CONFIG: disable-static
9649
9650# Local Variables:
9651# mode:shell-script
9652# sh-indentation:2
9653# End:
9654# vi:sw=2
9655
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makcjpeg.st b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makcjpeg.st
new file mode 100644
index 0000000..3cbad5e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makcjpeg.st
@@ -0,0 +1,36 @@
1; Project file for Independent JPEG Group's software
2;
3; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
4; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.
5;
6; To use this file, rename it to cjpeg.prj.
7; If you are using Turbo C, change filenames beginning with "pc..." to "tc..."
8; Read installation instructions before trying to make the program!
9;
10;
11; * * * Output file * * *
12cjpeg.ttp
13;
14; * * * COMPILER OPTIONS * * *
15.C[-P] ; absolute calls
16.C[-M] ; and no string merging, folks
17.C[-w-cln] ; no "constant is long" warnings
18.C[-w-par] ; no "parameter xxxx unused"
19.C[-w-rch] ; no "unreachable code"
20.C[-wsig] ; warn if significant digits may be lost
21=
22; * * * * List of modules * * * *
23pcstart.o
24cjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h)
25cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
26rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
27rdppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
28rdgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
29rdtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
30rdbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
31rdrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
32libjpeg.lib ; built by libjpeg.prj
33pcfltlib.lib ; floating point library
34; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED
35pcstdlib.lib ; standard library
36pcextlib.lib ; extended library
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makdjpeg.st b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makdjpeg.st
new file mode 100644
index 0000000..52179e3
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makdjpeg.st
@@ -0,0 +1,36 @@
1; Project file for Independent JPEG Group's software
2;
3; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
4; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.
5;
6; To use this file, rename it to djpeg.prj.
7; If you are using Turbo C, change filenames beginning with "pc..." to "tc..."
8; Read installation instructions before trying to make the program!
9;
10;
11; * * * Output file * * *
12djpeg.ttp
13;
14; * * * COMPILER OPTIONS * * *
15.C[-P] ; absolute calls
16.C[-M] ; and no string merging, folks
17.C[-w-cln] ; no "constant is long" warnings
18.C[-w-par] ; no "parameter xxxx unused"
19.C[-w-rch] ; no "unreachable code"
20.C[-wsig] ; warn if significant digits may be lost
21=
22; * * * * List of modules * * * *
23pcstart.o
24djpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h)
25cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
26rdcolmap.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
27wrppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
28wrgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
29wrtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
30wrbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
31wrrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
32libjpeg.lib ; built by libjpeg.prj
33pcfltlib.lib ; floating point library
34; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED
35pcstdlib.lib ; standard library
36pcextlib.lib ; extended library
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeadsw.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeadsw.vc6
new file mode 100644
index 0000000..9af6a19
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeadsw.vc6
@@ -0,0 +1,77 @@
1Microsoft Developer Studio Workspace File, Format Version 6.00
2# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
3
4###############################################################################
5
6Project: "cjpeg"=".\cjpeg.dsp" - Package Owner=<4>
7
8Package=<5>
9{{{
10}}}
11
12Package=<4>
13{{{
14}}}
15
16###############################################################################
17
18Project: "djpeg"=".\djpeg.dsp" - Package Owner=<4>
19
20Package=<5>
21{{{
22}}}
23
24Package=<4>
25{{{
26}}}
27
28###############################################################################
29
30Project: "jpegtran"=".\jpegtran.dsp" - Package Owner=<4>
31
32Package=<5>
33{{{
34}}}
35
36Package=<4>
37{{{
38}}}
39
40###############################################################################
41
42Project: "rdjpgcom"=".\rdjpgcom.dsp" - Package Owner=<4>
43
44Package=<5>
45{{{
46}}}
47
48Package=<4>
49{{{
50}}}
51
52###############################################################################
53
54Project: "wrjpgcom"=".\wrjpgcom.dsp" - Package Owner=<4>
55
56Package=<5>
57{{{
58}}}
59
60Package=<4>
61{{{
62}}}
63
64###############################################################################
65
66Global:
67
68Package=<5>
69{{{
70}}}
71
72Package=<3>
73{{{
74}}}
75
76###############################################################################
77
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeasln.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeasln.v10
new file mode 100644
index 0000000..f687301
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeasln.v10
@@ -0,0 +1,33 @@
1
2Microsoft Visual Studio Solution File, Format Version 11.00
3# Visual C++ Express 2010
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cjpeg", "cjpeg.vcxproj", "{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}"
5EndProject
6Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "djpeg", "djpeg.vcxproj", "{11043137-B453-4DFA-9010-4D2B9DC1545C}"
7EndProject
8Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpegtran", "jpegtran.vcxproj", "{025BAC50-51B5-4FFE-BC47-3F920BB4047E}"
9EndProject
10Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdjpgcom", "rdjpgcom.vcxproj", "{C81513DB-78DC-46BC-BC98-82E745203976}"
11EndProject
12Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrjpgcom", "wrjpgcom.vcxproj", "{B57065D4-DDDA-4668-BAF5-2D49270C973C}"
13EndProject
14Global
15 GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 Release|Win32 = Release|Win32
17 EndGlobalSection
18 GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32
20 {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32
21 {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32
22 {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32
23 {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32
24 {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32
25 {C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32
26 {C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32
27 {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32
28 {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32
29 EndGlobalSection
30 GlobalSection(SolutionProperties) = preSolution
31 HideSolutionNode = FALSE
32 EndGlobalSection
33EndGlobal
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdep.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdep.vc6
new file mode 100644
index 0000000..5436a59
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdep.vc6
@@ -0,0 +1,82 @@
1# Microsoft Developer Studio erstellte Abhängigkeitsdatei, einbezogen von cjpeg.mak
2
3.\cdjpeg.c : \
4 ".\cderror.h"\
5 ".\cdjpeg.h"\
6 ".\jconfig.h"\
7 ".\jerror.h"\
8 ".\jinclude.h"\
9 ".\jmorecfg.h"\
10 ".\jpeglib.h"\
11
12
13.\cjpeg.c : \
14 ".\cderror.h"\
15 ".\cdjpeg.h"\
16 ".\jconfig.h"\
17 ".\jerror.h"\
18 ".\jinclude.h"\
19 ".\jmorecfg.h"\
20 ".\jpeglib.h"\
21 ".\jversion.h"\
22
23
24.\rdbmp.c : \
25 ".\cderror.h"\
26 ".\cdjpeg.h"\
27 ".\jconfig.h"\
28 ".\jerror.h"\
29 ".\jinclude.h"\
30 ".\jmorecfg.h"\
31 ".\jpeglib.h"\
32
33
34.\rdgif.c : \
35 ".\cderror.h"\
36 ".\cdjpeg.h"\
37 ".\jconfig.h"\
38 ".\jerror.h"\
39 ".\jinclude.h"\
40 ".\jmorecfg.h"\
41 ".\jpeglib.h"\
42
43
44.\rdppm.c : \
45 ".\cderror.h"\
46 ".\cdjpeg.h"\
47 ".\jconfig.h"\
48 ".\jerror.h"\
49 ".\jinclude.h"\
50 ".\jmorecfg.h"\
51 ".\jpeglib.h"\
52
53
54.\rdrle.c : \
55 ".\cderror.h"\
56 ".\cdjpeg.h"\
57 ".\jconfig.h"\
58 ".\jerror.h"\
59 ".\jinclude.h"\
60 ".\jmorecfg.h"\
61 ".\jpeglib.h"\
62
63
64.\rdswitch.c : \
65 ".\cderror.h"\
66 ".\cdjpeg.h"\
67 ".\jconfig.h"\
68 ".\jerror.h"\
69 ".\jinclude.h"\
70 ".\jmorecfg.h"\
71 ".\jpeglib.h"\
72
73
74.\rdtarga.c : \
75 ".\cderror.h"\
76 ".\cdjpeg.h"\
77 ".\jconfig.h"\
78 ".\jerror.h"\
79 ".\jinclude.h"\
80 ".\jmorecfg.h"\
81 ".\jpeglib.h"\
82
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdsp.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdsp.vc6
new file mode 100644
index 0000000..c9d3d4a
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecdsp.vc6
@@ -0,0 +1,130 @@
1# Microsoft Developer Studio Project File - Name="cjpeg" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** NICHT BEARBEITEN **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=cjpeg - Win32
8!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
9!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
10!MESSAGE
11!MESSAGE NMAKE /f "cjpeg.mak".
12!MESSAGE
13!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
14!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
15!MESSAGE
16!MESSAGE NMAKE /f "cjpeg.mak" CFG="cjpeg - Win32"
17!MESSAGE
18!MESSAGE Für die Konfiguration stehen zur Auswahl:
19!MESSAGE
20!MESSAGE "cjpeg - Win32" (basierend auf "Win32 (x86) Console Application")
21!MESSAGE
22
23# Begin Project
24# PROP AllowPerConfigDependencies 0
25# PROP Scc_ProjName ""
26# PROP Scc_LocalPath ""
27CPP=cl.exe
28RSC=rc.exe
29# PROP BASE Use_MFC 0
30# PROP BASE Use_Debug_Libraries 0
31# PROP BASE Output_Dir ".\cjpeg\Release"
32# PROP BASE Intermediate_Dir ".\cjpeg\Release"
33# PROP BASE Target_Dir ".\cjpeg"
34# PROP Use_MFC 0
35# PROP Use_Debug_Libraries 0
36# PROP Output_Dir ".\cjpeg\Release"
37# PROP Intermediate_Dir ".\cjpeg\Release"
38# PROP Ignore_Export_Lib 0
39# PROP Target_Dir ".\cjpeg"
40# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
41# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
42# ADD BASE RSC /l 0x409 /d "NDEBUG"
43# ADD RSC /l 0x409 /d "NDEBUG"
44BSC32=bscmake.exe
45# ADD BASE BSC32 /nologo
46# ADD BSC32 /nologo
47LINK32=link.exe
48# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
49# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
50# Begin Target
51
52# Name "cjpeg - Win32"
53# Begin Group "Quellcodedateien"
54
55# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
56# Begin Source File
57
58SOURCE=.\cdjpeg.c
59# End Source File
60# Begin Source File
61
62SOURCE=.\cjpeg.c
63# End Source File
64# Begin Source File
65
66SOURCE=.\rdbmp.c
67# End Source File
68# Begin Source File
69
70SOURCE=.\rdgif.c
71# End Source File
72# Begin Source File
73
74SOURCE=.\rdppm.c
75# End Source File
76# Begin Source File
77
78SOURCE=.\rdrle.c
79# End Source File
80# Begin Source File
81
82SOURCE=.\rdswitch.c
83# End Source File
84# Begin Source File
85
86SOURCE=.\rdtarga.c
87# End Source File
88# End Group
89# Begin Group "Header-Dateien"
90
91# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
92# Begin Source File
93
94SOURCE=.\cderror.h
95# End Source File
96# Begin Source File
97
98SOURCE=.\cdjpeg.h
99# End Source File
100# Begin Source File
101
102SOURCE=.\jconfig.h
103# End Source File
104# Begin Source File
105
106SOURCE=.\jerror.h
107# End Source File
108# Begin Source File
109
110SOURCE=.\jinclude.h
111# End Source File
112# Begin Source File
113
114SOURCE=.\jmorecfg.h
115# End Source File
116# Begin Source File
117
118SOURCE=.\jpeglib.h
119# End Source File
120# Begin Source File
121
122SOURCE=.\jversion.h
123# End Source File
124# End Group
125# Begin Group "Ressourcendateien"
126
127# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
128# End Group
129# End Target
130# End Project
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecfil.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecfil.v10
new file mode 100644
index 0000000..62f13fe
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecfil.v10
@@ -0,0 +1,69 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="cderror.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="cdjpeg.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 <ClInclude Include="jconfig.h">
25 <Filter>Header Files</Filter>
26 </ClInclude>
27 <ClInclude Include="jerror.h">
28 <Filter>Header Files</Filter>
29 </ClInclude>
30 <ClInclude Include="jinclude.h">
31 <Filter>Header Files</Filter>
32 </ClInclude>
33 <ClInclude Include="jmorecfg.h">
34 <Filter>Header Files</Filter>
35 </ClInclude>
36 <ClInclude Include="jpeglib.h">
37 <Filter>Header Files</Filter>
38 </ClInclude>
39 <ClInclude Include="jversion.h">
40 <Filter>Header Files</Filter>
41 </ClInclude>
42 </ItemGroup>
43 <ItemGroup>
44 <ClCompile Include="cdjpeg.c">
45 <Filter>Source Files</Filter>
46 </ClCompile>
47 <ClCompile Include="cjpeg.c">
48 <Filter>Source Files</Filter>
49 </ClCompile>
50 <ClCompile Include="rdbmp.c">
51 <Filter>Source Files</Filter>
52 </ClCompile>
53 <ClCompile Include="rdgif.c">
54 <Filter>Source Files</Filter>
55 </ClCompile>
56 <ClCompile Include="rdppm.c">
57 <Filter>Source Files</Filter>
58 </ClCompile>
59 <ClCompile Include="rdrle.c">
60 <Filter>Source Files</Filter>
61 </ClCompile>
62 <ClCompile Include="rdswitch.c">
63 <Filter>Source Files</Filter>
64 </ClCompile>
65 <ClCompile Include="rdtarga.c">
66 <Filter>Source Files</Filter>
67 </ClCompile>
68 </ItemGroup>
69</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecmak.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecmak.vc6
new file mode 100644
index 0000000..53235ad
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecmak.vc6
@@ -0,0 +1,159 @@
1# Microsoft Developer Studio Generated NMAKE File, Based on cjpeg.dsp
2!IF "$(CFG)" == ""
3CFG=cjpeg - Win32
4!MESSAGE Keine Konfiguration angegeben. cjpeg - Win32 wird als Standard verwendet.
5!ENDIF
6
7!IF "$(CFG)" != "cjpeg - Win32"
8!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
9!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
10!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
11!MESSAGE
12!MESSAGE NMAKE /f "cjpeg.mak" CFG="cjpeg - Win32"
13!MESSAGE
14!MESSAGE Fr die Konfiguration stehen zur Auswahl:
15!MESSAGE
16!MESSAGE "cjpeg - Win32" (basierend auf "Win32 (x86) Console Application")
17!MESSAGE
18!ERROR Eine ungltige Konfiguration wurde angegeben.
19!ENDIF
20
21!IF "$(OS)" == "Windows_NT"
22NULL=
23!ELSE
24NULL=nul
25!ENDIF
26
27CPP=cl.exe
28RSC=rc.exe
29OUTDIR=.\cjpeg\Release
30INTDIR=.\cjpeg\Release
31# Begin Custom Macros
32OutDir=.\cjpeg\Release
33# End Custom Macros
34
35ALL : "$(OUTDIR)\cjpeg.exe"
36
37
38CLEAN :
39 -@erase "$(INTDIR)\cdjpeg.obj"
40 -@erase "$(INTDIR)\cjpeg.obj"
41 -@erase "$(INTDIR)\rdbmp.obj"
42 -@erase "$(INTDIR)\rdgif.obj"
43 -@erase "$(INTDIR)\rdppm.obj"
44 -@erase "$(INTDIR)\rdrle.obj"
45 -@erase "$(INTDIR)\rdswitch.obj"
46 -@erase "$(INTDIR)\rdtarga.obj"
47 -@erase "$(INTDIR)\vc60.idb"
48 -@erase "$(OUTDIR)\cjpeg.exe"
49
50"$(OUTDIR)" :
51 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
52
53BSC32=bscmake.exe
54BSC32_FLAGS=/nologo /o"$(OUTDIR)\cjpeg.bsc"
55BSC32_SBRS= \
56
57LINK32=link.exe
58LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\cjpeg.pdb" /machine:I386 /out:"$(OUTDIR)\cjpeg.exe"
59LINK32_OBJS= \
60 "$(INTDIR)\cdjpeg.obj" \
61 "$(INTDIR)\cjpeg.obj" \
62 "$(INTDIR)\rdbmp.obj" \
63 "$(INTDIR)\rdgif.obj" \
64 "$(INTDIR)\rdppm.obj" \
65 "$(INTDIR)\rdrle.obj" \
66 "$(INTDIR)\rdswitch.obj" \
67 "$(INTDIR)\rdtarga.obj"
68
69"$(OUTDIR)\cjpeg.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
70 $(LINK32) @<<
71 $(LINK32_FLAGS) $(LINK32_OBJS)
72<<
73
74CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\cjpeg.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
75
76.c{$(INTDIR)}.obj::
77 $(CPP) @<<
78 $(CPP_PROJ) $<
79<<
80
81.cpp{$(INTDIR)}.obj::
82 $(CPP) @<<
83 $(CPP_PROJ) $<
84<<
85
86.cxx{$(INTDIR)}.obj::
87 $(CPP) @<<
88 $(CPP_PROJ) $<
89<<
90
91.c{$(INTDIR)}.sbr::
92 $(CPP) @<<
93 $(CPP_PROJ) $<
94<<
95
96.cpp{$(INTDIR)}.sbr::
97 $(CPP) @<<
98 $(CPP_PROJ) $<
99<<
100
101.cxx{$(INTDIR)}.sbr::
102 $(CPP) @<<
103 $(CPP_PROJ) $<
104<<
105
106
107!IF "$(NO_EXTERNAL_DEPS)" != "1"
108!IF EXISTS("cjpeg.dep")
109!INCLUDE "cjpeg.dep"
110!ELSE
111!MESSAGE Warning: cannot find "cjpeg.dep"
112!ENDIF
113!ENDIF
114
115
116!IF "$(CFG)" == "cjpeg - Win32"
117SOURCE=.\cdjpeg.c
118
119"$(INTDIR)\cdjpeg.obj" : $(SOURCE) "$(INTDIR)"
120
121
122SOURCE=.\cjpeg.c
123
124"$(INTDIR)\cjpeg.obj" : $(SOURCE) "$(INTDIR)"
125
126
127SOURCE=.\rdbmp.c
128
129"$(INTDIR)\rdbmp.obj" : $(SOURCE) "$(INTDIR)"
130
131
132SOURCE=.\rdgif.c
133
134"$(INTDIR)\rdgif.obj" : $(SOURCE) "$(INTDIR)"
135
136
137SOURCE=.\rdppm.c
138
139"$(INTDIR)\rdppm.obj" : $(SOURCE) "$(INTDIR)"
140
141
142SOURCE=.\rdrle.c
143
144"$(INTDIR)\rdrle.obj" : $(SOURCE) "$(INTDIR)"
145
146
147SOURCE=.\rdswitch.c
148
149"$(INTDIR)\rdswitch.obj" : $(SOURCE) "$(INTDIR)"
150
151
152SOURCE=.\rdtarga.c
153
154"$(INTDIR)\rdtarga.obj" : $(SOURCE) "$(INTDIR)"
155
156
157
158!ENDIF
159
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecvcx.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecvcx.v10
new file mode 100644
index 0000000..c709079
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makecvcx.v10
@@ -0,0 +1,76 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 </ItemGroup>
9 <PropertyGroup Label="Globals">
10 <ProjectGuid>{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}</ProjectGuid>
11 <Keyword>Win32Proj</Keyword>
12 <RootNamespace>cjpeg</RootNamespace>
13 </PropertyGroup>
14 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
15 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
16 <ConfigurationType>Application</ConfigurationType>
17 <UseDebugLibraries>false</UseDebugLibraries>
18 <WholeProgramOptimization>true</WholeProgramOptimization>
19 <CharacterSet>Unicode</CharacterSet>
20 </PropertyGroup>
21 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
22 <ImportGroup Label="ExtensionSettings">
23 </ImportGroup>
24 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
25 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
26 </ImportGroup>
27 <PropertyGroup Label="UserMacros" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
29 <LinkIncremental>false</LinkIncremental>
30 <OutDir>$(ProjectName)\$(Configuration)\</OutDir>
31 <IntDir>$(ProjectName)\$(Configuration)\</IntDir>
32 </PropertyGroup>
33 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
34 <ClCompile>
35 <WarningLevel>Level3</WarningLevel>
36 <PrecompiledHeader>NotUsing</PrecompiledHeader>
37 <Optimization>Full</Optimization>
38 <FunctionLevelLinking>true</FunctionLevelLinking>
39 <IntrinsicFunctions>false</IntrinsicFunctions>
40 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
41 <OmitFramePointers>true</OmitFramePointers>
42 <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
43 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
44 </ClCompile>
45 <Link>
46 <SubSystem>Console</SubSystem>
47 <GenerateDebugInformation>true</GenerateDebugInformation>
48 <EnableCOMDATFolding>true</EnableCOMDATFolding>
49 <OptimizeReferences>true</OptimizeReferences>
50 <AdditionalDependencies>Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
51 </Link>
52 </ItemDefinitionGroup>
53 <ItemGroup>
54 <ClInclude Include="cderror.h" />
55 <ClInclude Include="cdjpeg.h" />
56 <ClInclude Include="jconfig.h" />
57 <ClInclude Include="jerror.h" />
58 <ClInclude Include="jinclude.h" />
59 <ClInclude Include="jmorecfg.h" />
60 <ClInclude Include="jpeglib.h" />
61 <ClInclude Include="jversion.h" />
62 </ItemGroup>
63 <ItemGroup>
64 <ClCompile Include="cdjpeg.c" />
65 <ClCompile Include="cjpeg.c" />
66 <ClCompile Include="rdbmp.c" />
67 <ClCompile Include="rdgif.c" />
68 <ClCompile Include="rdppm.c" />
69 <ClCompile Include="rdrle.c" />
70 <ClCompile Include="rdswitch.c" />
71 <ClCompile Include="rdtarga.c" />
72 </ItemGroup>
73 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
74 <ImportGroup Label="ExtensionTargets">
75 </ImportGroup>
76</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddep.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddep.vc6
new file mode 100644
index 0000000..79a44a1
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddep.vc6
@@ -0,0 +1,82 @@
1# Microsoft Developer Studio erstellte Abhängigkeitsdatei, einbezogen von djpeg.mak
2
3.\cdjpeg.c : \
4 ".\cderror.h"\
5 ".\cdjpeg.h"\
6 ".\jconfig.h"\
7 ".\jerror.h"\
8 ".\jinclude.h"\
9 ".\jmorecfg.h"\
10 ".\jpeglib.h"\
11
12
13.\djpeg.c : \
14 ".\cderror.h"\
15 ".\cdjpeg.h"\
16 ".\jconfig.h"\
17 ".\jerror.h"\
18 ".\jinclude.h"\
19 ".\jmorecfg.h"\
20 ".\jpeglib.h"\
21 ".\jversion.h"\
22
23
24.\rdcolmap.c : \
25 ".\cderror.h"\
26 ".\cdjpeg.h"\
27 ".\jconfig.h"\
28 ".\jerror.h"\
29 ".\jinclude.h"\
30 ".\jmorecfg.h"\
31 ".\jpeglib.h"\
32
33
34.\wrbmp.c : \
35 ".\cderror.h"\
36 ".\cdjpeg.h"\
37 ".\jconfig.h"\
38 ".\jerror.h"\
39 ".\jinclude.h"\
40 ".\jmorecfg.h"\
41 ".\jpeglib.h"\
42
43
44.\wrgif.c : \
45 ".\cderror.h"\
46 ".\cdjpeg.h"\
47 ".\jconfig.h"\
48 ".\jerror.h"\
49 ".\jinclude.h"\
50 ".\jmorecfg.h"\
51 ".\jpeglib.h"\
52
53
54.\wrppm.c : \
55 ".\cderror.h"\
56 ".\cdjpeg.h"\
57 ".\jconfig.h"\
58 ".\jerror.h"\
59 ".\jinclude.h"\
60 ".\jmorecfg.h"\
61 ".\jpeglib.h"\
62
63
64.\wrrle.c : \
65 ".\cderror.h"\
66 ".\cdjpeg.h"\
67 ".\jconfig.h"\
68 ".\jerror.h"\
69 ".\jinclude.h"\
70 ".\jmorecfg.h"\
71 ".\jpeglib.h"\
72
73
74.\wrtarga.c : \
75 ".\cderror.h"\
76 ".\cdjpeg.h"\
77 ".\jconfig.h"\
78 ".\jerror.h"\
79 ".\jinclude.h"\
80 ".\jmorecfg.h"\
81 ".\jpeglib.h"\
82
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddsp.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddsp.vc6
new file mode 100644
index 0000000..fdb5e5a
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeddsp.vc6
@@ -0,0 +1,130 @@
1# Microsoft Developer Studio Project File - Name="djpeg" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** NICHT BEARBEITEN **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=djpeg - Win32
8!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
9!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
10!MESSAGE
11!MESSAGE NMAKE /f "djpeg.mak".
12!MESSAGE
13!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
14!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
15!MESSAGE
16!MESSAGE NMAKE /f "djpeg.mak" CFG="djpeg - Win32"
17!MESSAGE
18!MESSAGE Für die Konfiguration stehen zur Auswahl:
19!MESSAGE
20!MESSAGE "djpeg - Win32" (basierend auf "Win32 (x86) Console Application")
21!MESSAGE
22
23# Begin Project
24# PROP AllowPerConfigDependencies 0
25# PROP Scc_ProjName ""
26# PROP Scc_LocalPath ""
27CPP=cl.exe
28RSC=rc.exe
29# PROP BASE Use_MFC 0
30# PROP BASE Use_Debug_Libraries 0
31# PROP BASE Output_Dir ".\djpeg\Release"
32# PROP BASE Intermediate_Dir ".\djpeg\Release"
33# PROP BASE Target_Dir ".\djpeg"
34# PROP Use_MFC 0
35# PROP Use_Debug_Libraries 0
36# PROP Output_Dir ".\djpeg\Release"
37# PROP Intermediate_Dir ".\djpeg\Release"
38# PROP Ignore_Export_Lib 0
39# PROP Target_Dir ".\djpeg"
40# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
41# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
42# ADD BASE RSC /l 0x409 /d "NDEBUG"
43# ADD RSC /l 0x409 /d "NDEBUG"
44BSC32=bscmake.exe
45# ADD BASE BSC32 /nologo
46# ADD BSC32 /nologo
47LINK32=link.exe
48# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
49# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
50# Begin Target
51
52# Name "djpeg - Win32"
53# Begin Group "Quellcodedateien"
54
55# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
56# Begin Source File
57
58SOURCE=.\cdjpeg.c
59# End Source File
60# Begin Source File
61
62SOURCE=.\djpeg.c
63# End Source File
64# Begin Source File
65
66SOURCE=.\rdcolmap.c
67# End Source File
68# Begin Source File
69
70SOURCE=.\wrbmp.c
71# End Source File
72# Begin Source File
73
74SOURCE=.\wrgif.c
75# End Source File
76# Begin Source File
77
78SOURCE=.\wrppm.c
79# End Source File
80# Begin Source File
81
82SOURCE=.\wrrle.c
83# End Source File
84# Begin Source File
85
86SOURCE=.\wrtarga.c
87# End Source File
88# End Group
89# Begin Group "Header-Dateien"
90
91# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
92# Begin Source File
93
94SOURCE=.\cderror.h
95# End Source File
96# Begin Source File
97
98SOURCE=.\cdjpeg.h
99# End Source File
100# Begin Source File
101
102SOURCE=.\jconfig.h
103# End Source File
104# Begin Source File
105
106SOURCE=.\jerror.h
107# End Source File
108# Begin Source File
109
110SOURCE=.\jinclude.h
111# End Source File
112# Begin Source File
113
114SOURCE=.\jmorecfg.h
115# End Source File
116# Begin Source File
117
118SOURCE=.\jpeglib.h
119# End Source File
120# Begin Source File
121
122SOURCE=.\jversion.h
123# End Source File
124# End Group
125# Begin Group "Ressourcendateien"
126
127# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
128# End Group
129# End Target
130# End Project
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedfil.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedfil.v10
new file mode 100644
index 0000000..6846e14
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedfil.v10
@@ -0,0 +1,69 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="cderror.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="cdjpeg.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 <ClInclude Include="jconfig.h">
25 <Filter>Header Files</Filter>
26 </ClInclude>
27 <ClInclude Include="jerror.h">
28 <Filter>Header Files</Filter>
29 </ClInclude>
30 <ClInclude Include="jinclude.h">
31 <Filter>Header Files</Filter>
32 </ClInclude>
33 <ClInclude Include="jmorecfg.h">
34 <Filter>Header Files</Filter>
35 </ClInclude>
36 <ClInclude Include="jpeglib.h">
37 <Filter>Header Files</Filter>
38 </ClInclude>
39 <ClInclude Include="jversion.h">
40 <Filter>Header Files</Filter>
41 </ClInclude>
42 </ItemGroup>
43 <ItemGroup>
44 <ClCompile Include="cdjpeg.c">
45 <Filter>Source Files</Filter>
46 </ClCompile>
47 <ClCompile Include="djpeg.c">
48 <Filter>Source Files</Filter>
49 </ClCompile>
50 <ClCompile Include="rdcolmap.c">
51 <Filter>Source Files</Filter>
52 </ClCompile>
53 <ClCompile Include="wrbmp.c">
54 <Filter>Source Files</Filter>
55 </ClCompile>
56 <ClCompile Include="wrgif.c">
57 <Filter>Source Files</Filter>
58 </ClCompile>
59 <ClCompile Include="wrppm.c">
60 <Filter>Source Files</Filter>
61 </ClCompile>
62 <ClCompile Include="wrrle.c">
63 <Filter>Source Files</Filter>
64 </ClCompile>
65 <ClCompile Include="wrtarga.c">
66 <Filter>Source Files</Filter>
67 </ClCompile>
68 </ItemGroup>
69</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedmak.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedmak.vc6
new file mode 100644
index 0000000..fd89563
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedmak.vc6
@@ -0,0 +1,159 @@
1# Microsoft Developer Studio Generated NMAKE File, Based on djpeg.dsp
2!IF "$(CFG)" == ""
3CFG=djpeg - Win32
4!MESSAGE Keine Konfiguration angegeben. djpeg - Win32 wird als Standard verwendet.
5!ENDIF
6
7!IF "$(CFG)" != "djpeg - Win32"
8!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
9!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
10!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
11!MESSAGE
12!MESSAGE NMAKE /f "djpeg.mak" CFG="djpeg - Win32"
13!MESSAGE
14!MESSAGE Fr die Konfiguration stehen zur Auswahl:
15!MESSAGE
16!MESSAGE "djpeg - Win32" (basierend auf "Win32 (x86) Console Application")
17!MESSAGE
18!ERROR Eine ungltige Konfiguration wurde angegeben.
19!ENDIF
20
21!IF "$(OS)" == "Windows_NT"
22NULL=
23!ELSE
24NULL=nul
25!ENDIF
26
27CPP=cl.exe
28RSC=rc.exe
29OUTDIR=.\djpeg\Release
30INTDIR=.\djpeg\Release
31# Begin Custom Macros
32OutDir=.\djpeg\Release
33# End Custom Macros
34
35ALL : "$(OUTDIR)\djpeg.exe"
36
37
38CLEAN :
39 -@erase "$(INTDIR)\cdjpeg.obj"
40 -@erase "$(INTDIR)\djpeg.obj"
41 -@erase "$(INTDIR)\rdcolmap.obj"
42 -@erase "$(INTDIR)\vc60.idb"
43 -@erase "$(INTDIR)\wrbmp.obj"
44 -@erase "$(INTDIR)\wrgif.obj"
45 -@erase "$(INTDIR)\wrppm.obj"
46 -@erase "$(INTDIR)\wrrle.obj"
47 -@erase "$(INTDIR)\wrtarga.obj"
48 -@erase "$(OUTDIR)\djpeg.exe"
49
50"$(OUTDIR)" :
51 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
52
53BSC32=bscmake.exe
54BSC32_FLAGS=/nologo /o"$(OUTDIR)\djpeg.bsc"
55BSC32_SBRS= \
56
57LINK32=link.exe
58LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\djpeg.pdb" /machine:I386 /out:"$(OUTDIR)\djpeg.exe"
59LINK32_OBJS= \
60 "$(INTDIR)\cdjpeg.obj" \
61 "$(INTDIR)\djpeg.obj" \
62 "$(INTDIR)\rdcolmap.obj" \
63 "$(INTDIR)\wrbmp.obj" \
64 "$(INTDIR)\wrgif.obj" \
65 "$(INTDIR)\wrppm.obj" \
66 "$(INTDIR)\wrrle.obj" \
67 "$(INTDIR)\wrtarga.obj"
68
69"$(OUTDIR)\djpeg.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
70 $(LINK32) @<<
71 $(LINK32_FLAGS) $(LINK32_OBJS)
72<<
73
74CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\djpeg.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
75
76.c{$(INTDIR)}.obj::
77 $(CPP) @<<
78 $(CPP_PROJ) $<
79<<
80
81.cpp{$(INTDIR)}.obj::
82 $(CPP) @<<
83 $(CPP_PROJ) $<
84<<
85
86.cxx{$(INTDIR)}.obj::
87 $(CPP) @<<
88 $(CPP_PROJ) $<
89<<
90
91.c{$(INTDIR)}.sbr::
92 $(CPP) @<<
93 $(CPP_PROJ) $<
94<<
95
96.cpp{$(INTDIR)}.sbr::
97 $(CPP) @<<
98 $(CPP_PROJ) $<
99<<
100
101.cxx{$(INTDIR)}.sbr::
102 $(CPP) @<<
103 $(CPP_PROJ) $<
104<<
105
106
107!IF "$(NO_EXTERNAL_DEPS)" != "1"
108!IF EXISTS("djpeg.dep")
109!INCLUDE "djpeg.dep"
110!ELSE
111!MESSAGE Warning: cannot find "djpeg.dep"
112!ENDIF
113!ENDIF
114
115
116!IF "$(CFG)" == "djpeg - Win32"
117SOURCE=.\cdjpeg.c
118
119"$(INTDIR)\cdjpeg.obj" : $(SOURCE) "$(INTDIR)"
120
121
122SOURCE=.\djpeg.c
123
124"$(INTDIR)\djpeg.obj" : $(SOURCE) "$(INTDIR)"
125
126
127SOURCE=.\rdcolmap.c
128
129"$(INTDIR)\rdcolmap.obj" : $(SOURCE) "$(INTDIR)"
130
131
132SOURCE=.\wrbmp.c
133
134"$(INTDIR)\wrbmp.obj" : $(SOURCE) "$(INTDIR)"
135
136
137SOURCE=.\wrgif.c
138
139"$(INTDIR)\wrgif.obj" : $(SOURCE) "$(INTDIR)"
140
141
142SOURCE=.\wrppm.c
143
144"$(INTDIR)\wrppm.obj" : $(SOURCE) "$(INTDIR)"
145
146
147SOURCE=.\wrrle.c
148
149"$(INTDIR)\wrrle.obj" : $(SOURCE) "$(INTDIR)"
150
151
152SOURCE=.\wrtarga.c
153
154"$(INTDIR)\wrtarga.obj" : $(SOURCE) "$(INTDIR)"
155
156
157
158!ENDIF
159
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedvcx.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedvcx.v10
new file mode 100644
index 0000000..46aa86e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makedvcx.v10
@@ -0,0 +1,76 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 </ItemGroup>
9 <PropertyGroup Label="Globals">
10 <ProjectGuid>{11043137-B453-4DFA-9010-4D2B9DC1545C}</ProjectGuid>
11 <Keyword>Win32Proj</Keyword>
12 <RootNamespace>djpeg</RootNamespace>
13 </PropertyGroup>
14 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
15 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
16 <ConfigurationType>Application</ConfigurationType>
17 <UseDebugLibraries>false</UseDebugLibraries>
18 <WholeProgramOptimization>true</WholeProgramOptimization>
19 <CharacterSet>Unicode</CharacterSet>
20 </PropertyGroup>
21 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
22 <ImportGroup Label="ExtensionSettings">
23 </ImportGroup>
24 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
25 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
26 </ImportGroup>
27 <PropertyGroup Label="UserMacros" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
29 <LinkIncremental>false</LinkIncremental>
30 <OutDir>$(ProjectName)\$(Configuration)\</OutDir>
31 <IntDir>$(ProjectName)\$(Configuration)\</IntDir>
32 </PropertyGroup>
33 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
34 <ClCompile>
35 <WarningLevel>Level3</WarningLevel>
36 <PrecompiledHeader>NotUsing</PrecompiledHeader>
37 <Optimization>Full</Optimization>
38 <FunctionLevelLinking>true</FunctionLevelLinking>
39 <IntrinsicFunctions>false</IntrinsicFunctions>
40 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
41 <OmitFramePointers>true</OmitFramePointers>
42 <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
43 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
44 </ClCompile>
45 <Link>
46 <SubSystem>Console</SubSystem>
47 <GenerateDebugInformation>true</GenerateDebugInformation>
48 <EnableCOMDATFolding>true</EnableCOMDATFolding>
49 <OptimizeReferences>true</OptimizeReferences>
50 <AdditionalDependencies>Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
51 </Link>
52 </ItemDefinitionGroup>
53 <ItemGroup>
54 <ClInclude Include="cderror.h" />
55 <ClInclude Include="cdjpeg.h" />
56 <ClInclude Include="jconfig.h" />
57 <ClInclude Include="jerror.h" />
58 <ClInclude Include="jinclude.h" />
59 <ClInclude Include="jmorecfg.h" />
60 <ClInclude Include="jpeglib.h" />
61 <ClInclude Include="jversion.h" />
62 </ItemGroup>
63 <ItemGroup>
64 <ClCompile Include="cdjpeg.c" />
65 <ClCompile Include="djpeg.c" />
66 <ClCompile Include="rdcolmap.c" />
67 <ClCompile Include="wrbmp.c" />
68 <ClCompile Include="wrgif.c" />
69 <ClCompile Include="wrppm.c" />
70 <ClCompile Include="wrrle.c" />
71 <ClCompile Include="wrtarga.c" />
72 </ItemGroup>
73 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
74 <ImportGroup Label="ExtensionTargets">
75 </ImportGroup>
76</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.ansi b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.ansi
new file mode 100644
index 0000000..357029e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.ansi
@@ -0,0 +1,221 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Unix-like systems with ANSI-capable compilers.
4# If you have a non-ANSI compiler, makefile.unix is a better starting point.
5
6# Read installation instructions before saying "make" !!
7
8# The name of your C compiler:
9CC= cc
10
11# You may need to adjust these cc options:
12CFLAGS= -O
13# Generally, we recommend defining any configuration symbols in jconfig.h,
14# NOT via -D switches here.
15
16# Link-time cc options:
17LDFLAGS=
18
19# To link any special libraries, add the necessary -l commands here.
20LDLIBS=
21
22# Put here the object file name for the correct system-dependent memory
23# manager file. For Unix this is usually jmemnobs.o, but you may want
24# to use jmemansi.o or jmemname.o if you have limited swap space.
25SYSDEPMEM= jmemnobs.o
26
27# miscellaneous OS-dependent stuff
28# linker
29LN= $(CC)
30# file deletion command
31RM= rm -f
32# library (.a) file creation command
33AR= ar rc
34# second step in .a creation (use "touch" if not needed)
35AR2= ranlib
36
37# End of configurable options.
38
39
40# source files: JPEG library proper
41LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
42 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
43 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
44 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
45 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
46 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
47 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
48 jquant2.c jutils.c jmemmgr.c
49# memmgr back ends: compile only one of these into a working library
50SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
51# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
52APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
53 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
54 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
55SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
56# files included by source files
57INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
58 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
59# documentation, test, and support files
60DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
61 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
62 coderules.txt filelist.txt change.log
63MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
64 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
65 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
66 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
67 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
68 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
69 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
70 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
71 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
72 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
73 makefile.mms makefile.vms makvms.opt
74CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
75 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
76 jconfig.vms
77CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
78OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
79 libjpeg.map
80TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
81 testimgp.jpg
82DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
83 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
84# library object files common to compression and decompression
85COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
86# compression library object files
87CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \
88 jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \
89 jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \
90 jfdctflt.o jfdctint.o
91# decompression library object files
92DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \
93 jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \
94 jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \
95 jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
96# These objectfiles are included in libjpeg.a
97LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
98# object files for sample applications (excluding library files)
99COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
100 cdjpeg.o
101DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
102 cdjpeg.o
103TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
104
105
106all: libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom
107
108libjpeg.a: $(LIBOBJECTS)
109 $(RM) libjpeg.a
110 $(AR) libjpeg.a $(LIBOBJECTS)
111 $(AR2) libjpeg.a
112
113cjpeg: $(COBJECTS) libjpeg.a
114 $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
115
116djpeg: $(DOBJECTS) libjpeg.a
117 $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
118
119jpegtran: $(TROBJECTS) libjpeg.a
120 $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS)
121
122rdjpgcom: rdjpgcom.o
123 $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
124
125wrjpgcom: wrjpgcom.o
126 $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
127
128jconfig.h: jconfig.txt
129 echo You must prepare a system-dependent jconfig.h file.
130 echo Please read the installation directions in install.txt.
131 exit 1
132
133clean:
134 $(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom
135 $(RM) core testout*
136
137test: cjpeg djpeg jpegtran
138 $(RM) testout*
139 ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
140 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
141 ./cjpeg -dct int -outfile testout.jpg testimg.ppm
142 ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
143 ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
144 ./jpegtran -outfile testoutt.jpg testprog.jpg
145 cmp testimg.ppm testout.ppm
146 cmp testimg.bmp testout.bmp
147 cmp testimg.jpg testout.jpg
148 cmp testimg.ppm testoutp.ppm
149 cmp testimgp.jpg testoutp.jpg
150 cmp testorig.jpg testoutt.jpg
151
152
153jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
154jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
155jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
156jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
157jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
158jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
159jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
160jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
161jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
162jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
163jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
164jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
165jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
166jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
167jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
168jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
169jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
170jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
172jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
174jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
175jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
176jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
177jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
178jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
179jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
180jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
181jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
182jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
183jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
184jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
188jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
189jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
190jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
191jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
192jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
193jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
194jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
198jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
199jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
200jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
201jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
202jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
203cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
204djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
205jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
206rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
207wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
208cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
209rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
210rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
211transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
212rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
213wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
214rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
215wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
216rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
217wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
218rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
219wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
220rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
221wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.bcc b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.bcc
new file mode 100644
index 0000000..c297a30
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.bcc
@@ -0,0 +1,292 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Borland C on MS-DOS or OS/2.
4# It works with Borland C++ for DOS, revision 3.0 or later,
5# and has been tested with Borland C++ for OS/2.
6# Watch out for optimization bugs in the OS/2 compilers --- see notes below!
7# Thanks to Tom Wright and Ge' Weijers (original DOS) and
8# Ken Porter (OS/2) for this file.
9
10# Read installation instructions before saying "make" !!
11
12# Are we under DOS or OS/2?
13!if !$d(DOS) && !$d(OS2)
14!if $d(__OS2__)
15OS2=1
16!else
17DOS=1
18!endif
19!endif
20
21# The name of your C compiler:
22CC= bcc
23
24# You may need to adjust these cc options:
25!if $d(DOS)
26CFLAGS= -O2 -mm -w-par -w-stu -w-ccc -w-rch
27!else
28CFLAGS= -O1 -w-par -w-stu -w-ccc -w-rch
29!endif
30# -O2 enables full code optimization (for pre-3.0 Borland C++, use -O -G -Z).
31# -O2 is buggy in Borland OS/2 C++ revision 2.0, so use -O1 there for now.
32# If you have Borland OS/2 C++ revision 1.0, use -O or no optimization at all.
33# -mm selects medium memory model (near data, far code pointers; DOS only!)
34# -w-par suppresses warnings about unused function parameters
35# -w-stu suppresses warnings about incomplete structures
36# -w-ccc suppresses warnings about compile-time-constant conditions
37# -w-rch suppresses warnings about unreachable code
38# Generally, we recommend defining any configuration symbols in jconfig.h,
39# NOT via -D switches here.
40
41# Link-time cc options:
42!if $d(DOS)
43LDFLAGS= -mm
44# memory model option here must match CFLAGS!
45!else
46LDFLAGS=
47# -lai full-screen app
48# -lc case-significant link
49!endif
50
51# Put here the object file name for the correct system-dependent memory
52# manager file.
53# For DOS, we recommend jmemdos.c and jmemdosa.asm.
54# For OS/2, we recommend jmemnobs.c (flat memory!)
55# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
56!if $d(DOS)
57SYSDEPMEM= jmemdos.obj jmemdosa.obj
58SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj
59!else
60SYSDEPMEM= jmemnobs.obj
61SYSDEPMEMLIB= +jmemnobs.obj
62!endif
63
64# End of configurable options.
65
66
67# source files: JPEG library proper
68LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
69 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
70 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
71 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
72 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
73 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
74 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
75 jquant2.c jutils.c jmemmgr.c
76# memmgr back ends: compile only one of these into a working library
77SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
78# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
79APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
80 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
81 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
82SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
83# files included by source files
84INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
85 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
86# documentation, test, and support files
87DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
88 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
89 coderules.txt filelist.txt change.log
90MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
91 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
92 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
93 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
94 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
95 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
96 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
97 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
98 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
99 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
100 makefile.mms makefile.vms makvms.opt
101CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
102 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
103 jconfig.vms
104CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
105OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
106 libjpeg.map
107TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
108 testimgp.jpg
109DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
110 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
111# library object files common to compression and decompression
112COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
113# compression library object files
114CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
115 jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
116 jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
117 jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
118# decompression library object files
119DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
120 jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
121 jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
122 jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
123 jdmerge.obj
124# These objectfiles are included in libjpeg.lib
125LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
126# object files for sample applications (excluding library files)
127COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
128 rdswitch.obj cdjpeg.obj
129DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
130 rdcolmap.obj cdjpeg.obj
131TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
132
133
134all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
135
136libjpeg.lib: $(LIBOBJECTS)
137 - del libjpeg.lib
138 tlib libjpeg.lib /E /C @&&|
139+jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj +jcparam.obj &
140+jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj &
141+jcprepct.obj +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj &
142+jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj &
143+jdapistd.obj +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj &
144+jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj +jdcoefct.obj &
145+jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj &
146+jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj +jdmerge.obj &
147+jaricom.obj +jcomapi.obj +jutils.obj +jerror.obj +jmemmgr.obj &
148$(SYSDEPMEMLIB)
149|
150
151cjpeg.exe: $(COBJECTS) libjpeg.lib
152 $(CC) $(LDFLAGS) -ecjpeg.exe $(COBJECTS) libjpeg.lib
153
154djpeg.exe: $(DOBJECTS) libjpeg.lib
155 $(CC) $(LDFLAGS) -edjpeg.exe $(DOBJECTS) libjpeg.lib
156
157jpegtran.exe: $(TROBJECTS) libjpeg.lib
158 $(CC) $(LDFLAGS) -ejpegtran.exe $(TROBJECTS) libjpeg.lib
159
160rdjpgcom.exe: rdjpgcom.c
161!if $d(DOS)
162 $(CC) -ms -O rdjpgcom.c
163!else
164 $(CC) $(CFLAGS) rdjpgcom.c
165!endif
166
167# On DOS, wrjpgcom needs large model so it can malloc a 64K chunk
168wrjpgcom.exe: wrjpgcom.c
169!if $d(DOS)
170 $(CC) -ml -O wrjpgcom.c
171!else
172 $(CC) $(CFLAGS) wrjpgcom.c
173!endif
174
175# This "{}" syntax allows Borland Make to "batch" source files.
176# In this way, each run of the compiler can build many modules.
177.c.obj:
178 $(CC) $(CFLAGS) -c{ $<}
179
180jconfig.h: jconfig.txt
181 echo You must prepare a system-dependent jconfig.h file.
182 echo Please read the installation directions in install.txt.
183 exit 1
184
185clean:
186 - del *.obj
187 - del libjpeg.lib
188 - del cjpeg.exe
189 - del djpeg.exe
190 - del jpegtran.exe
191 - del rdjpgcom.exe
192 - del wrjpgcom.exe
193 - del testout*.*
194
195test: cjpeg.exe djpeg.exe jpegtran.exe
196 - del testout*.*
197 djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
198 djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
199 cjpeg -dct int -outfile testout.jpg testimg.ppm
200 djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
201 cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
202 jpegtran -outfile testoutt.jpg testprog.jpg
203!if $d(DOS)
204 fc /b testimg.ppm testout.ppm
205 fc /b testimg.bmp testout.bmp
206 fc /b testimg.jpg testout.jpg
207 fc /b testimg.ppm testoutp.ppm
208 fc /b testimgp.jpg testoutp.jpg
209 fc /b testorig.jpg testoutt.jpg
210!else
211 echo n > n.tmp
212 comp testimg.ppm testout.ppm < n.tmp
213 comp testimg.bmp testout.bmp < n.tmp
214 comp testimg.jpg testout.jpg < n.tmp
215 comp testimg.ppm testoutp.ppm < n.tmp
216 comp testimgp.jpg testoutp.jpg < n.tmp
217 comp testorig.jpg testoutt.jpg < n.tmp
218 del n.tmp
219!endif
220
221
222jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
223jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
224jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
225jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
226jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
227jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
228jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
229jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
230jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
231jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
232jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
233jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
234jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
235jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
236jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
237jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
238jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
239jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
240jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
241jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
242jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
243jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
244jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
245jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
246jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
247jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
248jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
249jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
250jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
251jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
252jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
253jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
254jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
255jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
256jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
257jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
258jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
259jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
260jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
261jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
262jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
263jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
264jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
265jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
266jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
267jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
268jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
269jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
270jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
271jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
272cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
273djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
274jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
275rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
276wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
277cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
278rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
279rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
280transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
281rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
282wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
283rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
284wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
285rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
286wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
287rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
288wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
289rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
290wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
291jmemdosa.obj: jmemdosa.asm
292 tasm /mx jmemdosa.asm
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.dj b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.dj
new file mode 100644
index 0000000..363e436
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.dj
@@ -0,0 +1,227 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is for DJGPP (Delorie's GNU C port on MS-DOS), v2.0 or later.
4# Thanks to Frank J. Donahoe for this version.
5
6# Read installation instructions before saying "make" !!
7
8# The name of your C compiler:
9CC= gcc
10
11# You may need to adjust these cc options:
12CFLAGS= -O2 -Wall -I.
13# Generally, we recommend defining any configuration symbols in jconfig.h,
14# NOT via -D switches here.
15
16# Link-time cc options:
17LDFLAGS= -s
18
19# To link any special libraries, add the necessary -l commands here.
20LDLIBS=
21
22# Put here the object file name for the correct system-dependent memory
23# manager file. For DJGPP this is usually jmemnobs.o, but you could
24# use jmemname.o if you want to use named temp files instead of swap space.
25SYSDEPMEM= jmemnobs.o
26
27# miscellaneous OS-dependent stuff
28# linker
29LN= $(CC)
30# file deletion command
31RM= del
32# library (.a) file creation command
33AR= ar rc
34# second step in .a creation (use "touch" if not needed)
35AR2= ranlib
36
37# End of configurable options.
38
39
40# source files: JPEG library proper
41LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
42 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
43 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
44 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
45 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
46 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
47 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
48 jquant2.c jutils.c jmemmgr.c
49# memmgr back ends: compile only one of these into a working library
50SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
51# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
52APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
53 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
54 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
55SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
56# files included by source files
57INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
58 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
59# documentation, test, and support files
60DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
61 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
62 coderules.txt filelist.txt change.log
63MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
64 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
65 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
66 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
67 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
68 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
69 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
70 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
71 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
72 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
73 makefile.mms makefile.vms makvms.opt
74CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
75 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
76 jconfig.vms
77CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
78OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
79 libjpeg.map
80TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
81 testimgp.jpg
82DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
83 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
84# library object files common to compression and decompression
85COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
86# compression library object files
87CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \
88 jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \
89 jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \
90 jfdctflt.o jfdctint.o
91# decompression library object files
92DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \
93 jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \
94 jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \
95 jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
96# These objectfiles are included in libjpeg.a
97LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
98# object files for sample applications (excluding library files)
99COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
100 cdjpeg.o
101DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
102 cdjpeg.o
103TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
104
105
106all: libjpeg.a cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
107
108libjpeg.a: $(LIBOBJECTS)
109 $(RM) libjpeg.a
110 $(AR) libjpeg.a $(LIBOBJECTS)
111 $(AR2) libjpeg.a
112
113cjpeg.exe: $(COBJECTS) libjpeg.a
114 $(LN) $(LDFLAGS) -o cjpeg.exe $(COBJECTS) libjpeg.a $(LDLIBS)
115
116djpeg.exe: $(DOBJECTS) libjpeg.a
117 $(LN) $(LDFLAGS) -o djpeg.exe $(DOBJECTS) libjpeg.a $(LDLIBS)
118
119jpegtran.exe: $(TROBJECTS) libjpeg.a
120 $(LN) $(LDFLAGS) -o jpegtran.exe $(TROBJECTS) libjpeg.a $(LDLIBS)
121
122rdjpgcom.exe: rdjpgcom.o
123 $(LN) $(LDFLAGS) -o rdjpgcom.exe rdjpgcom.o $(LDLIBS)
124
125wrjpgcom.exe: wrjpgcom.o
126 $(LN) $(LDFLAGS) -o wrjpgcom.exe wrjpgcom.o $(LDLIBS)
127
128jconfig.h: jconfig.txt
129 echo You must prepare a system-dependent jconfig.h file.
130 echo Please read the installation directions in install.txt.
131 exit 1
132
133clean:
134 $(RM) *.o
135 $(RM) cjpeg.exe
136 $(RM) djpeg.exe
137 $(RM) jpegtran.exe
138 $(RM) rdjpgcom.exe
139 $(RM) wrjpgcom.exe
140 $(RM) libjpeg.a
141 $(RM) testout*.*
142
143test: cjpeg.exe djpeg.exe jpegtran.exe
144 $(RM) testout*.*
145 ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
146 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
147 ./cjpeg -dct int -outfile testout.jpg testimg.ppm
148 ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
149 ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
150 ./jpegtran -outfile testoutt.jpg testprog.jpg
151 fc /b testimg.ppm testout.ppm
152 fc /b testimg.bmp testout.bmp
153 fc /b testimg.jpg testout.jpg
154 fc /b testimg.ppm testoutp.ppm
155 fc /b testimgp.jpg testoutp.jpg
156 fc /b testorig.jpg testoutt.jpg
157
158
159jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
160jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
161jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
162jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
163jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
164jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
165jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
166jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
167jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
168jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
169jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
170jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
172jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
174jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
175jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
176jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
177jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
178jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
179jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
180jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
181jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
182jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
183jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
184jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
188jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
192jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
193jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
194jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
195jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
196jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
197jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
198jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
199jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
200jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
202jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
204jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
205jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
206jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
207jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
208jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
209cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
210djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
211jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
212rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
213wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
214cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
215rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
216rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
217transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
218rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
219wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
220rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
221wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
222rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
223wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
224rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
225wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
226rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
227wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.manx b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.manx
new file mode 100644
index 0000000..7fcc00a
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.manx
@@ -0,0 +1,221 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is for Amiga systems using Manx Aztec C ver 5.x.
4# Thanks to D.J. James (djjames@cup.portal.com) for this version.
5
6# Read installation instructions before saying "make" !!
7
8# The name of your C compiler:
9CC= cc
10
11# You may need to adjust these cc options:
12# Uncomment for generic 68000 code (will work on any Amiga)
13ARCHFLAGS= -sn
14
15# Uncomment for 68020/68030 code (faster, but won't run on 68000 CPU)
16#ARCHFLAGS= -c2
17
18CFLAGS= -MC -MD $(ARCHFLAGS) -spfam -r4
19
20# Link-time cc options:
21LDFLAGS= -g
22
23# To link any special libraries, add the necessary -l commands here.
24LDLIBS= -lml -lcl
25
26# Put here the object file name for the correct system-dependent memory
27# manager file. For Amiga we recommend jmemname.o.
28SYSDEPMEM= jmemname.o
29
30# miscellaneous OS-dependent stuff
31# linker
32LN= ln
33# file deletion command
34RM= delete quiet
35# library (.lib) file creation command
36AR= lb
37
38# End of configurable options.
39
40
41# source files: JPEG library proper
42LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
43 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
44 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
45 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
46 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
47 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
48 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
49 jquant2.c jutils.c jmemmgr.c
50# memmgr back ends: compile only one of these into a working library
51SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
52# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
53APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
54 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
55 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
56SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
57# files included by source files
58INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
59 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
60# documentation, test, and support files
61DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
62 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
63 coderules.txt filelist.txt change.log
64MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
65 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
66 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
67 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
68 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
69 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
70 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
71 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
72 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
73 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
74 makefile.mms makefile.vms makvms.opt
75CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
76 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
77 jconfig.vms
78CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
79OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
80 libjpeg.map
81TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
82 testimgp.jpg
83DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
84 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
85# library object files common to compression and decompression
86COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
87# compression library object files
88CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \
89 jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \
90 jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \
91 jfdctflt.o jfdctint.o
92# decompression library object files
93DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \
94 jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \
95 jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \
96 jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
97# These objectfiles are included in libjpeg.lib
98LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
99# object files for sample applications (excluding library files)
100COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
101 cdjpeg.o
102DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
103 cdjpeg.o
104TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
105
106
107all: libjpeg.lib cjpeg djpeg jpegtran rdjpgcom wrjpgcom
108
109libjpeg.lib: $(LIBOBJECTS)
110 -$(RM) libjpeg.lib
111 $(AR) libjpeg.lib $(LIBOBJECTS)
112
113cjpeg: $(COBJECTS) libjpeg.lib
114 $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.lib $(LDLIBS)
115
116djpeg: $(DOBJECTS) libjpeg.lib
117 $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.lib $(LDLIBS)
118
119jpegtran: $(TROBJECTS) libjpeg.lib
120 $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.lib $(LDLIBS)
121
122rdjpgcom: rdjpgcom.o
123 $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
124
125wrjpgcom: wrjpgcom.o
126 $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
127
128jconfig.h: jconfig.txt
129 echo You must prepare a system-dependent jconfig.h file.
130 echo Please read the installation directions in install.txt.
131 exit 1
132
133clean:
134 -$(RM) *.o cjpeg djpeg jpegtran libjpeg.lib rdjpgcom wrjpgcom
135 -$(RM) core testout*.*
136
137test: cjpeg djpeg jpegtran
138 -$(RM) testout*.*
139 djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
140 djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
141 cjpeg -dct int -outfile testout.jpg testimg.ppm
142 djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
143 cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
144 jpegtran -outfile testoutt.jpg testprog.jpg
145 cmp testimg.ppm testout.ppm
146 cmp testimg.bmp testout.bmp
147 cmp testimg.jpg testout.jpg
148 cmp testimg.ppm testoutp.ppm
149 cmp testimgp.jpg testoutp.jpg
150 cmp testorig.jpg testoutt.jpg
151
152
153jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
154jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
155jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
156jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
157jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
158jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
159jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
160jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
161jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
162jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
163jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
164jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
165jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
166jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
167jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
168jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
169jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
170jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
172jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
174jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
175jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
176jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
177jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
178jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
179jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
180jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
181jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
182jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
183jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
184jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
188jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
189jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
190jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
191jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
192jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
193jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
194jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
198jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
199jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
200jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
201jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
202jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
203cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
204djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
205jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
206rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
207wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
208cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
209rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
210rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
211transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
212rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
213wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
214rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
215wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
216rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
217wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
218rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
219wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
220rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
221wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mc6
new file mode 100644
index 0000000..b083ab6
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mc6
@@ -0,0 +1,256 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is for Microsoft C for MS-DOS, version 6.00A and up.
4# Use NMAKE, not Microsoft's brain-damaged MAKE.
5# Thanks to Alan Wright and Chris Turner of Olivetti Research Ltd.
6
7# Read installation instructions before saying "nmake" !!
8
9# You may need to adjust these compiler options:
10CFLAGS = -AM -Oecigt -Gs -W3
11# -AM medium memory model (or use -AS for small model, if you remove features)
12# -Oecigt -Gs maximum safe optimisation (-Ol has bugs in MSC 6.00A)
13# -W3 warning level 3
14# You might also want to add -G2 if you have an 80286, etc.
15# Generally, we recommend defining any configuration symbols in jconfig.h,
16# NOT via -D switches here.
17
18# Jan-Herman Buining suggests the following switches for MS C 8.0 and a 486:
19# CFLAGS = /AM /f- /FPi87 /G3 /Gs /Gy /Ob1 /Oc /Oe /Og /Oi /Ol /On /Oo /Ot \
20# /OV4 /W3
21# except for jquant1.c, which must be compiled with /Oo- to avoid a compiler
22# crash.
23
24# Ingar Steinsland suggests the following switches when building
25# a 16-bit Windows DLL:
26# CFLAGS = -ALw -Gsw -Zpe -W3 -O2 -Zi -Zd
27
28# Put here the object file name for the correct system-dependent memory
29# manager file. For DOS, we recommend jmemdos.c and jmemdosa.asm.
30# (But not for Windows; see install.txt if you use this makefile for Windows.)
31SYSDEPMEM= jmemdos.obj jmemdosa.obj
32# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
33SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj
34
35# End of configurable options.
36
37
38# source files: JPEG library proper
39LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
40 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
41 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
42 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
43 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
44 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
45 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
46 jquant2.c jutils.c jmemmgr.c
47# memmgr back ends: compile only one of these into a working library
48SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
49# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
50APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
51 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
52 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
53SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
54# files included by source files
55INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
56 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
57# documentation, test, and support files
58DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
59 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
60 coderules.txt filelist.txt change.log
61MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
62 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
63 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
64 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
65 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
66 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
67 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
68 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
69 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
70 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
71 makefile.mms makefile.vms makvms.opt
72CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
73 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
74 jconfig.vms
75CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
76OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
77 libjpeg.map
78TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
79 testimgp.jpg
80DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
81 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
82# library object files common to compression and decompression
83COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
84# compression library object files
85CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
86 jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
87 jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
88 jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
89# decompression library object files
90DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
91 jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
92 jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
93 jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
94 jdmerge.obj
95# These objectfiles are included in libjpeg.lib
96LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
97# object files for sample applications (excluding library files)
98COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
99 rdswitch.obj cdjpeg.obj
100DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
101 rdcolmap.obj cdjpeg.obj
102TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
103
104# need linker response file because file list > 128 chars
105RFILE = libjpeg.ans
106
107
108all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
109
110libjpeg.lib: $(LIBOBJECTS) $(RFILE)
111 del libjpeg.lib
112 lib @$(RFILE)
113
114# linker response file for building libjpeg.lib
115$(RFILE) : makefile
116 del $(RFILE)
117 echo libjpeg.lib >$(RFILE)
118# silly want-to-create-it prompt:
119 echo y >>$(RFILE)
120 echo +jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj & >>$(RFILE)
121 echo +jcparam.obj +jdatadst.obj +jcinit.obj +jcmaster.obj & >>$(RFILE)
122 echo +jcmarker.obj +jcmainct.obj +jcprepct.obj & >>$(RFILE)
123 echo +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & >>$(RFILE)
124 echo +jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj & >>$(RFILE)
125 echo +jfdctint.obj +jdapimin.obj +jdapistd.obj & >>$(RFILE)
126 echo +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & >>$(RFILE)
127 echo +jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj & >>$(RFILE)
128 echo +jdcoefct.obj +jdpostct.obj +jddctmgr.obj & >>$(RFILE)
129 echo +jidctfst.obj +jidctflt.obj +jidctint.obj & >>$(RFILE)
130 echo +jdsample.obj +jdcolor.obj +jquant1.obj & >>$(RFILE)
131 echo +jquant2.obj +jdmerge.obj +jaricom.obj +jcomapi.obj & >>$(RFILE)
132 echo +jutils.obj +jerror.obj +jmemmgr.obj & >>$(RFILE)
133 echo $(SYSDEPMEMLIB) ; >>$(RFILE)
134
135cjpeg.exe: $(COBJECTS) libjpeg.lib
136 echo $(COBJECTS) >cjpeg.lst
137 link /STACK:4096 /EXEPACK @cjpeg.lst, cjpeg.exe, , libjpeg.lib, ;
138 del cjpeg.lst
139
140djpeg.exe: $(DOBJECTS) libjpeg.lib
141 echo $(DOBJECTS) >djpeg.lst
142 link /STACK:4096 /EXEPACK @djpeg.lst, djpeg.exe, , libjpeg.lib, ;
143 del djpeg.lst
144
145jpegtran.exe: $(TROBJECTS) libjpeg.lib
146 link /STACK:4096 /EXEPACK $(TROBJECTS), jpegtran.exe, , libjpeg.lib, ;
147
148rdjpgcom.exe: rdjpgcom.c
149 $(CC) -AS -O -W3 rdjpgcom.c
150
151# wrjpgcom needs large model so it can malloc a 64K chunk
152wrjpgcom.exe: wrjpgcom.c
153 $(CC) -AL -O -W3 wrjpgcom.c
154
155jconfig.h: jconfig.txt
156 echo You must prepare a system-dependent jconfig.h file.
157 echo Please read the installation directions in install.txt.
158 exit 1
159
160clean:
161 del *.obj
162 del libjpeg.lib
163 del cjpeg.exe
164 del djpeg.exe
165 del jpegtran.exe
166 del rdjpgcom.exe
167 del wrjpgcom.exe
168 del testout*.*
169
170test: cjpeg.exe djpeg.exe jpegtran.exe
171 del testout*.*
172 djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
173 djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
174 cjpeg -dct int -outfile testout.jpg testimg.ppm
175 djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
176 cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
177 jpegtran -outfile testoutt.jpg testprog.jpg
178 fc /b testimg.ppm testout.ppm
179 fc /b testimg.bmp testout.bmp
180 fc /b testimg.jpg testout.jpg
181 fc /b testimg.ppm testoutp.ppm
182 fc /b testimgp.jpg testoutp.jpg
183 fc /b testorig.jpg testoutt.jpg
184
185
186jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
188jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
192jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
193jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
194jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
198jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
202jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
204jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
205jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
207jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
208jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
211jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
212jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
213jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
216jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
217jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
220jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
221jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
222jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
223jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
224jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
225jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
226jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
227jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
228jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
229jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
230jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
231jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
232jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
233jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
234jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
235jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
236cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
237djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
238jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
239rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
240wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
241cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
242rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
243rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
244transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
245rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
246wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
247rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
248wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
249rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
250wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
251rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
252wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
253rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
254wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
255jmemdosa.obj : jmemdosa.asm
256 masm /mx $*;
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mms b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mms
new file mode 100644
index 0000000..7d828e6
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.mms
@@ -0,0 +1,225 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is for use with MMS on Digital VMS systems.
4# Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)
5# and Tim Bell (tbell@netcom.com) for their help.
6
7# Read installation instructions before saying "MMS" !!
8
9# You may need to adjust these cc options:
10CFLAGS= $(CFLAGS) /NoDebug /Optimize
11# Generally, we recommend defining any configuration symbols in jconfig.h,
12# NOT via /Define switches here.
13.ifdef ALPHA
14OPT=
15.else
16OPT= ,Sys$Disk:[]MAKVMS.OPT/Option
17.endif
18
19# Put here the object file name for the correct system-dependent memory
20# manager file. For Unix this is usually jmemnobs.o, but you may want
21# to use jmemansi.o or jmemname.o if you have limited swap space.
22SYSDEPMEM= jmemnobs.obj
23
24# End of configurable options.
25
26
27# source files: JPEG library proper
28LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
29 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
30 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
31 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
32 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
33 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
34 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
35 jquant2.c jutils.c jmemmgr.c
36# memmgr back ends: compile only one of these into a working library
37SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
38# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
39APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
40 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
41 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
42SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
43# files included by source files
44INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
45 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
46# documentation, test, and support files
47DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
48 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
49 coderules.txt filelist.txt change.log
50MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
51 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
52 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
53 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
54 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
55 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
56 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
57 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
58 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
59 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
60 makefile.mms makefile.vms makvms.opt
61CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
62 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
63 jconfig.vms
64CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
65OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
66 libjpeg.map
67TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
68 testimgp.jpg
69DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
70 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
71# library object files common to compression and decompression
72COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
73# compression library object files
74CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
75 jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
76 jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
77 jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
78# decompression library object files
79DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
80 jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
81 jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
82 jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
83 jdmerge.obj
84# These objectfiles are included in libjpeg.olb
85LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
86# object files for sample applications (excluding library files)
87COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
88 rdswitch.obj cdjpeg.obj
89DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
90 rdcolmap.obj cdjpeg.obj
91TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
92# objectfile lists with commas --- what a crock
93COBJLIST= cjpeg.obj,rdppm.obj,rdgif.obj,rdtarga.obj,rdrle.obj,rdbmp.obj,\
94 rdswitch.obj,cdjpeg.obj
95DOBJLIST= djpeg.obj,wrppm.obj,wrgif.obj,wrtarga.obj,wrrle.obj,wrbmp.obj,\
96 rdcolmap.obj,cdjpeg.obj
97TROBJLIST= jpegtran.obj,rdswitch.obj,cdjpeg.obj,transupp.obj
98LIBOBJLIST= jaricom.obj,jcapimin.obj,jcapistd.obj,jcarith.obj,jctrans.obj,\
99 jcparam.obj,jdatadst.obj,jcinit.obj,jcmaster.obj,jcmarker.obj,\
100 jcmainct.obj,jcprepct.obj,jccoefct.obj,jccolor.obj,jcsample.obj,\
101 jchuff.obj,jcdctmgr.obj,jfdctfst.obj,jfdctflt.obj,jfdctint.obj,\
102 jdapimin.obj,jdapistd.obj,jdarith.obj,jdtrans.obj,jdatasrc.obj,\
103 jdmaster.obj,jdinput.obj,jdmarker.obj,jdhuff.obj,jdmainct.obj,\
104 jdcoefct.obj,jdpostct.obj,jddctmgr.obj,jidctfst.obj,jidctflt.obj,\
105 jidctint.obj,jdsample.obj,jdcolor.obj,jquant1.obj,jquant2.obj,\
106 jdmerge.obj,jcomapi.obj,jutils.obj,jerror.obj,jmemmgr.obj,$(SYSDEPMEM)
107
108
109.first
110 @- Define /NoLog Sys Sys$Library
111
112ALL : libjpeg.olb cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
113 @ Continue
114
115libjpeg.olb : $(LIBOBJECTS)
116 Library /Create libjpeg.olb $(LIBOBJLIST)
117
118cjpeg.exe : $(COBJECTS) libjpeg.olb
119 $(LINK) $(LFLAGS) /Executable = cjpeg.exe $(COBJLIST),libjpeg.olb/Library$(OPT)
120
121djpeg.exe : $(DOBJECTS) libjpeg.olb
122 $(LINK) $(LFLAGS) /Executable = djpeg.exe $(DOBJLIST),libjpeg.olb/Library$(OPT)
123
124jpegtran.exe : $(TROBJECTS) libjpeg.olb
125 $(LINK) $(LFLAGS) /Executable = jpegtran.exe $(TROBJLIST),libjpeg.olb/Library$(OPT)
126
127rdjpgcom.exe : rdjpgcom.obj
128 $(LINK) $(LFLAGS) /Executable = rdjpgcom.exe rdjpgcom.obj$(OPT)
129
130wrjpgcom.exe : wrjpgcom.obj
131 $(LINK) $(LFLAGS) /Executable = wrjpgcom.exe wrjpgcom.obj$(OPT)
132
133jconfig.h : jconfig.vms
134 @- Copy jconfig.vms jconfig.h
135
136clean :
137 @- Set Protection = Owner:RWED *.*;-1
138 @- Set Protection = Owner:RWED *.OBJ
139 - Purge /NoLog /NoConfirm *.*
140 - Delete /NoLog /NoConfirm *.OBJ;
141
142test : cjpeg.exe djpeg.exe jpegtran.exe
143 mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
144 mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
145 mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm
146 mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
147 mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
148 mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg
149 - Backup /Compare/Log testimg.ppm testout.ppm
150 - Backup /Compare/Log testimg.bmp testout.bmp
151 - Backup /Compare/Log testimg.jpg testout.jpg
152 - Backup /Compare/Log testimg.ppm testoutp.ppm
153 - Backup /Compare/Log testimgp.jpg testoutp.jpg
154 - Backup /Compare/Log testorig.jpg testoutt.jpg
155
156
157jaricom.obj : jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
158jcapimin.obj : jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
159jcapistd.obj : jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
160jcarith.obj : jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
161jccoefct.obj : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
162jccolor.obj : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
163jcdctmgr.obj : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
164jchuff.obj : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
165jcinit.obj : jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
166jcmainct.obj : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
167jcmarker.obj : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
168jcmaster.obj : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
169jcomapi.obj : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
170jcparam.obj : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jcprepct.obj : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
172jcsample.obj : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jctrans.obj : jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
174jdapimin.obj : jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
175jdapistd.obj : jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
176jdarith.obj : jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
177jdatadst.obj : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
178jdatasrc.obj : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
179jdcoefct.obj : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
180jdcolor.obj : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
181jddctmgr.obj : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
182jdhuff.obj : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
183jdinput.obj : jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
184jdmainct.obj : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jdmarker.obj : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jdmaster.obj : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jdmerge.obj : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
188jdpostct.obj : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jdsample.obj : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jdtrans.obj : jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jerror.obj : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
192jfdctflt.obj : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
193jfdctfst.obj : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
194jfdctint.obj : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
195jidctflt.obj : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
196jidctfst.obj : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
197jidctint.obj : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
198jquant1.obj : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jquant2.obj : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jutils.obj : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jmemmgr.obj : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
202jmemansi.obj : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
203jmemname.obj : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
204jmemnobs.obj : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
205jmemdos.obj : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
206jmemmac.obj : jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
207cjpeg.obj : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
208djpeg.obj : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
209jpegtran.obj : jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
210rdjpgcom.obj : rdjpgcom.c jinclude.h jconfig.h
211wrjpgcom.obj : wrjpgcom.c jinclude.h jconfig.h
212cdjpeg.obj : cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
213rdcolmap.obj : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
214rdswitch.obj : rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
215transupp.obj : transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
216rdppm.obj : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
217wrppm.obj : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
218rdgif.obj : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
219wrgif.obj : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
220rdtarga.obj : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
221wrtarga.obj : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
222rdbmp.obj : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
223wrbmp.obj : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
224rdrle.obj : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
225wrrle.obj : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.sas b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.sas
new file mode 100644
index 0000000..9ecb066
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.sas
@@ -0,0 +1,259 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is for Amiga systems using SAS C 6.0 and up.
4# Thanks to Ed Hanway, Mark Rinfret, and Jim Zepeda.
5
6# Read installation instructions before saying "make" !!
7
8# The name of your C compiler:
9CC= sc
10
11# You may need to adjust these cc options:
12# Uncomment the following lines for generic 680x0 version
13ARCHFLAGS= cpu=any
14SUFFIX=
15
16# Uncomment the following lines for 68030-only version
17#ARCHFLAGS= cpu=68030
18#SUFFIX=.030
19
20CFLAGS= nostackcheck data=near parms=register optimize $(ARCHFLAGS) \
21 ignore=104 ignore=304 ignore=306
22# ignore=104 disables warnings for mismatched const qualifiers
23# ignore=304 disables warnings for variables being optimized out
24# ignore=306 disables warnings for the inlining of functions
25# Generally, we recommend defining any configuration symbols in jconfig.h,
26# NOT via define switches here.
27
28# Link-time cc options:
29LDFLAGS= SC SD ND BATCH
30
31# To link any special libraries, add the necessary commands here.
32LDLIBS= LIB:scm.lib LIB:sc.lib
33
34# Put here the object file name for the correct system-dependent memory
35# manager file. For Amiga we recommend jmemname.o.
36SYSDEPMEM= jmemname.o
37
38# miscellaneous OS-dependent stuff
39# linker
40LN= slink
41# file deletion command
42RM= delete quiet
43# library (.lib) file creation command
44AR= oml
45
46# End of configurable options.
47
48
49# source files: JPEG library proper
50LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
51 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
52 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
53 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
54 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
55 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
56 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
57 jquant2.c jutils.c jmemmgr.c
58# memmgr back ends: compile only one of these into a working library
59SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
60# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
61APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
62 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
63 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
64SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
65# files included by source files
66INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
67 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
68# documentation, test, and support files
69DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
70 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
71 coderules.txt filelist.txt change.log
72MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
73 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
74 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
75 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
76 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
77 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
78 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
79 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
80 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
81 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
82 makefile.mms makefile.vms makvms.opt
83CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
84 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
85 jconfig.vms
86CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
87OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
88 libjpeg.map
89TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
90 testimgp.jpg
91DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
92 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
93# library object files common to compression and decompression
94COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
95# compression library object files
96CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \
97 jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \
98 jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \
99 jfdctflt.o jfdctint.o
100# decompression library object files
101DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \
102 jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \
103 jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \
104 jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
105# These objectfiles are included in libjpeg.lib
106LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
107# object files for sample applications (excluding library files)
108COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
109 cdjpeg.o
110DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
111 cdjpeg.o
112TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
113
114
115all: libjpeg.lib cjpeg$(SUFFIX) djpeg$(SUFFIX) jpegtran$(SUFFIX) rdjpgcom$(SUFFIX) wrjpgcom$(SUFFIX)
116
117# note: do several AR steps to avoid command line length limitations
118
119libjpeg.lib: $(LIBOBJECTS)
120 -$(RM) libjpeg.lib
121 $(AR) libjpeg.lib r $(CLIBOBJECTS)
122 $(AR) libjpeg.lib r $(DLIBOBJECTS)
123 $(AR) libjpeg.lib r $(COMOBJECTS)
124
125cjpeg$(SUFFIX): $(COBJECTS) libjpeg.lib
126 $(LN) <WITH <
127$(LDFLAGS)
128TO cjpeg$(SUFFIX)
129FROM LIB:c.o $(COBJECTS)
130LIB libjpeg.lib $(LDLIBS)
131<
132
133djpeg$(SUFFIX): $(DOBJECTS) libjpeg.lib
134 $(LN) <WITH <
135$(LDFLAGS)
136TO djpeg$(SUFFIX)
137FROM LIB:c.o $(DOBJECTS)
138LIB libjpeg.lib $(LDLIBS)
139<
140
141jpegtran$(SUFFIX): $(TROBJECTS) libjpeg.lib
142 $(LN) <WITH <
143$(LDFLAGS)
144TO jpegtran$(SUFFIX)
145FROM LIB:c.o $(TROBJECTS)
146LIB libjpeg.lib $(LDLIBS)
147<
148
149rdjpgcom$(SUFFIX): rdjpgcom.o
150 $(LN) <WITH <
151$(LDFLAGS)
152TO rdjpgcom$(SUFFIX)
153FROM LIB:c.o rdjpgcom.o
154LIB $(LDLIBS)
155<
156
157wrjpgcom$(SUFFIX): wrjpgcom.o
158 $(LN) <WITH <
159$(LDFLAGS)
160TO wrjpgcom$(SUFFIX)
161FROM LIB:c.o wrjpgcom.o
162LIB $(LDLIBS)
163<
164
165jconfig.h: jconfig.txt
166 echo You must prepare a system-dependent jconfig.h file.
167 echo Please read the installation directions in install.txt.
168 exit 1
169
170clean:
171 -$(RM) *.o cjpeg djpeg jpegtran cjpeg.030 djpeg.030 jpegtran.030
172 -$(RM) rdjpgcom wrjpgcom rdjpgcom.030 wrjpgcom.030
173 -$(RM) libjpeg.lib core testout*.*
174
175test: cjpeg djpeg jpegtran
176 -$(RM) testout*.*
177 djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
178 djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
179 cjpeg -dct int -outfile testout.jpg testimg.ppm
180 djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
181 cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
182 jpegtran -outfile testoutt.jpg testprog.jpg
183 cmp testimg.ppm testout.ppm
184 cmp testimg.bmp testout.bmp
185 cmp testimg.jpg testout.jpg
186 cmp testimg.ppm testoutp.ppm
187 cmp testimgp.jpg testoutp.jpg
188 cmp testorig.jpg testoutt.jpg
189
190
191jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
192jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
193jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
194jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
198jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
202jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
204jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
205jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
207jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
208jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
211jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
212jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
213jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
216jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
217jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
220jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
221jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
222jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
223jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
224jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
225jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
226jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
227jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
228jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
229jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
230jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
231jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
232jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
233jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
234jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
235jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
236jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
237jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
238jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
239jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
240jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
241cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
242djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
243jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
244rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
245wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
246cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
247rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
248rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
249transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
250rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
251wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
252rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
253wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
254rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
255wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
256rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
257wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
258rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
259wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.unix b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.unix
new file mode 100644
index 0000000..3167907
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.unix
@@ -0,0 +1,235 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Unix-like systems with non-ANSI compilers.
4# If you have an ANSI compiler, makefile.ansi is a better starting point.
5
6# Read installation instructions before saying "make" !!
7
8# The name of your C compiler:
9CC= cc
10
11# You may need to adjust these cc options:
12CFLAGS= -O
13# Generally, we recommend defining any configuration symbols in jconfig.h,
14# NOT via -D switches here.
15# However, any special defines for ansi2knr.c may be included here:
16ANSI2KNRFLAGS=
17
18# Link-time cc options:
19LDFLAGS=
20
21# To link any special libraries, add the necessary -l commands here.
22LDLIBS=
23
24# Put here the object file name for the correct system-dependent memory
25# manager file. For Unix this is usually jmemnobs.o, but you may want
26# to use jmemansi.o or jmemname.o if you have limited swap space.
27SYSDEPMEM= jmemnobs.o
28
29# miscellaneous OS-dependent stuff
30# linker
31LN= $(CC)
32# file deletion command
33RM= rm -f
34# file rename command
35MV= mv
36# library (.a) file creation command
37AR= ar rc
38# second step in .a creation (use "touch" if not needed)
39AR2= ranlib
40
41# End of configurable options.
42
43
44# source files: JPEG library proper
45LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
46 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
47 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
48 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
49 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
50 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
51 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
52 jquant2.c jutils.c jmemmgr.c
53# memmgr back ends: compile only one of these into a working library
54SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
55# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
56APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
57 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
58 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
59SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
60# files included by source files
61INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
62 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
63# documentation, test, and support files
64DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
65 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
66 coderules.txt filelist.txt change.log
67MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
68 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
69 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
70 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
71 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
72 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
73 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
74 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
75 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
76 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
77 makefile.mms makefile.vms makvms.opt
78CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
79 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
80 jconfig.vms
81CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
82OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
83 libjpeg.map
84TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
85 testimgp.jpg
86DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
87 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
88# library object files common to compression and decompression
89COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
90# compression library object files
91CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \
92 jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \
93 jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \
94 jfdctflt.o jfdctint.o
95# decompression library object files
96DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \
97 jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \
98 jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \
99 jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
100# These objectfiles are included in libjpeg.a
101LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
102# object files for sample applications (excluding library files)
103COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \
104 cdjpeg.o
105DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \
106 cdjpeg.o
107TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o
108
109
110all: ansi2knr libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom
111
112# This rule causes ansi2knr to be invoked.
113.c.o:
114 ./ansi2knr $*.c T$*.c
115 $(CC) $(CFLAGS) -c T$*.c
116 $(RM) T$*.c $*.o
117 $(MV) T$*.o $*.o
118
119ansi2knr: ansi2knr.c
120 $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
121
122libjpeg.a: ansi2knr $(LIBOBJECTS)
123 $(RM) libjpeg.a
124 $(AR) libjpeg.a $(LIBOBJECTS)
125 $(AR2) libjpeg.a
126
127cjpeg: ansi2knr $(COBJECTS) libjpeg.a
128 $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
129
130djpeg: ansi2knr $(DOBJECTS) libjpeg.a
131 $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
132
133jpegtran: ansi2knr $(TROBJECTS) libjpeg.a
134 $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS)
135
136rdjpgcom: rdjpgcom.o
137 $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
138
139wrjpgcom: wrjpgcom.o
140 $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
141
142jconfig.h: jconfig.txt
143 echo You must prepare a system-dependent jconfig.h file.
144 echo Please read the installation directions in install.txt.
145 exit 1
146
147clean:
148 $(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom
149 $(RM) ansi2knr core testout*
150
151test: cjpeg djpeg jpegtran
152 $(RM) testout*
153 ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
154 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
155 ./cjpeg -dct int -outfile testout.jpg testimg.ppm
156 ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
157 ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
158 ./jpegtran -outfile testoutt.jpg testprog.jpg
159 cmp testimg.ppm testout.ppm
160 cmp testimg.bmp testout.bmp
161 cmp testimg.jpg testout.jpg
162 cmp testimg.ppm testoutp.ppm
163 cmp testimgp.jpg testoutp.jpg
164 cmp testorig.jpg testoutt.jpg
165
166
167jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
168jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
169jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
170jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
172jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
174jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
175jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
176jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
177jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
178jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
179jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
180jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
181jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
182jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
183jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
184jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
188jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
189jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
192jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
193jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
194jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
198jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
202jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
203jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
204jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
205jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
206jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
207jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
208jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
211jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
212jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
213jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
214jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
215jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
216jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
217cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
218djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
219jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
220rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h
221wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h
222cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
223rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
224rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
225transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
226rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
227wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
228rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
229wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
230rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
231wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
232rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
233wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
234rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
235wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vc b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vc
new file mode 100644
index 0000000..c2ba6ff
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vc
@@ -0,0 +1,273 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is for Microsoft Visual C++ on Windows NT (and 95?).
4# It builds the IJG library as a statically linkable library (.LIB),
5# and builds the sample applications as console-mode apps.
6# Thanks to Xingong Chang, Raymond Everly and others.
7
8# Read installation instructions before saying "nmake" !!
9# To build an optimized library without debug info, say "nmake nodebug=1".
10
11# Pull in standard variable definitions
12!include <win32.mak>
13
14# You may want to adjust these compiler options:
15CFLAGS= $(cflags) $(cdebug) $(cvars) -I.
16# Generally, we recommend defining any configuration symbols in jconfig.h,
17# NOT via -D switches here.
18
19# Link-time options:
20LDFLAGS= $(ldebug) $(conlflags)
21
22# To link any special libraries, add the necessary commands here.
23LDLIBS= $(conlibs)
24
25# Put here the object file name for the correct system-dependent memory
26# manager file. For NT we suggest jmemnobs.obj, which expects the OS to
27# provide adequate virtual memory.
28SYSDEPMEM= jmemnobs.obj
29
30# miscellaneous OS-dependent stuff
31# file deletion command
32RM= del
33
34# End of configurable options.
35
36
37# source files: JPEG library proper
38LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
39 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
40 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
41 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
42 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
43 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
44 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
45 jquant2.c jutils.c jmemmgr.c
46# memmgr back ends: compile only one of these into a working library
47SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
48# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
49APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
50 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
51 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
52SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
53# files included by source files
54INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
55 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
56# documentation, test, and support files
57DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
58 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
59 coderules.txt filelist.txt change.log
60MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
61 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
62 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
63 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
64 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
65 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
66 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
67 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
68 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
69 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
70 makefile.mms makefile.vms makvms.opt
71CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
72 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
73 jconfig.vms
74CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
75OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
76 libjpeg.map
77TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
78 testimgp.jpg
79DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
80 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
81# library object files common to compression and decompression
82COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
83# compression library object files
84CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
85 jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
86 jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
87 jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
88# decompression library object files
89DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
90 jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
91 jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
92 jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
93 jdmerge.obj
94# These objectfiles are included in libjpeg.lib
95LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
96# object files for sample applications (excluding library files)
97COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
98 rdswitch.obj cdjpeg.obj
99DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
100 rdcolmap.obj cdjpeg.obj
101TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
102
103# Template command for compiling .c to .obj
104.c.obj:
105 $(cc) $(CFLAGS) $*.c
106
107
108all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
109
110libjpeg.lib: $(LIBOBJECTS)
111 $(RM) libjpeg.lib
112 lib -out:libjpeg.lib $(LIBOBJECTS)
113
114cjpeg.exe: $(COBJECTS) libjpeg.lib
115 $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS)
116
117djpeg.exe: $(DOBJECTS) libjpeg.lib
118 $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS)
119
120jpegtran.exe: $(TROBJECTS) libjpeg.lib
121 $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS)
122
123rdjpgcom.exe: rdjpgcom.obj
124 $(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS)
125
126wrjpgcom.exe: wrjpgcom.obj
127 $(link) $(LDFLAGS) -out:wrjpgcom.exe wrjpgcom.obj $(LDLIBS)
128
129
130clean:
131 $(RM) *.obj *.exe libjpeg.lib
132 $(RM) testout*
133
134setup-vc6:
135 ren jconfig.vc jconfig.h
136 ren makejdsw.vc6 jpeg.dsw
137 ren makeadsw.vc6 apps.dsw
138 ren makejmak.vc6 jpeg.mak
139 ren makejdep.vc6 jpeg.dep
140 ren makejdsp.vc6 jpeg.dsp
141 ren makecmak.vc6 cjpeg.mak
142 ren makecdep.vc6 cjpeg.dep
143 ren makecdsp.vc6 cjpeg.dsp
144 ren makedmak.vc6 djpeg.mak
145 ren makeddep.vc6 djpeg.dep
146 ren makeddsp.vc6 djpeg.dsp
147 ren maketmak.vc6 jpegtran.mak
148 ren maketdep.vc6 jpegtran.dep
149 ren maketdsp.vc6 jpegtran.dsp
150 ren makermak.vc6 rdjpgcom.mak
151 ren makerdep.vc6 rdjpgcom.dep
152 ren makerdsp.vc6 rdjpgcom.dsp
153 ren makewmak.vc6 wrjpgcom.mak
154 ren makewdep.vc6 wrjpgcom.dep
155 ren makewdsp.vc6 wrjpgcom.dsp
156
157setup-v10:
158 ren jconfig.vc jconfig.h
159 ren makejsln.v10 jpeg.sln
160 ren makeasln.v10 apps.sln
161 ren makejvcx.v10 jpeg.vcxproj
162 ren makejfil.v10 jpeg.vcxproj.filters
163 ren makecvcx.v10 cjpeg.vcxproj
164 ren makecfil.v10 cjpeg.vcxproj.filters
165 ren makedvcx.v10 djpeg.vcxproj
166 ren makedfil.v10 djpeg.vcxproj.filters
167 ren maketvcx.v10 jpegtran.vcxproj
168 ren maketfil.v10 jpegtran.vcxproj.filters
169 ren makervcx.v10 rdjpgcom.vcxproj
170 ren makerfil.v10 rdjpgcom.vcxproj.filters
171 ren makewvcx.v10 wrjpgcom.vcxproj
172 ren makewfil.v10 wrjpgcom.vcxproj.filters
173
174test:
175 IF EXIST testout* $(RM) testout*
176 .\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
177 .\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
178 .\cjpeg -dct int -outfile testout.jpg testimg.ppm
179 .\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
180 .\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
181 .\jpegtran -outfile testoutt.jpg testprog.jpg
182 fc /b testimg.ppm testout.ppm
183 fc /b testimg.bmp testout.bmp
184 fc /b testimg.jpg testout.jpg
185 fc /b testimg.ppm testoutp.ppm
186 fc /b testimgp.jpg testoutp.jpg
187 fc /b testorig.jpg testoutt.jpg
188
189test-build:
190 IF EXIST testout* $(RM) testout*
191 .\djpeg\Release\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
192 .\djpeg\Release\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
193 .\cjpeg\Release\cjpeg -dct int -outfile testout.jpg testimg.ppm
194 .\djpeg\Release\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
195 .\cjpeg\Release\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
196 .\jpegtran\Release\jpegtran -outfile testoutt.jpg testprog.jpg
197 fc /b testimg.ppm testout.ppm
198 fc /b testimg.bmp testout.bmp
199 fc /b testimg.jpg testout.jpg
200 fc /b testimg.ppm testoutp.ppm
201 fc /b testimgp.jpg testoutp.jpg
202 fc /b testorig.jpg testoutt.jpg
203
204
205jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
207jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
208jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
211jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
212jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
213jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
216jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
217jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
220jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
221jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
222jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
223jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
224jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
225jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
226jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
227jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
228jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
229jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
230jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
231jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
232jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
233jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
234jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
235jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
236jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
237jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
238jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
239jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
240jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
241jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
242jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
243jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
244jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
245jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
246jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
247jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
248jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
249jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
250jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
251jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
252jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
253jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
254jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
255cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
256djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
257jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
258rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
259wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
260cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
261rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
262rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
263transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
264rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
265wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
266rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
267wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
268rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
269wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
270rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
271wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
272rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
273wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vms b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vms
new file mode 100644
index 0000000..5d89ff2
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.vms
@@ -0,0 +1,142 @@
1$! Makefile for Independent JPEG Group's software
2$!
3$! This is a command procedure for Digital VMS systems that do not have MMS.
4$! It builds the JPEG software by brute force, recompiling everything whether
5$! or not it is necessary. It then runs the basic self-test.
6$! Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)
7$! and Tim Bell (tbell@netcom.com) for their help.
8$!
9$! Read installation instructions before running this!!
10$!
11$ If F$Mode () .eqs. "INTERACTIVE"
12$ Then
13$ VERIFY = F$Verify (0)
14$ Else
15$ VERIFY = F$Verify (1)
16$ EndIf
17$ On Control_Y Then GoTo End
18$ On Error Then GoTo End
19$
20$ If F$GetSyi ("HW_MODEL") .gt. 1023
21$ Then
22$ OPT = ""
23$ Else
24$ OPT = ",Sys$Disk:[]makvms.opt/Option"
25$ EndIf
26$
27$ DoCompile := CC /NoDebug /Optimize /NoList
28$!
29$ DoCompile jaricom.c
30$ DoCompile jcapimin.c
31$ DoCompile jcapistd.c
32$ DoCompile jcarith.c
33$ DoCompile jctrans.c
34$ DoCompile jcparam.c
35$ DoCompile jdatadst.c
36$ DoCompile jcinit.c
37$ DoCompile jcmaster.c
38$ DoCompile jcmarker.c
39$ DoCompile jcmainct.c
40$ DoCompile jcprepct.c
41$ DoCompile jccoefct.c
42$ DoCompile jccolor.c
43$ DoCompile jcsample.c
44$ DoCompile jchuff.c
45$ DoCompile jcdctmgr.c
46$ DoCompile jfdctfst.c
47$ DoCompile jfdctflt.c
48$ DoCompile jfdctint.c
49$ DoCompile jdapimin.c
50$ DoCompile jdapistd.c
51$ DoCompile jdarith.c
52$ DoCompile jdtrans.c
53$ DoCompile jdatasrc.c
54$ DoCompile jdmaster.c
55$ DoCompile jdinput.c
56$ DoCompile jdmarker.c
57$ DoCompile jdhuff.c
58$ DoCompile jdmainct.c
59$ DoCompile jdcoefct.c
60$ DoCompile jdpostct.c
61$ DoCompile jddctmgr.c
62$ DoCompile jidctfst.c
63$ DoCompile jidctflt.c
64$ DoCompile jidctint.c
65$ DoCompile jdsample.c
66$ DoCompile jdcolor.c
67$ DoCompile jquant1.c
68$ DoCompile jquant2.c
69$ DoCompile jdmerge.c
70$ DoCompile jcomapi.c
71$ DoCompile jutils.c
72$ DoCompile jerror.c
73$ DoCompile jmemmgr.c
74$ DoCompile jmemnobs.c
75$!
76$ Library /Create libjpeg.olb jaricom.obj,jcapimin.obj,jcapistd.obj, -
77 jcarith.obj,jctrans.obj,jcparam.obj,jdatadst.obj,jcinit.obj, -
78 jcmaster.obj,jcmarker.obj,jcmainct.obj,jcprepct.obj,jccoefct.obj, -
79 jccolor.obj,jcsample.obj,jchuff.obj,jcdctmgr.obj,jfdctfst.obj, -
80 jfdctflt.obj,jfdctint.obj,jdapimin.obj,jdapistd.obj,jdarith.obj, -
81 jdtrans.obj,jdatasrc.obj,jdmaster.obj,jdinput.obj,jdmarker.obj, -
82 jdhuff.obj,jdmainct.obj,jdcoefct.obj,jdpostct.obj,jddctmgr.obj, -
83 jidctfst.obj,jidctflt.obj,jidctint.obj,jdsample.obj,jdcolor.obj, -
84 jquant1.obj,jquant2.obj,jdmerge.obj,jcomapi.obj,jutils.obj, -
85 jerror.obj,jmemmgr.obj,jmemnobs.obj
86$!
87$ DoCompile cjpeg.c
88$ DoCompile rdppm.c
89$ DoCompile rdgif.c
90$ DoCompile rdtarga.c
91$ DoCompile rdrle.c
92$ DoCompile rdbmp.c
93$ DoCompile rdswitch.c
94$ DoCompile cdjpeg.c
95$!
96$ Link /NoMap /Executable = cjpeg.exe cjpeg.obj,rdppm.obj,rdgif.obj, -
97 rdtarga.obj,rdrle.obj,rdbmp.obj,rdswitch.obj,cdjpeg.obj,libjpeg.olb/Library'OPT'
98$!
99$ DoCompile djpeg.c
100$ DoCompile wrppm.c
101$ DoCompile wrgif.c
102$ DoCompile wrtarga.c
103$ DoCompile wrrle.c
104$ DoCompile wrbmp.c
105$ DoCompile rdcolmap.c
106$ DoCompile cdjpeg.c
107$!
108$ Link /NoMap /Executable = djpeg.exe djpeg.obj,wrppm.obj,wrgif.obj, -
109 wrtarga.obj,wrrle.obj,wrbmp.obj,rdcolmap.obj,cdjpeg.obj,libjpeg.olb/Library'OPT'
110$!
111$ DoCompile jpegtran.c
112$ DoCompile rdswitch.c
113$ DoCompile cdjpeg.c
114$ DoCompile transupp.c
115$!
116$ Link /NoMap /Executable = jpegtran.exe jpegtran.obj,rdswitch.obj, -
117 cdjpeg.obj,transupp.obj,libjpeg.olb/Library'OPT'
118$!
119$ DoCompile rdjpgcom.c
120$ Link /NoMap /Executable = rdjpgcom.exe rdjpgcom.obj'OPT'
121$!
122$ DoCompile wrjpgcom.c
123$ Link /NoMap /Executable = wrjpgcom.exe wrjpgcom.obj'OPT'
124$!
125$! Run the self-test
126$!
127$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
128$ mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
129$ mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm
130$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
131$ mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
132$ mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg
133$ Backup /Compare/Log testimg.ppm testout.ppm
134$ Backup /Compare/Log testimg.bmp testout.bmp
135$ Backup /Compare/Log testimg.jpg testout.jpg
136$ Backup /Compare/Log testimg.ppm testoutp.ppm
137$ Backup /Compare/Log testimgp.jpg testoutp.jpg
138$ Backup /Compare/Log testorig.jpg testoutt.jpg
139$!
140$End:
141$ If Verify Then Set Verify
142$ Exit
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.wat b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.wat
new file mode 100644
index 0000000..8ba7fe6
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makefile.wat
@@ -0,0 +1,240 @@
1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Watcom C/C++ 10.0 on MS-DOS (using
4# dos4g extender), OS/2, and Windows NT console mode.
5# Thanks to Janos Haide, jhaide@btrvtech.com.
6
7# Read installation instructions before saying "wmake" !!
8
9# Uncomment line for desired system
10SYSTEM=DOS
11#SYSTEM=OS2
12#SYSTEM=NT
13
14# The name of your C compiler:
15CC= wcl386
16
17# You may need to adjust these cc options:
18CFLAGS= -4r -ort -wx -zq -bt=$(SYSTEM)
19# Caution: avoid -ol or -ox; these generate bad code with 10.0 or 10.0a.
20# Generally, we recommend defining any configuration symbols in jconfig.h,
21# NOT via -D switches here.
22
23# Link-time cc options:
24!ifeq SYSTEM DOS
25LDFLAGS= -zq -l=dos4g
26!else ifeq SYSTEM OS2
27LDFLAGS= -zq -l=os2v2
28!else ifeq SYSTEM NT
29LDFLAGS= -zq -l=nt
30!endif
31
32# Put here the object file name for the correct system-dependent memory
33# manager file. jmemnobs should work fine for dos4g or OS/2 environment.
34SYSDEPMEM= jmemnobs.obj
35
36# End of configurable options.
37
38
39# source files: JPEG library proper
40LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c &
41 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c &
42 jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c &
43 jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c &
44 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c &
45 jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c &
46 jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c &
47 jquant2.c jutils.c jmemmgr.c
48# memmgr back ends: compile only one of these into a working library
49SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
50# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
51APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c &
52 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c &
53 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
54SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
55# files included by source files
56INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h &
57 jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
58# documentation, test, and support files
59DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 &
60 wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt &
61 coderules.txt filelist.txt change.log
62MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc &
63 makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 &
64 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 &
65 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 &
66 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 &
67 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 &
68 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 &
69 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 &
70 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st &
71 makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas &
72 makefile.mms makefile.vms makvms.opt
73CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat &
74 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas &
75 jconfig.vms
76CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
77OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm &
78 libjpeg.map
79TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg &
80 testimgp.jpg
81DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) &
82 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
83# library object files common to compression and decompression
84COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
85# compression library object files
86CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj &
87 jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj &
88 jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj &
89 jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
90# decompression library object files
91DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj &
92 jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj &
93 jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj &
94 jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj &
95 jdmerge.obj
96# These objectfiles are included in libjpeg.lib
97LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
98# object files for sample applications (excluding library files)
99COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj &
100 rdswitch.obj cdjpeg.obj
101DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj &
102 rdcolmap.obj cdjpeg.obj
103TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
104
105
106all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
107
108libjpeg.lib: $(LIBOBJECTS)
109 - del libjpeg.lib
110 * wlib -n libjpeg.lib $(LIBOBJECTS)
111
112cjpeg.exe: $(COBJECTS) libjpeg.lib
113 $(CC) $(LDFLAGS) $(COBJECTS) libjpeg.lib
114
115djpeg.exe: $(DOBJECTS) libjpeg.lib
116 $(CC) $(LDFLAGS) $(DOBJECTS) libjpeg.lib
117
118jpegtran.exe: $(TROBJECTS) libjpeg.lib
119 $(CC) $(LDFLAGS) $(TROBJECTS) libjpeg.lib
120
121rdjpgcom.exe: rdjpgcom.c
122 $(CC) $(CFLAGS) $(LDFLAGS) rdjpgcom.c
123
124wrjpgcom.exe: wrjpgcom.c
125 $(CC) $(CFLAGS) $(LDFLAGS) wrjpgcom.c
126
127.c.obj:
128 $(CC) $(CFLAGS) -c $<
129
130jconfig.h: jconfig.txt
131 echo You must prepare a system-dependent jconfig.h file.
132 echo Please read the installation directions in install.txt.
133 exit 1
134
135clean: .SYMBOLIC
136 - del *.obj
137 - del libjpeg.lib
138 - del cjpeg.exe
139 - del djpeg.exe
140 - del jpegtran.exe
141 - del rdjpgcom.exe
142 - del wrjpgcom.exe
143 - del testout*.*
144
145test: cjpeg.exe djpeg.exe jpegtran.exe .SYMBOLIC
146 - del testout*.*
147 djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
148 djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
149 cjpeg -dct int -outfile testout.jpg testimg.ppm
150 djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
151 cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
152 jpegtran -outfile testoutt.jpg testprog.jpg
153!ifeq SYSTEM DOS
154 fc /b testimg.ppm testout.ppm
155 fc /b testimg.bmp testout.bmp
156 fc /b testimg.jpg testout.jpg
157 fc /b testimg.ppm testoutp.ppm
158 fc /b testimgp.jpg testoutp.jpg
159 fc /b testorig.jpg testoutt.jpg
160!else
161 echo n > n.tmp
162 comp testimg.ppm testout.ppm < n.tmp
163 comp testimg.bmp testout.bmp < n.tmp
164 comp testimg.jpg testout.jpg < n.tmp
165 comp testimg.ppm testoutp.ppm < n.tmp
166 comp testimgp.jpg testoutp.jpg < n.tmp
167 comp testorig.jpg testoutt.jpg < n.tmp
168 del n.tmp
169!endif
170
171
172jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
174jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
175jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
176jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
177jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
178jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
179jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
180jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
181jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
182jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
183jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
184jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
188jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
192jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
193jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
194jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
197jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
198jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
202jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
204jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
205jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
207jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
208jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
209jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
210jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
211jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
212jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
213jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
216jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
217jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
218jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
219jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
220jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
221jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
222cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
223djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
224jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
225rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
226wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
227cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
228rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
229rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
230transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
231rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
232wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
233rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
234wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
235rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
236wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
237rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
238wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
239rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
240wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdep.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdep.vc6
new file mode 100644
index 0000000..d1e3c5f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdep.vc6
@@ -0,0 +1,423 @@
1# Microsoft Developer Studio erstellte Abhängigkeitsdatei, einbezogen von jpeg.mak
2
3.\jaricom.c : \
4 ".\jconfig.h"\
5 ".\jerror.h"\
6 ".\jinclude.h"\
7 ".\jmorecfg.h"\
8 ".\jpegint.h"\
9 ".\jpeglib.h"\
10
11
12.\jcapimin.c : \
13 ".\jconfig.h"\
14 ".\jerror.h"\
15 ".\jinclude.h"\
16 ".\jmorecfg.h"\
17 ".\jpegint.h"\
18 ".\jpeglib.h"\
19
20
21.\jcapistd.c : \
22 ".\jconfig.h"\
23 ".\jerror.h"\
24 ".\jinclude.h"\
25 ".\jmorecfg.h"\
26 ".\jpegint.h"\
27 ".\jpeglib.h"\
28
29
30.\jcarith.c : \
31 ".\jconfig.h"\
32 ".\jerror.h"\
33 ".\jinclude.h"\
34 ".\jmorecfg.h"\
35 ".\jpegint.h"\
36 ".\jpeglib.h"\
37
38
39.\jccoefct.c : \
40 ".\jconfig.h"\
41 ".\jerror.h"\
42 ".\jinclude.h"\
43 ".\jmorecfg.h"\
44 ".\jpegint.h"\
45 ".\jpeglib.h"\
46
47
48.\jccolor.c : \
49 ".\jconfig.h"\
50 ".\jerror.h"\
51 ".\jinclude.h"\
52 ".\jmorecfg.h"\
53 ".\jpegint.h"\
54 ".\jpeglib.h"\
55
56
57.\jcdctmgr.c : \
58 ".\jconfig.h"\
59 ".\jdct.h"\
60 ".\jerror.h"\
61 ".\jinclude.h"\
62 ".\jmorecfg.h"\
63 ".\jpegint.h"\
64 ".\jpeglib.h"\
65
66
67.\jchuff.c : \
68 ".\jconfig.h"\
69 ".\jerror.h"\
70 ".\jinclude.h"\
71 ".\jmorecfg.h"\
72 ".\jpegint.h"\
73 ".\jpeglib.h"\
74
75
76.\jcinit.c : \
77 ".\jconfig.h"\
78 ".\jerror.h"\
79 ".\jinclude.h"\
80 ".\jmorecfg.h"\
81 ".\jpegint.h"\
82 ".\jpeglib.h"\
83
84
85.\jcmainct.c : \
86 ".\jconfig.h"\
87 ".\jerror.h"\
88 ".\jinclude.h"\
89 ".\jmorecfg.h"\
90 ".\jpegint.h"\
91 ".\jpeglib.h"\
92
93
94.\jcmarker.c : \
95 ".\jconfig.h"\
96 ".\jerror.h"\
97 ".\jinclude.h"\
98 ".\jmorecfg.h"\
99 ".\jpegint.h"\
100 ".\jpeglib.h"\
101
102
103.\jcmaster.c : \
104 ".\jconfig.h"\
105 ".\jerror.h"\
106 ".\jinclude.h"\
107 ".\jmorecfg.h"\
108 ".\jpegint.h"\
109 ".\jpeglib.h"\
110
111
112.\jcomapi.c : \
113 ".\jconfig.h"\
114 ".\jerror.h"\
115 ".\jinclude.h"\
116 ".\jmorecfg.h"\
117 ".\jpegint.h"\
118 ".\jpeglib.h"\
119
120
121.\jcparam.c : \
122 ".\jconfig.h"\
123 ".\jerror.h"\
124 ".\jinclude.h"\
125 ".\jmorecfg.h"\
126 ".\jpegint.h"\
127 ".\jpeglib.h"\
128
129
130.\jcprepct.c : \
131 ".\jconfig.h"\
132 ".\jerror.h"\
133 ".\jinclude.h"\
134 ".\jmorecfg.h"\
135 ".\jpegint.h"\
136 ".\jpeglib.h"\
137
138
139.\jcsample.c : \
140 ".\jconfig.h"\
141 ".\jerror.h"\
142 ".\jinclude.h"\
143 ".\jmorecfg.h"\
144 ".\jpegint.h"\
145 ".\jpeglib.h"\
146
147
148.\jctrans.c : \
149 ".\jconfig.h"\
150 ".\jerror.h"\
151 ".\jinclude.h"\
152 ".\jmorecfg.h"\
153 ".\jpegint.h"\
154 ".\jpeglib.h"\
155
156
157.\jdapimin.c : \
158 ".\jconfig.h"\
159 ".\jerror.h"\
160 ".\jinclude.h"\
161 ".\jmorecfg.h"\
162 ".\jpegint.h"\
163 ".\jpeglib.h"\
164
165
166.\jdapistd.c : \
167 ".\jconfig.h"\
168 ".\jerror.h"\
169 ".\jinclude.h"\
170 ".\jmorecfg.h"\
171 ".\jpegint.h"\
172 ".\jpeglib.h"\
173
174
175.\jdarith.c : \
176 ".\jconfig.h"\
177 ".\jerror.h"\
178 ".\jinclude.h"\
179 ".\jmorecfg.h"\
180 ".\jpegint.h"\
181 ".\jpeglib.h"\
182
183
184.\jdatadst.c : \
185 ".\jconfig.h"\
186 ".\jerror.h"\
187 ".\jinclude.h"\
188 ".\jmorecfg.h"\
189 ".\jpeglib.h"\
190
191
192.\jdatasrc.c : \
193 ".\jconfig.h"\
194 ".\jerror.h"\
195 ".\jinclude.h"\
196 ".\jmorecfg.h"\
197 ".\jpeglib.h"\
198
199
200.\jdcoefct.c : \
201 ".\jconfig.h"\
202 ".\jerror.h"\
203 ".\jinclude.h"\
204 ".\jmorecfg.h"\
205 ".\jpegint.h"\
206 ".\jpeglib.h"\
207
208
209.\jdcolor.c : \
210 ".\jconfig.h"\
211 ".\jerror.h"\
212 ".\jinclude.h"\
213 ".\jmorecfg.h"\
214 ".\jpegint.h"\
215 ".\jpeglib.h"\
216
217
218.\jddctmgr.c : \
219 ".\jconfig.h"\
220 ".\jdct.h"\
221 ".\jerror.h"\
222 ".\jinclude.h"\
223 ".\jmorecfg.h"\
224 ".\jpegint.h"\
225 ".\jpeglib.h"\
226
227
228.\jdhuff.c : \
229 ".\jconfig.h"\
230 ".\jerror.h"\
231 ".\jinclude.h"\
232 ".\jmorecfg.h"\
233 ".\jpegint.h"\
234 ".\jpeglib.h"\
235
236
237.\jdinput.c : \
238 ".\jconfig.h"\
239 ".\jerror.h"\
240 ".\jinclude.h"\
241 ".\jmorecfg.h"\
242 ".\jpegint.h"\
243 ".\jpeglib.h"\
244
245
246.\jdmainct.c : \
247 ".\jconfig.h"\
248 ".\jerror.h"\
249 ".\jinclude.h"\
250 ".\jmorecfg.h"\
251 ".\jpegint.h"\
252 ".\jpeglib.h"\
253
254
255.\jdmarker.c : \
256 ".\jconfig.h"\
257 ".\jerror.h"\
258 ".\jinclude.h"\
259 ".\jmorecfg.h"\
260 ".\jpegint.h"\
261 ".\jpeglib.h"\
262
263
264.\jdmaster.c : \
265 ".\jconfig.h"\
266 ".\jerror.h"\
267 ".\jinclude.h"\
268 ".\jmorecfg.h"\
269 ".\jpegint.h"\
270 ".\jpeglib.h"\
271
272
273.\jdmerge.c : \
274 ".\jconfig.h"\
275 ".\jerror.h"\
276 ".\jinclude.h"\
277 ".\jmorecfg.h"\
278 ".\jpegint.h"\
279 ".\jpeglib.h"\
280
281
282.\jdpostct.c : \
283 ".\jconfig.h"\
284 ".\jerror.h"\
285 ".\jinclude.h"\
286 ".\jmorecfg.h"\
287 ".\jpegint.h"\
288 ".\jpeglib.h"\
289
290
291.\jdsample.c : \
292 ".\jconfig.h"\
293 ".\jerror.h"\
294 ".\jinclude.h"\
295 ".\jmorecfg.h"\
296 ".\jpegint.h"\
297 ".\jpeglib.h"\
298
299
300.\jdtrans.c : \
301 ".\jconfig.h"\
302 ".\jerror.h"\
303 ".\jinclude.h"\
304 ".\jmorecfg.h"\
305 ".\jpegint.h"\
306 ".\jpeglib.h"\
307
308
309.\jerror.c : \
310 ".\jconfig.h"\
311 ".\jerror.h"\
312 ".\jinclude.h"\
313 ".\jmorecfg.h"\
314 ".\jpeglib.h"\
315 ".\jversion.h"\
316
317
318.\jfdctflt.c : \
319 ".\jconfig.h"\
320 ".\jdct.h"\
321 ".\jerror.h"\
322 ".\jinclude.h"\
323 ".\jmorecfg.h"\
324 ".\jpegint.h"\
325 ".\jpeglib.h"\
326
327
328.\jfdctfst.c : \
329 ".\jconfig.h"\
330 ".\jdct.h"\
331 ".\jerror.h"\
332 ".\jinclude.h"\
333 ".\jmorecfg.h"\
334 ".\jpegint.h"\
335 ".\jpeglib.h"\
336
337
338.\jfdctint.c : \
339 ".\jconfig.h"\
340 ".\jdct.h"\
341 ".\jerror.h"\
342 ".\jinclude.h"\
343 ".\jmorecfg.h"\
344 ".\jpegint.h"\
345 ".\jpeglib.h"\
346
347
348.\jidctflt.c : \
349 ".\jconfig.h"\
350 ".\jdct.h"\
351 ".\jerror.h"\
352 ".\jinclude.h"\
353 ".\jmorecfg.h"\
354 ".\jpegint.h"\
355 ".\jpeglib.h"\
356
357
358.\jidctfst.c : \
359 ".\jconfig.h"\
360 ".\jdct.h"\
361 ".\jerror.h"\
362 ".\jinclude.h"\
363 ".\jmorecfg.h"\
364 ".\jpegint.h"\
365 ".\jpeglib.h"\
366
367
368.\jidctint.c : \
369 ".\jconfig.h"\
370 ".\jdct.h"\
371 ".\jerror.h"\
372 ".\jinclude.h"\
373 ".\jmorecfg.h"\
374 ".\jpegint.h"\
375 ".\jpeglib.h"\
376
377
378.\jmemmgr.c : \
379 ".\jconfig.h"\
380 ".\jerror.h"\
381 ".\jinclude.h"\
382 ".\jmemsys.h"\
383 ".\jmorecfg.h"\
384 ".\jpegint.h"\
385 ".\jpeglib.h"\
386
387
388.\jmemnobs.c : \
389 ".\jconfig.h"\
390 ".\jerror.h"\
391 ".\jinclude.h"\
392 ".\jmemsys.h"\
393 ".\jmorecfg.h"\
394 ".\jpegint.h"\
395 ".\jpeglib.h"\
396
397
398.\jquant1.c : \
399 ".\jconfig.h"\
400 ".\jerror.h"\
401 ".\jinclude.h"\
402 ".\jmorecfg.h"\
403 ".\jpegint.h"\
404 ".\jpeglib.h"\
405
406
407.\jquant2.c : \
408 ".\jconfig.h"\
409 ".\jerror.h"\
410 ".\jinclude.h"\
411 ".\jmorecfg.h"\
412 ".\jpegint.h"\
413 ".\jpeglib.h"\
414
415
416.\jutils.c : \
417 ".\jconfig.h"\
418 ".\jerror.h"\
419 ".\jinclude.h"\
420 ".\jmorecfg.h"\
421 ".\jpegint.h"\
422 ".\jpeglib.h"\
423
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsp.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsp.vc6
new file mode 100644
index 0000000..ba87738
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsp.vc6
@@ -0,0 +1,285 @@
1# Microsoft Developer Studio Project File - Name="jpeg" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** NICHT BEARBEITEN **
4
5# TARGTYPE "Win32 (x86) Static Library" 0x0104
6
7CFG=jpeg - Win32
8!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
9!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
10!MESSAGE
11!MESSAGE NMAKE /f "jpeg.mak".
12!MESSAGE
13!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
14!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
15!MESSAGE
16!MESSAGE NMAKE /f "jpeg.mak" CFG="jpeg - Win32"
17!MESSAGE
18!MESSAGE Für die Konfiguration stehen zur Auswahl:
19!MESSAGE
20!MESSAGE "jpeg - Win32" (basierend auf "Win32 (x86) Static Library")
21!MESSAGE
22
23# Begin Project
24# PROP AllowPerConfigDependencies 0
25# PROP Scc_ProjName ""
26# PROP Scc_LocalPath ""
27CPP=cl.exe
28RSC=rc.exe
29# PROP BASE Use_MFC 0
30# PROP BASE Use_Debug_Libraries 0
31# PROP BASE Output_Dir ".\Release"
32# PROP BASE Intermediate_Dir ".\Release"
33# PROP BASE Target_Dir ""
34# PROP Use_MFC 0
35# PROP Use_Debug_Libraries 0
36# PROP Output_Dir ".\Release"
37# PROP Intermediate_Dir ".\Release"
38# PROP Target_Dir ""
39# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
40# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
41# ADD BASE RSC /l 0x407
42# ADD RSC /l 0x407
43BSC32=bscmake.exe
44# ADD BASE BSC32 /nologo
45# ADD BSC32 /nologo
46LIB32=link.exe -lib
47# ADD BASE LIB32 /nologo
48# ADD LIB32 /nologo
49# Begin Target
50
51# Name "jpeg - Win32"
52# Begin Group "Quellcodedateien"
53
54# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
55# Begin Source File
56
57SOURCE=.\jaricom.c
58# End Source File
59# Begin Source File
60
61SOURCE=.\jcapimin.c
62# End Source File
63# Begin Source File
64
65SOURCE=.\jcapistd.c
66# End Source File
67# Begin Source File
68
69SOURCE=.\jcarith.c
70# End Source File
71# Begin Source File
72
73SOURCE=.\jccoefct.c
74# End Source File
75# Begin Source File
76
77SOURCE=.\jccolor.c
78# End Source File
79# Begin Source File
80
81SOURCE=.\jcdctmgr.c
82# End Source File
83# Begin Source File
84
85SOURCE=.\jchuff.c
86# End Source File
87# Begin Source File
88
89SOURCE=.\jcinit.c
90# End Source File
91# Begin Source File
92
93SOURCE=.\jcmainct.c
94# End Source File
95# Begin Source File
96
97SOURCE=.\jcmarker.c
98# End Source File
99# Begin Source File
100
101SOURCE=.\jcmaster.c
102# End Source File
103# Begin Source File
104
105SOURCE=.\jcomapi.c
106# End Source File
107# Begin Source File
108
109SOURCE=.\jcparam.c
110# End Source File
111# Begin Source File
112
113SOURCE=.\jcprepct.c
114# End Source File
115# Begin Source File
116
117SOURCE=.\jcsample.c
118# End Source File
119# Begin Source File
120
121SOURCE=.\jctrans.c
122# End Source File
123# Begin Source File
124
125SOURCE=.\jdapimin.c
126# End Source File
127# Begin Source File
128
129SOURCE=.\jdapistd.c
130# End Source File
131# Begin Source File
132
133SOURCE=.\jdarith.c
134# End Source File
135# Begin Source File
136
137SOURCE=.\jdatadst.c
138# End Source File
139# Begin Source File
140
141SOURCE=.\jdatasrc.c
142# End Source File
143# Begin Source File
144
145SOURCE=.\jdcoefct.c
146# End Source File
147# Begin Source File
148
149SOURCE=.\jdcolor.c
150# End Source File
151# Begin Source File
152
153SOURCE=.\jddctmgr.c
154# End Source File
155# Begin Source File
156
157SOURCE=.\jdhuff.c
158# End Source File
159# Begin Source File
160
161SOURCE=.\jdinput.c
162# End Source File
163# Begin Source File
164
165SOURCE=.\jdmainct.c
166# End Source File
167# Begin Source File
168
169SOURCE=.\jdmarker.c
170# End Source File
171# Begin Source File
172
173SOURCE=.\jdmaster.c
174# End Source File
175# Begin Source File
176
177SOURCE=.\jdmerge.c
178# End Source File
179# Begin Source File
180
181SOURCE=.\jdpostct.c
182# End Source File
183# Begin Source File
184
185SOURCE=.\jdsample.c
186# End Source File
187# Begin Source File
188
189SOURCE=.\jdtrans.c
190# End Source File
191# Begin Source File
192
193SOURCE=.\jerror.c
194# End Source File
195# Begin Source File
196
197SOURCE=.\jfdctflt.c
198# End Source File
199# Begin Source File
200
201SOURCE=.\jfdctfst.c
202# End Source File
203# Begin Source File
204
205SOURCE=.\jfdctint.c
206# End Source File
207# Begin Source File
208
209SOURCE=.\jidctflt.c
210# End Source File
211# Begin Source File
212
213SOURCE=.\jidctfst.c
214# End Source File
215# Begin Source File
216
217SOURCE=.\jidctint.c
218# End Source File
219# Begin Source File
220
221SOURCE=.\jmemmgr.c
222# End Source File
223# Begin Source File
224
225SOURCE=.\jmemnobs.c
226# End Source File
227# Begin Source File
228
229SOURCE=.\jquant1.c
230# End Source File
231# Begin Source File
232
233SOURCE=.\jquant2.c
234# End Source File
235# Begin Source File
236
237SOURCE=.\jutils.c
238# End Source File
239# End Group
240# Begin Group "Header-Dateien"
241
242# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
243# Begin Source File
244
245SOURCE=.\jconfig.h
246# End Source File
247# Begin Source File
248
249SOURCE=.\jdct.h
250# End Source File
251# Begin Source File
252
253SOURCE=.\jerror.h
254# End Source File
255# Begin Source File
256
257SOURCE=.\jinclude.h
258# End Source File
259# Begin Source File
260
261SOURCE=.\jmemsys.h
262# End Source File
263# Begin Source File
264
265SOURCE=.\jmorecfg.h
266# End Source File
267# Begin Source File
268
269SOURCE=.\jpegint.h
270# End Source File
271# Begin Source File
272
273SOURCE=.\jpeglib.h
274# End Source File
275# Begin Source File
276
277SOURCE=.\jversion.h
278# End Source File
279# End Group
280# Begin Group "Ressourcendateien"
281
282# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
283# End Group
284# End Target
285# End Project
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsw.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsw.vc6
new file mode 100644
index 0000000..86c8fe5
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejdsw.vc6
@@ -0,0 +1,29 @@
1Microsoft Developer Studio Workspace File, Format Version 6.00
2# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
3
4###############################################################################
5
6Project: "jpeg"=".\jpeg.dsp" - Package Owner=<4>
7
8Package=<5>
9{{{
10}}}
11
12Package=<4>
13{{{
14}}}
15
16###############################################################################
17
18Global:
19
20Package=<5>
21{{{
22}}}
23
24Package=<3>
25{{{
26}}}
27
28###############################################################################
29
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejfil.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejfil.v10
new file mode 100644
index 0000000..123c07d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejfil.v10
@@ -0,0 +1,186 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="jconfig.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="jdct.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 <ClInclude Include="jerror.h">
25 <Filter>Header Files</Filter>
26 </ClInclude>
27 <ClInclude Include="jinclude.h">
28 <Filter>Header Files</Filter>
29 </ClInclude>
30 <ClInclude Include="jmemsys.h">
31 <Filter>Header Files</Filter>
32 </ClInclude>
33 <ClInclude Include="jmorecfg.h">
34 <Filter>Header Files</Filter>
35 </ClInclude>
36 <ClInclude Include="jpegint.h">
37 <Filter>Header Files</Filter>
38 </ClInclude>
39 <ClInclude Include="jpeglib.h">
40 <Filter>Header Files</Filter>
41 </ClInclude>
42 <ClInclude Include="jversion.h">
43 <Filter>Header Files</Filter>
44 </ClInclude>
45 </ItemGroup>
46 <ItemGroup>
47 <ClCompile Include="jaricom.c">
48 <Filter>Source Files</Filter>
49 </ClCompile>
50 <ClCompile Include="jcapimin.c">
51 <Filter>Source Files</Filter>
52 </ClCompile>
53 <ClCompile Include="jcapistd.c">
54 <Filter>Source Files</Filter>
55 </ClCompile>
56 <ClCompile Include="jcarith.c">
57 <Filter>Source Files</Filter>
58 </ClCompile>
59 <ClCompile Include="jccoefct.c">
60 <Filter>Source Files</Filter>
61 </ClCompile>
62 <ClCompile Include="jccolor.c">
63 <Filter>Source Files</Filter>
64 </ClCompile>
65 <ClCompile Include="jcdctmgr.c">
66 <Filter>Source Files</Filter>
67 </ClCompile>
68 <ClCompile Include="jchuff.c">
69 <Filter>Source Files</Filter>
70 </ClCompile>
71 <ClCompile Include="jcinit.c">
72 <Filter>Source Files</Filter>
73 </ClCompile>
74 <ClCompile Include="jcmainct.c">
75 <Filter>Source Files</Filter>
76 </ClCompile>
77 <ClCompile Include="jcmarker.c">
78 <Filter>Source Files</Filter>
79 </ClCompile>
80 <ClCompile Include="jcmaster.c">
81 <Filter>Source Files</Filter>
82 </ClCompile>
83 <ClCompile Include="jcomapi.c">
84 <Filter>Source Files</Filter>
85 </ClCompile>
86 <ClCompile Include="jcparam.c">
87 <Filter>Source Files</Filter>
88 </ClCompile>
89 <ClCompile Include="jcprepct.c">
90 <Filter>Source Files</Filter>
91 </ClCompile>
92 <ClCompile Include="jcsample.c">
93 <Filter>Source Files</Filter>
94 </ClCompile>
95 <ClCompile Include="jctrans.c">
96 <Filter>Source Files</Filter>
97 </ClCompile>
98 <ClCompile Include="jdapimin.c">
99 <Filter>Source Files</Filter>
100 </ClCompile>
101 <ClCompile Include="jdapistd.c">
102 <Filter>Source Files</Filter>
103 </ClCompile>
104 <ClCompile Include="jdarith.c">
105 <Filter>Source Files</Filter>
106 </ClCompile>
107 <ClCompile Include="jdatadst.c">
108 <Filter>Source Files</Filter>
109 </ClCompile>
110 <ClCompile Include="jdatasrc.c">
111 <Filter>Source Files</Filter>
112 </ClCompile>
113 <ClCompile Include="jdcoefct.c">
114 <Filter>Source Files</Filter>
115 </ClCompile>
116 <ClCompile Include="jdcolor.c">
117 <Filter>Source Files</Filter>
118 </ClCompile>
119 <ClCompile Include="jddctmgr.c">
120 <Filter>Source Files</Filter>
121 </ClCompile>
122 <ClCompile Include="jdhuff.c">
123 <Filter>Source Files</Filter>
124 </ClCompile>
125 <ClCompile Include="jdinput.c">
126 <Filter>Source Files</Filter>
127 </ClCompile>
128 <ClCompile Include="jdmainct.c">
129 <Filter>Source Files</Filter>
130 </ClCompile>
131 <ClCompile Include="jdmarker.c">
132 <Filter>Source Files</Filter>
133 </ClCompile>
134 <ClCompile Include="jdmaster.c">
135 <Filter>Source Files</Filter>
136 </ClCompile>
137 <ClCompile Include="jdmerge.c">
138 <Filter>Source Files</Filter>
139 </ClCompile>
140 <ClCompile Include="jdpostct.c">
141 <Filter>Source Files</Filter>
142 </ClCompile>
143 <ClCompile Include="jdsample.c">
144 <Filter>Source Files</Filter>
145 </ClCompile>
146 <ClCompile Include="jdtrans.c">
147 <Filter>Source Files</Filter>
148 </ClCompile>
149 <ClCompile Include="jerror.c">
150 <Filter>Source Files</Filter>
151 </ClCompile>
152 <ClCompile Include="jfdctflt.c">
153 <Filter>Source Files</Filter>
154 </ClCompile>
155 <ClCompile Include="jfdctfst.c">
156 <Filter>Source Files</Filter>
157 </ClCompile>
158 <ClCompile Include="jfdctint.c">
159 <Filter>Source Files</Filter>
160 </ClCompile>
161 <ClCompile Include="jidctflt.c">
162 <Filter>Source Files</Filter>
163 </ClCompile>
164 <ClCompile Include="jidctfst.c">
165 <Filter>Source Files</Filter>
166 </ClCompile>
167 <ClCompile Include="jidctint.c">
168 <Filter>Source Files</Filter>
169 </ClCompile>
170 <ClCompile Include="jmemmgr.c">
171 <Filter>Source Files</Filter>
172 </ClCompile>
173 <ClCompile Include="jmemnobs.c">
174 <Filter>Source Files</Filter>
175 </ClCompile>
176 <ClCompile Include="jquant1.c">
177 <Filter>Source Files</Filter>
178 </ClCompile>
179 <ClCompile Include="jquant2.c">
180 <Filter>Source Files</Filter>
181 </ClCompile>
182 <ClCompile Include="jutils.c">
183 <Filter>Source Files</Filter>
184 </ClCompile>
185 </ItemGroup>
186</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejmak.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejmak.vc6
new file mode 100644
index 0000000..eff0c72
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejmak.vc6
@@ -0,0 +1,425 @@
1# Microsoft Developer Studio Generated NMAKE File, Based on jpeg.dsp
2!IF "$(CFG)" == ""
3CFG=jpeg - Win32
4!MESSAGE Keine Konfiguration angegeben. jpeg - Win32 wird als Standard verwendet.
5!ENDIF
6
7!IF "$(CFG)" != "jpeg - Win32"
8!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
9!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
10!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
11!MESSAGE
12!MESSAGE NMAKE /f "jpeg.mak" CFG="jpeg - Win32"
13!MESSAGE
14!MESSAGE Fr die Konfiguration stehen zur Auswahl:
15!MESSAGE
16!MESSAGE "jpeg - Win32" (basierend auf "Win32 (x86) Static Library")
17!MESSAGE
18!ERROR Eine ungltige Konfiguration wurde angegeben.
19!ENDIF
20
21!IF "$(OS)" == "Windows_NT"
22NULL=
23!ELSE
24NULL=nul
25!ENDIF
26
27OUTDIR=.\Release
28INTDIR=.\Release
29# Begin Custom Macros
30OutDir=.\Release
31# End Custom Macros
32
33ALL : "$(OUTDIR)\jpeg.lib"
34
35
36CLEAN :
37 -@erase "$(INTDIR)\jaricom.obj"
38 -@erase "$(INTDIR)\jcapimin.obj"
39 -@erase "$(INTDIR)\jcapistd.obj"
40 -@erase "$(INTDIR)\jcarith.obj"
41 -@erase "$(INTDIR)\jccoefct.obj"
42 -@erase "$(INTDIR)\jccolor.obj"
43 -@erase "$(INTDIR)\jcdctmgr.obj"
44 -@erase "$(INTDIR)\jchuff.obj"
45 -@erase "$(INTDIR)\jcinit.obj"
46 -@erase "$(INTDIR)\jcmainct.obj"
47 -@erase "$(INTDIR)\jcmarker.obj"
48 -@erase "$(INTDIR)\jcmaster.obj"
49 -@erase "$(INTDIR)\jcomapi.obj"
50 -@erase "$(INTDIR)\jcparam.obj"
51 -@erase "$(INTDIR)\jcprepct.obj"
52 -@erase "$(INTDIR)\jcsample.obj"
53 -@erase "$(INTDIR)\jctrans.obj"
54 -@erase "$(INTDIR)\jdapimin.obj"
55 -@erase "$(INTDIR)\jdapistd.obj"
56 -@erase "$(INTDIR)\jdarith.obj"
57 -@erase "$(INTDIR)\jdatadst.obj"
58 -@erase "$(INTDIR)\jdatasrc.obj"
59 -@erase "$(INTDIR)\jdcoefct.obj"
60 -@erase "$(INTDIR)\jdcolor.obj"
61 -@erase "$(INTDIR)\jddctmgr.obj"
62 -@erase "$(INTDIR)\jdhuff.obj"
63 -@erase "$(INTDIR)\jdinput.obj"
64 -@erase "$(INTDIR)\jdmainct.obj"
65 -@erase "$(INTDIR)\jdmarker.obj"
66 -@erase "$(INTDIR)\jdmaster.obj"
67 -@erase "$(INTDIR)\jdmerge.obj"
68 -@erase "$(INTDIR)\jdpostct.obj"
69 -@erase "$(INTDIR)\jdsample.obj"
70 -@erase "$(INTDIR)\jdtrans.obj"
71 -@erase "$(INTDIR)\jerror.obj"
72 -@erase "$(INTDIR)\jfdctflt.obj"
73 -@erase "$(INTDIR)\jfdctfst.obj"
74 -@erase "$(INTDIR)\jfdctint.obj"
75 -@erase "$(INTDIR)\jidctflt.obj"
76 -@erase "$(INTDIR)\jidctfst.obj"
77 -@erase "$(INTDIR)\jidctint.obj"
78 -@erase "$(INTDIR)\jmemmgr.obj"
79 -@erase "$(INTDIR)\jmemnobs.obj"
80 -@erase "$(INTDIR)\jquant1.obj"
81 -@erase "$(INTDIR)\jquant2.obj"
82 -@erase "$(INTDIR)\jutils.obj"
83 -@erase "$(INTDIR)\vc60.idb"
84 -@erase "$(OUTDIR)\jpeg.lib"
85
86"$(OUTDIR)" :
87 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
88
89CPP=cl.exe
90CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\jpeg.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
91
92.c{$(INTDIR)}.obj::
93 $(CPP) @<<
94 $(CPP_PROJ) $<
95<<
96
97.cpp{$(INTDIR)}.obj::
98 $(CPP) @<<
99 $(CPP_PROJ) $<
100<<
101
102.cxx{$(INTDIR)}.obj::
103 $(CPP) @<<
104 $(CPP_PROJ) $<
105<<
106
107.c{$(INTDIR)}.sbr::
108 $(CPP) @<<
109 $(CPP_PROJ) $<
110<<
111
112.cpp{$(INTDIR)}.sbr::
113 $(CPP) @<<
114 $(CPP_PROJ) $<
115<<
116
117.cxx{$(INTDIR)}.sbr::
118 $(CPP) @<<
119 $(CPP_PROJ) $<
120<<
121
122RSC=rc.exe
123BSC32=bscmake.exe
124BSC32_FLAGS=/nologo /o"$(OUTDIR)\jpeg.bsc"
125BSC32_SBRS= \
126
127LIB32=link.exe -lib
128LIB32_FLAGS=/nologo /out:"$(OUTDIR)\jpeg.lib"
129LIB32_OBJS= \
130 "$(INTDIR)\jaricom.obj" \
131 "$(INTDIR)\jcapimin.obj" \
132 "$(INTDIR)\jcapistd.obj" \
133 "$(INTDIR)\jcarith.obj" \
134 "$(INTDIR)\jccoefct.obj" \
135 "$(INTDIR)\jccolor.obj" \
136 "$(INTDIR)\jcdctmgr.obj" \
137 "$(INTDIR)\jchuff.obj" \
138 "$(INTDIR)\jcinit.obj" \
139 "$(INTDIR)\jcmainct.obj" \
140 "$(INTDIR)\jcmarker.obj" \
141 "$(INTDIR)\jcmaster.obj" \
142 "$(INTDIR)\jcomapi.obj" \
143 "$(INTDIR)\jcparam.obj" \
144 "$(INTDIR)\jcprepct.obj" \
145 "$(INTDIR)\jcsample.obj" \
146 "$(INTDIR)\jctrans.obj" \
147 "$(INTDIR)\jdapimin.obj" \
148 "$(INTDIR)\jdapistd.obj" \
149 "$(INTDIR)\jdarith.obj" \
150 "$(INTDIR)\jdatadst.obj" \
151 "$(INTDIR)\jdatasrc.obj" \
152 "$(INTDIR)\jdcoefct.obj" \
153 "$(INTDIR)\jdcolor.obj" \
154 "$(INTDIR)\jddctmgr.obj" \
155 "$(INTDIR)\jdhuff.obj" \
156 "$(INTDIR)\jdinput.obj" \
157 "$(INTDIR)\jdmainct.obj" \
158 "$(INTDIR)\jdmarker.obj" \
159 "$(INTDIR)\jdmaster.obj" \
160 "$(INTDIR)\jdmerge.obj" \
161 "$(INTDIR)\jdpostct.obj" \
162 "$(INTDIR)\jdsample.obj" \
163 "$(INTDIR)\jdtrans.obj" \
164 "$(INTDIR)\jerror.obj" \
165 "$(INTDIR)\jfdctflt.obj" \
166 "$(INTDIR)\jfdctfst.obj" \
167 "$(INTDIR)\jfdctint.obj" \
168 "$(INTDIR)\jidctflt.obj" \
169 "$(INTDIR)\jidctfst.obj" \
170 "$(INTDIR)\jidctint.obj" \
171 "$(INTDIR)\jmemmgr.obj" \
172 "$(INTDIR)\jmemnobs.obj" \
173 "$(INTDIR)\jquant1.obj" \
174 "$(INTDIR)\jquant2.obj" \
175 "$(INTDIR)\jutils.obj"
176
177"$(OUTDIR)\jpeg.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
178 $(LIB32) @<<
179 $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
180<<
181
182
183!IF "$(NO_EXTERNAL_DEPS)" != "1"
184!IF EXISTS("jpeg.dep")
185!INCLUDE "jpeg.dep"
186!ELSE
187!MESSAGE Warning: cannot find "jpeg.dep"
188!ENDIF
189!ENDIF
190
191
192!IF "$(CFG)" == "jpeg - Win32"
193SOURCE=.\jaricom.c
194
195"$(INTDIR)\jaricom.obj" : $(SOURCE) "$(INTDIR)"
196
197
198SOURCE=.\jcapimin.c
199
200"$(INTDIR)\jcapimin.obj" : $(SOURCE) "$(INTDIR)"
201
202
203SOURCE=.\jcapistd.c
204
205"$(INTDIR)\jcapistd.obj" : $(SOURCE) "$(INTDIR)"
206
207
208SOURCE=.\jcarith.c
209
210"$(INTDIR)\jcarith.obj" : $(SOURCE) "$(INTDIR)"
211
212
213SOURCE=.\jccoefct.c
214
215"$(INTDIR)\jccoefct.obj" : $(SOURCE) "$(INTDIR)"
216
217
218SOURCE=.\jccolor.c
219
220"$(INTDIR)\jccolor.obj" : $(SOURCE) "$(INTDIR)"
221
222
223SOURCE=.\jcdctmgr.c
224
225"$(INTDIR)\jcdctmgr.obj" : $(SOURCE) "$(INTDIR)"
226
227
228SOURCE=.\jchuff.c
229
230"$(INTDIR)\jchuff.obj" : $(SOURCE) "$(INTDIR)"
231
232
233SOURCE=.\jcinit.c
234
235"$(INTDIR)\jcinit.obj" : $(SOURCE) "$(INTDIR)"
236
237
238SOURCE=.\jcmainct.c
239
240"$(INTDIR)\jcmainct.obj" : $(SOURCE) "$(INTDIR)"
241
242
243SOURCE=.\jcmarker.c
244
245"$(INTDIR)\jcmarker.obj" : $(SOURCE) "$(INTDIR)"
246
247
248SOURCE=.\jcmaster.c
249
250"$(INTDIR)\jcmaster.obj" : $(SOURCE) "$(INTDIR)"
251
252
253SOURCE=.\jcomapi.c
254
255"$(INTDIR)\jcomapi.obj" : $(SOURCE) "$(INTDIR)"
256
257
258SOURCE=.\jcparam.c
259
260"$(INTDIR)\jcparam.obj" : $(SOURCE) "$(INTDIR)"
261
262
263SOURCE=.\jcprepct.c
264
265"$(INTDIR)\jcprepct.obj" : $(SOURCE) "$(INTDIR)"
266
267
268SOURCE=.\jcsample.c
269
270"$(INTDIR)\jcsample.obj" : $(SOURCE) "$(INTDIR)"
271
272
273SOURCE=.\jctrans.c
274
275"$(INTDIR)\jctrans.obj" : $(SOURCE) "$(INTDIR)"
276
277
278SOURCE=.\jdapimin.c
279
280"$(INTDIR)\jdapimin.obj" : $(SOURCE) "$(INTDIR)"
281
282
283SOURCE=.\jdapistd.c
284
285"$(INTDIR)\jdapistd.obj" : $(SOURCE) "$(INTDIR)"
286
287
288SOURCE=.\jdarith.c
289
290"$(INTDIR)\jdarith.obj" : $(SOURCE) "$(INTDIR)"
291
292
293SOURCE=.\jdatadst.c
294
295"$(INTDIR)\jdatadst.obj" : $(SOURCE) "$(INTDIR)"
296
297
298SOURCE=.\jdatasrc.c
299
300"$(INTDIR)\jdatasrc.obj" : $(SOURCE) "$(INTDIR)"
301
302
303SOURCE=.\jdcoefct.c
304
305"$(INTDIR)\jdcoefct.obj" : $(SOURCE) "$(INTDIR)"
306
307
308SOURCE=.\jdcolor.c
309
310"$(INTDIR)\jdcolor.obj" : $(SOURCE) "$(INTDIR)"
311
312
313SOURCE=.\jddctmgr.c
314
315"$(INTDIR)\jddctmgr.obj" : $(SOURCE) "$(INTDIR)"
316
317
318SOURCE=.\jdhuff.c
319
320"$(INTDIR)\jdhuff.obj" : $(SOURCE) "$(INTDIR)"
321
322
323SOURCE=.\jdinput.c
324
325"$(INTDIR)\jdinput.obj" : $(SOURCE) "$(INTDIR)"
326
327
328SOURCE=.\jdmainct.c
329
330"$(INTDIR)\jdmainct.obj" : $(SOURCE) "$(INTDIR)"
331
332
333SOURCE=.\jdmarker.c
334
335"$(INTDIR)\jdmarker.obj" : $(SOURCE) "$(INTDIR)"
336
337
338SOURCE=.\jdmaster.c
339
340"$(INTDIR)\jdmaster.obj" : $(SOURCE) "$(INTDIR)"
341
342
343SOURCE=.\jdmerge.c
344
345"$(INTDIR)\jdmerge.obj" : $(SOURCE) "$(INTDIR)"
346
347
348SOURCE=.\jdpostct.c
349
350"$(INTDIR)\jdpostct.obj" : $(SOURCE) "$(INTDIR)"
351
352
353SOURCE=.\jdsample.c
354
355"$(INTDIR)\jdsample.obj" : $(SOURCE) "$(INTDIR)"
356
357
358SOURCE=.\jdtrans.c
359
360"$(INTDIR)\jdtrans.obj" : $(SOURCE) "$(INTDIR)"
361
362
363SOURCE=.\jerror.c
364
365"$(INTDIR)\jerror.obj" : $(SOURCE) "$(INTDIR)"
366
367
368SOURCE=.\jfdctflt.c
369
370"$(INTDIR)\jfdctflt.obj" : $(SOURCE) "$(INTDIR)"
371
372
373SOURCE=.\jfdctfst.c
374
375"$(INTDIR)\jfdctfst.obj" : $(SOURCE) "$(INTDIR)"
376
377
378SOURCE=.\jfdctint.c
379
380"$(INTDIR)\jfdctint.obj" : $(SOURCE) "$(INTDIR)"
381
382
383SOURCE=.\jidctflt.c
384
385"$(INTDIR)\jidctflt.obj" : $(SOURCE) "$(INTDIR)"
386
387
388SOURCE=.\jidctfst.c
389
390"$(INTDIR)\jidctfst.obj" : $(SOURCE) "$(INTDIR)"
391
392
393SOURCE=.\jidctint.c
394
395"$(INTDIR)\jidctint.obj" : $(SOURCE) "$(INTDIR)"
396
397
398SOURCE=.\jmemmgr.c
399
400"$(INTDIR)\jmemmgr.obj" : $(SOURCE) "$(INTDIR)"
401
402
403SOURCE=.\jmemnobs.c
404
405"$(INTDIR)\jmemnobs.obj" : $(SOURCE) "$(INTDIR)"
406
407
408SOURCE=.\jquant1.c
409
410"$(INTDIR)\jquant1.obj" : $(SOURCE) "$(INTDIR)"
411
412
413SOURCE=.\jquant2.c
414
415"$(INTDIR)\jquant2.obj" : $(SOURCE) "$(INTDIR)"
416
417
418SOURCE=.\jutils.c
419
420"$(INTDIR)\jutils.obj" : $(SOURCE) "$(INTDIR)"
421
422
423
424!ENDIF
425
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejsln.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejsln.v10
new file mode 100644
index 0000000..f85ab50
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejsln.v10
@@ -0,0 +1,17 @@
1
2Microsoft Visual Studio Solution File, Format Version 11.00
3# Visual C++ Express 2010
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "jpeg.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Release|Win32 = Release|Win32
9 EndGlobalSection
10 GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32
12 {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32
13 EndGlobalSection
14 GlobalSection(SolutionProperties) = preSolution
15 HideSolutionNode = FALSE
16 EndGlobalSection
17EndGlobal
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejvcx.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejvcx.v10
new file mode 100644
index 0000000..cd8c87b
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makejvcx.v10
@@ -0,0 +1,112 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 </ItemGroup>
9 <ItemGroup>
10 <ClInclude Include="jconfig.h" />
11 <ClInclude Include="jdct.h" />
12 <ClInclude Include="jerror.h" />
13 <ClInclude Include="jinclude.h" />
14 <ClInclude Include="jmemsys.h" />
15 <ClInclude Include="jmorecfg.h" />
16 <ClInclude Include="jpegint.h" />
17 <ClInclude Include="jpeglib.h" />
18 <ClInclude Include="jversion.h" />
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="jaricom.c" />
22 <ClCompile Include="jcapimin.c" />
23 <ClCompile Include="jcapistd.c" />
24 <ClCompile Include="jcarith.c" />
25 <ClCompile Include="jccoefct.c" />
26 <ClCompile Include="jccolor.c" />
27 <ClCompile Include="jcdctmgr.c" />
28 <ClCompile Include="jchuff.c" />
29 <ClCompile Include="jcinit.c" />
30 <ClCompile Include="jcmainct.c" />
31 <ClCompile Include="jcmarker.c" />
32 <ClCompile Include="jcmaster.c" />
33 <ClCompile Include="jcomapi.c" />
34 <ClCompile Include="jcparam.c" />
35 <ClCompile Include="jcprepct.c" />
36 <ClCompile Include="jcsample.c" />
37 <ClCompile Include="jctrans.c" />
38 <ClCompile Include="jdapimin.c" />
39 <ClCompile Include="jdapistd.c" />
40 <ClCompile Include="jdarith.c" />
41 <ClCompile Include="jdatadst.c" />
42 <ClCompile Include="jdatasrc.c" />
43 <ClCompile Include="jdcoefct.c" />
44 <ClCompile Include="jdcolor.c" />
45 <ClCompile Include="jddctmgr.c" />
46 <ClCompile Include="jdhuff.c" />
47 <ClCompile Include="jdinput.c" />
48 <ClCompile Include="jdmainct.c" />
49 <ClCompile Include="jdmarker.c" />
50 <ClCompile Include="jdmaster.c" />
51 <ClCompile Include="jdmerge.c" />
52 <ClCompile Include="jdpostct.c" />
53 <ClCompile Include="jdsample.c" />
54 <ClCompile Include="jdtrans.c" />
55 <ClCompile Include="jerror.c" />
56 <ClCompile Include="jfdctflt.c" />
57 <ClCompile Include="jfdctfst.c" />
58 <ClCompile Include="jfdctint.c" />
59 <ClCompile Include="jidctflt.c" />
60 <ClCompile Include="jidctfst.c" />
61 <ClCompile Include="jidctint.c" />
62 <ClCompile Include="jmemmgr.c" />
63 <ClCompile Include="jmemnobs.c" />
64 <ClCompile Include="jquant1.c" />
65 <ClCompile Include="jquant2.c">
66 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Disabled</Optimization>
67 <BufferSecurityCheck Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</BufferSecurityCheck>
68 </ClCompile>
69 <ClCompile Include="jutils.c" />
70 </ItemGroup>
71 <PropertyGroup Label="Globals">
72 <ProjectGuid>{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}</ProjectGuid>
73 <Keyword>Win32Proj</Keyword>
74 <RootNamespace>jpeg</RootNamespace>
75 </PropertyGroup>
76 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
77 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
78 <ConfigurationType>StaticLibrary</ConfigurationType>
79 <UseDebugLibraries>false</UseDebugLibraries>
80 <WholeProgramOptimization>true</WholeProgramOptimization>
81 <CharacterSet>Unicode</CharacterSet>
82 </PropertyGroup>
83 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
84 <ImportGroup Label="ExtensionSettings">
85 </ImportGroup>
86 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
87 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
88 </ImportGroup>
89 <PropertyGroup Label="UserMacros" />
90 <PropertyGroup />
91 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
92 <ClCompile>
93 <WarningLevel>Level3</WarningLevel>
94 <PrecompiledHeader>NotUsing</PrecompiledHeader>
95 <Optimization>Full</Optimization>
96 <FunctionLevelLinking>true</FunctionLevelLinking>
97 <IntrinsicFunctions>false</IntrinsicFunctions>
98 <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
99 <OmitFramePointers>true</OmitFramePointers>
100 <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
101 </ClCompile>
102 <Link>
103 <SubSystem>Windows</SubSystem>
104 <GenerateDebugInformation>true</GenerateDebugInformation>
105 <EnableCOMDATFolding>true</EnableCOMDATFolding>
106 <OptimizeReferences>true</OptimizeReferences>
107 </Link>
108 </ItemDefinitionGroup>
109 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
110 <ImportGroup Label="ExtensionTargets">
111 </ImportGroup>
112</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeproj.mac b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeproj.mac
new file mode 100644
index 0000000..4c01e15
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makeproj.mac
@@ -0,0 +1,213 @@
1--
2-- makeproj.mac
3--
4-- This AppleScript builds Code Warrior PRO Release 2 project files for the
5-- libjpeg library as well as the test programs 'cjpeg', 'djpeg', 'jpegtran'.
6-- (We'd distribute real project files, except they're not text
7-- and would create maintenance headaches.)
8--
9-- The script then compiles and links the library and the test programs.
10-- NOTE: if you haven't already created a 'jconfig.h' file, the script
11-- automatically copies 'jconfig.mac' to 'jconfig.h'.
12--
13-- To use this script, you must have AppleScript 1.1 or later installed
14-- and a suitable AppleScript editor like Script Editor or Script Debugger
15-- (http://www.latenightsw.com). Open this file with your AppleScript
16-- editor and execute the "run" command to build the projects.
17--
18-- Thanks to Dan Sears and Don Agro for this script.
19-- Questions about this script can be addressed to dogpark@interlog.com
20--
21
22on run
23
24 choose folder with prompt ">>> Select IJG source folder <<<"
25 set ijg_folder to result
26
27 choose folder with prompt ">>> Select MetroWerks folder <<<"
28 set cw_folder to result
29
30 -- if jconfig.h doesn't already exist, copy jconfig.mac
31
32 tell application "Finder"
33 if not (exists file "jconfig.h" of ijg_folder) then
34 duplicate {file "jconfig.mac" of folder ijg_folder}
35 select file "jconfig.mac copy" of folder ijg_folder
36 set name of selection to "jconfig.h"
37 end if
38 end tell
39
40 tell application "CodeWarrior IDE 2.1"
41 with timeout of 10000 seconds
42
43 -- create libjpeg project
44
45 activate
46 Create Project (ijg_folder as string) & "libjpeg.proj"
47 Set Preferences of panel "Target Settings" to {Target Name:"libjpeg"}
48 Set Preferences of panel "PPC Project" to {File Name:"libjpeg"}
49 Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
50 Set Preferences of panel "PPC Project" to {Project Type:library}
51 Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
52 Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
53 Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
54 Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
55
56 Add Files (ijg_folder as string) & "jaricom.c" To Segment 1
57 Add Files (ijg_folder as string) & "jcapimin.c" To Segment 1
58 Add Files (ijg_folder as string) & "jcapistd.c" To Segment 1
59 Add Files (ijg_folder as string) & "jcarith.c" To Segment 1
60 Add Files (ijg_folder as string) & "jctrans.c" To Segment 1
61 Add Files (ijg_folder as string) & "jcparam.c" To Segment 1
62 Add Files (ijg_folder as string) & "jdatadst.c" To Segment 1
63 Add Files (ijg_folder as string) & "jcinit.c" To Segment 1
64 Add Files (ijg_folder as string) & "jcmaster.c" To Segment 1
65 Add Files (ijg_folder as string) & "jcmarker.c" To Segment 1
66 Add Files (ijg_folder as string) & "jcmainct.c" To Segment 1
67 Add Files (ijg_folder as string) & "jcprepct.c" To Segment 1
68 Add Files (ijg_folder as string) & "jccoefct.c" To Segment 1
69 Add Files (ijg_folder as string) & "jccolor.c" To Segment 1
70 Add Files (ijg_folder as string) & "jcsample.c" To Segment 1
71 Add Files (ijg_folder as string) & "jchuff.c" To Segment 1
72 Add Files (ijg_folder as string) & "jcdctmgr.c" To Segment 1
73 Add Files (ijg_folder as string) & "jfdctfst.c" To Segment 1
74 Add Files (ijg_folder as string) & "jfdctflt.c" To Segment 1
75 Add Files (ijg_folder as string) & "jfdctint.c" To Segment 1
76 Add Files (ijg_folder as string) & "jdapimin.c" To Segment 1
77 Add Files (ijg_folder as string) & "jdapistd.c" To Segment 1
78 Add Files (ijg_folder as string) & "jdarith.c" To Segment 1
79 Add Files (ijg_folder as string) & "jdtrans.c" To Segment 1
80 Add Files (ijg_folder as string) & "jdatasrc.c" To Segment 1
81 Add Files (ijg_folder as string) & "jdmaster.c" To Segment 1
82 Add Files (ijg_folder as string) & "jdinput.c" To Segment 1
83 Add Files (ijg_folder as string) & "jdmarker.c" To Segment 1
84 Add Files (ijg_folder as string) & "jdhuff.c" To Segment 1
85 Add Files (ijg_folder as string) & "jdmainct.c" To Segment 1
86 Add Files (ijg_folder as string) & "jdcoefct.c" To Segment 1
87 Add Files (ijg_folder as string) & "jdpostct.c" To Segment 1
88 Add Files (ijg_folder as string) & "jddctmgr.c" To Segment 1
89 Add Files (ijg_folder as string) & "jidctfst.c" To Segment 1
90 Add Files (ijg_folder as string) & "jidctflt.c" To Segment 1
91 Add Files (ijg_folder as string) & "jidctint.c" To Segment 1
92 Add Files (ijg_folder as string) & "jdsample.c" To Segment 1
93 Add Files (ijg_folder as string) & "jdcolor.c" To Segment 1
94 Add Files (ijg_folder as string) & "jquant1.c" To Segment 1
95 Add Files (ijg_folder as string) & "jquant2.c" To Segment 1
96 Add Files (ijg_folder as string) & "jdmerge.c" To Segment 1
97 Add Files (ijg_folder as string) & "jcomapi.c" To Segment 1
98 Add Files (ijg_folder as string) & "jutils.c" To Segment 1
99 Add Files (ijg_folder as string) & "jerror.c" To Segment 1
100 Add Files (ijg_folder as string) & "jmemmgr.c" To Segment 1
101 Add Files (ijg_folder as string) & "jmemmac.c" To Segment 1
102
103 -- compile and link the library
104
105 Make Project
106 Close Project
107
108 -- create cjpeg project
109
110 activate
111 Create Project (ijg_folder as string) & "cjpeg.proj"
112 Set Preferences of panel "Target Settings" to {Target Name:"cjpeg"}
113 Set Preferences of panel "PPC Project" to {File Name:"cjpeg"}
114 Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
115 Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
116 Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
117 Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
118 Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
119
120 Add Files (ijg_folder as string) & "cjpeg.c" To Segment 1
121 Add Files (ijg_folder as string) & "rdppm.c" To Segment 1
122 Add Files (ijg_folder as string) & "rdgif.c" To Segment 1
123 Add Files (ijg_folder as string) & "rdtarga.c" To Segment 1
124 Add Files (ijg_folder as string) & "rdrle.c" To Segment 1
125 Add Files (ijg_folder as string) & "rdbmp.c" To Segment 1
126 Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
127 Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
128
129 Add Files (ijg_folder as string) & "libjpeg" To Segment 2
130
131 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
132 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
133 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
134
135 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
136 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
137
138 -- compile and link cjpeg
139
140 Make Project
141 Close Project
142
143 -- create djpeg project
144
145 activate
146 Create Project (ijg_folder as string) & "djpeg.proj"
147 Set Preferences of panel "Target Settings" to {Target Name:"djpeg"}
148 Set Preferences of panel "PPC Project" to {File Name:"djpeg"}
149 Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
150 Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
151 Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
152 Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
153 Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
154
155 Add Files (ijg_folder as string) & "djpeg.c" To Segment 1
156 Add Files (ijg_folder as string) & "wrppm.c" To Segment 1
157 Add Files (ijg_folder as string) & "wrgif.c" To Segment 1
158 Add Files (ijg_folder as string) & "wrtarga.c" To Segment 1
159 Add Files (ijg_folder as string) & "wrrle.c" To Segment 1
160 Add Files (ijg_folder as string) & "wrbmp.c" To Segment 1
161 Add Files (ijg_folder as string) & "rdcolmap.c" To Segment 1
162 Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
163
164 Add Files (ijg_folder as string) & "libjpeg" To Segment 2
165
166 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
167 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
168 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
169
170 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
171 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
172
173 -- compile and link djpeg
174
175 Make Project
176 Close Project
177
178 -- create jpegtran project
179
180 activate
181 Create Project (ijg_folder as string) & "jpegtran.proj"
182 Set Preferences of panel "Target Settings" to {Target Name:"jpegtran"}
183 Set Preferences of panel "PPC Project" to {File Name:"jpegtran"}
184 Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
185 Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
186 Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
187 Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
188 Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
189
190 Add Files (ijg_folder as string) & "jpegtran.c" To Segment 1
191 Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
192 Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
193 Add Files (ijg_folder as string) & "transupp.c" To Segment 1
194
195 Add Files (ijg_folder as string) & "libjpeg" To Segment 2
196
197 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
198 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
199 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
200
201 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
202 Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
203
204 -- compile and link jpegtran
205
206 Make Project
207 Close Project
208
209 quit
210
211 end timeout
212 end tell
213end run
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdep.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdep.vc6
new file mode 100644
index 0000000..27052b0
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdep.vc6
@@ -0,0 +1,6 @@
1# Microsoft Developer Studio erstellte Abhängigkeitsdatei, einbezogen von rdjpgcom.mak
2
3.\rdjpgcom.c : \
4 ".\jconfig.h"\
5 ".\jinclude.h"\
6
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdsp.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdsp.vc6
new file mode 100644
index 0000000..f62700e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerdsp.vc6
@@ -0,0 +1,78 @@
1# Microsoft Developer Studio Project File - Name="rdjpgcom" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** NICHT BEARBEITEN **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=rdjpgcom - Win32
8!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
9!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
10!MESSAGE
11!MESSAGE NMAKE /f "rdjpgcom.mak".
12!MESSAGE
13!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
14!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
15!MESSAGE
16!MESSAGE NMAKE /f "rdjpgcom.mak" CFG="rdjpgcom - Win32"
17!MESSAGE
18!MESSAGE Für die Konfiguration stehen zur Auswahl:
19!MESSAGE
20!MESSAGE "rdjpgcom - Win32" (basierend auf "Win32 (x86) Console Application")
21!MESSAGE
22
23# Begin Project
24# PROP AllowPerConfigDependencies 0
25# PROP Scc_ProjName ""
26# PROP Scc_LocalPath ""
27CPP=cl.exe
28RSC=rc.exe
29# PROP BASE Use_MFC 0
30# PROP BASE Use_Debug_Libraries 0
31# PROP BASE Output_Dir ".\rdjpgcom\Release"
32# PROP BASE Intermediate_Dir ".\rdjpgcom\Release"
33# PROP BASE Target_Dir ".\rdjpgcom"
34# PROP Use_MFC 0
35# PROP Use_Debug_Libraries 0
36# PROP Output_Dir ".\rdjpgcom\Release"
37# PROP Intermediate_Dir ".\rdjpgcom\Release"
38# PROP Ignore_Export_Lib 0
39# PROP Target_Dir ".\rdjpgcom"
40# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
41# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
42# ADD BASE RSC /l 0x409 /d "NDEBUG"
43# ADD RSC /l 0x409 /d "NDEBUG"
44BSC32=bscmake.exe
45# ADD BASE BSC32 /nologo
46# ADD BSC32 /nologo
47LINK32=link.exe
48# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
49# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
50# Begin Target
51
52# Name "rdjpgcom - Win32"
53# Begin Group "Quellcodedateien"
54
55# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
56# Begin Source File
57
58SOURCE=.\rdjpgcom.c
59# End Source File
60# End Group
61# Begin Group "Header-Dateien"
62
63# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
64# Begin Source File
65
66SOURCE=.\jconfig.h
67# End Source File
68# Begin Source File
69
70SOURCE=.\jinclude.h
71# End Source File
72# End Group
73# Begin Group "Ressourcendateien"
74
75# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
76# End Group
77# End Target
78# End Project
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerfil.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerfil.v10
new file mode 100644
index 0000000..2b2fcb3
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makerfil.v10
@@ -0,0 +1,30 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="jconfig.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="jinclude.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 </ItemGroup>
25 <ItemGroup>
26 <ClCompile Include="rdjpgcom.c">
27 <Filter>Source Files</Filter>
28 </ClCompile>
29 </ItemGroup>
30</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makermak.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makermak.vc6
new file mode 100644
index 0000000..ac76914
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makermak.vc6
@@ -0,0 +1,110 @@
1# Microsoft Developer Studio Generated NMAKE File, Based on rdjpgcom.dsp
2!IF "$(CFG)" == ""
3CFG=rdjpgcom - Win32
4!MESSAGE Keine Konfiguration angegeben. rdjpgcom - Win32 wird als Standard verwendet.
5!ENDIF
6
7!IF "$(CFG)" != "rdjpgcom - Win32"
8!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
9!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
10!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
11!MESSAGE
12!MESSAGE NMAKE /f "rdjpgcom.mak" CFG="rdjpgcom - Win32"
13!MESSAGE
14!MESSAGE Fr die Konfiguration stehen zur Auswahl:
15!MESSAGE
16!MESSAGE "rdjpgcom - Win32" (basierend auf "Win32 (x86) Console Application")
17!MESSAGE
18!ERROR Eine ungltige Konfiguration wurde angegeben.
19!ENDIF
20
21!IF "$(OS)" == "Windows_NT"
22NULL=
23!ELSE
24NULL=nul
25!ENDIF
26
27CPP=cl.exe
28RSC=rc.exe
29OUTDIR=.\rdjpgcom\Release
30INTDIR=.\rdjpgcom\Release
31# Begin Custom Macros
32OutDir=.\rdjpgcom\Release
33# End Custom Macros
34
35ALL : "$(OUTDIR)\rdjpgcom.exe"
36
37
38CLEAN :
39 -@erase "$(INTDIR)\rdjpgcom.obj"
40 -@erase "$(INTDIR)\vc60.idb"
41 -@erase "$(OUTDIR)\rdjpgcom.exe"
42
43"$(OUTDIR)" :
44 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
45
46BSC32=bscmake.exe
47BSC32_FLAGS=/nologo /o"$(OUTDIR)\rdjpgcom.bsc"
48BSC32_SBRS= \
49
50LINK32=link.exe
51LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\rdjpgcom.pdb" /machine:I386 /out:"$(OUTDIR)\rdjpgcom.exe"
52LINK32_OBJS= \
53 "$(INTDIR)\rdjpgcom.obj"
54
55"$(OUTDIR)\rdjpgcom.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
56 $(LINK32) @<<
57 $(LINK32_FLAGS) $(LINK32_OBJS)
58<<
59
60CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\rdjpgcom.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
61
62.c{$(INTDIR)}.obj::
63 $(CPP) @<<
64 $(CPP_PROJ) $<
65<<
66
67.cpp{$(INTDIR)}.obj::
68 $(CPP) @<<
69 $(CPP_PROJ) $<
70<<
71
72.cxx{$(INTDIR)}.obj::
73 $(CPP) @<<
74 $(CPP_PROJ) $<
75<<
76
77.c{$(INTDIR)}.sbr::
78 $(CPP) @<<
79 $(CPP_PROJ) $<
80<<
81
82.cpp{$(INTDIR)}.sbr::
83 $(CPP) @<<
84 $(CPP_PROJ) $<
85<<
86
87.cxx{$(INTDIR)}.sbr::
88 $(CPP) @<<
89 $(CPP_PROJ) $<
90<<
91
92
93!IF "$(NO_EXTERNAL_DEPS)" != "1"
94!IF EXISTS("rdjpgcom.dep")
95!INCLUDE "rdjpgcom.dep"
96!ELSE
97!MESSAGE Warning: cannot find "rdjpgcom.dep"
98!ENDIF
99!ENDIF
100
101
102!IF "$(CFG)" == "rdjpgcom - Win32"
103SOURCE=.\rdjpgcom.c
104
105"$(INTDIR)\rdjpgcom.obj" : $(SOURCE) "$(INTDIR)"
106
107
108
109!ENDIF
110
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makervcx.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makervcx.v10
new file mode 100644
index 0000000..3d8928d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makervcx.v10
@@ -0,0 +1,62 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 </ItemGroup>
9 <PropertyGroup Label="Globals">
10 <ProjectGuid>{C81513DB-78DC-46BC-BC98-82E745203976}</ProjectGuid>
11 <Keyword>Win32Proj</Keyword>
12 <RootNamespace>rdjpgcom</RootNamespace>
13 </PropertyGroup>
14 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
15 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
16 <ConfigurationType>Application</ConfigurationType>
17 <UseDebugLibraries>false</UseDebugLibraries>
18 <WholeProgramOptimization>true</WholeProgramOptimization>
19 <CharacterSet>Unicode</CharacterSet>
20 </PropertyGroup>
21 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
22 <ImportGroup Label="ExtensionSettings">
23 </ImportGroup>
24 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
25 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
26 </ImportGroup>
27 <PropertyGroup Label="UserMacros" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
29 <LinkIncremental>false</LinkIncremental>
30 <OutDir>$(ProjectName)\$(Configuration)\</OutDir>
31 <IntDir>$(ProjectName)\$(Configuration)\</IntDir>
32 </PropertyGroup>
33 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
34 <ClCompile>
35 <WarningLevel>Level3</WarningLevel>
36 <PrecompiledHeader>NotUsing</PrecompiledHeader>
37 <Optimization>Full</Optimization>
38 <FunctionLevelLinking>true</FunctionLevelLinking>
39 <IntrinsicFunctions>false</IntrinsicFunctions>
40 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
41 <OmitFramePointers>true</OmitFramePointers>
42 <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
43 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
44 </ClCompile>
45 <Link>
46 <SubSystem>Console</SubSystem>
47 <GenerateDebugInformation>true</GenerateDebugInformation>
48 <EnableCOMDATFolding>true</EnableCOMDATFolding>
49 <OptimizeReferences>true</OptimizeReferences>
50 </Link>
51 </ItemDefinitionGroup>
52 <ItemGroup>
53 <ClInclude Include="jconfig.h" />
54 <ClInclude Include="jinclude.h" />
55 </ItemGroup>
56 <ItemGroup>
57 <ClCompile Include="rdjpgcom.c" />
58 </ItemGroup>
59 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
60 <ImportGroup Label="ExtensionTargets">
61 </ImportGroup>
62</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdep.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdep.vc6
new file mode 100644
index 0000000..ee26cf1
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdep.vc6
@@ -0,0 +1,43 @@
1# Microsoft Developer Studio erstellte Abhängigkeitsdatei, einbezogen von jpegtran.mak
2
3.\cdjpeg.c : \
4 ".\cderror.h"\
5 ".\cdjpeg.h"\
6 ".\jconfig.h"\
7 ".\jerror.h"\
8 ".\jinclude.h"\
9 ".\jmorecfg.h"\
10 ".\jpeglib.h"\
11
12
13.\jpegtran.c : \
14 ".\cderror.h"\
15 ".\cdjpeg.h"\
16 ".\jconfig.h"\
17 ".\jerror.h"\
18 ".\jinclude.h"\
19 ".\jmorecfg.h"\
20 ".\jpeglib.h"\
21 ".\jversion.h"\
22 ".\transupp.h"\
23
24
25.\rdswitch.c : \
26 ".\cderror.h"\
27 ".\cdjpeg.h"\
28 ".\jconfig.h"\
29 ".\jerror.h"\
30 ".\jinclude.h"\
31 ".\jmorecfg.h"\
32 ".\jpeglib.h"\
33
34
35.\transupp.c : \
36 ".\jconfig.h"\
37 ".\jerror.h"\
38 ".\jinclude.h"\
39 ".\jmorecfg.h"\
40 ".\jpegint.h"\
41 ".\jpeglib.h"\
42 ".\transupp.h"\
43
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdsp.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdsp.vc6
new file mode 100644
index 0000000..4df6026
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketdsp.vc6
@@ -0,0 +1,122 @@
1# Microsoft Developer Studio Project File - Name="jpegtran" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** NICHT BEARBEITEN **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=jpegtran - Win32
8!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
9!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
10!MESSAGE
11!MESSAGE NMAKE /f "jpegtran.mak".
12!MESSAGE
13!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
14!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
15!MESSAGE
16!MESSAGE NMAKE /f "jpegtran.mak" CFG="jpegtran - Win32"
17!MESSAGE
18!MESSAGE Für die Konfiguration stehen zur Auswahl:
19!MESSAGE
20!MESSAGE "jpegtran - Win32" (basierend auf "Win32 (x86) Console Application")
21!MESSAGE
22
23# Begin Project
24# PROP AllowPerConfigDependencies 0
25# PROP Scc_ProjName ""
26# PROP Scc_LocalPath ""
27CPP=cl.exe
28RSC=rc.exe
29# PROP BASE Use_MFC 0
30# PROP BASE Use_Debug_Libraries 0
31# PROP BASE Output_Dir ".\jpegtran\Release"
32# PROP BASE Intermediate_Dir ".\jpegtran\Release"
33# PROP BASE Target_Dir ".\jpegtran"
34# PROP Use_MFC 0
35# PROP Use_Debug_Libraries 0
36# PROP Output_Dir ".\jpegtran\Release"
37# PROP Intermediate_Dir ".\jpegtran\Release"
38# PROP Ignore_Export_Lib 0
39# PROP Target_Dir ".\jpegtran"
40# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
41# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
42# ADD BASE RSC /l 0x409 /d "NDEBUG"
43# ADD RSC /l 0x409 /d "NDEBUG"
44BSC32=bscmake.exe
45# ADD BASE BSC32 /nologo
46# ADD BSC32 /nologo
47LINK32=link.exe
48# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
49# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
50# Begin Target
51
52# Name "jpegtran - Win32"
53# Begin Group "Quellcodedateien"
54
55# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
56# Begin Source File
57
58SOURCE=.\cdjpeg.c
59# End Source File
60# Begin Source File
61
62SOURCE=.\jpegtran.c
63# End Source File
64# Begin Source File
65
66SOURCE=.\rdswitch.c
67# End Source File
68# Begin Source File
69
70SOURCE=.\transupp.c
71# End Source File
72# End Group
73# Begin Group "Header-Dateien"
74
75# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
76# Begin Source File
77
78SOURCE=.\cderror.h
79# End Source File
80# Begin Source File
81
82SOURCE=.\cdjpeg.h
83# End Source File
84# Begin Source File
85
86SOURCE=.\jconfig.h
87# End Source File
88# Begin Source File
89
90SOURCE=.\jerror.h
91# End Source File
92# Begin Source File
93
94SOURCE=.\jinclude.h
95# End Source File
96# Begin Source File
97
98SOURCE=.\jmorecfg.h
99# End Source File
100# Begin Source File
101
102SOURCE=.\jpegint.h
103# End Source File
104# Begin Source File
105
106SOURCE=.\jpeglib.h
107# End Source File
108# Begin Source File
109
110SOURCE=.\jversion.h
111# End Source File
112# Begin Source File
113
114SOURCE=.\transupp.h
115# End Source File
116# End Group
117# Begin Group "Ressourcendateien"
118
119# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
120# End Group
121# End Target
122# End Project
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketfil.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketfil.v10
new file mode 100644
index 0000000..52f4b02
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketfil.v10
@@ -0,0 +1,63 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="cderror.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="cdjpeg.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 <ClInclude Include="jconfig.h">
25 <Filter>Header Files</Filter>
26 </ClInclude>
27 <ClInclude Include="jerror.h">
28 <Filter>Header Files</Filter>
29 </ClInclude>
30 <ClInclude Include="jinclude.h">
31 <Filter>Header Files</Filter>
32 </ClInclude>
33 <ClInclude Include="jmorecfg.h">
34 <Filter>Header Files</Filter>
35 </ClInclude>
36 <ClInclude Include="jpegint.h">
37 <Filter>Header Files</Filter>
38 </ClInclude>
39 <ClInclude Include="jpeglib.h">
40 <Filter>Header Files</Filter>
41 </ClInclude>
42 <ClInclude Include="jversion.h">
43 <Filter>Header Files</Filter>
44 </ClInclude>
45 <ClInclude Include="transupp.h">
46 <Filter>Header Files</Filter>
47 </ClInclude>
48 </ItemGroup>
49 <ItemGroup>
50 <ClCompile Include="cdjpeg.c">
51 <Filter>Source Files</Filter>
52 </ClCompile>
53 <ClCompile Include="jpegtran.c">
54 <Filter>Source Files</Filter>
55 </ClCompile>
56 <ClCompile Include="rdswitch.c">
57 <Filter>Source Files</Filter>
58 </ClCompile>
59 <ClCompile Include="transupp.c">
60 <Filter>Source Files</Filter>
61 </ClCompile>
62 </ItemGroup>
63</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketmak.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketmak.vc6
new file mode 100644
index 0000000..3f35c28
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketmak.vc6
@@ -0,0 +1,131 @@
1# Microsoft Developer Studio Generated NMAKE File, Based on jpegtran.dsp
2!IF "$(CFG)" == ""
3CFG=jpegtran - Win32
4!MESSAGE Keine Konfiguration angegeben. jpegtran - Win32 wird als Standard verwendet.
5!ENDIF
6
7!IF "$(CFG)" != "jpegtran - Win32"
8!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
9!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
10!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
11!MESSAGE
12!MESSAGE NMAKE /f "jpegtran.mak" CFG="jpegtran - Win32"
13!MESSAGE
14!MESSAGE Fr die Konfiguration stehen zur Auswahl:
15!MESSAGE
16!MESSAGE "jpegtran - Win32" (basierend auf "Win32 (x86) Console Application")
17!MESSAGE
18!ERROR Eine ungltige Konfiguration wurde angegeben.
19!ENDIF
20
21!IF "$(OS)" == "Windows_NT"
22NULL=
23!ELSE
24NULL=nul
25!ENDIF
26
27CPP=cl.exe
28RSC=rc.exe
29OUTDIR=.\jpegtran\Release
30INTDIR=.\jpegtran\Release
31# Begin Custom Macros
32OutDir=.\jpegtran\Release
33# End Custom Macros
34
35ALL : "$(OUTDIR)\jpegtran.exe"
36
37
38CLEAN :
39 -@erase "$(INTDIR)\cdjpeg.obj"
40 -@erase "$(INTDIR)\jpegtran.obj"
41 -@erase "$(INTDIR)\rdswitch.obj"
42 -@erase "$(INTDIR)\transupp.obj"
43 -@erase "$(INTDIR)\vc60.idb"
44 -@erase "$(OUTDIR)\jpegtran.exe"
45
46"$(OUTDIR)" :
47 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
48
49BSC32=bscmake.exe
50BSC32_FLAGS=/nologo /o"$(OUTDIR)\jpegtran.bsc"
51BSC32_SBRS= \
52
53LINK32=link.exe
54LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\jpegtran.pdb" /machine:I386 /out:"$(OUTDIR)\jpegtran.exe"
55LINK32_OBJS= \
56 "$(INTDIR)\cdjpeg.obj" \
57 "$(INTDIR)\jpegtran.obj" \
58 "$(INTDIR)\rdswitch.obj" \
59 "$(INTDIR)\transupp.obj"
60
61"$(OUTDIR)\jpegtran.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
62 $(LINK32) @<<
63 $(LINK32_FLAGS) $(LINK32_OBJS)
64<<
65
66CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\jpegtran.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
67
68.c{$(INTDIR)}.obj::
69 $(CPP) @<<
70 $(CPP_PROJ) $<
71<<
72
73.cpp{$(INTDIR)}.obj::
74 $(CPP) @<<
75 $(CPP_PROJ) $<
76<<
77
78.cxx{$(INTDIR)}.obj::
79 $(CPP) @<<
80 $(CPP_PROJ) $<
81<<
82
83.c{$(INTDIR)}.sbr::
84 $(CPP) @<<
85 $(CPP_PROJ) $<
86<<
87
88.cpp{$(INTDIR)}.sbr::
89 $(CPP) @<<
90 $(CPP_PROJ) $<
91<<
92
93.cxx{$(INTDIR)}.sbr::
94 $(CPP) @<<
95 $(CPP_PROJ) $<
96<<
97
98
99!IF "$(NO_EXTERNAL_DEPS)" != "1"
100!IF EXISTS("jpegtran.dep")
101!INCLUDE "jpegtran.dep"
102!ELSE
103!MESSAGE Warning: cannot find "jpegtran.dep"
104!ENDIF
105!ENDIF
106
107
108!IF "$(CFG)" == "jpegtran - Win32"
109SOURCE=.\cdjpeg.c
110
111"$(INTDIR)\cdjpeg.obj" : $(SOURCE) "$(INTDIR)"
112
113
114SOURCE=.\jpegtran.c
115
116"$(INTDIR)\jpegtran.obj" : $(SOURCE) "$(INTDIR)"
117
118
119SOURCE=.\rdswitch.c
120
121"$(INTDIR)\rdswitch.obj" : $(SOURCE) "$(INTDIR)"
122
123
124SOURCE=.\transupp.c
125
126"$(INTDIR)\transupp.obj" : $(SOURCE) "$(INTDIR)"
127
128
129
130!ENDIF
131
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketvcx.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketvcx.v10
new file mode 100644
index 0000000..f943c90
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maketvcx.v10
@@ -0,0 +1,74 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 </ItemGroup>
9 <PropertyGroup Label="Globals">
10 <ProjectGuid>{025BAC50-51B5-4FFE-BC47-3F920BB4047E}</ProjectGuid>
11 <Keyword>Win32Proj</Keyword>
12 <RootNamespace>jpegtran</RootNamespace>
13 </PropertyGroup>
14 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
15 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
16 <ConfigurationType>Application</ConfigurationType>
17 <UseDebugLibraries>false</UseDebugLibraries>
18 <WholeProgramOptimization>true</WholeProgramOptimization>
19 <CharacterSet>Unicode</CharacterSet>
20 </PropertyGroup>
21 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
22 <ImportGroup Label="ExtensionSettings">
23 </ImportGroup>
24 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
25 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
26 </ImportGroup>
27 <PropertyGroup Label="UserMacros" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
29 <LinkIncremental>false</LinkIncremental>
30 <OutDir>$(ProjectName)\$(Configuration)\</OutDir>
31 <IntDir>$(ProjectName)\$(Configuration)\</IntDir>
32 </PropertyGroup>
33 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
34 <ClCompile>
35 <WarningLevel>Level3</WarningLevel>
36 <PrecompiledHeader>NotUsing</PrecompiledHeader>
37 <Optimization>Full</Optimization>
38 <FunctionLevelLinking>true</FunctionLevelLinking>
39 <IntrinsicFunctions>false</IntrinsicFunctions>
40 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
41 <OmitFramePointers>true</OmitFramePointers>
42 <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
43 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
44 </ClCompile>
45 <Link>
46 <SubSystem>Console</SubSystem>
47 <GenerateDebugInformation>true</GenerateDebugInformation>
48 <EnableCOMDATFolding>true</EnableCOMDATFolding>
49 <OptimizeReferences>true</OptimizeReferences>
50 <AdditionalDependencies>Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
51 </Link>
52 </ItemDefinitionGroup>
53 <ItemGroup>
54 <ClInclude Include="cderror.h" />
55 <ClInclude Include="cdjpeg.h" />
56 <ClInclude Include="jconfig.h" />
57 <ClInclude Include="jerror.h" />
58 <ClInclude Include="jinclude.h" />
59 <ClInclude Include="jmorecfg.h" />
60 <ClInclude Include="jpegint.h" />
61 <ClInclude Include="jpeglib.h" />
62 <ClInclude Include="jversion.h" />
63 <ClInclude Include="transupp.h" />
64 </ItemGroup>
65 <ItemGroup>
66 <ClCompile Include="cdjpeg.c" />
67 <ClCompile Include="jpegtran.c" />
68 <ClCompile Include="rdswitch.c" />
69 <ClCompile Include="transupp.c" />
70 </ItemGroup>
71 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
72 <ImportGroup Label="ExtensionTargets">
73 </ImportGroup>
74</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdep.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdep.vc6
new file mode 100644
index 0000000..7dd081f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdep.vc6
@@ -0,0 +1,6 @@
1# Microsoft Developer Studio erstellte Abhängigkeitsdatei, einbezogen von wrjpgcom.mak
2
3.\wrjpgcom.c : \
4 ".\jconfig.h"\
5 ".\jinclude.h"\
6
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdsp.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdsp.vc6
new file mode 100644
index 0000000..f625aec
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewdsp.vc6
@@ -0,0 +1,78 @@
1# Microsoft Developer Studio Project File - Name="wrjpgcom" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** NICHT BEARBEITEN **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=wrjpgcom - Win32
8!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
9!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
10!MESSAGE
11!MESSAGE NMAKE /f "wrjpgcom.mak".
12!MESSAGE
13!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
14!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
15!MESSAGE
16!MESSAGE NMAKE /f "wrjpgcom.mak" CFG="wrjpgcom - Win32"
17!MESSAGE
18!MESSAGE Für die Konfiguration stehen zur Auswahl:
19!MESSAGE
20!MESSAGE "wrjpgcom - Win32" (basierend auf "Win32 (x86) Console Application")
21!MESSAGE
22
23# Begin Project
24# PROP AllowPerConfigDependencies 0
25# PROP Scc_ProjName ""
26# PROP Scc_LocalPath ""
27CPP=cl.exe
28RSC=rc.exe
29# PROP BASE Use_MFC 0
30# PROP BASE Use_Debug_Libraries 0
31# PROP BASE Output_Dir ".\wrjpgcom\Release"
32# PROP BASE Intermediate_Dir ".\wrjpgcom\Release"
33# PROP BASE Target_Dir ".\wrjpgcom"
34# PROP Use_MFC 0
35# PROP Use_Debug_Libraries 0
36# PROP Output_Dir ".\wrjpgcom\Release"
37# PROP Intermediate_Dir ".\wrjpgcom\Release"
38# PROP Ignore_Export_Lib 0
39# PROP Target_Dir ".\wrjpgcom"
40# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
41# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
42# ADD BASE RSC /l 0x409 /d "NDEBUG"
43# ADD RSC /l 0x409 /d "NDEBUG"
44BSC32=bscmake.exe
45# ADD BASE BSC32 /nologo
46# ADD BSC32 /nologo
47LINK32=link.exe
48# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
49# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
50# Begin Target
51
52# Name "wrjpgcom - Win32"
53# Begin Group "Quellcodedateien"
54
55# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
56# Begin Source File
57
58SOURCE=.\wrjpgcom.c
59# End Source File
60# End Group
61# Begin Group "Header-Dateien"
62
63# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
64# Begin Source File
65
66SOURCE=.\jconfig.h
67# End Source File
68# Begin Source File
69
70SOURCE=.\jinclude.h
71# End Source File
72# End Group
73# Begin Group "Ressourcendateien"
74
75# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
76# End Group
77# End Target
78# End Project
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewfil.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewfil.v10
new file mode 100644
index 0000000..df6b35d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewfil.v10
@@ -0,0 +1,30 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="jconfig.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="jinclude.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 </ItemGroup>
25 <ItemGroup>
26 <ClCompile Include="wrjpgcom.c">
27 <Filter>Source Files</Filter>
28 </ClCompile>
29 </ItemGroup>
30</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewmak.vc6 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewmak.vc6
new file mode 100644
index 0000000..89ed555
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewmak.vc6
@@ -0,0 +1,110 @@
1# Microsoft Developer Studio Generated NMAKE File, Based on wrjpgcom.dsp
2!IF "$(CFG)" == ""
3CFG=wrjpgcom - Win32
4!MESSAGE Keine Konfiguration angegeben. wrjpgcom - Win32 wird als Standard verwendet.
5!ENDIF
6
7!IF "$(CFG)" != "wrjpgcom - Win32"
8!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
9!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
10!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
11!MESSAGE
12!MESSAGE NMAKE /f "wrjpgcom.mak" CFG="wrjpgcom - Win32"
13!MESSAGE
14!MESSAGE Fr die Konfiguration stehen zur Auswahl:
15!MESSAGE
16!MESSAGE "wrjpgcom - Win32" (basierend auf "Win32 (x86) Console Application")
17!MESSAGE
18!ERROR Eine ungltige Konfiguration wurde angegeben.
19!ENDIF
20
21!IF "$(OS)" == "Windows_NT"
22NULL=
23!ELSE
24NULL=nul
25!ENDIF
26
27CPP=cl.exe
28RSC=rc.exe
29OUTDIR=.\wrjpgcom\Release
30INTDIR=.\wrjpgcom\Release
31# Begin Custom Macros
32OutDir=.\wrjpgcom\Release
33# End Custom Macros
34
35ALL : "$(OUTDIR)\wrjpgcom.exe"
36
37
38CLEAN :
39 -@erase "$(INTDIR)\vc60.idb"
40 -@erase "$(INTDIR)\wrjpgcom.obj"
41 -@erase "$(OUTDIR)\wrjpgcom.exe"
42
43"$(OUTDIR)" :
44 if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
45
46BSC32=bscmake.exe
47BSC32_FLAGS=/nologo /o"$(OUTDIR)\wrjpgcom.bsc"
48BSC32_SBRS= \
49
50LINK32=link.exe
51LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\wrjpgcom.pdb" /machine:I386 /out:"$(OUTDIR)\wrjpgcom.exe"
52LINK32_OBJS= \
53 "$(INTDIR)\wrjpgcom.obj"
54
55"$(OUTDIR)\wrjpgcom.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
56 $(LINK32) @<<
57 $(LINK32_FLAGS) $(LINK32_OBJS)
58<<
59
60CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\wrjpgcom.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
61
62.c{$(INTDIR)}.obj::
63 $(CPP) @<<
64 $(CPP_PROJ) $<
65<<
66
67.cpp{$(INTDIR)}.obj::
68 $(CPP) @<<
69 $(CPP_PROJ) $<
70<<
71
72.cxx{$(INTDIR)}.obj::
73 $(CPP) @<<
74 $(CPP_PROJ) $<
75<<
76
77.c{$(INTDIR)}.sbr::
78 $(CPP) @<<
79 $(CPP_PROJ) $<
80<<
81
82.cpp{$(INTDIR)}.sbr::
83 $(CPP) @<<
84 $(CPP_PROJ) $<
85<<
86
87.cxx{$(INTDIR)}.sbr::
88 $(CPP) @<<
89 $(CPP_PROJ) $<
90<<
91
92
93!IF "$(NO_EXTERNAL_DEPS)" != "1"
94!IF EXISTS("wrjpgcom.dep")
95!INCLUDE "wrjpgcom.dep"
96!ELSE
97!MESSAGE Warning: cannot find "wrjpgcom.dep"
98!ENDIF
99!ENDIF
100
101
102!IF "$(CFG)" == "wrjpgcom - Win32"
103SOURCE=.\wrjpgcom.c
104
105"$(INTDIR)\wrjpgcom.obj" : $(SOURCE) "$(INTDIR)"
106
107
108
109!ENDIF
110
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewvcx.v10 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewvcx.v10
new file mode 100644
index 0000000..13aa501
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makewvcx.v10
@@ -0,0 +1,62 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 </ItemGroup>
9 <PropertyGroup Label="Globals">
10 <ProjectGuid>{B57065D4-DDDA-4668-BAF5-2D49270C973C}</ProjectGuid>
11 <Keyword>Win32Proj</Keyword>
12 <RootNamespace>wrjpgcom</RootNamespace>
13 </PropertyGroup>
14 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
15 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
16 <ConfigurationType>Application</ConfigurationType>
17 <UseDebugLibraries>false</UseDebugLibraries>
18 <WholeProgramOptimization>true</WholeProgramOptimization>
19 <CharacterSet>Unicode</CharacterSet>
20 </PropertyGroup>
21 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
22 <ImportGroup Label="ExtensionSettings">
23 </ImportGroup>
24 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
25 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
26 </ImportGroup>
27 <PropertyGroup Label="UserMacros" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
29 <LinkIncremental>false</LinkIncremental>
30 <OutDir>$(ProjectName)\$(Configuration)\</OutDir>
31 <IntDir>$(ProjectName)\$(Configuration)\</IntDir>
32 </PropertyGroup>
33 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
34 <ClCompile>
35 <WarningLevel>Level3</WarningLevel>
36 <PrecompiledHeader>NotUsing</PrecompiledHeader>
37 <Optimization>Full</Optimization>
38 <FunctionLevelLinking>true</FunctionLevelLinking>
39 <IntrinsicFunctions>false</IntrinsicFunctions>
40 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
41 <OmitFramePointers>true</OmitFramePointers>
42 <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
43 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
44 </ClCompile>
45 <Link>
46 <SubSystem>Console</SubSystem>
47 <GenerateDebugInformation>true</GenerateDebugInformation>
48 <EnableCOMDATFolding>true</EnableCOMDATFolding>
49 <OptimizeReferences>true</OptimizeReferences>
50 </Link>
51 </ItemDefinitionGroup>
52 <ItemGroup>
53 <ClInclude Include="jconfig.h" />
54 <ClInclude Include="jinclude.h" />
55 </ItemGroup>
56 <ItemGroup>
57 <ClCompile Include="wrjpgcom.c" />
58 </ItemGroup>
59 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
60 <ImportGroup Label="ExtensionTargets">
61 </ImportGroup>
62</Project> \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makljpeg.st b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makljpeg.st
new file mode 100644
index 0000000..0720fb5
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makljpeg.st
@@ -0,0 +1,68 @@
1; Project file for Independent JPEG Group's software
2;
3; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
4; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.
5;
6; To use this file, rename it to libjpeg.prj.
7; Read installation instructions before trying to make the program!
8;
9;
10; * * * Output file * * *
11libjpeg.lib
12;
13; * * * COMPILER OPTIONS * * *
14.C[-P] ; absolute calls
15.C[-M] ; and no string merging, folks
16.C[-w-cln] ; no "constant is long" warnings
17.C[-w-par] ; no "parameter xxxx unused"
18.C[-w-rch] ; no "unreachable code"
19.C[-wsig] ; warn if significant digits may be lost
20.L[-J] ; link new Obj-format (so we get a library)
21=
22; * * * * List of modules * * * *
23jaricom.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
24jcapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
25jcapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
26jcarith.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
27jccoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
28jccolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
29jcdctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
30jchuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
31jcinit.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
32jcmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
33jcmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
34jcmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
35jcomapi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
36jcparam.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
37jcprepct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
38jcsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
39jctrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
40jdapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
41jdapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
42jdarith.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
43jdatadst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h)
44jdatasrc.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h)
45jdcoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
46jdcolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
47jddctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
48jdhuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
49jdinput.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
50jdmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
51jdmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
52jdmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
53jdmerge.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
54jdpostct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
55jdsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
56jdtrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
57jerror.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jversion.h,jerror.h)
58jfdctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
59jfdctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
60jfdctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
61jidctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
62jidctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
63jidctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h)
64jquant1.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
65jquant2.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
66jutils.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h)
67jmemmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h)
68jmemansi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h)
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maktjpeg.st b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maktjpeg.st
new file mode 100644
index 0000000..25ce926
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/maktjpeg.st
@@ -0,0 +1,30 @@
1; Project file for Independent JPEG Group's software
2;
3; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C.
4; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding.
5;
6; To use this file, rename it to jpegtran.prj.
7; If you are using Turbo C, change filenames beginning with "pc..." to "tc..."
8; Read installation instructions before trying to make the program!
9;
10;
11; * * * Output file * * *
12jpegtran.ttp
13;
14; * * * COMPILER OPTIONS * * *
15.C[-P] ; absolute calls
16.C[-M] ; and no string merging, folks
17.C[-w-cln] ; no "constant is long" warnings
18.C[-w-par] ; no "parameter xxxx unused"
19.C[-w-rch] ; no "unreachable code"
20.C[-wsig] ; warn if significant digits may be lost
21=
22; * * * * List of modules * * * *
23pcstart.o
24jpegtran.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h)
25cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
26rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h)
27transupp.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h)
28libjpeg.lib ; built by libjpeg.prj
29pcstdlib.lib ; standard library
30pcextlib.lib ; extended library
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makvms.opt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makvms.opt
new file mode 100644
index 0000000..26db714
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/makvms.opt
@@ -0,0 +1,4 @@
1! A pointer to the VAX/VMS C Run-Time Shareable Library.
2! This file is needed by makefile.mms and makefile.vms,
3! but only for the older VAX C compiler. DEC C does not need it.
4Sys$Library:VAXCRTL.EXE /Share
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/missing b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/missing
new file mode 100644
index 0000000..23c9d2e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/missing
@@ -0,0 +1,376 @@
1#! /bin/sh
2# Common stub for a few missing GNU programs while installing.
3
4scriptversion=2009-04-28.21; # UTC
5
6# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
7# 2008, 2009 Free Software Foundation, Inc.
8# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28if test $# -eq 0; then
29 echo 1>&2 "Try \`$0 --help' for more information"
30 exit 1
31fi
32
33run=:
34sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
35sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
36
37# In the cases where this matters, `missing' is being run in the
38# srcdir already.
39if test -f configure.ac; then
40 configure_ac=configure.ac
41else
42 configure_ac=configure.in
43fi
44
45msg="missing on your system"
46
47case $1 in
48--run)
49 # Try to run requested program, and just exit if it succeeds.
50 run=
51 shift
52 "$@" && exit 0
53 # Exit code 63 means version mismatch. This often happens
54 # when the user try to use an ancient version of a tool on
55 # a file that requires a minimum version. In this case we
56 # we should proceed has if the program had been absent, or
57 # if --run hadn't been passed.
58 if test $? = 63; then
59 run=:
60 msg="probably too old"
61 fi
62 ;;
63
64 -h|--h|--he|--hel|--help)
65 echo "\
66$0 [OPTION]... PROGRAM [ARGUMENT]...
67
68Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
69error status if there is no known handling for PROGRAM.
70
71Options:
72 -h, --help display this help and exit
73 -v, --version output version information and exit
74 --run try to run the given command, and emulate it if it fails
75
76Supported PROGRAM values:
77 aclocal touch file \`aclocal.m4'
78 autoconf touch file \`configure'
79 autoheader touch file \`config.h.in'
80 autom4te touch the output file, or create a stub one
81 automake touch all \`Makefile.in' files
82 bison create \`y.tab.[ch]', if possible, from existing .[ch]
83 flex create \`lex.yy.c', if possible, from existing .c
84 help2man touch the output file
85 lex create \`lex.yy.c', if possible, from existing .c
86 makeinfo touch the output file
87 tar try tar, gnutar, gtar, then tar without non-portable flags
88 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
89
90Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
91\`g' are ignored when checking the name.
92
93Send bug reports to <bug-automake@gnu.org>."
94 exit $?
95 ;;
96
97 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
98 echo "missing $scriptversion (GNU Automake)"
99 exit $?
100 ;;
101
102 -*)
103 echo 1>&2 "$0: Unknown \`$1' option"
104 echo 1>&2 "Try \`$0 --help' for more information"
105 exit 1
106 ;;
107
108esac
109
110# normalize program name to check for.
111program=`echo "$1" | sed '
112 s/^gnu-//; t
113 s/^gnu//; t
114 s/^g//; t'`
115
116# Now exit if we have it, but it failed. Also exit now if we
117# don't have it and --version was passed (most likely to detect
118# the program). This is about non-GNU programs, so use $1 not
119# $program.
120case $1 in
121 lex*|yacc*)
122 # Not GNU programs, they don't have --version.
123 ;;
124
125 tar*)
126 if test -n "$run"; then
127 echo 1>&2 "ERROR: \`tar' requires --run"
128 exit 1
129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130 exit 1
131 fi
132 ;;
133
134 *)
135 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
136 # We have it, but it failed.
137 exit 1
138 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
139 # Could not run --version or --help. This is probably someone
140 # running `$TOOL --version' or `$TOOL --help' to check whether
141 # $TOOL exists and not knowing $TOOL uses missing.
142 exit 1
143 fi
144 ;;
145esac
146
147# If it does not exist, or fails to run (possibly an outdated version),
148# try to emulate it.
149case $program in
150 aclocal*)
151 echo 1>&2 "\
152WARNING: \`$1' is $msg. You should only need it if
153 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
154 to install the \`Automake' and \`Perl' packages. Grab them from
155 any GNU archive site."
156 touch aclocal.m4
157 ;;
158
159 autoconf*)
160 echo 1>&2 "\
161WARNING: \`$1' is $msg. You should only need it if
162 you modified \`${configure_ac}'. You might want to install the
163 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
164 archive site."
165 touch configure
166 ;;
167
168 autoheader*)
169 echo 1>&2 "\
170WARNING: \`$1' is $msg. You should only need it if
171 you modified \`acconfig.h' or \`${configure_ac}'. You might want
172 to install the \`Autoconf' and \`GNU m4' packages. Grab them
173 from any GNU archive site."
174 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
175 test -z "$files" && files="config.h"
176 touch_files=
177 for f in $files; do
178 case $f in
179 *:*) touch_files="$touch_files "`echo "$f" |
180 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
181 *) touch_files="$touch_files $f.in";;
182 esac
183 done
184 touch $touch_files
185 ;;
186
187 automake*)
188 echo 1>&2 "\
189WARNING: \`$1' is $msg. You should only need it if
190 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
191 You might want to install the \`Automake' and \`Perl' packages.
192 Grab them from any GNU archive site."
193 find . -type f -name Makefile.am -print |
194 sed 's/\.am$/.in/' |
195 while read f; do touch "$f"; done
196 ;;
197
198 autom4te*)
199 echo 1>&2 "\
200WARNING: \`$1' is needed, but is $msg.
201 You might have modified some files without having the
202 proper tools for further handling them.
203 You can get \`$1' as part of \`Autoconf' from any GNU
204 archive site."
205
206 file=`echo "$*" | sed -n "$sed_output"`
207 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
208 if test -f "$file"; then
209 touch $file
210 else
211 test -z "$file" || exec >$file
212 echo "#! /bin/sh"
213 echo "# Created by GNU Automake missing as a replacement of"
214 echo "# $ $@"
215 echo "exit 0"
216 chmod +x $file
217 exit 1
218 fi
219 ;;
220
221 bison*|yacc*)
222 echo 1>&2 "\
223WARNING: \`$1' $msg. You should only need it if
224 you modified a \`.y' file. You may need the \`Bison' package
225 in order for those modifications to take effect. You can get
226 \`Bison' from any GNU archive site."
227 rm -f y.tab.c y.tab.h
228 if test $# -ne 1; then
229 eval LASTARG="\${$#}"
230 case $LASTARG in
231 *.y)
232 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
233 if test -f "$SRCFILE"; then
234 cp "$SRCFILE" y.tab.c
235 fi
236 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
237 if test -f "$SRCFILE"; then
238 cp "$SRCFILE" y.tab.h
239 fi
240 ;;
241 esac
242 fi
243 if test ! -f y.tab.h; then
244 echo >y.tab.h
245 fi
246 if test ! -f y.tab.c; then
247 echo 'main() { return 0; }' >y.tab.c
248 fi
249 ;;
250
251 lex*|flex*)
252 echo 1>&2 "\
253WARNING: \`$1' is $msg. You should only need it if
254 you modified a \`.l' file. You may need the \`Flex' package
255 in order for those modifications to take effect. You can get
256 \`Flex' from any GNU archive site."
257 rm -f lex.yy.c
258 if test $# -ne 1; then
259 eval LASTARG="\${$#}"
260 case $LASTARG in
261 *.l)
262 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
263 if test -f "$SRCFILE"; then
264 cp "$SRCFILE" lex.yy.c
265 fi
266 ;;
267 esac
268 fi
269 if test ! -f lex.yy.c; then
270 echo 'main() { return 0; }' >lex.yy.c
271 fi
272 ;;
273
274 help2man*)
275 echo 1>&2 "\
276WARNING: \`$1' is $msg. You should only need it if
277 you modified a dependency of a manual page. You may need the
278 \`Help2man' package in order for those modifications to take
279 effect. You can get \`Help2man' from any GNU archive site."
280
281 file=`echo "$*" | sed -n "$sed_output"`
282 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
283 if test -f "$file"; then
284 touch $file
285 else
286 test -z "$file" || exec >$file
287 echo ".ab help2man is required to generate this page"
288 exit $?
289 fi
290 ;;
291
292 makeinfo*)
293 echo 1>&2 "\
294WARNING: \`$1' is $msg. You should only need it if
295 you modified a \`.texi' or \`.texinfo' file, or any other file
296 indirectly affecting the aspect of the manual. The spurious
297 call might also be the consequence of using a buggy \`make' (AIX,
298 DU, IRIX). You might want to install the \`Texinfo' package or
299 the \`GNU make' package. Grab either from any GNU archive site."
300 # The file to touch is that specified with -o ...
301 file=`echo "$*" | sed -n "$sed_output"`
302 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
303 if test -z "$file"; then
304 # ... or it is the one specified with @setfilename ...
305 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
306 file=`sed -n '
307 /^@setfilename/{
308 s/.* \([^ ]*\) *$/\1/
309 p
310 q
311 }' $infile`
312 # ... or it is derived from the source name (dir/f.texi becomes f.info)
313 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
314 fi
315 # If the file does not exist, the user really needs makeinfo;
316 # let's fail without touching anything.
317 test -f $file || exit 1
318 touch $file
319 ;;
320
321 tar*)
322 shift
323
324 # We have already tried tar in the generic part.
325 # Look for gnutar/gtar before invocation to avoid ugly error
326 # messages.
327 if (gnutar --version > /dev/null 2>&1); then
328 gnutar "$@" && exit 0
329 fi
330 if (gtar --version > /dev/null 2>&1); then
331 gtar "$@" && exit 0
332 fi
333 firstarg="$1"
334 if shift; then
335 case $firstarg in
336 *o*)
337 firstarg=`echo "$firstarg" | sed s/o//`
338 tar "$firstarg" "$@" && exit 0
339 ;;
340 esac
341 case $firstarg in
342 *h*)
343 firstarg=`echo "$firstarg" | sed s/h//`
344 tar "$firstarg" "$@" && exit 0
345 ;;
346 esac
347 fi
348
349 echo 1>&2 "\
350WARNING: I can't seem to be able to run \`tar' with the given arguments.
351 You may want to install GNU tar or Free paxutils, or check the
352 command line arguments."
353 exit 1
354 ;;
355
356 *)
357 echo 1>&2 "\
358WARNING: \`$1' is needed, and is $msg.
359 You might have modified some files without having the
360 proper tools for further handling them. Check the \`README' file,
361 it often tells you about the needed prerequisites for installing
362 this package. You may also peek at any GNU archive site, in case
363 some other package would contain this missing \`$1' program."
364 exit 1
365 ;;
366esac
367
368exit 0
369
370# Local variables:
371# eval: (add-hook 'write-file-hooks 'time-stamp)
372# time-stamp-start: "scriptversion="
373# time-stamp-format: "%:y-%02m-%02d.%02H"
374# time-stamp-time-zone: "UTC"
375# time-stamp-end: "; # UTC"
376# End:
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdbmp.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdbmp.c
new file mode 100644
index 0000000..dfdf96f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdbmp.c
@@ -0,0 +1,480 @@
1/*
2 * rdbmp.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * Modified 2009-2010 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains routines to read input images in Microsoft "BMP"
10 * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors).
11 * Currently, only 8-bit and 24-bit images are supported, not 1-bit or
12 * 4-bit (feeding such low-depth images into JPEG would be silly anyway).
13 * Also, we don't support RLE-compressed files.
14 *
15 * These routines may need modification for non-Unix environments or
16 * specialized applications. As they stand, they assume input from
17 * an ordinary stdio stream. They further assume that reading begins
18 * at the start of the file; start_input may need work if the
19 * user interface has already read some data (e.g., to determine that
20 * the file is indeed BMP format).
21 *
22 * This code contributed by James Arthur Boucher.
23 */
24
25#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
26
27#ifdef BMP_SUPPORTED
28
29
30/* Macros to deal with unsigned chars as efficiently as compiler allows */
31
32#ifdef HAVE_UNSIGNED_CHAR
33typedef unsigned char U_CHAR;
34#define UCH(x) ((int) (x))
35#else /* !HAVE_UNSIGNED_CHAR */
36#ifdef CHAR_IS_UNSIGNED
37typedef char U_CHAR;
38#define UCH(x) ((int) (x))
39#else
40typedef char U_CHAR;
41#define UCH(x) ((int) (x) & 0xFF)
42#endif
43#endif /* HAVE_UNSIGNED_CHAR */
44
45
46#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))
47
48
49/* Private version of data source object */
50
51typedef struct _bmp_source_struct * bmp_source_ptr;
52
53typedef struct _bmp_source_struct {
54 struct cjpeg_source_struct pub; /* public fields */
55
56 j_compress_ptr cinfo; /* back link saves passing separate parm */
57
58 JSAMPARRAY colormap; /* BMP colormap (converted to my format) */
59
60 jvirt_sarray_ptr whole_image; /* Needed to reverse row order */
61 JDIMENSION source_row; /* Current source row number */
62 JDIMENSION row_width; /* Physical width of scanlines in file */
63
64 int bits_per_pixel; /* remembers 8- or 24-bit format */
65} bmp_source_struct;
66
67
68LOCAL(int)
69read_byte (bmp_source_ptr sinfo)
70/* Read next byte from BMP file */
71{
72 register FILE *infile = sinfo->pub.input_file;
73 register int c;
74
75 if ((c = getc(infile)) == EOF)
76 ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);
77 return c;
78}
79
80
81LOCAL(void)
82read_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize)
83/* Read the colormap from a BMP file */
84{
85 int i;
86
87 switch (mapentrysize) {
88 case 3:
89 /* BGR format (occurs in OS/2 files) */
90 for (i = 0; i < cmaplen; i++) {
91 sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);
92 sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);
93 sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);
94 }
95 break;
96 case 4:
97 /* BGR0 format (occurs in MS Windows files) */
98 for (i = 0; i < cmaplen; i++) {
99 sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);
100 sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);
101 sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);
102 (void) read_byte(sinfo);
103 }
104 break;
105 default:
106 ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP);
107 break;
108 }
109}
110
111
112/*
113 * Read one row of pixels.
114 * The image has been read into the whole_image array, but is otherwise
115 * unprocessed. We must read it out in top-to-bottom row order, and if
116 * it is an 8-bit image, we must expand colormapped pixels to 24bit format.
117 */
118
119METHODDEF(JDIMENSION)
120get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
121/* This version is for reading 8-bit colormap indexes */
122{
123 bmp_source_ptr source = (bmp_source_ptr) sinfo;
124 register JSAMPARRAY colormap = source->colormap;
125 JSAMPARRAY image_ptr;
126 register int t;
127 register JSAMPROW inptr, outptr;
128 register JDIMENSION col;
129
130 /* Fetch next row from virtual array */
131 source->source_row--;
132 image_ptr = (*cinfo->mem->access_virt_sarray)
133 ((j_common_ptr) cinfo, source->whole_image,
134 source->source_row, (JDIMENSION) 1, FALSE);
135
136 /* Expand the colormap indexes to real data */
137 inptr = image_ptr[0];
138 outptr = source->pub.buffer[0];
139 for (col = cinfo->image_width; col > 0; col--) {
140 t = GETJSAMPLE(*inptr++);
141 *outptr++ = colormap[0][t]; /* can omit GETJSAMPLE() safely */
142 *outptr++ = colormap[1][t];
143 *outptr++ = colormap[2][t];
144 }
145
146 return 1;
147}
148
149
150METHODDEF(JDIMENSION)
151get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
152/* This version is for reading 24-bit pixels */
153{
154 bmp_source_ptr source = (bmp_source_ptr) sinfo;
155 JSAMPARRAY image_ptr;
156 register JSAMPROW inptr, outptr;
157 register JDIMENSION col;
158
159 /* Fetch next row from virtual array */
160 source->source_row--;
161 image_ptr = (*cinfo->mem->access_virt_sarray)
162 ((j_common_ptr) cinfo, source->whole_image,
163 source->source_row, (JDIMENSION) 1, FALSE);
164
165 /* Transfer data. Note source values are in BGR order
166 * (even though Microsoft's own documents say the opposite).
167 */
168 inptr = image_ptr[0];
169 outptr = source->pub.buffer[0];
170 for (col = cinfo->image_width; col > 0; col--) {
171 outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */
172 outptr[1] = *inptr++;
173 outptr[0] = *inptr++;
174 outptr += 3;
175 }
176
177 return 1;
178}
179
180
181METHODDEF(JDIMENSION)
182get_32bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
183/* This version is for reading 32-bit pixels */
184{
185 bmp_source_ptr source = (bmp_source_ptr) sinfo;
186 JSAMPARRAY image_ptr;
187 register JSAMPROW inptr, outptr;
188 register JDIMENSION col;
189
190 /* Fetch next row from virtual array */
191 source->source_row--;
192 image_ptr = (*cinfo->mem->access_virt_sarray)
193 ((j_common_ptr) cinfo, source->whole_image,
194 source->source_row, (JDIMENSION) 1, FALSE);
195 /* Transfer data. Note source values are in BGR order
196 * (even though Microsoft's own documents say the opposite).
197 */
198 inptr = image_ptr[0];
199 outptr = source->pub.buffer[0];
200 for (col = cinfo->image_width; col > 0; col--) {
201 outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */
202 outptr[1] = *inptr++;
203 outptr[0] = *inptr++;
204 inptr++; /* skip the 4th byte (Alpha channel) */
205 outptr += 3;
206 }
207
208 return 1;
209}
210
211
212/*
213 * This method loads the image into whole_image during the first call on
214 * get_pixel_rows. The get_pixel_rows pointer is then adjusted to call
215 * get_8bit_row, get_24bit_row, or get_32bit_row on subsequent calls.
216 */
217
218METHODDEF(JDIMENSION)
219preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
220{
221 bmp_source_ptr source = (bmp_source_ptr) sinfo;
222 register FILE *infile = source->pub.input_file;
223 register int c;
224 register JSAMPROW out_ptr;
225 JSAMPARRAY image_ptr;
226 JDIMENSION row, col;
227 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
228
229 /* Read the data into a virtual array in input-file row order. */
230 for (row = 0; row < cinfo->image_height; row++) {
231 if (progress != NULL) {
232 progress->pub.pass_counter = (long) row;
233 progress->pub.pass_limit = (long) cinfo->image_height;
234 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
235 }
236 image_ptr = (*cinfo->mem->access_virt_sarray)
237 ((j_common_ptr) cinfo, source->whole_image,
238 row, (JDIMENSION) 1, TRUE);
239 out_ptr = image_ptr[0];
240 for (col = source->row_width; col > 0; col--) {
241 /* inline copy of read_byte() for speed */
242 if ((c = getc(infile)) == EOF)
243 ERREXIT(cinfo, JERR_INPUT_EOF);
244 *out_ptr++ = (JSAMPLE) c;
245 }
246 }
247 if (progress != NULL)
248 progress->completed_extra_passes++;
249
250 /* Set up to read from the virtual array in top-to-bottom order */
251 switch (source->bits_per_pixel) {
252 case 8:
253 source->pub.get_pixel_rows = get_8bit_row;
254 break;
255 case 24:
256 source->pub.get_pixel_rows = get_24bit_row;
257 break;
258 case 32:
259 source->pub.get_pixel_rows = get_32bit_row;
260 break;
261 default:
262 ERREXIT(cinfo, JERR_BMP_BADDEPTH);
263 }
264 source->source_row = cinfo->image_height;
265
266 /* And read the first row */
267 return (*source->pub.get_pixel_rows) (cinfo, sinfo);
268}
269
270
271/*
272 * Read the file header; return image size and component count.
273 */
274
275METHODDEF(void)
276start_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
277{
278 bmp_source_ptr source = (bmp_source_ptr) sinfo;
279 U_CHAR bmpfileheader[14];
280 U_CHAR bmpinfoheader[64];
281#define GET_2B(array,offset) ((unsigned int) UCH(array[offset]) + \
282 (((unsigned int) UCH(array[offset+1])) << 8))
283#define GET_4B(array,offset) ((INT32) UCH(array[offset]) + \
284 (((INT32) UCH(array[offset+1])) << 8) + \
285 (((INT32) UCH(array[offset+2])) << 16) + \
286 (((INT32) UCH(array[offset+3])) << 24))
287 INT32 bfOffBits;
288 INT32 headerSize;
289 INT32 biWidth;
290 INT32 biHeight;
291 unsigned int biPlanes;
292 INT32 biCompression;
293 INT32 biXPelsPerMeter,biYPelsPerMeter;
294 INT32 biClrUsed = 0;
295 int mapentrysize = 0; /* 0 indicates no colormap */
296 INT32 bPad;
297 JDIMENSION row_width;
298
299 /* Read and verify the bitmap file header */
300 if (! ReadOK(source->pub.input_file, bmpfileheader, 14))
301 ERREXIT(cinfo, JERR_INPUT_EOF);
302 if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */
303 ERREXIT(cinfo, JERR_BMP_NOT);
304 bfOffBits = (INT32) GET_4B(bmpfileheader,10);
305 /* We ignore the remaining fileheader fields */
306
307 /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows),
308 * or 64 bytes (OS/2 2.x). Check the first 4 bytes to find out which.
309 */
310 if (! ReadOK(source->pub.input_file, bmpinfoheader, 4))
311 ERREXIT(cinfo, JERR_INPUT_EOF);
312 headerSize = (INT32) GET_4B(bmpinfoheader,0);
313 if (headerSize < 12 || headerSize > 64)
314 ERREXIT(cinfo, JERR_BMP_BADHEADER);
315 if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4))
316 ERREXIT(cinfo, JERR_INPUT_EOF);
317
318 switch ((int) headerSize) {
319 case 12:
320 /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */
321 biWidth = (INT32) GET_2B(bmpinfoheader,4);
322 biHeight = (INT32) GET_2B(bmpinfoheader,6);
323 biPlanes = GET_2B(bmpinfoheader,8);
324 source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10);
325
326 switch (source->bits_per_pixel) {
327 case 8: /* colormapped image */
328 mapentrysize = 3; /* OS/2 uses RGBTRIPLE colormap */
329 TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight);
330 break;
331 case 24: /* RGB image */
332 TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight);
333 break;
334 default:
335 ERREXIT(cinfo, JERR_BMP_BADDEPTH);
336 break;
337 }
338 break;
339 case 40:
340 case 64:
341 /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */
342 /* or OS/2 2.x header, which has additional fields that we ignore */
343 biWidth = GET_4B(bmpinfoheader,4);
344 biHeight = GET_4B(bmpinfoheader,8);
345 biPlanes = GET_2B(bmpinfoheader,12);
346 source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14);
347 biCompression = GET_4B(bmpinfoheader,16);
348 biXPelsPerMeter = GET_4B(bmpinfoheader,24);
349 biYPelsPerMeter = GET_4B(bmpinfoheader,28);
350 biClrUsed = GET_4B(bmpinfoheader,32);
351 /* biSizeImage, biClrImportant fields are ignored */
352
353 switch (source->bits_per_pixel) {
354 case 8: /* colormapped image */
355 mapentrysize = 4; /* Windows uses RGBQUAD colormap */
356 TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight);
357 break;
358 case 24: /* RGB image */
359 TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);
360 break;
361 case 32: /* RGB image + Alpha channel */
362 TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);
363 break;
364 default:
365 ERREXIT(cinfo, JERR_BMP_BADDEPTH);
366 break;
367 }
368 if (biCompression != 0)
369 ERREXIT(cinfo, JERR_BMP_COMPRESSED);
370
371 if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) {
372 /* Set JFIF density parameters from the BMP data */
373 cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */
374 cinfo->Y_density = (UINT16) (biYPelsPerMeter/100);
375 cinfo->density_unit = 2; /* dots/cm */
376 }
377 break;
378 default:
379 ERREXIT(cinfo, JERR_BMP_BADHEADER);
380 return;
381 }
382
383 if (biWidth <= 0 || biHeight <= 0)
384 ERREXIT(cinfo, JERR_BMP_EMPTY);
385 if (biPlanes != 1)
386 ERREXIT(cinfo, JERR_BMP_BADPLANES);
387
388 /* Compute distance to bitmap data --- will adjust for colormap below */
389 bPad = bfOffBits - (headerSize + 14);
390
391 /* Read the colormap, if any */
392 if (mapentrysize > 0) {
393 if (biClrUsed <= 0)
394 biClrUsed = 256; /* assume it's 256 */
395 else if (biClrUsed > 256)
396 ERREXIT(cinfo, JERR_BMP_BADCMAP);
397 /* Allocate space to store the colormap */
398 source->colormap = (*cinfo->mem->alloc_sarray)
399 ((j_common_ptr) cinfo, JPOOL_IMAGE,
400 (JDIMENSION) biClrUsed, (JDIMENSION) 3);
401 /* and read it from the file */
402 read_colormap(source, (int) biClrUsed, mapentrysize);
403 /* account for size of colormap */
404 bPad -= biClrUsed * mapentrysize;
405 }
406
407 /* Skip any remaining pad bytes */
408 if (bPad < 0) /* incorrect bfOffBits value? */
409 ERREXIT(cinfo, JERR_BMP_BADHEADER);
410 while (--bPad >= 0) {
411 (void) read_byte(source);
412 }
413
414 /* Compute row width in file, including padding to 4-byte boundary */
415 if (source->bits_per_pixel == 24)
416 row_width = (JDIMENSION) (biWidth * 3);
417 else if (source->bits_per_pixel == 32)
418 row_width = (JDIMENSION) (biWidth * 4);
419 else
420 row_width = (JDIMENSION) biWidth;
421 while ((row_width & 3) != 0) row_width++;
422 source->row_width = row_width;
423
424 /* Allocate space for inversion array, prepare for preload pass */
425 source->whole_image = (*cinfo->mem->request_virt_sarray)
426 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
427 row_width, (JDIMENSION) biHeight, (JDIMENSION) 1);
428 source->pub.get_pixel_rows = preload_image;
429 if (cinfo->progress != NULL) {
430 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
431 progress->total_extra_passes++; /* count file input as separate pass */
432 }
433
434 /* Allocate one-row buffer for returned data */
435 source->pub.buffer = (*cinfo->mem->alloc_sarray)
436 ((j_common_ptr) cinfo, JPOOL_IMAGE,
437 (JDIMENSION) (biWidth * 3), (JDIMENSION) 1);
438 source->pub.buffer_height = 1;
439
440 cinfo->in_color_space = JCS_RGB;
441 cinfo->input_components = 3;
442 cinfo->data_precision = 8;
443 cinfo->image_width = (JDIMENSION) biWidth;
444 cinfo->image_height = (JDIMENSION) biHeight;
445}
446
447
448/*
449 * Finish up at the end of the file.
450 */
451
452METHODDEF(void)
453finish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
454{
455 /* no work */
456}
457
458
459/*
460 * The module selection routine for BMP format input.
461 */
462
463GLOBAL(cjpeg_source_ptr)
464jinit_read_bmp (j_compress_ptr cinfo)
465{
466 bmp_source_ptr source;
467
468 /* Create module interface object */
469 source = (bmp_source_ptr)
470 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
471 SIZEOF(bmp_source_struct));
472 source->cinfo = cinfo; /* make back link for subroutines */
473 /* Fill in method ptrs, except get_pixel_rows which start_input sets */
474 source->pub.start_input = start_input_bmp;
475 source->pub.finish_input = finish_input_bmp;
476
477 return (cjpeg_source_ptr) source;
478}
479
480#endif /* BMP_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdcolmap.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdcolmap.c
new file mode 100644
index 0000000..eebf834
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdcolmap.c
@@ -0,0 +1,253 @@
1/*
2 * rdcolmap.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file implements djpeg's "-map file" switch. It reads a source image
9 * and constructs a colormap to be supplied to the JPEG decompressor.
10 *
11 * Currently, these file formats are supported for the map file:
12 * GIF: the contents of the GIF's global colormap are used.
13 * PPM (either text or raw flavor): the entire file is read and
14 * each unique pixel value is entered in the map.
15 * Note that reading a large PPM file will be horrendously slow.
16 * Typically, a PPM-format map file should contain just one pixel
17 * of each desired color. Such a file can be extracted from an
18 * ordinary image PPM file with ppmtomap(1).
19 *
20 * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not
21 * currently implemented.
22 */
23
24#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
25
26#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
27
28/* Portions of this code are based on the PBMPLUS library, which is:
29**
30** Copyright (C) 1988 by Jef Poskanzer.
31**
32** Permission to use, copy, modify, and distribute this software and its
33** documentation for any purpose and without fee is hereby granted, provided
34** that the above copyright notice appear in all copies and that both that
35** copyright notice and this permission notice appear in supporting
36** documentation. This software is provided "as is" without express or
37** implied warranty.
38*/
39
40
41/*
42 * Add a (potentially) new color to the color map.
43 */
44
45LOCAL(void)
46add_map_entry (j_decompress_ptr cinfo, int R, int G, int B)
47{
48 JSAMPROW colormap0 = cinfo->colormap[0];
49 JSAMPROW colormap1 = cinfo->colormap[1];
50 JSAMPROW colormap2 = cinfo->colormap[2];
51 int ncolors = cinfo->actual_number_of_colors;
52 int index;
53
54 /* Check for duplicate color. */
55 for (index = 0; index < ncolors; index++) {
56 if (GETJSAMPLE(colormap0[index]) == R &&
57 GETJSAMPLE(colormap1[index]) == G &&
58 GETJSAMPLE(colormap2[index]) == B)
59 return; /* color is already in map */
60 }
61
62 /* Check for map overflow. */
63 if (ncolors >= (MAXJSAMPLE+1))
64 ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1));
65
66 /* OK, add color to map. */
67 colormap0[ncolors] = (JSAMPLE) R;
68 colormap1[ncolors] = (JSAMPLE) G;
69 colormap2[ncolors] = (JSAMPLE) B;
70 cinfo->actual_number_of_colors++;
71}
72
73
74/*
75 * Extract color map from a GIF file.
76 */
77
78LOCAL(void)
79read_gif_map (j_decompress_ptr cinfo, FILE * infile)
80{
81 int header[13];
82 int i, colormaplen;
83 int R, G, B;
84
85 /* Initial 'G' has already been read by read_color_map */
86 /* Read the rest of the GIF header and logical screen descriptor */
87 for (i = 1; i < 13; i++) {
88 if ((header[i] = getc(infile)) == EOF)
89 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
90 }
91
92 /* Verify GIF Header */
93 if (header[1] != 'I' || header[2] != 'F')
94 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
95
96 /* There must be a global color map. */
97 if ((header[10] & 0x80) == 0)
98 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
99
100 /* OK, fetch it. */
101 colormaplen = 2 << (header[10] & 0x07);
102
103 for (i = 0; i < colormaplen; i++) {
104 R = getc(infile);
105 G = getc(infile);
106 B = getc(infile);
107 if (R == EOF || G == EOF || B == EOF)
108 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
109 add_map_entry(cinfo,
110 R << (BITS_IN_JSAMPLE-8),
111 G << (BITS_IN_JSAMPLE-8),
112 B << (BITS_IN_JSAMPLE-8));
113 }
114}
115
116
117/* Support routines for reading PPM */
118
119
120LOCAL(int)
121pbm_getc (FILE * infile)
122/* Read next char, skipping over any comments */
123/* A comment/newline sequence is returned as a newline */
124{
125 register int ch;
126
127 ch = getc(infile);
128 if (ch == '#') {
129 do {
130 ch = getc(infile);
131 } while (ch != '\n' && ch != EOF);
132 }
133 return ch;
134}
135
136
137LOCAL(unsigned int)
138read_pbm_integer (j_decompress_ptr cinfo, FILE * infile)
139/* Read an unsigned decimal integer from the PPM file */
140/* Swallows one trailing character after the integer */
141/* Note that on a 16-bit-int machine, only values up to 64k can be read. */
142/* This should not be a problem in practice. */
143{
144 register int ch;
145 register unsigned int val;
146
147 /* Skip any leading whitespace */
148 do {
149 ch = pbm_getc(infile);
150 if (ch == EOF)
151 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
152 } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
153
154 if (ch < '0' || ch > '9')
155 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
156
157 val = ch - '0';
158 while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {
159 val *= 10;
160 val += ch - '0';
161 }
162 return val;
163}
164
165
166/*
167 * Extract color map from a PPM file.
168 */
169
170LOCAL(void)
171read_ppm_map (j_decompress_ptr cinfo, FILE * infile)
172{
173 int c;
174 unsigned int w, h, maxval, row, col;
175 int R, G, B;
176
177 /* Initial 'P' has already been read by read_color_map */
178 c = getc(infile); /* save format discriminator for a sec */
179
180 /* while we fetch the remaining header info */
181 w = read_pbm_integer(cinfo, infile);
182 h = read_pbm_integer(cinfo, infile);
183 maxval = read_pbm_integer(cinfo, infile);
184
185 if (w <= 0 || h <= 0 || maxval <= 0) /* error check */
186 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
187
188 /* For now, we don't support rescaling from an unusual maxval. */
189 if (maxval != (unsigned int) MAXJSAMPLE)
190 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
191
192 switch (c) {
193 case '3': /* it's a text-format PPM file */
194 for (row = 0; row < h; row++) {
195 for (col = 0; col < w; col++) {
196 R = read_pbm_integer(cinfo, infile);
197 G = read_pbm_integer(cinfo, infile);
198 B = read_pbm_integer(cinfo, infile);
199 add_map_entry(cinfo, R, G, B);
200 }
201 }
202 break;
203
204 case '6': /* it's a raw-format PPM file */
205 for (row = 0; row < h; row++) {
206 for (col = 0; col < w; col++) {
207 R = getc(infile);
208 G = getc(infile);
209 B = getc(infile);
210 if (R == EOF || G == EOF || B == EOF)
211 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
212 add_map_entry(cinfo, R, G, B);
213 }
214 }
215 break;
216
217 default:
218 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
219 break;
220 }
221}
222
223
224/*
225 * Main entry point from djpeg.c.
226 * Input: opened input file (from file name argument on command line).
227 * Output: colormap and actual_number_of_colors fields are set in cinfo.
228 */
229
230GLOBAL(void)
231read_color_map (j_decompress_ptr cinfo, FILE * infile)
232{
233 /* Allocate space for a color map of maximum supported size. */
234 cinfo->colormap = (*cinfo->mem->alloc_sarray)
235 ((j_common_ptr) cinfo, JPOOL_IMAGE,
236 (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3);
237 cinfo->actual_number_of_colors = 0; /* initialize map to empty */
238
239 /* Read first byte to determine file format */
240 switch (getc(infile)) {
241 case 'G':
242 read_gif_map(cinfo, infile);
243 break;
244 case 'P':
245 read_ppm_map(cinfo, infile);
246 break;
247 default:
248 ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
249 break;
250 }
251}
252
253#endif /* QUANT_2PASS_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdgif.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdgif.c
new file mode 100644
index 0000000..b0757e7
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdgif.c
@@ -0,0 +1,38 @@
1/*
2 * rdgif.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to read input images in GIF format.
9 *
10 *****************************************************************************
11 * NOTE: to avoid entanglements with Unisys' patent on LZW compression, *
12 * the ability to read GIF files has been removed from the IJG distribution. *
13 * Sorry about that. *
14 *****************************************************************************
15 *
16 * We are required to state that
17 * "The Graphics Interchange Format(c) is the Copyright property of
18 * CompuServe Incorporated. GIF(sm) is a Service Mark property of
19 * CompuServe Incorporated."
20 */
21
22#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
23
24#ifdef GIF_SUPPORTED
25
26/*
27 * The module selection routine for GIF format input.
28 */
29
30GLOBAL(cjpeg_source_ptr)
31jinit_read_gif (j_compress_ptr cinfo)
32{
33 fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n");
34 exit(EXIT_FAILURE);
35 return NULL; /* keep compiler happy */
36}
37
38#endif /* GIF_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.1 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.1
new file mode 100644
index 0000000..2ddea6b
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.1
@@ -0,0 +1,63 @@
1.TH RDJPGCOM 1 "02 April 2009"
2.SH NAME
3rdjpgcom \- display text comments from a JPEG file
4.SH SYNOPSIS
5.B rdjpgcom
6[
7.B \-raw
8]
9[
10.B \-verbose
11]
12[
13.I filename
14]
15.LP
16.SH DESCRIPTION
17.LP
18.B rdjpgcom
19reads the named JPEG/JFIF file, or the standard input if no file is named,
20and prints any text comments found in the file on the standard output.
21.PP
22The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
23Although the standard doesn't actually define what COM blocks are for, they
24are widely used to hold user-supplied text strings. This lets you add
25annotations, titles, index terms, etc to your JPEG files, and later retrieve
26them as text. COM blocks do not interfere with the image stored in the JPEG
27file. The maximum size of a COM block is 64K, but you can have as many of
28them as you like in one JPEG file.
29.SH OPTIONS
30.TP
31.B \-raw
32Normally
33.B rdjpgcom
34escapes non-printable characters in comments, for security reasons.
35This option avoids that.
36.PP
37.B \-verbose
38Causes
39.B rdjpgcom
40to also display the JPEG image dimensions.
41.PP
42Switch names may be abbreviated, and are not case sensitive.
43.SH HINTS
44.B rdjpgcom
45does not depend on the IJG JPEG library. Its source code is intended as an
46illustration of the minimum amount of code required to parse a JPEG file
47header correctly.
48.PP
49In
50.B \-verbose
51mode,
52.B rdjpgcom
53will also attempt to print the contents of any "APP12" markers as text.
54Some digital cameras produce APP12 markers containing useful textual
55information. If you like, you can modify the source code to print
56other APPn marker types as well.
57.SH SEE ALSO
58.BR cjpeg (1),
59.BR djpeg (1),
60.BR jpegtran (1),
61.BR wrjpgcom (1)
62.SH AUTHOR
63Independent JPEG Group
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.c
new file mode 100644
index 0000000..ab09b44
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdjpgcom.c
@@ -0,0 +1,515 @@
1/*
2 * rdjpgcom.c
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * Modified 2009 by Bill Allombert, Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains a very simple stand-alone application that displays
10 * the text in COM (comment) markers in a JFIF file.
11 * This may be useful as an example of the minimum logic needed to parse
12 * JPEG markers.
13 */
14
15#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */
16#include "jinclude.h" /* get auto-config symbols, <stdio.h> */
17
18#ifdef HAVE_LOCALE_H
19#include <locale.h> /* Bill Allombert: use locale for isprint */
20#endif
21#include <ctype.h> /* to declare isupper(), tolower() */
22#ifdef USE_SETMODE
23#include <fcntl.h> /* to declare setmode()'s parameter macros */
24/* If you have setmode() but not <io.h>, just delete this line: */
25#include <io.h> /* to declare setmode() */
26#endif
27
28#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
29#ifdef __MWERKS__
30#include <SIOUX.h> /* Metrowerks needs this */
31#include <console.h> /* ... and this */
32#endif
33#ifdef THINK_C
34#include <console.h> /* Think declares it here */
35#endif
36#endif
37
38#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
39#define READ_BINARY "r"
40#else
41#ifdef VMS /* VMS is very nonstandard */
42#define READ_BINARY "rb", "ctx=stm"
43#else /* standard ANSI-compliant case */
44#define READ_BINARY "rb"
45#endif
46#endif
47
48#ifndef EXIT_FAILURE /* define exit() codes if not provided */
49#define EXIT_FAILURE 1
50#endif
51#ifndef EXIT_SUCCESS
52#ifdef VMS
53#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
54#else
55#define EXIT_SUCCESS 0
56#endif
57#endif
58
59
60/*
61 * These macros are used to read the input file.
62 * To reuse this code in another application, you might need to change these.
63 */
64
65static FILE * infile; /* input JPEG file */
66
67/* Return next input byte, or EOF if no more */
68#define NEXTBYTE() getc(infile)
69
70
71/* Error exit handler */
72#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE))
73
74
75/* Read one byte, testing for EOF */
76static int
77read_1_byte (void)
78{
79 int c;
80
81 c = NEXTBYTE();
82 if (c == EOF)
83 ERREXIT("Premature EOF in JPEG file");
84 return c;
85}
86
87/* Read 2 bytes, convert to unsigned int */
88/* All 2-byte quantities in JPEG markers are MSB first */
89static unsigned int
90read_2_bytes (void)
91{
92 int c1, c2;
93
94 c1 = NEXTBYTE();
95 if (c1 == EOF)
96 ERREXIT("Premature EOF in JPEG file");
97 c2 = NEXTBYTE();
98 if (c2 == EOF)
99 ERREXIT("Premature EOF in JPEG file");
100 return (((unsigned int) c1) << 8) + ((unsigned int) c2);
101}
102
103
104/*
105 * JPEG markers consist of one or more 0xFF bytes, followed by a marker
106 * code byte (which is not an FF). Here are the marker codes of interest
107 * in this program. (See jdmarker.c for a more complete list.)
108 */
109
110#define M_SOF0 0xC0 /* Start Of Frame N */
111#define M_SOF1 0xC1 /* N indicates which compression process */
112#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */
113#define M_SOF3 0xC3
114#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */
115#define M_SOF6 0xC6
116#define M_SOF7 0xC7
117#define M_SOF9 0xC9
118#define M_SOF10 0xCA
119#define M_SOF11 0xCB
120#define M_SOF13 0xCD
121#define M_SOF14 0xCE
122#define M_SOF15 0xCF
123#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */
124#define M_EOI 0xD9 /* End Of Image (end of datastream) */
125#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */
126#define M_APP0 0xE0 /* Application-specific marker, type N */
127#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */
128#define M_COM 0xFE /* COMment */
129
130
131/*
132 * Find the next JPEG marker and return its marker code.
133 * We expect at least one FF byte, possibly more if the compressor used FFs
134 * to pad the file.
135 * There could also be non-FF garbage between markers. The treatment of such
136 * garbage is unspecified; we choose to skip over it but emit a warning msg.
137 * NB: this routine must not be used after seeing SOS marker, since it will
138 * not deal correctly with FF/00 sequences in the compressed image data...
139 */
140
141static int
142next_marker (void)
143{
144 int c;
145 int discarded_bytes = 0;
146
147 /* Find 0xFF byte; count and skip any non-FFs. */
148 c = read_1_byte();
149 while (c != 0xFF) {
150 discarded_bytes++;
151 c = read_1_byte();
152 }
153 /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs
154 * are legal as pad bytes, so don't count them in discarded_bytes.
155 */
156 do {
157 c = read_1_byte();
158 } while (c == 0xFF);
159
160 if (discarded_bytes != 0) {
161 fprintf(stderr, "Warning: garbage data found in JPEG file\n");
162 }
163
164 return c;
165}
166
167
168/*
169 * Read the initial marker, which should be SOI.
170 * For a JFIF file, the first two bytes of the file should be literally
171 * 0xFF M_SOI. To be more general, we could use next_marker, but if the
172 * input file weren't actually JPEG at all, next_marker might read the whole
173 * file and then return a misleading error message...
174 */
175
176static int
177first_marker (void)
178{
179 int c1, c2;
180
181 c1 = NEXTBYTE();
182 c2 = NEXTBYTE();
183 if (c1 != 0xFF || c2 != M_SOI)
184 ERREXIT("Not a JPEG file");
185 return c2;
186}
187
188
189/*
190 * Most types of marker are followed by a variable-length parameter segment.
191 * This routine skips over the parameters for any marker we don't otherwise
192 * want to process.
193 * Note that we MUST skip the parameter segment explicitly in order not to
194 * be fooled by 0xFF bytes that might appear within the parameter segment;
195 * such bytes do NOT introduce new markers.
196 */
197
198static void
199skip_variable (void)
200/* Skip over an unknown or uninteresting variable-length marker */
201{
202 unsigned int length;
203
204 /* Get the marker parameter length count */
205 length = read_2_bytes();
206 /* Length includes itself, so must be at least 2 */
207 if (length < 2)
208 ERREXIT("Erroneous JPEG marker length");
209 length -= 2;
210 /* Skip over the remaining bytes */
211 while (length > 0) {
212 (void) read_1_byte();
213 length--;
214 }
215}
216
217
218/*
219 * Process a COM marker.
220 * We want to print out the marker contents as legible text;
221 * we must guard against non-text junk and varying newline representations.
222 */
223
224static void
225process_COM (int raw)
226{
227 unsigned int length;
228 int ch;
229 int lastch = 0;
230
231 /* Bill Allombert: set locale properly for isprint */
232#ifdef HAVE_LOCALE_H
233 setlocale(LC_CTYPE, "");
234#endif
235
236 /* Get the marker parameter length count */
237 length = read_2_bytes();
238 /* Length includes itself, so must be at least 2 */
239 if (length < 2)
240 ERREXIT("Erroneous JPEG marker length");
241 length -= 2;
242
243 while (length > 0) {
244 ch = read_1_byte();
245 if (raw) {
246 putc(ch, stdout);
247 /* Emit the character in a readable form.
248 * Nonprintables are converted to \nnn form,
249 * while \ is converted to \\.
250 * Newlines in CR, CR/LF, or LF form will be printed as one newline.
251 */
252 } else if (ch == '\r') {
253 printf("\n");
254 } else if (ch == '\n') {
255 if (lastch != '\r')
256 printf("\n");
257 } else if (ch == '\\') {
258 printf("\\\\");
259 } else if (isprint(ch)) {
260 putc(ch, stdout);
261 } else {
262 printf("\\%03o", ch);
263 }
264 lastch = ch;
265 length--;
266 }
267 printf("\n");
268
269 /* Bill Allombert: revert to C locale */
270#ifdef HAVE_LOCALE_H
271 setlocale(LC_CTYPE, "C");
272#endif
273}
274
275
276/*
277 * Process a SOFn marker.
278 * This code is only needed if you want to know the image dimensions...
279 */
280
281static void
282process_SOFn (int marker)
283{
284 unsigned int length;
285 unsigned int image_height, image_width;
286 int data_precision, num_components;
287 const char * process;
288 int ci;
289
290 length = read_2_bytes(); /* usual parameter length count */
291
292 data_precision = read_1_byte();
293 image_height = read_2_bytes();
294 image_width = read_2_bytes();
295 num_components = read_1_byte();
296
297 switch (marker) {
298 case M_SOF0: process = "Baseline"; break;
299 case M_SOF1: process = "Extended sequential"; break;
300 case M_SOF2: process = "Progressive"; break;
301 case M_SOF3: process = "Lossless"; break;
302 case M_SOF5: process = "Differential sequential"; break;
303 case M_SOF6: process = "Differential progressive"; break;
304 case M_SOF7: process = "Differential lossless"; break;
305 case M_SOF9: process = "Extended sequential, arithmetic coding"; break;
306 case M_SOF10: process = "Progressive, arithmetic coding"; break;
307 case M_SOF11: process = "Lossless, arithmetic coding"; break;
308 case M_SOF13: process = "Differential sequential, arithmetic coding"; break;
309 case M_SOF14: process = "Differential progressive, arithmetic coding"; break;
310 case M_SOF15: process = "Differential lossless, arithmetic coding"; break;
311 default: process = "Unknown"; break;
312 }
313
314 printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n",
315 image_width, image_height, num_components, data_precision);
316 printf("JPEG process: %s\n", process);
317
318 if (length != (unsigned int) (8 + num_components * 3))
319 ERREXIT("Bogus SOF marker length");
320
321 for (ci = 0; ci < num_components; ci++) {
322 (void) read_1_byte(); /* Component ID code */
323 (void) read_1_byte(); /* H, V sampling factors */
324 (void) read_1_byte(); /* Quantization table number */
325 }
326}
327
328
329/*
330 * Parse the marker stream until SOS or EOI is seen;
331 * display any COM markers.
332 * While the companion program wrjpgcom will always insert COM markers before
333 * SOFn, other implementations might not, so we scan to SOS before stopping.
334 * If we were only interested in the image dimensions, we would stop at SOFn.
335 * (Conversely, if we only cared about COM markers, there would be no need
336 * for special code to handle SOFn; we could treat it like other markers.)
337 */
338
339static int
340scan_JPEG_header (int verbose, int raw)
341{
342 int marker;
343
344 /* Expect SOI at start of file */
345 if (first_marker() != M_SOI)
346 ERREXIT("Expected SOI marker first");
347
348 /* Scan miscellaneous markers until we reach SOS. */
349 for (;;) {
350 marker = next_marker();
351 switch (marker) {
352 /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,
353 * treated as SOFn. C4 in particular is actually DHT.
354 */
355 case M_SOF0: /* Baseline */
356 case M_SOF1: /* Extended sequential, Huffman */
357 case M_SOF2: /* Progressive, Huffman */
358 case M_SOF3: /* Lossless, Huffman */
359 case M_SOF5: /* Differential sequential, Huffman */
360 case M_SOF6: /* Differential progressive, Huffman */
361 case M_SOF7: /* Differential lossless, Huffman */
362 case M_SOF9: /* Extended sequential, arithmetic */
363 case M_SOF10: /* Progressive, arithmetic */
364 case M_SOF11: /* Lossless, arithmetic */
365 case M_SOF13: /* Differential sequential, arithmetic */
366 case M_SOF14: /* Differential progressive, arithmetic */
367 case M_SOF15: /* Differential lossless, arithmetic */
368 if (verbose)
369 process_SOFn(marker);
370 else
371 skip_variable();
372 break;
373
374 case M_SOS: /* stop before hitting compressed data */
375 return marker;
376
377 case M_EOI: /* in case it's a tables-only JPEG stream */
378 return marker;
379
380 case M_COM:
381 process_COM(raw);
382 break;
383
384 case M_APP12:
385 /* Some digital camera makers put useful textual information into
386 * APP12 markers, so we print those out too when in -verbose mode.
387 */
388 if (verbose) {
389 printf("APP12 contains:\n");
390 process_COM(raw);
391 } else
392 skip_variable();
393 break;
394
395 default: /* Anything else just gets skipped */
396 skip_variable(); /* we assume it has a parameter count... */
397 break;
398 }
399 } /* end loop */
400}
401
402
403/* Command line parsing code */
404
405static const char * progname; /* program name for error messages */
406
407
408static void
409usage (void)
410/* complain about bad command line */
411{
412 fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n");
413
414 fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname);
415
416 fprintf(stderr, "Switches (names may be abbreviated):\n");
417 fprintf(stderr, " -raw Display non-printable characters in comments (unsafe)\n");
418 fprintf(stderr, " -verbose Also display dimensions of JPEG image\n");
419
420 exit(EXIT_FAILURE);
421}
422
423
424static int
425keymatch (char * arg, const char * keyword, int minchars)
426/* Case-insensitive matching of (possibly abbreviated) keyword switches. */
427/* keyword is the constant keyword (must be lower case already), */
428/* minchars is length of minimum legal abbreviation. */
429{
430 register int ca, ck;
431 register int nmatched = 0;
432
433 while ((ca = *arg++) != '\0') {
434 if ((ck = *keyword++) == '\0')
435 return 0; /* arg longer than keyword, no good */
436 if (isupper(ca)) /* force arg to lcase (assume ck is already) */
437 ca = tolower(ca);
438 if (ca != ck)
439 return 0; /* no good */
440 nmatched++; /* count matched characters */
441 }
442 /* reached end of argument; fail if it's too short for unique abbrev */
443 if (nmatched < minchars)
444 return 0;
445 return 1; /* A-OK */
446}
447
448
449/*
450 * The main program.
451 */
452
453int
454main (int argc, char **argv)
455{
456 int argn;
457 char * arg;
458 int verbose = 0, raw = 0;
459
460 /* On Mac, fetch a command line. */
461#ifdef USE_CCOMMAND
462 argc = ccommand(&argv);
463#endif
464
465 progname = argv[0];
466 if (progname == NULL || progname[0] == 0)
467 progname = "rdjpgcom"; /* in case C library doesn't provide it */
468
469 /* Parse switches, if any */
470 for (argn = 1; argn < argc; argn++) {
471 arg = argv[argn];
472 if (arg[0] != '-')
473 break; /* not switch, must be file name */
474 arg++; /* advance over '-' */
475 if (keymatch(arg, "verbose", 1)) {
476 verbose++;
477 } else if (keymatch(arg, "raw", 1)) {
478 raw = 1;
479 } else
480 usage();
481 }
482
483 /* Open the input file. */
484 /* Unix style: expect zero or one file name */
485 if (argn < argc-1) {
486 fprintf(stderr, "%s: only one input file\n", progname);
487 usage();
488 }
489 if (argn < argc) {
490 if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {
491 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
492 exit(EXIT_FAILURE);
493 }
494 } else {
495 /* default input file is stdin */
496#ifdef USE_SETMODE /* need to hack file mode? */
497 setmode(fileno(stdin), O_BINARY);
498#endif
499#ifdef USE_FDOPEN /* need to re-open in binary mode? */
500 if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
501 fprintf(stderr, "%s: can't open stdin\n", progname);
502 exit(EXIT_FAILURE);
503 }
504#else
505 infile = stdin;
506#endif
507 }
508
509 /* Scan the JPEG headers. */
510 (void) scan_JPEG_header(verbose, raw);
511
512 /* All done. */
513 exit(EXIT_SUCCESS);
514 return 0; /* suppress no-return-value warnings */
515}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdppm.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdppm.c
new file mode 100644
index 0000000..9dcd2dc
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdppm.c
@@ -0,0 +1,459 @@
1/*
2 * rdppm.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * Modified 2009 by Bill Allombert, Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains routines to read input images in PPM/PGM format.
10 * The extended 2-byte-per-sample raw PPM/PGM formats are supported.
11 * The PBMPLUS library is NOT required to compile this software
12 * (but it is highly useful as a set of PPM image manipulation programs).
13 *
14 * These routines may need modification for non-Unix environments or
15 * specialized applications. As they stand, they assume input from
16 * an ordinary stdio stream. They further assume that reading begins
17 * at the start of the file; start_input may need work if the
18 * user interface has already read some data (e.g., to determine that
19 * the file is indeed PPM format).
20 */
21
22#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
23
24#ifdef PPM_SUPPORTED
25
26
27/* Portions of this code are based on the PBMPLUS library, which is:
28**
29** Copyright (C) 1988 by Jef Poskanzer.
30**
31** Permission to use, copy, modify, and distribute this software and its
32** documentation for any purpose and without fee is hereby granted, provided
33** that the above copyright notice appear in all copies and that both that
34** copyright notice and this permission notice appear in supporting
35** documentation. This software is provided "as is" without express or
36** implied warranty.
37*/
38
39
40/* Macros to deal with unsigned chars as efficiently as compiler allows */
41
42#ifdef HAVE_UNSIGNED_CHAR
43typedef unsigned char U_CHAR;
44#define UCH(x) ((int) (x))
45#else /* !HAVE_UNSIGNED_CHAR */
46#ifdef CHAR_IS_UNSIGNED
47typedef char U_CHAR;
48#define UCH(x) ((int) (x))
49#else
50typedef char U_CHAR;
51#define UCH(x) ((int) (x) & 0xFF)
52#endif
53#endif /* HAVE_UNSIGNED_CHAR */
54
55
56#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))
57
58
59/*
60 * On most systems, reading individual bytes with getc() is drastically less
61 * efficient than buffering a row at a time with fread(). On PCs, we must
62 * allocate the buffer in near data space, because we are assuming small-data
63 * memory model, wherein fread() can't reach far memory. If you need to
64 * process very wide images on a PC, you might have to compile in large-memory
65 * model, or else replace fread() with a getc() loop --- which will be much
66 * slower.
67 */
68
69
70/* Private version of data source object */
71
72typedef struct {
73 struct cjpeg_source_struct pub; /* public fields */
74
75 U_CHAR *iobuffer; /* non-FAR pointer to I/O buffer */
76 JSAMPROW pixrow; /* FAR pointer to same */
77 size_t buffer_width; /* width of I/O buffer */
78 JSAMPLE *rescale; /* => maxval-remapping array, or NULL */
79} ppm_source_struct;
80
81typedef ppm_source_struct * ppm_source_ptr;
82
83
84LOCAL(int)
85pbm_getc (FILE * infile)
86/* Read next char, skipping over any comments */
87/* A comment/newline sequence is returned as a newline */
88{
89 register int ch;
90
91 ch = getc(infile);
92 if (ch == '#') {
93 do {
94 ch = getc(infile);
95 } while (ch != '\n' && ch != EOF);
96 }
97 return ch;
98}
99
100
101LOCAL(unsigned int)
102read_pbm_integer (j_compress_ptr cinfo, FILE * infile)
103/* Read an unsigned decimal integer from the PPM file */
104/* Swallows one trailing character after the integer */
105/* Note that on a 16-bit-int machine, only values up to 64k can be read. */
106/* This should not be a problem in practice. */
107{
108 register int ch;
109 register unsigned int val;
110
111 /* Skip any leading whitespace */
112 do {
113 ch = pbm_getc(infile);
114 if (ch == EOF)
115 ERREXIT(cinfo, JERR_INPUT_EOF);
116 } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
117
118 if (ch < '0' || ch > '9')
119 ERREXIT(cinfo, JERR_PPM_NONNUMERIC);
120
121 val = ch - '0';
122 while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {
123 val *= 10;
124 val += ch - '0';
125 }
126 return val;
127}
128
129
130/*
131 * Read one row of pixels.
132 *
133 * We provide several different versions depending on input file format.
134 * In all cases, input is scaled to the size of JSAMPLE.
135 *
136 * A really fast path is provided for reading byte/sample raw files with
137 * maxval = MAXJSAMPLE, which is the normal case for 8-bit data.
138 */
139
140
141METHODDEF(JDIMENSION)
142get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
143/* This version is for reading text-format PGM files with any maxval */
144{
145 ppm_source_ptr source = (ppm_source_ptr) sinfo;
146 FILE * infile = source->pub.input_file;
147 register JSAMPROW ptr;
148 register JSAMPLE *rescale = source->rescale;
149 JDIMENSION col;
150
151 ptr = source->pub.buffer[0];
152 for (col = cinfo->image_width; col > 0; col--) {
153 *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
154 }
155 return 1;
156}
157
158
159METHODDEF(JDIMENSION)
160get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
161/* This version is for reading text-format PPM files with any maxval */
162{
163 ppm_source_ptr source = (ppm_source_ptr) sinfo;
164 FILE * infile = source->pub.input_file;
165 register JSAMPROW ptr;
166 register JSAMPLE *rescale = source->rescale;
167 JDIMENSION col;
168
169 ptr = source->pub.buffer[0];
170 for (col = cinfo->image_width; col > 0; col--) {
171 *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
172 *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
173 *ptr++ = rescale[read_pbm_integer(cinfo, infile)];
174 }
175 return 1;
176}
177
178
179METHODDEF(JDIMENSION)
180get_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
181/* This version is for reading raw-byte-format PGM files with any maxval */
182{
183 ppm_source_ptr source = (ppm_source_ptr) sinfo;
184 register JSAMPROW ptr;
185 register U_CHAR * bufferptr;
186 register JSAMPLE *rescale = source->rescale;
187 JDIMENSION col;
188
189 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
190 ERREXIT(cinfo, JERR_INPUT_EOF);
191 ptr = source->pub.buffer[0];
192 bufferptr = source->iobuffer;
193 for (col = cinfo->image_width; col > 0; col--) {
194 *ptr++ = rescale[UCH(*bufferptr++)];
195 }
196 return 1;
197}
198
199
200METHODDEF(JDIMENSION)
201get_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
202/* This version is for reading raw-byte-format PPM files with any maxval */
203{
204 ppm_source_ptr source = (ppm_source_ptr) sinfo;
205 register JSAMPROW ptr;
206 register U_CHAR * bufferptr;
207 register JSAMPLE *rescale = source->rescale;
208 JDIMENSION col;
209
210 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
211 ERREXIT(cinfo, JERR_INPUT_EOF);
212 ptr = source->pub.buffer[0];
213 bufferptr = source->iobuffer;
214 for (col = cinfo->image_width; col > 0; col--) {
215 *ptr++ = rescale[UCH(*bufferptr++)];
216 *ptr++ = rescale[UCH(*bufferptr++)];
217 *ptr++ = rescale[UCH(*bufferptr++)];
218 }
219 return 1;
220}
221
222
223METHODDEF(JDIMENSION)
224get_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
225/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE.
226 * In this case we just read right into the JSAMPLE buffer!
227 * Note that same code works for PPM and PGM files.
228 */
229{
230 ppm_source_ptr source = (ppm_source_ptr) sinfo;
231
232 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
233 ERREXIT(cinfo, JERR_INPUT_EOF);
234 return 1;
235}
236
237
238METHODDEF(JDIMENSION)
239get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
240/* This version is for reading raw-word-format PGM files with any maxval */
241{
242 ppm_source_ptr source = (ppm_source_ptr) sinfo;
243 register JSAMPROW ptr;
244 register U_CHAR * bufferptr;
245 register JSAMPLE *rescale = source->rescale;
246 JDIMENSION col;
247
248 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
249 ERREXIT(cinfo, JERR_INPUT_EOF);
250 ptr = source->pub.buffer[0];
251 bufferptr = source->iobuffer;
252 for (col = cinfo->image_width; col > 0; col--) {
253 register int temp;
254 temp = UCH(*bufferptr++) << 8;
255 temp |= UCH(*bufferptr++);
256 *ptr++ = rescale[temp];
257 }
258 return 1;
259}
260
261
262METHODDEF(JDIMENSION)
263get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
264/* This version is for reading raw-word-format PPM files with any maxval */
265{
266 ppm_source_ptr source = (ppm_source_ptr) sinfo;
267 register JSAMPROW ptr;
268 register U_CHAR * bufferptr;
269 register JSAMPLE *rescale = source->rescale;
270 JDIMENSION col;
271
272 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
273 ERREXIT(cinfo, JERR_INPUT_EOF);
274 ptr = source->pub.buffer[0];
275 bufferptr = source->iobuffer;
276 for (col = cinfo->image_width; col > 0; col--) {
277 register int temp;
278 temp = UCH(*bufferptr++) << 8;
279 temp |= UCH(*bufferptr++);
280 *ptr++ = rescale[temp];
281 temp = UCH(*bufferptr++) << 8;
282 temp |= UCH(*bufferptr++);
283 *ptr++ = rescale[temp];
284 temp = UCH(*bufferptr++) << 8;
285 temp |= UCH(*bufferptr++);
286 *ptr++ = rescale[temp];
287 }
288 return 1;
289}
290
291
292/*
293 * Read the file header; return image size and component count.
294 */
295
296METHODDEF(void)
297start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
298{
299 ppm_source_ptr source = (ppm_source_ptr) sinfo;
300 int c;
301 unsigned int w, h, maxval;
302 boolean need_iobuffer, use_raw_buffer, need_rescale;
303
304 if (getc(source->pub.input_file) != 'P')
305 ERREXIT(cinfo, JERR_PPM_NOT);
306
307 c = getc(source->pub.input_file); /* subformat discriminator character */
308
309 /* detect unsupported variants (ie, PBM) before trying to read header */
310 switch (c) {
311 case '2': /* it's a text-format PGM file */
312 case '3': /* it's a text-format PPM file */
313 case '5': /* it's a raw-format PGM file */
314 case '6': /* it's a raw-format PPM file */
315 break;
316 default:
317 ERREXIT(cinfo, JERR_PPM_NOT);
318 break;
319 }
320
321 /* fetch the remaining header info */
322 w = read_pbm_integer(cinfo, source->pub.input_file);
323 h = read_pbm_integer(cinfo, source->pub.input_file);
324 maxval = read_pbm_integer(cinfo, source->pub.input_file);
325
326 if (w <= 0 || h <= 0 || maxval <= 0) /* error check */
327 ERREXIT(cinfo, JERR_PPM_NOT);
328
329 cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */
330 cinfo->image_width = (JDIMENSION) w;
331 cinfo->image_height = (JDIMENSION) h;
332
333 /* initialize flags to most common settings */
334 need_iobuffer = TRUE; /* do we need an I/O buffer? */
335 use_raw_buffer = FALSE; /* do we map input buffer onto I/O buffer? */
336 need_rescale = TRUE; /* do we need a rescale array? */
337
338 switch (c) {
339 case '2': /* it's a text-format PGM file */
340 cinfo->input_components = 1;
341 cinfo->in_color_space = JCS_GRAYSCALE;
342 TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h);
343 source->pub.get_pixel_rows = get_text_gray_row;
344 need_iobuffer = FALSE;
345 break;
346
347 case '3': /* it's a text-format PPM file */
348 cinfo->input_components = 3;
349 cinfo->in_color_space = JCS_RGB;
350 TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h);
351 source->pub.get_pixel_rows = get_text_rgb_row;
352 need_iobuffer = FALSE;
353 break;
354
355 case '5': /* it's a raw-format PGM file */
356 cinfo->input_components = 1;
357 cinfo->in_color_space = JCS_GRAYSCALE;
358 TRACEMS2(cinfo, 1, JTRC_PGM, w, h);
359 if (maxval > 255) {
360 source->pub.get_pixel_rows = get_word_gray_row;
361 } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {
362 source->pub.get_pixel_rows = get_raw_row;
363 use_raw_buffer = TRUE;
364 need_rescale = FALSE;
365 } else {
366 source->pub.get_pixel_rows = get_scaled_gray_row;
367 }
368 break;
369
370 case '6': /* it's a raw-format PPM file */
371 cinfo->input_components = 3;
372 cinfo->in_color_space = JCS_RGB;
373 TRACEMS2(cinfo, 1, JTRC_PPM, w, h);
374 if (maxval > 255) {
375 source->pub.get_pixel_rows = get_word_rgb_row;
376 } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {
377 source->pub.get_pixel_rows = get_raw_row;
378 use_raw_buffer = TRUE;
379 need_rescale = FALSE;
380 } else {
381 source->pub.get_pixel_rows = get_scaled_rgb_row;
382 }
383 break;
384 }
385
386 /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */
387 if (need_iobuffer) {
388 source->buffer_width = (size_t) w * cinfo->input_components *
389 ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR)));
390 source->iobuffer = (U_CHAR *)
391 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
392 source->buffer_width);
393 }
394
395 /* Create compressor input buffer. */
396 if (use_raw_buffer) {
397 /* For unscaled raw-input case, we can just map it onto the I/O buffer. */
398 /* Synthesize a JSAMPARRAY pointer structure */
399 /* Cast here implies near->far pointer conversion on PCs */
400 source->pixrow = (JSAMPROW) source->iobuffer;
401 source->pub.buffer = & source->pixrow;
402 source->pub.buffer_height = 1;
403 } else {
404 /* Need to translate anyway, so make a separate sample buffer. */
405 source->pub.buffer = (*cinfo->mem->alloc_sarray)
406 ((j_common_ptr) cinfo, JPOOL_IMAGE,
407 (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);
408 source->pub.buffer_height = 1;
409 }
410
411 /* Compute the rescaling array if required. */
412 if (need_rescale) {
413 INT32 val, half_maxval;
414
415 /* On 16-bit-int machines we have to be careful of maxval = 65535 */
416 source->rescale = (JSAMPLE *)
417 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
418 (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE)));
419 half_maxval = maxval / 2;
420 for (val = 0; val <= (INT32) maxval; val++) {
421 /* The multiplication here must be done in 32 bits to avoid overflow */
422 source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval);
423 }
424 }
425}
426
427
428/*
429 * Finish up at the end of the file.
430 */
431
432METHODDEF(void)
433finish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
434{
435 /* no work */
436}
437
438
439/*
440 * The module selection routine for PPM format input.
441 */
442
443GLOBAL(cjpeg_source_ptr)
444jinit_read_ppm (j_compress_ptr cinfo)
445{
446 ppm_source_ptr source;
447
448 /* Create module interface object */
449 source = (ppm_source_ptr)
450 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
451 SIZEOF(ppm_source_struct));
452 /* Fill in method ptrs, except get_pixel_rows which start_input sets */
453 source->pub.start_input = start_input_ppm;
454 source->pub.finish_input = finish_input_ppm;
455
456 return (cjpeg_source_ptr) source;
457}
458
459#endif /* PPM_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdrle.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdrle.c
new file mode 100644
index 0000000..df871e0
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdrle.c
@@ -0,0 +1,387 @@
1/*
2 * rdrle.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to read input images in Utah RLE format.
9 * The Utah Raster Toolkit library is required (version 3.1 or later).
10 *
11 * These routines may need modification for non-Unix environments or
12 * specialized applications. As they stand, they assume input from
13 * an ordinary stdio stream. They further assume that reading begins
14 * at the start of the file; start_input may need work if the
15 * user interface has already read some data (e.g., to determine that
16 * the file is indeed RLE format).
17 *
18 * Based on code contributed by Mike Lijewski,
19 * with updates from Robert Hutchinson.
20 */
21
22#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
23
24#ifdef RLE_SUPPORTED
25
26/* rle.h is provided by the Utah Raster Toolkit. */
27
28#include <rle.h>
29
30/*
31 * We assume that JSAMPLE has the same representation as rle_pixel,
32 * to wit, "unsigned char". Hence we can't cope with 12- or 16-bit samples.
33 */
34
35#if BITS_IN_JSAMPLE != 8
36 Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
37#endif
38
39/*
40 * We support the following types of RLE files:
41 *
42 * GRAYSCALE - 8 bits, no colormap
43 * MAPPEDGRAY - 8 bits, 1 channel colomap
44 * PSEUDOCOLOR - 8 bits, 3 channel colormap
45 * TRUECOLOR - 24 bits, 3 channel colormap
46 * DIRECTCOLOR - 24 bits, no colormap
47 *
48 * For now, we ignore any alpha channel in the image.
49 */
50
51typedef enum
52 { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind;
53
54
55/*
56 * Since RLE stores scanlines bottom-to-top, we have to invert the image
57 * to conform to JPEG's top-to-bottom order. To do this, we read the
58 * incoming image into a virtual array on the first get_pixel_rows call,
59 * then fetch the required row from the virtual array on subsequent calls.
60 */
61
62typedef struct _rle_source_struct * rle_source_ptr;
63
64typedef struct _rle_source_struct {
65 struct cjpeg_source_struct pub; /* public fields */
66
67 rle_kind visual; /* actual type of input file */
68 jvirt_sarray_ptr image; /* virtual array to hold the image */
69 JDIMENSION row; /* current row # in the virtual array */
70 rle_hdr header; /* Input file information */
71 rle_pixel** rle_row; /* holds a row returned by rle_getrow() */
72
73} rle_source_struct;
74
75
76/*
77 * Read the file header; return image size and component count.
78 */
79
80METHODDEF(void)
81start_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
82{
83 rle_source_ptr source = (rle_source_ptr) sinfo;
84 JDIMENSION width, height;
85#ifdef PROGRESS_REPORT
86 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
87#endif
88
89 /* Use RLE library routine to get the header info */
90 source->header = *rle_hdr_init(NULL);
91 source->header.rle_file = source->pub.input_file;
92 switch (rle_get_setup(&(source->header))) {
93 case RLE_SUCCESS:
94 /* A-OK */
95 break;
96 case RLE_NOT_RLE:
97 ERREXIT(cinfo, JERR_RLE_NOT);
98 break;
99 case RLE_NO_SPACE:
100 ERREXIT(cinfo, JERR_RLE_MEM);
101 break;
102 case RLE_EMPTY:
103 ERREXIT(cinfo, JERR_RLE_EMPTY);
104 break;
105 case RLE_EOF:
106 ERREXIT(cinfo, JERR_RLE_EOF);
107 break;
108 default:
109 ERREXIT(cinfo, JERR_RLE_BADERROR);
110 break;
111 }
112
113 /* Figure out what we have, set private vars and return values accordingly */
114
115 width = source->header.xmax - source->header.xmin + 1;
116 height = source->header.ymax - source->header.ymin + 1;
117 source->header.xmin = 0; /* realign horizontally */
118 source->header.xmax = width-1;
119
120 cinfo->image_width = width;
121 cinfo->image_height = height;
122 cinfo->data_precision = 8; /* we can only handle 8 bit data */
123
124 if (source->header.ncolors == 1 && source->header.ncmap == 0) {
125 source->visual = GRAYSCALE;
126 TRACEMS2(cinfo, 1, JTRC_RLE_GRAY, width, height);
127 } else if (source->header.ncolors == 1 && source->header.ncmap == 1) {
128 source->visual = MAPPEDGRAY;
129 TRACEMS3(cinfo, 1, JTRC_RLE_MAPGRAY, width, height,
130 1 << source->header.cmaplen);
131 } else if (source->header.ncolors == 1 && source->header.ncmap == 3) {
132 source->visual = PSEUDOCOLOR;
133 TRACEMS3(cinfo, 1, JTRC_RLE_MAPPED, width, height,
134 1 << source->header.cmaplen);
135 } else if (source->header.ncolors == 3 && source->header.ncmap == 3) {
136 source->visual = TRUECOLOR;
137 TRACEMS3(cinfo, 1, JTRC_RLE_FULLMAP, width, height,
138 1 << source->header.cmaplen);
139 } else if (source->header.ncolors == 3 && source->header.ncmap == 0) {
140 source->visual = DIRECTCOLOR;
141 TRACEMS2(cinfo, 1, JTRC_RLE, width, height);
142 } else
143 ERREXIT(cinfo, JERR_RLE_UNSUPPORTED);
144
145 if (source->visual == GRAYSCALE || source->visual == MAPPEDGRAY) {
146 cinfo->in_color_space = JCS_GRAYSCALE;
147 cinfo->input_components = 1;
148 } else {
149 cinfo->in_color_space = JCS_RGB;
150 cinfo->input_components = 3;
151 }
152
153 /*
154 * A place to hold each scanline while it's converted.
155 * (GRAYSCALE scanlines don't need converting)
156 */
157 if (source->visual != GRAYSCALE) {
158 source->rle_row = (rle_pixel**) (*cinfo->mem->alloc_sarray)
159 ((j_common_ptr) cinfo, JPOOL_IMAGE,
160 (JDIMENSION) width, (JDIMENSION) cinfo->input_components);
161 }
162
163 /* request a virtual array to hold the image */
164 source->image = (*cinfo->mem->request_virt_sarray)
165 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
166 (JDIMENSION) (width * source->header.ncolors),
167 (JDIMENSION) height, (JDIMENSION) 1);
168
169#ifdef PROGRESS_REPORT
170 if (progress != NULL) {
171 /* count file input as separate pass */
172 progress->total_extra_passes++;
173 }
174#endif
175
176 source->pub.buffer_height = 1;
177}
178
179
180/*
181 * Read one row of pixels.
182 * Called only after load_image has read the image into the virtual array.
183 * Used for GRAYSCALE, MAPPEDGRAY, TRUECOLOR, and DIRECTCOLOR images.
184 */
185
186METHODDEF(JDIMENSION)
187get_rle_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
188{
189 rle_source_ptr source = (rle_source_ptr) sinfo;
190
191 source->row--;
192 source->pub.buffer = (*cinfo->mem->access_virt_sarray)
193 ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);
194
195 return 1;
196}
197
198/*
199 * Read one row of pixels.
200 * Called only after load_image has read the image into the virtual array.
201 * Used for PSEUDOCOLOR images.
202 */
203
204METHODDEF(JDIMENSION)
205get_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
206{
207 rle_source_ptr source = (rle_source_ptr) sinfo;
208 JSAMPROW src_row, dest_row;
209 JDIMENSION col;
210 rle_map *colormap;
211 int val;
212
213 colormap = source->header.cmap;
214 dest_row = source->pub.buffer[0];
215 source->row--;
216 src_row = * (*cinfo->mem->access_virt_sarray)
217 ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);
218
219 for (col = cinfo->image_width; col > 0; col--) {
220 val = GETJSAMPLE(*src_row++);
221 *dest_row++ = (JSAMPLE) (colormap[val ] >> 8);
222 *dest_row++ = (JSAMPLE) (colormap[val + 256] >> 8);
223 *dest_row++ = (JSAMPLE) (colormap[val + 512] >> 8);
224 }
225
226 return 1;
227}
228
229
230/*
231 * Load the image into a virtual array. We have to do this because RLE
232 * files start at the lower left while the JPEG standard has them starting
233 * in the upper left. This is called the first time we want to get a row
234 * of input. What we do is load the RLE data into the array and then call
235 * the appropriate routine to read one row from the array. Before returning,
236 * we set source->pub.get_pixel_rows so that subsequent calls go straight to
237 * the appropriate row-reading routine.
238 */
239
240METHODDEF(JDIMENSION)
241load_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
242{
243 rle_source_ptr source = (rle_source_ptr) sinfo;
244 JDIMENSION row, col;
245 JSAMPROW scanline, red_ptr, green_ptr, blue_ptr;
246 rle_pixel **rle_row;
247 rle_map *colormap;
248 char channel;
249#ifdef PROGRESS_REPORT
250 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
251#endif
252
253 colormap = source->header.cmap;
254 rle_row = source->rle_row;
255
256 /* Read the RLE data into our virtual array.
257 * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
258 * and (b) we are not on a machine where FAR pointers differ from regular.
259 */
260 RLE_CLR_BIT(source->header, RLE_ALPHA); /* don't read the alpha channel */
261
262#ifdef PROGRESS_REPORT
263 if (progress != NULL) {
264 progress->pub.pass_limit = cinfo->image_height;
265 progress->pub.pass_counter = 0;
266 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
267 }
268#endif
269
270 switch (source->visual) {
271
272 case GRAYSCALE:
273 case PSEUDOCOLOR:
274 for (row = 0; row < cinfo->image_height; row++) {
275 rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
276 ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
277 rle_getrow(&source->header, rle_row);
278#ifdef PROGRESS_REPORT
279 if (progress != NULL) {
280 progress->pub.pass_counter++;
281 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
282 }
283#endif
284 }
285 break;
286
287 case MAPPEDGRAY:
288 case TRUECOLOR:
289 for (row = 0; row < cinfo->image_height; row++) {
290 scanline = * (*cinfo->mem->access_virt_sarray)
291 ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
292 rle_row = source->rle_row;
293 rle_getrow(&source->header, rle_row);
294
295 for (col = 0; col < cinfo->image_width; col++) {
296 for (channel = 0; channel < source->header.ncolors; channel++) {
297 *scanline++ = (JSAMPLE)
298 (colormap[GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8);
299 }
300 }
301
302#ifdef PROGRESS_REPORT
303 if (progress != NULL) {
304 progress->pub.pass_counter++;
305 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
306 }
307#endif
308 }
309 break;
310
311 case DIRECTCOLOR:
312 for (row = 0; row < cinfo->image_height; row++) {
313 scanline = * (*cinfo->mem->access_virt_sarray)
314 ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);
315 rle_getrow(&source->header, rle_row);
316
317 red_ptr = rle_row[0];
318 green_ptr = rle_row[1];
319 blue_ptr = rle_row[2];
320
321 for (col = cinfo->image_width; col > 0; col--) {
322 *scanline++ = *red_ptr++;
323 *scanline++ = *green_ptr++;
324 *scanline++ = *blue_ptr++;
325 }
326
327#ifdef PROGRESS_REPORT
328 if (progress != NULL) {
329 progress->pub.pass_counter++;
330 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
331 }
332#endif
333 }
334 }
335
336#ifdef PROGRESS_REPORT
337 if (progress != NULL)
338 progress->completed_extra_passes++;
339#endif
340
341 /* Set up to call proper row-extraction routine in future */
342 if (source->visual == PSEUDOCOLOR) {
343 source->pub.buffer = source->rle_row;
344 source->pub.get_pixel_rows = get_pseudocolor_row;
345 } else {
346 source->pub.get_pixel_rows = get_rle_row;
347 }
348 source->row = cinfo->image_height;
349
350 /* And fetch the topmost (bottommost) row */
351 return (*source->pub.get_pixel_rows) (cinfo, sinfo);
352}
353
354
355/*
356 * Finish up at the end of the file.
357 */
358
359METHODDEF(void)
360finish_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
361{
362 /* no work */
363}
364
365
366/*
367 * The module selection routine for RLE format input.
368 */
369
370GLOBAL(cjpeg_source_ptr)
371jinit_read_rle (j_compress_ptr cinfo)
372{
373 rle_source_ptr source;
374
375 /* Create module interface object */
376 source = (rle_source_ptr)
377 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
378 SIZEOF(rle_source_struct));
379 /* Fill in method ptrs */
380 source->pub.start_input = start_input_rle;
381 source->pub.finish_input = finish_input_rle;
382 source->pub.get_pixel_rows = load_image;
383
384 return (cjpeg_source_ptr) source;
385}
386
387#endif /* RLE_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdswitch.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdswitch.c
new file mode 100644
index 0000000..5eebcc1
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdswitch.c
@@ -0,0 +1,365 @@
1/*
2 * rdswitch.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to process some of cjpeg's more complicated
9 * command-line switches. Switches processed here are:
10 * -qtables file Read quantization tables from text file
11 * -scans file Read scan script from text file
12 * -quality N[,N,...] Set quality ratings
13 * -qslots N[,N,...] Set component quantization table selectors
14 * -sample HxV[,HxV,...] Set component sampling factors
15 */
16
17#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
18#include <ctype.h> /* to declare isdigit(), isspace() */
19
20
21LOCAL(int)
22text_getc (FILE * file)
23/* Read next char, skipping over any comments (# to end of line) */
24/* A comment/newline sequence is returned as a newline */
25{
26 register int ch;
27
28 ch = getc(file);
29 if (ch == '#') {
30 do {
31 ch = getc(file);
32 } while (ch != '\n' && ch != EOF);
33 }
34 return ch;
35}
36
37
38LOCAL(boolean)
39read_text_integer (FILE * file, long * result, int * termchar)
40/* Read an unsigned decimal integer from a file, store it in result */
41/* Reads one trailing character after the integer; returns it in termchar */
42{
43 register int ch;
44 register long val;
45
46 /* Skip any leading whitespace, detect EOF */
47 do {
48 ch = text_getc(file);
49 if (ch == EOF) {
50 *termchar = ch;
51 return FALSE;
52 }
53 } while (isspace(ch));
54
55 if (! isdigit(ch)) {
56 *termchar = ch;
57 return FALSE;
58 }
59
60 val = ch - '0';
61 while ((ch = text_getc(file)) != EOF) {
62 if (! isdigit(ch))
63 break;
64 val *= 10;
65 val += ch - '0';
66 }
67 *result = val;
68 *termchar = ch;
69 return TRUE;
70}
71
72
73GLOBAL(boolean)
74read_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline)
75/* Read a set of quantization tables from the specified file.
76 * The file is plain ASCII text: decimal numbers with whitespace between.
77 * Comments preceded by '#' may be included in the file.
78 * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.
79 * The tables are implicitly numbered 0,1,etc.
80 * NOTE: does not affect the qslots mapping, which will default to selecting
81 * table 0 for luminance (or primary) components, 1 for chrominance components.
82 * You must use -qslots if you want a different component->table mapping.
83 */
84{
85 FILE * fp;
86 int tblno, i, termchar;
87 long val;
88 unsigned int table[DCTSIZE2];
89
90 if ((fp = fopen(filename, "r")) == NULL) {
91 fprintf(stderr, "Can't open table file %s\n", filename);
92 return FALSE;
93 }
94 tblno = 0;
95
96 while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */
97 if (tblno >= NUM_QUANT_TBLS) {
98 fprintf(stderr, "Too many tables in file %s\n", filename);
99 fclose(fp);
100 return FALSE;
101 }
102 table[0] = (unsigned int) val;
103 for (i = 1; i < DCTSIZE2; i++) {
104 if (! read_text_integer(fp, &val, &termchar)) {
105 fprintf(stderr, "Invalid table data in file %s\n", filename);
106 fclose(fp);
107 return FALSE;
108 }
109 table[i] = (unsigned int) val;
110 }
111 jpeg_add_quant_table(cinfo, tblno, table, cinfo->q_scale_factor[tblno],
112 force_baseline);
113 tblno++;
114 }
115
116 if (termchar != EOF) {
117 fprintf(stderr, "Non-numeric data in file %s\n", filename);
118 fclose(fp);
119 return FALSE;
120 }
121
122 fclose(fp);
123 return TRUE;
124}
125
126
127#ifdef C_MULTISCAN_FILES_SUPPORTED
128
129LOCAL(boolean)
130read_scan_integer (FILE * file, long * result, int * termchar)
131/* Variant of read_text_integer that always looks for a non-space termchar;
132 * this simplifies parsing of punctuation in scan scripts.
133 */
134{
135 register int ch;
136
137 if (! read_text_integer(file, result, termchar))
138 return FALSE;
139 ch = *termchar;
140 while (ch != EOF && isspace(ch))
141 ch = text_getc(file);
142 if (isdigit(ch)) { /* oops, put it back */
143 if (ungetc(ch, file) == EOF)
144 return FALSE;
145 ch = ' ';
146 } else {
147 /* Any separators other than ';' and ':' are ignored;
148 * this allows user to insert commas, etc, if desired.
149 */
150 if (ch != EOF && ch != ';' && ch != ':')
151 ch = ' ';
152 }
153 *termchar = ch;
154 return TRUE;
155}
156
157
158GLOBAL(boolean)
159read_scan_script (j_compress_ptr cinfo, char * filename)
160/* Read a scan script from the specified text file.
161 * Each entry in the file defines one scan to be emitted.
162 * Entries are separated by semicolons ';'.
163 * An entry contains one to four component indexes,
164 * optionally followed by a colon ':' and four progressive-JPEG parameters.
165 * The component indexes denote which component(s) are to be transmitted
166 * in the current scan. The first component has index 0.
167 * Sequential JPEG is used if the progressive-JPEG parameters are omitted.
168 * The file is free format text: any whitespace may appear between numbers
169 * and the ':' and ';' punctuation marks. Also, other punctuation (such
170 * as commas or dashes) can be placed between numbers if desired.
171 * Comments preceded by '#' may be included in the file.
172 * Note: we do very little validity checking here;
173 * jcmaster.c will validate the script parameters.
174 */
175{
176 FILE * fp;
177 int scanno, ncomps, termchar;
178 long val;
179 jpeg_scan_info * scanptr;
180#define MAX_SCANS 100 /* quite arbitrary limit */
181 jpeg_scan_info scans[MAX_SCANS];
182
183 if ((fp = fopen(filename, "r")) == NULL) {
184 fprintf(stderr, "Can't open scan definition file %s\n", filename);
185 return FALSE;
186 }
187 scanptr = scans;
188 scanno = 0;
189
190 while (read_scan_integer(fp, &val, &termchar)) {
191 if (scanno >= MAX_SCANS) {
192 fprintf(stderr, "Too many scans defined in file %s\n", filename);
193 fclose(fp);
194 return FALSE;
195 }
196 scanptr->component_index[0] = (int) val;
197 ncomps = 1;
198 while (termchar == ' ') {
199 if (ncomps >= MAX_COMPS_IN_SCAN) {
200 fprintf(stderr, "Too many components in one scan in file %s\n",
201 filename);
202 fclose(fp);
203 return FALSE;
204 }
205 if (! read_scan_integer(fp, &val, &termchar))
206 goto bogus;
207 scanptr->component_index[ncomps] = (int) val;
208 ncomps++;
209 }
210 scanptr->comps_in_scan = ncomps;
211 if (termchar == ':') {
212 if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
213 goto bogus;
214 scanptr->Ss = (int) val;
215 if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
216 goto bogus;
217 scanptr->Se = (int) val;
218 if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
219 goto bogus;
220 scanptr->Ah = (int) val;
221 if (! read_scan_integer(fp, &val, &termchar))
222 goto bogus;
223 scanptr->Al = (int) val;
224 } else {
225 /* set non-progressive parameters */
226 scanptr->Ss = 0;
227 scanptr->Se = DCTSIZE2-1;
228 scanptr->Ah = 0;
229 scanptr->Al = 0;
230 }
231 if (termchar != ';' && termchar != EOF) {
232bogus:
233 fprintf(stderr, "Invalid scan entry format in file %s\n", filename);
234 fclose(fp);
235 return FALSE;
236 }
237 scanptr++, scanno++;
238 }
239
240 if (termchar != EOF) {
241 fprintf(stderr, "Non-numeric data in file %s\n", filename);
242 fclose(fp);
243 return FALSE;
244 }
245
246 if (scanno > 0) {
247 /* Stash completed scan list in cinfo structure.
248 * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,
249 * but if you want to compress multiple images you'd want JPOOL_PERMANENT.
250 */
251 scanptr = (jpeg_scan_info *)
252 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
253 scanno * SIZEOF(jpeg_scan_info));
254 MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info));
255 cinfo->scan_info = scanptr;
256 cinfo->num_scans = scanno;
257 }
258
259 fclose(fp);
260 return TRUE;
261}
262
263#endif /* C_MULTISCAN_FILES_SUPPORTED */
264
265
266GLOBAL(boolean)
267set_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline)
268/* Process a quality-ratings parameter string, of the form
269 * N[,N,...]
270 * If there are more q-table slots than parameters, the last value is replicated.
271 */
272{
273 int val = 75; /* default value */
274 int tblno;
275 char ch;
276
277 for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
278 if (*arg) {
279 ch = ','; /* if not set by sscanf, will be ',' */
280 if (sscanf(arg, "%d%c", &val, &ch) < 1)
281 return FALSE;
282 if (ch != ',') /* syntax check */
283 return FALSE;
284 /* Convert user 0-100 rating to percentage scaling */
285 cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);
286 while (*arg && *arg++ != ',') /* advance to next segment of arg string */
287 ;
288 } else {
289 /* reached end of parameter, set remaining factors to last value */
290 cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);
291 }
292 }
293 jpeg_default_qtables(cinfo, force_baseline);
294 return TRUE;
295}
296
297
298GLOBAL(boolean)
299set_quant_slots (j_compress_ptr cinfo, char *arg)
300/* Process a quantization-table-selectors parameter string, of the form
301 * N[,N,...]
302 * If there are more components than parameters, the last value is replicated.
303 */
304{
305 int val = 0; /* default table # */
306 int ci;
307 char ch;
308
309 for (ci = 0; ci < MAX_COMPONENTS; ci++) {
310 if (*arg) {
311 ch = ','; /* if not set by sscanf, will be ',' */
312 if (sscanf(arg, "%d%c", &val, &ch) < 1)
313 return FALSE;
314 if (ch != ',') /* syntax check */
315 return FALSE;
316 if (val < 0 || val >= NUM_QUANT_TBLS) {
317 fprintf(stderr, "JPEG quantization tables are numbered 0..%d\n",
318 NUM_QUANT_TBLS-1);
319 return FALSE;
320 }
321 cinfo->comp_info[ci].quant_tbl_no = val;
322 while (*arg && *arg++ != ',') /* advance to next segment of arg string */
323 ;
324 } else {
325 /* reached end of parameter, set remaining components to last table */
326 cinfo->comp_info[ci].quant_tbl_no = val;
327 }
328 }
329 return TRUE;
330}
331
332
333GLOBAL(boolean)
334set_sample_factors (j_compress_ptr cinfo, char *arg)
335/* Process a sample-factors parameter string, of the form
336 * HxV[,HxV,...]
337 * If there are more components than parameters, "1x1" is assumed for the rest.
338 */
339{
340 int ci, val1, val2;
341 char ch1, ch2;
342
343 for (ci = 0; ci < MAX_COMPONENTS; ci++) {
344 if (*arg) {
345 ch2 = ','; /* if not set by sscanf, will be ',' */
346 if (sscanf(arg, "%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3)
347 return FALSE;
348 if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */
349 return FALSE;
350 if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
351 fprintf(stderr, "JPEG sampling factors must be 1..4\n");
352 return FALSE;
353 }
354 cinfo->comp_info[ci].h_samp_factor = val1;
355 cinfo->comp_info[ci].v_samp_factor = val2;
356 while (*arg && *arg++ != ',') /* advance to next segment of arg string */
357 ;
358 } else {
359 /* reached end of parameter, set remaining components to 1x1 sampling */
360 cinfo->comp_info[ci].h_samp_factor = 1;
361 cinfo->comp_info[ci].v_samp_factor = 1;
362 }
363 }
364 return TRUE;
365}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdtarga.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdtarga.c
new file mode 100644
index 0000000..d7ffc33
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/rdtarga.c
@@ -0,0 +1,500 @@
1/*
2 * rdtarga.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to read input images in Targa format.
9 *
10 * These routines may need modification for non-Unix environments or
11 * specialized applications. As they stand, they assume input from
12 * an ordinary stdio stream. They further assume that reading begins
13 * at the start of the file; start_input may need work if the
14 * user interface has already read some data (e.g., to determine that
15 * the file is indeed Targa format).
16 *
17 * Based on code contributed by Lee Daniel Crocker.
18 */
19
20#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
21
22#ifdef TARGA_SUPPORTED
23
24
25/* Macros to deal with unsigned chars as efficiently as compiler allows */
26
27#ifdef HAVE_UNSIGNED_CHAR
28typedef unsigned char U_CHAR;
29#define UCH(x) ((int) (x))
30#else /* !HAVE_UNSIGNED_CHAR */
31#ifdef CHAR_IS_UNSIGNED
32typedef char U_CHAR;
33#define UCH(x) ((int) (x))
34#else
35typedef char U_CHAR;
36#define UCH(x) ((int) (x) & 0xFF)
37#endif
38#endif /* HAVE_UNSIGNED_CHAR */
39
40
41#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))
42
43
44/* Private version of data source object */
45
46typedef struct _tga_source_struct * tga_source_ptr;
47
48typedef struct _tga_source_struct {
49 struct cjpeg_source_struct pub; /* public fields */
50
51 j_compress_ptr cinfo; /* back link saves passing separate parm */
52
53 JSAMPARRAY colormap; /* Targa colormap (converted to my format) */
54
55 jvirt_sarray_ptr whole_image; /* Needed if funny input row order */
56 JDIMENSION current_row; /* Current logical row number to read */
57
58 /* Pointer to routine to extract next Targa pixel from input file */
59 JMETHOD(void, read_pixel, (tga_source_ptr sinfo));
60
61 /* Result of read_pixel is delivered here: */
62 U_CHAR tga_pixel[4];
63
64 int pixel_size; /* Bytes per Targa pixel (1 to 4) */
65
66 /* State info for reading RLE-coded pixels; both counts must be init to 0 */
67 int block_count; /* # of pixels remaining in RLE block */
68 int dup_pixel_count; /* # of times to duplicate previous pixel */
69
70 /* This saves the correct pixel-row-expansion method for preload_image */
71 JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
72 cjpeg_source_ptr sinfo));
73} tga_source_struct;
74
75
76/* For expanding 5-bit pixel values to 8-bit with best rounding */
77
78static const UINT8 c5to8bits[32] = {
79 0, 8, 16, 25, 33, 41, 49, 58,
80 66, 74, 82, 90, 99, 107, 115, 123,
81 132, 140, 148, 156, 165, 173, 181, 189,
82 197, 206, 214, 222, 230, 239, 247, 255
83};
84
85
86
87LOCAL(int)
88read_byte (tga_source_ptr sinfo)
89/* Read next byte from Targa file */
90{
91 register FILE *infile = sinfo->pub.input_file;
92 register int c;
93
94 if ((c = getc(infile)) == EOF)
95 ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);
96 return c;
97}
98
99
100LOCAL(void)
101read_colormap (tga_source_ptr sinfo, int cmaplen, int mapentrysize)
102/* Read the colormap from a Targa file */
103{
104 int i;
105
106 /* Presently only handles 24-bit BGR format */
107 if (mapentrysize != 24)
108 ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);
109
110 for (i = 0; i < cmaplen; i++) {
111 sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);
112 sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);
113 sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);
114 }
115}
116
117
118/*
119 * read_pixel methods: get a single pixel from Targa file into tga_pixel[]
120 */
121
122METHODDEF(void)
123read_non_rle_pixel (tga_source_ptr sinfo)
124/* Read one Targa pixel from the input file; no RLE expansion */
125{
126 register FILE *infile = sinfo->pub.input_file;
127 register int i;
128
129 for (i = 0; i < sinfo->pixel_size; i++) {
130 sinfo->tga_pixel[i] = (U_CHAR) getc(infile);
131 }
132}
133
134
135METHODDEF(void)
136read_rle_pixel (tga_source_ptr sinfo)
137/* Read one Targa pixel from the input file, expanding RLE data as needed */
138{
139 register FILE *infile = sinfo->pub.input_file;
140 register int i;
141
142 /* Duplicate previously read pixel? */
143 if (sinfo->dup_pixel_count > 0) {
144 sinfo->dup_pixel_count--;
145 return;
146 }
147
148 /* Time to read RLE block header? */
149 if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */
150 i = read_byte(sinfo);
151 if (i & 0x80) { /* Start of duplicate-pixel block? */
152 sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */
153 sinfo->block_count = 0; /* then read new block header */
154 } else {
155 sinfo->block_count = i & 0x7F; /* number of pixels after this one */
156 }
157 }
158
159 /* Read next pixel */
160 for (i = 0; i < sinfo->pixel_size; i++) {
161 sinfo->tga_pixel[i] = (U_CHAR) getc(infile);
162 }
163}
164
165
166/*
167 * Read one row of pixels.
168 *
169 * We provide several different versions depending on input file format.
170 */
171
172
173METHODDEF(JDIMENSION)
174get_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
175/* This version is for reading 8-bit grayscale pixels */
176{
177 tga_source_ptr source = (tga_source_ptr) sinfo;
178 register JSAMPROW ptr;
179 register JDIMENSION col;
180
181 ptr = source->pub.buffer[0];
182 for (col = cinfo->image_width; col > 0; col--) {
183 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
184 *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);
185 }
186 return 1;
187}
188
189METHODDEF(JDIMENSION)
190get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
191/* This version is for reading 8-bit colormap indexes */
192{
193 tga_source_ptr source = (tga_source_ptr) sinfo;
194 register int t;
195 register JSAMPROW ptr;
196 register JDIMENSION col;
197 register JSAMPARRAY colormap = source->colormap;
198
199 ptr = source->pub.buffer[0];
200 for (col = cinfo->image_width; col > 0; col--) {
201 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
202 t = UCH(source->tga_pixel[0]);
203 *ptr++ = colormap[0][t];
204 *ptr++ = colormap[1][t];
205 *ptr++ = colormap[2][t];
206 }
207 return 1;
208}
209
210METHODDEF(JDIMENSION)
211get_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
212/* This version is for reading 16-bit pixels */
213{
214 tga_source_ptr source = (tga_source_ptr) sinfo;
215 register int t;
216 register JSAMPROW ptr;
217 register JDIMENSION col;
218
219 ptr = source->pub.buffer[0];
220 for (col = cinfo->image_width; col > 0; col--) {
221 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
222 t = UCH(source->tga_pixel[0]);
223 t += UCH(source->tga_pixel[1]) << 8;
224 /* We expand 5 bit data to 8 bit sample width.
225 * The format of the 16-bit (LSB first) input word is
226 * xRRRRRGGGGGBBBBB
227 */
228 ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F];
229 t >>= 5;
230 ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F];
231 t >>= 5;
232 ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F];
233 ptr += 3;
234 }
235 return 1;
236}
237
238METHODDEF(JDIMENSION)
239get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
240/* This version is for reading 24-bit pixels */
241{
242 tga_source_ptr source = (tga_source_ptr) sinfo;
243 register JSAMPROW ptr;
244 register JDIMENSION col;
245
246 ptr = source->pub.buffer[0];
247 for (col = cinfo->image_width; col > 0; col--) {
248 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */
249 *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */
250 *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]);
251 *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);
252 }
253 return 1;
254}
255
256/*
257 * Targa also defines a 32-bit pixel format with order B,G,R,A.
258 * We presently ignore the attribute byte, so the code for reading
259 * these pixels is identical to the 24-bit routine above.
260 * This works because the actual pixel length is only known to read_pixel.
261 */
262
263#define get_32bit_row get_24bit_row
264
265
266/*
267 * This method is for re-reading the input data in standard top-down
268 * row order. The entire image has already been read into whole_image
269 * with proper conversion of pixel format, but it's in a funny row order.
270 */
271
272METHODDEF(JDIMENSION)
273get_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
274{
275 tga_source_ptr source = (tga_source_ptr) sinfo;
276 JDIMENSION source_row;
277
278 /* Compute row of source that maps to current_row of normal order */
279 /* For now, assume image is bottom-up and not interlaced. */
280 /* NEEDS WORK to support interlaced images! */
281 source_row = cinfo->image_height - source->current_row - 1;
282
283 /* Fetch that row from virtual array */
284 source->pub.buffer = (*cinfo->mem->access_virt_sarray)
285 ((j_common_ptr) cinfo, source->whole_image,
286 source_row, (JDIMENSION) 1, FALSE);
287
288 source->current_row++;
289 return 1;
290}
291
292
293/*
294 * This method loads the image into whole_image during the first call on
295 * get_pixel_rows. The get_pixel_rows pointer is then adjusted to call
296 * get_memory_row on subsequent calls.
297 */
298
299METHODDEF(JDIMENSION)
300preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
301{
302 tga_source_ptr source = (tga_source_ptr) sinfo;
303 JDIMENSION row;
304 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
305
306 /* Read the data into a virtual array in input-file row order. */
307 for (row = 0; row < cinfo->image_height; row++) {
308 if (progress != NULL) {
309 progress->pub.pass_counter = (long) row;
310 progress->pub.pass_limit = (long) cinfo->image_height;
311 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
312 }
313 source->pub.buffer = (*cinfo->mem->access_virt_sarray)
314 ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);
315 (*source->get_pixel_rows) (cinfo, sinfo);
316 }
317 if (progress != NULL)
318 progress->completed_extra_passes++;
319
320 /* Set up to read from the virtual array in unscrambled order */
321 source->pub.get_pixel_rows = get_memory_row;
322 source->current_row = 0;
323 /* And read the first row */
324 return get_memory_row(cinfo, sinfo);
325}
326
327
328/*
329 * Read the file header; return image size and component count.
330 */
331
332METHODDEF(void)
333start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
334{
335 tga_source_ptr source = (tga_source_ptr) sinfo;
336 U_CHAR targaheader[18];
337 int idlen, cmaptype, subtype, flags, interlace_type, components;
338 unsigned int width, height, maplen;
339 boolean is_bottom_up;
340
341#define GET_2B(offset) ((unsigned int) UCH(targaheader[offset]) + \
342 (((unsigned int) UCH(targaheader[offset+1])) << 8))
343
344 if (! ReadOK(source->pub.input_file, targaheader, 18))
345 ERREXIT(cinfo, JERR_INPUT_EOF);
346
347 /* Pretend "15-bit" pixels are 16-bit --- we ignore attribute bit anyway */
348 if (targaheader[16] == 15)
349 targaheader[16] = 16;
350
351 idlen = UCH(targaheader[0]);
352 cmaptype = UCH(targaheader[1]);
353 subtype = UCH(targaheader[2]);
354 maplen = GET_2B(5);
355 width = GET_2B(12);
356 height = GET_2B(14);
357 source->pixel_size = UCH(targaheader[16]) >> 3;
358 flags = UCH(targaheader[17]); /* Image Descriptor byte */
359
360 is_bottom_up = ((flags & 0x20) == 0); /* bit 5 set => top-down */
361 interlace_type = flags >> 6; /* bits 6/7 are interlace code */
362
363 if (cmaptype > 1 || /* cmaptype must be 0 or 1 */
364 source->pixel_size < 1 || source->pixel_size > 4 ||
365 (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */
366 interlace_type != 0) /* currently don't allow interlaced image */
367 ERREXIT(cinfo, JERR_TGA_BADPARMS);
368
369 if (subtype > 8) {
370 /* It's an RLE-coded file */
371 source->read_pixel = read_rle_pixel;
372 source->block_count = source->dup_pixel_count = 0;
373 subtype -= 8;
374 } else {
375 /* Non-RLE file */
376 source->read_pixel = read_non_rle_pixel;
377 }
378
379 /* Now should have subtype 1, 2, or 3 */
380 components = 3; /* until proven different */
381 cinfo->in_color_space = JCS_RGB;
382
383 switch (subtype) {
384 case 1: /* Colormapped image */
385 if (source->pixel_size == 1 && cmaptype == 1)
386 source->get_pixel_rows = get_8bit_row;
387 else
388 ERREXIT(cinfo, JERR_TGA_BADPARMS);
389 TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);
390 break;
391 case 2: /* RGB image */
392 switch (source->pixel_size) {
393 case 2:
394 source->get_pixel_rows = get_16bit_row;
395 break;
396 case 3:
397 source->get_pixel_rows = get_24bit_row;
398 break;
399 case 4:
400 source->get_pixel_rows = get_32bit_row;
401 break;
402 default:
403 ERREXIT(cinfo, JERR_TGA_BADPARMS);
404 break;
405 }
406 TRACEMS2(cinfo, 1, JTRC_TGA, width, height);
407 break;
408 case 3: /* Grayscale image */
409 components = 1;
410 cinfo->in_color_space = JCS_GRAYSCALE;
411 if (source->pixel_size == 1)
412 source->get_pixel_rows = get_8bit_gray_row;
413 else
414 ERREXIT(cinfo, JERR_TGA_BADPARMS);
415 TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);
416 break;
417 default:
418 ERREXIT(cinfo, JERR_TGA_BADPARMS);
419 break;
420 }
421
422 if (is_bottom_up) {
423 /* Create a virtual array to buffer the upside-down image. */
424 source->whole_image = (*cinfo->mem->request_virt_sarray)
425 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
426 (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);
427 if (cinfo->progress != NULL) {
428 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
429 progress->total_extra_passes++; /* count file input as separate pass */
430 }
431 /* source->pub.buffer will point to the virtual array. */
432 source->pub.buffer_height = 1; /* in case anyone looks at it */
433 source->pub.get_pixel_rows = preload_image;
434 } else {
435 /* Don't need a virtual array, but do need a one-row input buffer. */
436 source->whole_image = NULL;
437 source->pub.buffer = (*cinfo->mem->alloc_sarray)
438 ((j_common_ptr) cinfo, JPOOL_IMAGE,
439 (JDIMENSION) width * components, (JDIMENSION) 1);
440 source->pub.buffer_height = 1;
441 source->pub.get_pixel_rows = source->get_pixel_rows;
442 }
443
444 while (idlen--) /* Throw away ID field */
445 (void) read_byte(source);
446
447 if (maplen > 0) {
448 if (maplen > 256 || GET_2B(3) != 0)
449 ERREXIT(cinfo, JERR_TGA_BADCMAP);
450 /* Allocate space to store the colormap */
451 source->colormap = (*cinfo->mem->alloc_sarray)
452 ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);
453 /* and read it from the file */
454 read_colormap(source, (int) maplen, UCH(targaheader[7]));
455 } else {
456 if (cmaptype) /* but you promised a cmap! */
457 ERREXIT(cinfo, JERR_TGA_BADPARMS);
458 source->colormap = NULL;
459 }
460
461 cinfo->input_components = components;
462 cinfo->data_precision = 8;
463 cinfo->image_width = width;
464 cinfo->image_height = height;
465}
466
467
468/*
469 * Finish up at the end of the file.
470 */
471
472METHODDEF(void)
473finish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
474{
475 /* no work */
476}
477
478
479/*
480 * The module selection routine for Targa format input.
481 */
482
483GLOBAL(cjpeg_source_ptr)
484jinit_read_targa (j_compress_ptr cinfo)
485{
486 tga_source_ptr source;
487
488 /* Create module interface object */
489 source = (tga_source_ptr)
490 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
491 SIZEOF(tga_source_struct));
492 source->cinfo = cinfo; /* make back link for subroutines */
493 /* Fill in method ptrs, except get_pixel_rows which start_input sets */
494 source->pub.start_input = start_input_tga;
495 source->pub.finish_input = finish_input_tga;
496
497 return (cjpeg_source_ptr) source;
498}
499
500#endif /* TARGA_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/readme.dos b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/readme.dos
new file mode 100644
index 0000000..4d10d2d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/readme.dos
@@ -0,0 +1,15 @@
1This archive contains a DOS-friendly version of the Independent JPEG Group's
2source code. It differs from the normal distribution in that:
3
41. The archive format is zip rather than tar+gzip. You should be able to
5unpack it with PKUNZIP (2.04g or later) or Info-Zip's unzip or 7-Zip.
6
72. Newlines have been converted from Unix (LF) to DOS (CR/LF) style in all
8text files, but not in the binary files (test*.*).
9
103. Object files have been included for jmemdosa.asm. See jdosaobj.txt.
11
12Please see the main README file for the primary documentation.
13
14If you'd rather have a non-DOSified archive, see the ARCHIVE LOCATIONS section
15of README.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/structure.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/structure.txt
new file mode 100644
index 0000000..ae9f89f
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/structure.txt
@@ -0,0 +1,941 @@
1IJG JPEG LIBRARY: SYSTEM ARCHITECTURE
2
3Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
4This file is part of the Independent JPEG Group's software.
5For conditions of distribution and use, see the accompanying README file.
6
7
8This file provides an overview of the architecture of the IJG JPEG software;
9that is, the functions of the various modules in the system and the interfaces
10between modules. For more precise details about any data structure or calling
11convention, see the include files and comments in the source code.
12
13We assume that the reader is already somewhat familiar with the JPEG standard.
14The README file includes references for learning about JPEG. The file
15libjpeg.txt describes the library from the viewpoint of an application
16programmer using the library; it's best to read that file before this one.
17Also, the file coderules.txt describes the coding style conventions we use.
18
19In this document, JPEG-specific terminology follows the JPEG standard:
20 A "component" means a color channel, e.g., Red or Luminance.
21 A "sample" is a single component value (i.e., one number in the image data).
22 A "coefficient" is a frequency coefficient (a DCT transform output number).
23 A "block" is an array of samples or coefficients.
24 An "MCU" (minimum coded unit) is an interleaved set of blocks of size
25 determined by the sampling factors, or a single block in a
26 noninterleaved scan.
27We do not use the terms "pixel" and "sample" interchangeably. When we say
28pixel, we mean an element of the full-size image, while a sample is an element
29of the downsampled image. Thus the number of samples may vary across
30components while the number of pixels does not. (This terminology is not used
31rigorously throughout the code, but it is used in places where confusion would
32otherwise result.)
33
34
35*** System features ***
36
37The IJG distribution contains two parts:
38 * A subroutine library for JPEG compression and decompression.
39 * cjpeg/djpeg, two sample applications that use the library to transform
40 JFIF JPEG files to and from several other image formats.
41cjpeg/djpeg are of no great intellectual complexity: they merely add a simple
42command-line user interface and I/O routines for several uncompressed image
43formats. This document concentrates on the library itself.
44
45We desire the library to be capable of supporting all JPEG baseline, extended
46sequential, and progressive DCT processes. The library does not support the
47hierarchical or lossless processes defined in the standard.
48
49Within these limits, any set of compression parameters allowed by the JPEG
50spec should be readable for decompression. (We can be more restrictive about
51what formats we can generate.) Although the system design allows for all
52parameter values, some uncommon settings are not yet implemented and may
53never be; nonintegral sampling ratios are the prime example. Furthermore,
54we treat 8-bit vs. 12-bit data precision as a compile-time switch, not a
55run-time option, because most machines can store 8-bit pixels much more
56compactly than 12-bit.
57
58By itself, the library handles only interchange JPEG datastreams --- in
59particular the widely used JFIF file format. The library can be used by
60surrounding code to process interchange or abbreviated JPEG datastreams that
61are embedded in more complex file formats. (For example, libtiff uses this
62library to implement JPEG compression within the TIFF file format.)
63
64The library includes a substantial amount of code that is not covered by the
65JPEG standard but is necessary for typical applications of JPEG. These
66functions preprocess the image before JPEG compression or postprocess it after
67decompression. They include colorspace conversion, downsampling/upsampling,
68and color quantization. This code can be omitted if not needed.
69
70A wide range of quality vs. speed tradeoffs are possible in JPEG processing,
71and even more so in decompression postprocessing. The decompression library
72provides multiple implementations that cover most of the useful tradeoffs,
73ranging from very-high-quality down to fast-preview operation. On the
74compression side we have generally not provided low-quality choices, since
75compression is normally less time-critical. It should be understood that the
76low-quality modes may not meet the JPEG standard's accuracy requirements;
77nonetheless, they are useful for viewers.
78
79
80*** Portability issues ***
81
82Portability is an essential requirement for the library. The key portability
83issues that show up at the level of system architecture are:
84
851. Memory usage. We want the code to be able to run on PC-class machines
86with limited memory. Images should therefore be processed sequentially (in
87strips), to avoid holding the whole image in memory at once. Where a
88full-image buffer is necessary, we should be able to use either virtual memory
89or temporary files.
90
912. Near/far pointer distinction. To run efficiently on 80x86 machines, the
92code should distinguish "small" objects (kept in near data space) from
93"large" ones (kept in far data space). This is an annoying restriction, but
94fortunately it does not impact code quality for less brain-damaged machines,
95and the source code clutter turns out to be minimal with sufficient use of
96pointer typedefs.
97
983. Data precision. We assume that "char" is at least 8 bits, "short" and
99"int" at least 16, "long" at least 32. The code will work fine with larger
100data sizes, although memory may be used inefficiently in some cases. However,
101the JPEG compressed datastream must ultimately appear on external storage as a
102sequence of 8-bit bytes if it is to conform to the standard. This may pose a
103problem on machines where char is wider than 8 bits. The library represents
104compressed data as an array of values of typedef JOCTET. If no data type
105exactly 8 bits wide is available, custom data source and data destination
106modules must be written to unpack and pack the chosen JOCTET datatype into
1078-bit external representation.
108
109
110*** System overview ***
111
112The compressor and decompressor are each divided into two main sections:
113the JPEG compressor or decompressor proper, and the preprocessing or
114postprocessing functions. The interface between these two sections is the
115image data that the official JPEG spec regards as its input or output: this
116data is in the colorspace to be used for compression, and it is downsampled
117to the sampling factors to be used. The preprocessing and postprocessing
118steps are responsible for converting a normal image representation to or from
119this form. (Those few applications that want to deal with YCbCr downsampled
120data can skip the preprocessing or postprocessing step.)
121
122Looking more closely, the compressor library contains the following main
123elements:
124
125 Preprocessing:
126 * Color space conversion (e.g., RGB to YCbCr).
127 * Edge expansion and downsampling. Optionally, this step can do simple
128 smoothing --- this is often helpful for low-quality source data.
129 JPEG proper:
130 * MCU assembly, DCT, quantization.
131 * Entropy coding (sequential or progressive, Huffman or arithmetic).
132
133In addition to these modules we need overall control, marker generation,
134and support code (memory management & error handling). There is also a
135module responsible for physically writing the output data --- typically
136this is just an interface to fwrite(), but some applications may need to
137do something else with the data.
138
139The decompressor library contains the following main elements:
140
141 JPEG proper:
142 * Entropy decoding (sequential or progressive, Huffman or arithmetic).
143 * Dequantization, inverse DCT, MCU disassembly.
144 Postprocessing:
145 * Upsampling. Optionally, this step may be able to do more general
146 rescaling of the image.
147 * Color space conversion (e.g., YCbCr to RGB). This step may also
148 provide gamma adjustment [ currently it does not ].
149 * Optional color quantization (e.g., reduction to 256 colors).
150 * Optional color precision reduction (e.g., 24-bit to 15-bit color).
151 [This feature is not currently implemented.]
152
153We also need overall control, marker parsing, and a data source module.
154The support code (memory management & error handling) can be shared with
155the compression half of the library.
156
157There may be several implementations of each of these elements, particularly
158in the decompressor, where a wide range of speed/quality tradeoffs is very
159useful. It must be understood that some of the best speedups involve
160merging adjacent steps in the pipeline. For example, upsampling, color space
161conversion, and color quantization might all be done at once when using a
162low-quality ordered-dither technique. The system architecture is designed to
163allow such merging where appropriate.
164
165
166Note: it is convenient to regard edge expansion (padding to block boundaries)
167as a preprocessing/postprocessing function, even though the JPEG spec includes
168it in compression/decompression. We do this because downsampling/upsampling
169can be simplified a little if they work on padded data: it's not necessary to
170have special cases at the right and bottom edges. Therefore the interface
171buffer is always an integral number of blocks wide and high, and we expect
172compression preprocessing to pad the source data properly. Padding will occur
173only to the next block (N-sample) boundary. In an interleaved-scan situation,
174additional dummy blocks may be used to fill out MCUs, but the MCU assembly and
175disassembly logic will create or discard these blocks internally. (This is
176advantageous for speed reasons, since we avoid DCTing the dummy blocks.
177It also permits a small reduction in file size, because the compressor can
178choose dummy block contents so as to minimize their size in compressed form.
179Finally, it makes the interface buffer specification independent of whether
180the file is actually interleaved or not.) Applications that wish to deal
181directly with the downsampled data must provide similar buffering and padding
182for odd-sized images.
183
184
185*** Poor man's object-oriented programming ***
186
187It should be clear by now that we have a lot of quasi-independent processing
188steps, many of which have several possible behaviors. To avoid cluttering the
189code with lots of switch statements, we use a simple form of object-style
190programming to separate out the different possibilities.
191
192For example, two different color quantization algorithms could be implemented
193as two separate modules that present the same external interface; at runtime,
194the calling code will access the proper module indirectly through an "object".
195
196We can get the limited features we need while staying within portable C.
197The basic tool is a function pointer. An "object" is just a struct
198containing one or more function pointer fields, each of which corresponds to
199a method name in real object-oriented languages. During initialization we
200fill in the function pointers with references to whichever module we have
201determined we need to use in this run. Then invocation of the module is done
202by indirecting through a function pointer; on most machines this is no more
203expensive than a switch statement, which would be the only other way of
204making the required run-time choice. The really significant benefit, of
205course, is keeping the source code clean and well structured.
206
207We can also arrange to have private storage that varies between different
208implementations of the same kind of object. We do this by making all the
209module-specific object structs be separately allocated entities, which will
210be accessed via pointers in the master compression or decompression struct.
211The "public" fields or methods for a given kind of object are specified by
212a commonly known struct. But a module's initialization code can allocate
213a larger struct that contains the common struct as its first member, plus
214additional private fields. With appropriate pointer casting, the module's
215internal functions can access these private fields. (For a simple example,
216see jdatadst.c, which implements the external interface specified by struct
217jpeg_destination_mgr, but adds extra fields.)
218
219(Of course this would all be a lot easier if we were using C++, but we are
220not yet prepared to assume that everyone has a C++ compiler.)
221
222An important benefit of this scheme is that it is easy to provide multiple
223versions of any method, each tuned to a particular case. While a lot of
224precalculation might be done to select an optimal implementation of a method,
225the cost per invocation is constant. For example, the upsampling step might
226have a "generic" method, plus one or more "hardwired" methods for the most
227popular sampling factors; the hardwired methods would be faster because they'd
228use straight-line code instead of for-loops. The cost to determine which
229method to use is paid only once, at startup, and the selection criteria are
230hidden from the callers of the method.
231
232This plan differs a little bit from usual object-oriented structures, in that
233only one instance of each object class will exist during execution. The
234reason for having the class structure is that on different runs we may create
235different instances (choose to execute different modules). You can think of
236the term "method" as denoting the common interface presented by a particular
237set of interchangeable functions, and "object" as denoting a group of related
238methods, or the total shared interface behavior of a group of modules.
239
240
241*** Overall control structure ***
242
243We previously mentioned the need for overall control logic in the compression
244and decompression libraries. In IJG implementations prior to v5, overall
245control was mostly provided by "pipeline control" modules, which proved to be
246large, unwieldy, and hard to understand. To improve the situation, the
247control logic has been subdivided into multiple modules. The control modules
248consist of:
249
2501. Master control for module selection and initialization. This has two
251responsibilities:
252
253 1A. Startup initialization at the beginning of image processing.
254 The individual processing modules to be used in this run are selected
255 and given initialization calls.
256
257 1B. Per-pass control. This determines how many passes will be performed
258 and calls each active processing module to configure itself
259 appropriately at the beginning of each pass. End-of-pass processing,
260 where necessary, is also invoked from the master control module.
261
262 Method selection is partially distributed, in that a particular processing
263 module may contain several possible implementations of a particular method,
264 which it will select among when given its initialization call. The master
265 control code need only be concerned with decisions that affect more than
266 one module.
267
2682. Data buffering control. A separate control module exists for each
269 inter-processing-step data buffer. This module is responsible for
270 invoking the processing steps that write or read that data buffer.
271
272Each buffer controller sees the world as follows:
273
274input data => processing step A => buffer => processing step B => output data
275 | | |
276 ------------------ controller ------------------
277
278The controller knows the dataflow requirements of steps A and B: how much data
279they want to accept in one chunk and how much they output in one chunk. Its
280function is to manage its buffer and call A and B at the proper times.
281
282A data buffer control module may itself be viewed as a processing step by a
283higher-level control module; thus the control modules form a binary tree with
284elementary processing steps at the leaves of the tree.
285
286The control modules are objects. A considerable amount of flexibility can
287be had by replacing implementations of a control module. For example:
288* Merging of adjacent steps in the pipeline is done by replacing a control
289 module and its pair of processing-step modules with a single processing-
290 step module. (Hence the possible merges are determined by the tree of
291 control modules.)
292* In some processing modes, a given interstep buffer need only be a "strip"
293 buffer large enough to accommodate the desired data chunk sizes. In other
294 modes, a full-image buffer is needed and several passes are required.
295 The control module determines which kind of buffer is used and manipulates
296 virtual array buffers as needed. One or both processing steps may be
297 unaware of the multi-pass behavior.
298
299In theory, we might be able to make all of the data buffer controllers
300interchangeable and provide just one set of implementations for all. In
301practice, each one contains considerable special-case processing for its
302particular job. The buffer controller concept should be regarded as an
303overall system structuring principle, not as a complete description of the
304task performed by any one controller.
305
306
307*** Compression object structure ***
308
309Here is a sketch of the logical structure of the JPEG compression library:
310
311 |-- Colorspace conversion
312 |-- Preprocessing controller --|
313 | |-- Downsampling
314Main controller --|
315 | |-- Forward DCT, quantize
316 |-- Coefficient controller --|
317 |-- Entropy encoding
318
319This sketch also describes the flow of control (subroutine calls) during
320typical image data processing. Each of the components shown in the diagram is
321an "object" which may have several different implementations available. One
322or more source code files contain the actual implementation(s) of each object.
323
324The objects shown above are:
325
326* Main controller: buffer controller for the subsampled-data buffer, which
327 holds the preprocessed input data. This controller invokes preprocessing to
328 fill the subsampled-data buffer, and JPEG compression to empty it. There is
329 usually no need for a full-image buffer here; a strip buffer is adequate.
330
331* Preprocessing controller: buffer controller for the downsampling input data
332 buffer, which lies between colorspace conversion and downsampling. Note
333 that a unified conversion/downsampling module would probably replace this
334 controller entirely.
335
336* Colorspace conversion: converts application image data into the desired
337 JPEG color space; also changes the data from pixel-interleaved layout to
338 separate component planes. Processes one pixel row at a time.
339
340* Downsampling: performs reduction of chroma components as required.
341 Optionally may perform pixel-level smoothing as well. Processes a "row
342 group" at a time, where a row group is defined as Vmax pixel rows of each
343 component before downsampling, and Vk sample rows afterwards (remember Vk
344 differs across components). Some downsampling or smoothing algorithms may
345 require context rows above and below the current row group; the
346 preprocessing controller is responsible for supplying these rows via proper
347 buffering. The downsampler is responsible for edge expansion at the right
348 edge (i.e., extending each sample row to a multiple of N samples); but the
349 preprocessing controller is responsible for vertical edge expansion (i.e.,
350 duplicating the bottom sample row as needed to make a multiple of N rows).
351
352* Coefficient controller: buffer controller for the DCT-coefficient data.
353 This controller handles MCU assembly, including insertion of dummy DCT
354 blocks when needed at the right or bottom edge. When performing
355 Huffman-code optimization or emitting a multiscan JPEG file, this
356 controller is responsible for buffering the full image. The equivalent of
357 one fully interleaved MCU row of subsampled data is processed per call,
358 even when the JPEG file is noninterleaved.
359
360* Forward DCT and quantization: Perform DCT, quantize, and emit coefficients.
361 Works on one or more DCT blocks at a time. (Note: the coefficients are now
362 emitted in normal array order, which the entropy encoder is expected to
363 convert to zigzag order as necessary. Prior versions of the IJG code did
364 the conversion to zigzag order within the quantization step.)
365
366* Entropy encoding: Perform Huffman or arithmetic entropy coding and emit the
367 coded data to the data destination module. Works on one MCU per call.
368 For progressive JPEG, the same DCT blocks are fed to the entropy coder
369 during each pass, and the coder must emit the appropriate subset of
370 coefficients.
371
372In addition to the above objects, the compression library includes these
373objects:
374
375* Master control: determines the number of passes required, controls overall
376 and per-pass initialization of the other modules.
377
378* Marker writing: generates JPEG markers (except for RSTn, which is emitted
379 by the entropy encoder when needed).
380
381* Data destination manager: writes the output JPEG datastream to its final
382 destination (e.g., a file). The destination manager supplied with the
383 library knows how to write to a stdio stream or to a memory buffer;
384 for other behaviors, the surrounding application may provide its own
385 destination manager.
386
387* Memory manager: allocates and releases memory, controls virtual arrays
388 (with backing store management, where required).
389
390* Error handler: performs formatting and output of error and trace messages;
391 determines handling of nonfatal errors. The surrounding application may
392 override some or all of this object's methods to change error handling.
393
394* Progress monitor: supports output of "percent-done" progress reports.
395 This object represents an optional callback to the surrounding application:
396 if wanted, it must be supplied by the application.
397
398The error handler, destination manager, and progress monitor objects are
399defined as separate objects in order to simplify application-specific
400customization of the JPEG library. A surrounding application may override
401individual methods or supply its own all-new implementation of one of these
402objects. The object interfaces for these objects are therefore treated as
403part of the application interface of the library, whereas the other objects
404are internal to the library.
405
406The error handler and memory manager are shared by JPEG compression and
407decompression; the progress monitor, if used, may be shared as well.
408
409
410*** Decompression object structure ***
411
412Here is a sketch of the logical structure of the JPEG decompression library:
413
414 |-- Entropy decoding
415 |-- Coefficient controller --|
416 | |-- Dequantize, Inverse DCT
417Main controller --|
418 | |-- Upsampling
419 |-- Postprocessing controller --| |-- Colorspace conversion
420 |-- Color quantization
421 |-- Color precision reduction
422
423As before, this diagram also represents typical control flow. The objects
424shown are:
425
426* Main controller: buffer controller for the subsampled-data buffer, which
427 holds the output of JPEG decompression proper. This controller's primary
428 task is to feed the postprocessing procedure. Some upsampling algorithms
429 may require context rows above and below the current row group; when this
430 is true, the main controller is responsible for managing its buffer so as
431 to make context rows available. In the current design, the main buffer is
432 always a strip buffer; a full-image buffer is never required.
433
434* Coefficient controller: buffer controller for the DCT-coefficient data.
435 This controller handles MCU disassembly, including deletion of any dummy
436 DCT blocks at the right or bottom edge. When reading a multiscan JPEG
437 file, this controller is responsible for buffering the full image.
438 (Buffering DCT coefficients, rather than samples, is necessary to support
439 progressive JPEG.) The equivalent of one fully interleaved MCU row of
440 subsampled data is processed per call, even when the source JPEG file is
441 noninterleaved.
442
443* Entropy decoding: Read coded data from the data source module and perform
444 Huffman or arithmetic entropy decoding. Works on one MCU per call.
445 For progressive JPEG decoding, the coefficient controller supplies the prior
446 coefficients of each MCU (initially all zeroes), which the entropy decoder
447 modifies in each scan.
448
449* Dequantization and inverse DCT: like it says. Note that the coefficients
450 buffered by the coefficient controller have NOT been dequantized; we
451 merge dequantization and inverse DCT into a single step for speed reasons.
452 When scaled-down output is asked for, simplified DCT algorithms may be used
453 that need fewer coefficients and emit fewer samples per DCT block, not the
454 full 8x8. Works on one DCT block at a time.
455
456* Postprocessing controller: buffer controller for the color quantization
457 input buffer, when quantization is in use. (Without quantization, this
458 controller just calls the upsampler.) For two-pass quantization, this
459 controller is responsible for buffering the full-image data.
460
461* Upsampling: restores chroma components to full size. (May support more
462 general output rescaling, too. Note that if undersized DCT outputs have
463 been emitted by the DCT module, this module must adjust so that properly
464 sized outputs are created.) Works on one row group at a time. This module
465 also calls the color conversion module, so its top level is effectively a
466 buffer controller for the upsampling->color conversion buffer. However, in
467 all but the highest-quality operating modes, upsampling and color
468 conversion are likely to be merged into a single step.
469
470* Colorspace conversion: convert from JPEG color space to output color space,
471 and change data layout from separate component planes to pixel-interleaved.
472 Works on one pixel row at a time.
473
474* Color quantization: reduce the data to colormapped form, using either an
475 externally specified colormap or an internally generated one. This module
476 is not used for full-color output. Works on one pixel row at a time; may
477 require two passes to generate a color map. Note that the output will
478 always be a single component representing colormap indexes. In the current
479 design, the output values are JSAMPLEs, so an 8-bit compilation cannot
480 quantize to more than 256 colors. This is unlikely to be a problem in
481 practice.
482
483* Color reduction: this module handles color precision reduction, e.g.,
484 generating 15-bit color (5 bits/primary) from JPEG's 24-bit output.
485 Not quite clear yet how this should be handled... should we merge it with
486 colorspace conversion???
487
488Note that some high-speed operating modes might condense the entire
489postprocessing sequence to a single module (upsample, color convert, and
490quantize in one step).
491
492In addition to the above objects, the decompression library includes these
493objects:
494
495* Master control: determines the number of passes required, controls overall
496 and per-pass initialization of the other modules. This is subdivided into
497 input and output control: jdinput.c controls only input-side processing,
498 while jdmaster.c handles overall initialization and output-side control.
499
500* Marker reading: decodes JPEG markers (except for RSTn).
501
502* Data source manager: supplies the input JPEG datastream. The source
503 manager supplied with the library knows how to read from a stdio stream
504 or from a memory buffer; for other behaviors, the surrounding application
505 may provide its own source manager.
506
507* Memory manager: same as for compression library.
508
509* Error handler: same as for compression library.
510
511* Progress monitor: same as for compression library.
512
513As with compression, the data source manager, error handler, and progress
514monitor are candidates for replacement by a surrounding application.
515
516
517*** Decompression input and output separation ***
518
519To support efficient incremental display of progressive JPEG files, the
520decompressor is divided into two sections that can run independently:
521
5221. Data input includes marker parsing, entropy decoding, and input into the
523 coefficient controller's DCT coefficient buffer. Note that this
524 processing is relatively cheap and fast.
525
5262. Data output reads from the DCT coefficient buffer and performs the IDCT
527 and all postprocessing steps.
528
529For a progressive JPEG file, the data input processing is allowed to get
530arbitrarily far ahead of the data output processing. (This occurs only
531if the application calls jpeg_consume_input(); otherwise input and output
532run in lockstep, since the input section is called only when the output
533section needs more data.) In this way the application can avoid making
534extra display passes when data is arriving faster than the display pass
535can run. Furthermore, it is possible to abort an output pass without
536losing anything, since the coefficient buffer is read-only as far as the
537output section is concerned. See libjpeg.txt for more detail.
538
539A full-image coefficient array is only created if the JPEG file has multiple
540scans (or if the application specifies buffered-image mode anyway). When
541reading a single-scan file, the coefficient controller normally creates only
542a one-MCU buffer, so input and output processing must run in lockstep in this
543case. jpeg_consume_input() is effectively a no-op in this situation.
544
545The main impact of dividing the decompressor in this fashion is that we must
546be very careful with shared variables in the cinfo data structure. Each
547variable that can change during the course of decompression must be
548classified as belonging to data input or data output, and each section must
549look only at its own variables. For example, the data output section may not
550depend on any of the variables that describe the current scan in the JPEG
551file, because these may change as the data input section advances into a new
552scan.
553
554The progress monitor is (somewhat arbitrarily) defined to treat input of the
555file as one pass when buffered-image mode is not used, and to ignore data
556input work completely when buffered-image mode is used. Note that the
557library has no reliable way to predict the number of passes when dealing
558with a progressive JPEG file, nor can it predict the number of output passes
559in buffered-image mode. So the work estimate is inherently bogus anyway.
560
561No comparable division is currently made in the compression library, because
562there isn't any real need for it.
563
564
565*** Data formats ***
566
567Arrays of pixel sample values use the following data structure:
568
569 typedef something JSAMPLE; a pixel component value, 0..MAXJSAMPLE
570 typedef JSAMPLE *JSAMPROW; ptr to a row of samples
571 typedef JSAMPROW *JSAMPARRAY; ptr to a list of rows
572 typedef JSAMPARRAY *JSAMPIMAGE; ptr to a list of color-component arrays
573
574The basic element type JSAMPLE will typically be one of unsigned char,
575(signed) char, or short. Short will be used if samples wider than 8 bits are
576to be supported (this is a compile-time option). Otherwise, unsigned char is
577used if possible. If the compiler only supports signed chars, then it is
578necessary to mask off the value when reading. Thus, all reads of JSAMPLE
579values must be coded as "GETJSAMPLE(value)", where the macro will be defined
580as "((value) & 0xFF)" on signed-char machines and "((int) (value))" elsewhere.
581
582With these conventions, JSAMPLE values can be assumed to be >= 0. This helps
583simplify correct rounding during downsampling, etc. The JPEG standard's
584specification that sample values run from -128..127 is accommodated by
585subtracting 128 from the sample value in the DCT step. Similarly, during
586decompression the output of the IDCT step will be immediately shifted back to
5870..255. (NB: different values are required when 12-bit samples are in use.
588The code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be
589defined as 255 and 128 respectively in an 8-bit implementation, and as 4095
590and 2048 in a 12-bit implementation.)
591
592We use a pointer per row, rather than a two-dimensional JSAMPLE array. This
593choice costs only a small amount of memory and has several benefits:
594* Code using the data structure doesn't need to know the allocated width of
595 the rows. This simplifies edge expansion/compression, since we can work
596 in an array that's wider than the logical picture width.
597* Indexing doesn't require multiplication; this is a performance win on many
598 machines.
599* Arrays with more than 64K total elements can be supported even on machines
600 where malloc() cannot allocate chunks larger than 64K.
601* The rows forming a component array may be allocated at different times
602 without extra copying. This trick allows some speedups in smoothing steps
603 that need access to the previous and next rows.
604
605Note that each color component is stored in a separate array; we don't use the
606traditional layout in which the components of a pixel are stored together.
607This simplifies coding of modules that work on each component independently,
608because they don't need to know how many components there are. Furthermore,
609we can read or write each component to a temporary file independently, which
610is helpful when dealing with noninterleaved JPEG files.
611
612In general, a specific sample value is accessed by code such as
613 GETJSAMPLE(image[colorcomponent][row][col])
614where col is measured from the image left edge, but row is measured from the
615first sample row currently in memory. Either of the first two indexings can
616be precomputed by copying the relevant pointer.
617
618
619Since most image-processing applications prefer to work on images in which
620the components of a pixel are stored together, the data passed to or from the
621surrounding application uses the traditional convention: a single pixel is
622represented by N consecutive JSAMPLE values, and an image row is an array of
623(# of color components)*(image width) JSAMPLEs. One or more rows of data can
624be represented by a pointer of type JSAMPARRAY in this scheme. This scheme is
625converted to component-wise storage inside the JPEG library. (Applications
626that want to skip JPEG preprocessing or postprocessing will have to contend
627with component-wise storage.)
628
629
630Arrays of DCT-coefficient values use the following data structure:
631
632 typedef short JCOEF; a 16-bit signed integer
633 typedef JCOEF JBLOCK[DCTSIZE2]; an 8x8 block of coefficients
634 typedef JBLOCK *JBLOCKROW; ptr to one horizontal row of 8x8 blocks
635 typedef JBLOCKROW *JBLOCKARRAY; ptr to a list of such rows
636 typedef JBLOCKARRAY *JBLOCKIMAGE; ptr to a list of color component arrays
637
638The underlying type is at least a 16-bit signed integer; while "short" is big
639enough on all machines of interest, on some machines it is preferable to use
640"int" for speed reasons, despite the storage cost. Coefficients are grouped
641into 8x8 blocks (but we always use #defines DCTSIZE and DCTSIZE2 rather than
642"8" and "64").
643
644The contents of a coefficient block may be in either "natural" or zigzagged
645order, and may be true values or divided by the quantization coefficients,
646depending on where the block is in the processing pipeline. In the current
647library, coefficient blocks are kept in natural order everywhere; the entropy
648codecs zigzag or dezigzag the data as it is written or read. The blocks
649contain quantized coefficients everywhere outside the DCT/IDCT subsystems.
650(This latter decision may need to be revisited to support variable
651quantization a la JPEG Part 3.)
652
653Notice that the allocation unit is now a row of 8x8 coefficient blocks,
654corresponding to N rows of samples. Otherwise the structure is much the same
655as for samples, and for the same reasons.
656
657On machines where malloc() can't handle a request bigger than 64Kb, this data
658structure limits us to rows of less than 512 JBLOCKs, or a picture width of
6594000+ pixels. This seems an acceptable restriction.
660
661
662On 80x86 machines, the bottom-level pointer types (JSAMPROW and JBLOCKROW)
663must be declared as "far" pointers, but the upper levels can be "near"
664(implying that the pointer lists are allocated in the DS segment).
665We use a #define symbol FAR, which expands to the "far" keyword when
666compiling on 80x86 machines and to nothing elsewhere.
667
668
669*** Suspendable processing ***
670
671In some applications it is desirable to use the JPEG library as an
672incremental, memory-to-memory filter. In this situation the data source or
673destination may be a limited-size buffer, and we can't rely on being able to
674empty or refill the buffer at arbitrary times. Instead the application would
675like to have control return from the library at buffer overflow/underrun, and
676then resume compression or decompression at a later time.
677
678This scenario is supported for simple cases. (For anything more complex, we
679recommend that the application "bite the bullet" and develop real multitasking
680capability.) The libjpeg.txt file goes into more detail about the usage and
681limitations of this capability; here we address the implications for library
682structure.
683
684The essence of the problem is that the entropy codec (coder or decoder) must
685be prepared to stop at arbitrary times. In turn, the controllers that call
686the entropy codec must be able to stop before having produced or consumed all
687the data that they normally would handle in one call. That part is reasonably
688straightforward: we make the controller call interfaces include "progress
689counters" which indicate the number of data chunks successfully processed, and
690we require callers to test the counter rather than just assume all of the data
691was processed.
692
693Rather than trying to restart at an arbitrary point, the current Huffman
694codecs are designed to restart at the beginning of the current MCU after a
695suspension due to buffer overflow/underrun. At the start of each call, the
696codec's internal state is loaded from permanent storage (in the JPEG object
697structures) into local variables. On successful completion of the MCU, the
698permanent state is updated. (This copying is not very expensive, and may even
699lead to *improved* performance if the local variables can be registerized.)
700If a suspension occurs, the codec simply returns without updating the state,
701thus effectively reverting to the start of the MCU. Note that this implies
702leaving some data unprocessed in the source/destination buffer (ie, the
703compressed partial MCU). The data source/destination module interfaces are
704specified so as to make this possible. This also implies that the data buffer
705must be large enough to hold a worst-case compressed MCU; a couple thousand
706bytes should be enough.
707
708In a successive-approximation AC refinement scan, the progressive Huffman
709decoder has to be able to undo assignments of newly nonzero coefficients if it
710suspends before the MCU is complete, since decoding requires distinguishing
711previously-zero and previously-nonzero coefficients. This is a bit tedious
712but probably won't have much effect on performance. Other variants of Huffman
713decoding need not worry about this, since they will just store the same values
714again if forced to repeat the MCU.
715
716This approach would probably not work for an arithmetic codec, since its
717modifiable state is quite large and couldn't be copied cheaply. Instead it
718would have to suspend and resume exactly at the point of the buffer end.
719
720The JPEG marker reader is designed to cope with suspension at an arbitrary
721point. It does so by backing up to the start of the marker parameter segment,
722so the data buffer must be big enough to hold the largest marker of interest.
723Again, a couple KB should be adequate. (A special "skip" convention is used
724to bypass COM and APPn markers, so these can be larger than the buffer size
725without causing problems; otherwise a 64K buffer would be needed in the worst
726case.)
727
728The JPEG marker writer currently does *not* cope with suspension.
729We feel that this is not necessary; it is much easier simply to require
730the application to ensure there is enough buffer space before starting. (An
731empty 2K buffer is more than sufficient for the header markers; and ensuring
732there are a dozen or two bytes available before calling jpeg_finish_compress()
733will suffice for the trailer.) This would not work for writing multi-scan
734JPEG files, but we simply do not intend to support that capability with
735suspension.
736
737
738*** Memory manager services ***
739
740The JPEG library's memory manager controls allocation and deallocation of
741memory, and it manages large "virtual" data arrays on machines where the
742operating system does not provide virtual memory. Note that the same
743memory manager serves both compression and decompression operations.
744
745In all cases, allocated objects are tied to a particular compression or
746decompression master record, and they will be released when that master
747record is destroyed.
748
749The memory manager does not provide explicit deallocation of objects.
750Instead, objects are created in "pools" of free storage, and a whole pool
751can be freed at once. This approach helps prevent storage-leak bugs, and
752it speeds up operations whenever malloc/free are slow (as they often are).
753The pools can be regarded as lifetime identifiers for objects. Two
754pools/lifetimes are defined:
755 * JPOOL_PERMANENT lasts until master record is destroyed
756 * JPOOL_IMAGE lasts until done with image (JPEG datastream)
757Permanent lifetime is used for parameters and tables that should be carried
758across from one datastream to another; this includes all application-visible
759parameters. Image lifetime is used for everything else. (A third lifetime,
760JPOOL_PASS = one processing pass, was originally planned. However it was
761dropped as not being worthwhile. The actual usage patterns are such that the
762peak memory usage would be about the same anyway; and having per-pass storage
763substantially complicates the virtual memory allocation rules --- see below.)
764
765The memory manager deals with three kinds of object:
7661. "Small" objects. Typically these require no more than 10K-20K total.
7672. "Large" objects. These may require tens to hundreds of K depending on
768 image size. Semantically they behave the same as small objects, but we
769 distinguish them for two reasons:
770 * On MS-DOS machines, large objects are referenced by FAR pointers,
771 small objects by NEAR pointers.
772 * Pool allocation heuristics may differ for large and small objects.
773 Note that individual "large" objects cannot exceed the size allowed by
774 type size_t, which may be 64K or less on some machines.
7753. "Virtual" objects. These are large 2-D arrays of JSAMPLEs or JBLOCKs
776 (typically large enough for the entire image being processed). The
777 memory manager provides stripwise access to these arrays. On machines
778 without virtual memory, the rest of the array may be swapped out to a
779 temporary file.
780
781(Note: JSAMPARRAY and JBLOCKARRAY data structures are a combination of large
782objects for the data proper and small objects for the row pointers. For
783convenience and speed, the memory manager provides single routines to create
784these structures. Similarly, virtual arrays include a small control block
785and a JSAMPARRAY or JBLOCKARRAY working buffer, all created with one call.)
786
787In the present implementation, virtual arrays are only permitted to have image
788lifespan. (Permanent lifespan would not be reasonable, and pass lifespan is
789not very useful since a virtual array's raison d'etre is to store data for
790multiple passes through the image.) We also expect that only "small" objects
791will be given permanent lifespan, though this restriction is not required by
792the memory manager.
793
794In a non-virtual-memory machine, some performance benefit can be gained by
795making the in-memory buffers for virtual arrays be as large as possible.
796(For small images, the buffers might fit entirely in memory, so blind
797swapping would be very wasteful.) The memory manager will adjust the height
798of the buffers to fit within a prespecified maximum memory usage. In order
799to do this in a reasonably optimal fashion, the manager needs to allocate all
800of the virtual arrays at once. Therefore, there isn't a one-step allocation
801routine for virtual arrays; instead, there is a "request" routine that simply
802allocates the control block, and a "realize" routine (called just once) that
803determines space allocation and creates all of the actual buffers. The
804realize routine must allow for space occupied by non-virtual large objects.
805(We don't bother to factor in the space needed for small objects, on the
806grounds that it isn't worth the trouble.)
807
808To support all this, we establish the following protocol for doing business
809with the memory manager:
810 1. Modules must request virtual arrays (which may have only image lifespan)
811 during the initial setup phase, i.e., in their jinit_xxx routines.
812 2. All "large" objects (including JSAMPARRAYs and JBLOCKARRAYs) must also be
813 allocated during initial setup.
814 3. realize_virt_arrays will be called at the completion of initial setup.
815 The above conventions ensure that sufficient information is available
816 for it to choose a good size for virtual array buffers.
817Small objects of any lifespan may be allocated at any time. We expect that
818the total space used for small objects will be small enough to be negligible
819in the realize_virt_arrays computation.
820
821In a virtual-memory machine, we simply pretend that the available space is
822infinite, thus causing realize_virt_arrays to decide that it can allocate all
823the virtual arrays as full-size in-memory buffers. The overhead of the
824virtual-array access protocol is very small when no swapping occurs.
825
826A virtual array can be specified to be "pre-zeroed"; when this flag is set,
827never-yet-written sections of the array are set to zero before being made
828available to the caller. If this flag is not set, never-written sections
829of the array contain garbage. (This feature exists primarily because the
830equivalent logic would otherwise be needed in jdcoefct.c for progressive
831JPEG mode; we may as well make it available for possible other uses.)
832
833The first write pass on a virtual array is required to occur in top-to-bottom
834order; read passes, as well as any write passes after the first one, may
835access the array in any order. This restriction exists partly to simplify
836the virtual array control logic, and partly because some file systems may not
837support seeking beyond the current end-of-file in a temporary file. The main
838implication of this restriction is that rearrangement of rows (such as
839converting top-to-bottom data order to bottom-to-top) must be handled while
840reading data out of the virtual array, not while putting it in.
841
842
843*** Memory manager internal structure ***
844
845To isolate system dependencies as much as possible, we have broken the
846memory manager into two parts. There is a reasonably system-independent
847"front end" (jmemmgr.c) and a "back end" that contains only the code
848likely to change across systems. All of the memory management methods
849outlined above are implemented by the front end. The back end provides
850the following routines for use by the front end (none of these routines
851are known to the rest of the JPEG code):
852
853jpeg_mem_init, jpeg_mem_term system-dependent initialization/shutdown
854
855jpeg_get_small, jpeg_free_small interface to malloc and free library routines
856 (or their equivalents)
857
858jpeg_get_large, jpeg_free_large interface to FAR malloc/free in MSDOS machines;
859 else usually the same as
860 jpeg_get_small/jpeg_free_small
861
862jpeg_mem_available estimate available memory
863
864jpeg_open_backing_store create a backing-store object
865
866read_backing_store, manipulate a backing-store object
867write_backing_store,
868close_backing_store
869
870On some systems there will be more than one type of backing-store object
871(specifically, in MS-DOS a backing store file might be an area of extended
872memory as well as a disk file). jpeg_open_backing_store is responsible for
873choosing how to implement a given object. The read/write/close routines
874are method pointers in the structure that describes a given object; this
875lets them be different for different object types.
876
877It may be necessary to ensure that backing store objects are explicitly
878released upon abnormal program termination. For example, MS-DOS won't free
879extended memory by itself. To support this, we will expect the main program
880or surrounding application to arrange to call self_destruct (typically via
881jpeg_destroy) upon abnormal termination. This may require a SIGINT signal
882handler or equivalent. We don't want to have the back end module install its
883own signal handler, because that would pre-empt the surrounding application's
884ability to control signal handling.
885
886The IJG distribution includes several memory manager back end implementations.
887Usually the same back end should be suitable for all applications on a given
888system, but it is possible for an application to supply its own back end at
889need.
890
891
892*** Implications of DNL marker ***
893
894Some JPEG files may use a DNL marker to postpone definition of the image
895height (this would be useful for a fax-like scanner's output, for instance).
896In these files the SOF marker claims the image height is 0, and you only
897find out the true image height at the end of the first scan.
898
899We could read these files as follows:
9001. Upon seeing zero image height, replace it by 65535 (the maximum allowed).
9012. When the DNL is found, update the image height in the global image
902 descriptor.
903This implies that control modules must avoid making copies of the image
904height, and must re-test for termination after each MCU row. This would
905be easy enough to do.
906
907In cases where image-size data structures are allocated, this approach will
908result in very inefficient use of virtual memory or much-larger-than-necessary
909temporary files. This seems acceptable for something that probably won't be a
910mainstream usage. People might have to forgo use of memory-hogging options
911(such as two-pass color quantization or noninterleaved JPEG files) if they
912want efficient conversion of such files. (One could improve efficiency by
913demanding a user-supplied upper bound for the height, less than 65536; in most
914cases it could be much less.)
915
916The standard also permits the SOF marker to overestimate the image height,
917with a DNL to give the true, smaller height at the end of the first scan.
918This would solve the space problems if the overestimate wasn't too great.
919However, it implies that you don't even know whether DNL will be used.
920
921This leads to a couple of very serious objections:
9221. Testing for a DNL marker must occur in the inner loop of the decompressor's
923 Huffman decoder; this implies a speed penalty whether the feature is used
924 or not.
9252. There is no way to hide the last-minute change in image height from an
926 application using the decoder. Thus *every* application using the IJG
927 library would suffer a complexity penalty whether it cared about DNL or
928 not.
929We currently do not support DNL because of these problems.
930
931A different approach is to insist that DNL-using files be preprocessed by a
932separate program that reads ahead to the DNL, then goes back and fixes the SOF
933marker. This is a much simpler solution and is probably far more efficient.
934Even if one wants piped input, buffering the first scan of the JPEG file needs
935a lot smaller temp file than is implied by the maximum-height method. For
936this approach we'd simply treat DNL as a no-op in the decompressor (at most,
937check that it matches the SOF image height).
938
939We will not worry about making the compressor capable of outputting DNL.
940Something similar to the first scheme above could be applied if anyone ever
941wants to make that work.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.bmp b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.bmp
new file mode 100644
index 0000000..012223e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.bmp
Binary files differ
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.jpg b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.jpg
new file mode 100644
index 0000000..a026e48
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.jpg
Binary files differ
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.ppm b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.ppm
new file mode 100644
index 0000000..bd78ef8
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimg.ppm
@@ -0,0 +1,4 @@
1P6
2227 149
3255
40/-0/-10.21/51.51.62/72.83/83/83/:3-:3-:3-:3-:3-:2/91.91.80-80-91.91.:2/80-80-80-80-80-80-80-80-6.+6.+6.+5-*5-*4,)4,)4,)4,)4,)4,)4,)4,)4,)4,)4,).+$/,%/,%0-&1.'2/(30)30)63,63,74-85.85.96/:70:70A;/B<0D>2F@2IA4JB5KC6KD4MD5MD5MD3NB2OC3OC3PD4QE5T>1Y?2b@4nB5}E6ŒG8šG9¥E7²F9ºF9¿E8ÆF;ÉF>ËF?ÌG@ÌG@íCNíCLíCLíDKíDIïBFñ>Bõ<Aø;Aø9@ö9?ð;@ë>@â?@×?<Ñ=;µ@.µ@.µ@.´?-´?-³@-²?-°?-­@,ªA.¦A-¢B,A*›A)˜@*—A*’?/’?/’?/‘>,‘>,’<+’<+’<+”?+”?+”=*”=*”=*•>+–?+—@,”?:•>7—=4Ÿ?1©B3³D3¼D3¿D4º?/¶@2­E8žH;‡H9mB2T8*D3#:659549547326216005//50-72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-3--5,-4+,4*+4(*7(+=.1E69L<?n@B|HJ‹MN–NO¢VZ¬cl­n s’|£„°}‡¼|‰¾pz­`aTLuRCjSKcOG_MH\TR`fdo|}‚‘™ž˜£©Ÿ¤¨š¡’’{|jhgUXWERO>UPdUPdUPd0/-0/-10.10.40-51.62/72.83/83/83/:3-:3-:3-:3-:3-91.91.80-80-80-80-91.91.80-80-80-80-80-80-80-80-6.+6.+5-*5-*5-*4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*/,%0-&0-&1.'2/(30)41*41*63,63,74-74-85.96/:70:70@:.A;/C=1E?3H@3IA4JB5JC3LC4LC4KB3MA1MA1NB2OC3PD4P>0U?1^A3jC4xD6†D4“D5žB3¨B3°@2¶@4¼B7ÂC:ÄE<ÆF=ÇG>èAKèAIèCIêDHíDGïBDó@D÷>Cø;Aø9@ö9?ð<?é?@à@@Õ@<Î=8µ@.µ@.´?-´?-´?-²?,°?-¯@-­@,©@-¦A-¡A+A*›@+˜@*—A*’?/’?/‘>.‘>.‘>,=+’<+’<+”>-“>*“>*”=*”=*•>+–?,—@-“@8•>5˜>3Ÿ?1«A3µD4½D3ÁC4¼A2¸B6­E8œI;…G:kA3S9*D4$<66;55:4493382271161.61.72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-2.-3--5,-4*+4(*5)+<-0C47I:=h<;vDC†JI’LJST§`h¨k{rŽ‘{¢„°|†»y†½lv«[\ŒQHsQBkOFaOFaNI_RN_[Yfnotƒ‡ˆ”™•™ž—š ”™‘ƒ~ojk[]\JVUCXQaXQaXQa/.,/.,0/-10.40-40-51.51.72.72.72.92,92,92,92,92,91.80-7/,7/,7/,7/,80-91.80-80-80-80-80-80-80-80-6.+5-*5-*5-*4,)4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*1.'1.'2/(30)30)41*41*52+63,63,63,74-85.96/96/:70?9-@:.B<0D>2G?4H@3H@3H@3I@1I@1I@1K?1K?/L@0MA1NB2MA1QA2YB2dC2qC3|C2‰A2“@0™<+ :+©;,¯>0¶@4¼C8¿F=ÀG>à?Eá@FãBGæCFêDFðCEõADù?Dú;@û:?÷:@ñ=@è@@ÜA=Ñ@;É>7³@-³@-³@-²?,²?,²?-¯>,®?,ª?-©@-¥@,¡A+A,˜@*—A*–@)’?/‘>.‘>.‘>.=+=+=+’<+“=,“=,’<+’=)“>*“>*”?+•@,”B7–?5š>3£>2­A4¹C5¿D5ÂC4ÂD6ºF9¯I=›I=‚F;gA4P:,B6&=77=77<66:4493383072/72/62/62/62/52-52-41,41,41,,1-,1-.0-.0-//-//-0/-2.-5//4..5,-4*+4*+9-/>24C79_83l?:|E@ˆIB’NK›Z^œft”n‡Œwž€~¯zƒºs¹dm¤UU‰NEtO?lMBbPEcQHcMH^NK\[[estx…‰ˆ‡Œ†Š†…†Š|xzlghXZ[KVTEZT`ZT`ZT`.-+/.,/.,0/-10.40-40-40-51.61-61-61-81+81+81+81+50-50-4/,4/,4/,4/,50-50-61.61.61.61.61.61.61.61.3.+3.+3.+2-*2-*2-*1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,30+30+30+41,41,52-52-52-52-52-63.74/850850961961>8,?9-@:.B<0E=2E=2F>1F>1G=1G>/F=.I=/I=/J>0L@0L@0JD4NE4TD4^D3hE2sB1~A/‡>-Œ9'”9'9)£<-¬@3³E8·I<ºJ>Ù@CÚACÝCEâDEçCDîACô@Cø>Aü;@û:?÷:>ð=@åA?ÚB=ËA7Ã>5°@,°@,°@,°?-¯>,¯>,®?,¬>-ª?-¦?,£@-Ÿ@,œ@+˜@*–@)”@(‘>.‘>.‘>.=-=-=-<*<*=+=+<*<*=+“=,”>-”>-”B6–?5›?2¦@2²B4½C6ÂB5ÄB5ÄF:½H>­K@˜J@|F:aA4K;.?9+@86@86?75>64:5294183073062/62/62/32.32-21,21,21,-2.-2.-2./1./1.00.00.10.5106005//5,-4+,6,-:01>45W6-b<3qA7}D9„H@ŒRQŽ_i‹iƒs˜|z¬u~·myµ^g¢RQŠMDyM?rN@dPEgQFfLC^GBVNLZ^^fjnquzvx}vz€vwzokoa`bUWYKTUG]V^]V^]V^.-+.-+.-+/.,0/-10.3/,40-3/,4/+4/+4/+4/+6/)6/)6/)4/,4/,3.+3.+3.+3.+4/,4/,50-50-50-50-50-50-50-50-3.+3.+2-*2-*2-*1,)1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,41,41,41,41,41,52-52-52-52-52-63.63.74/850961961<5+=6,?8.@9/B:/C;0C;0C;.D:.D:.D:.G;-H<.I=/J>0K?1GH6KH7PG6XG5aF3jD1uB/|?,‚;)‹:'’;(š=,£B2«G7±K<´M>ÒDBÔDCØDBÝEBâC@ê@@ð>>÷:>û:=ú9<õ;>í?>áB>ÓC:ÅA5º?0¯@-®?,®?,®?,­>+­>+¬>-ª?-¨?,¤?-¢?,ž?+š?*–?+”?*“>)?.?.>->->-Ž=,Ž=,Ž=,Ž=,Ž=,Ž=,Ž=,<,=-‘>.‘>.”B4—A4@1ª@3¶B5ÁC7ÆA8Å@7ÁB;¸G?©KCJ@uE;Y>3C9-78*@86@86?75>64=53:5294173062/43/43/32.23.12-12,12,,2.-2.-2.-2./1./1.00.00.3205105104..2,,4+,7./901P5*Y9,e>/n@1tB7|KGƒYcƒg~p—xx¬s{¹js¶]e¦TT”OG‚LAyPAjPAhMAeJA`GBYHEXKKWMPU^bc`fbcha`f\Z`TWZOUYKWYL`WZ`WZ`WZ,,,,,,---.-+/.,0/-10.3/,2.+2.+3.*3.*3.*3.*3.*3.*3.+3.+2-*1,)1,)2-*3.+3.+3.+3.+3.+3.+3.+3.+3.+3.+2-*2-*2-*2-*1,)1,)1,)0+(3.+3.+3.+3.+3.+3.+3.+3.+41,41,41,41,41,41,41,41,41,52-52-63.74/850850850;4*<5+=6,>7-@7.A8/A9.A9.C9/C9-C9-F:.G;/H<.J>0K?1FI8GH6MH5TG6[F3dC0lA.t?-{<*‚;)Š;*“=,šA1£F5ªJ:­M=ÉE@ËFAÑFAÖE@ÞC?å@>í==ó9<ø:<÷9;ó;=ë?=ÝB=ÌD8¼A2±>,«@,«@,¬?+¬>-¬>-©>,©>,¨>.¥>-¢?, ?,›>,—?+•>*“>)‘?)>->->->-Ž=,Ž=,Ž=,<+Ž=,<+‹<+‹<+‹<+Œ=.>/Ž?0’C2—A2 @2­A5»B9ÃC:Ç@:Å@9»@9³H@¥NGNEoG=R@4?;039-A75A75@64>63<4194083/74/63.43.34/23.13.02-02-02--3/-3/-3/.3/.3/02/02/11/11/32032040/2.-1-,4..5//H4)M5)X8+a<,f>2nGBzYb‚lƒ€uŸ{|´u|Àmu¾bi±[[¡SLLBQAnN?jI=cH>`HB^FCX@BO<?HBGJFLJJQJJQIIQFKQGOUISYMaXSaXSaXS++++++,,,---/.,/.,0/-0/-1-*1-*1-*2-)2-)2-)2-)2-)2-*2-*1,)1,)1,)1,)2-*2-*1,)1,)1,)1,)1,)1,)1,)1,)2-*2-*2-*1,)1,)1,)0+(0+(3.+3.+3.+3.+3.+3.+3.+3.+41,41,41,30+30+30+30+30+41,41,52-63.74/74/850850:3+;4,<5-=6.?6-?6-?6-?6-B8.B8.C9/E9-G;/H<0J>2K?3DG6EF6KE5PD4VC2^C2e@.m>,v=,|;)ƒ:)Š;*“=.›B2¢F7¦I:¿D<ÂF>ÇG>ÏF>ØE>âC?ì@>ó<>õ9:ó9:ï;<å@<×B;ÆD6´A/¨=)©@-©@-©@-¨?,¨?,¨>.§=-¥>-£>, ?.ž?-š?,—>,“>*‘?*>)>->->-Œ=,Œ=,Œ=,‹<-‹<-‹<-‹<-‰<,‰<,Š=-‹=0‹=0Œ>1‘D2–C1¡A3®B6¼C:ÅA<ÇB=ÃB=»EA³PJ¥XPŽZOqSIVI@BD97A6A83@72?61=60<4194083/63.43.43.34.13.13.02-.3-.3--3/-3/-3/.3/.3/.3/02/02/00.11/22021/0/-/.,2.-3/.?0)C1'K3'T8,Z<2dGCw]hƒsˆ­„„À|ƒËszÈkq¿ed°VSšJC‡N>kK<gG;cG=`FB]DBX?AP;?H:BE?HGDMHGQIGQHJRGNVKRZOaYNaYNaYN++++++,,,,,,---/.,0/-0/-/.,1-*1-*1-*2-)2-)2-)2-)1-,0,+0,+/+*/+*0,+0,+1-,/+*/+*/+*/+*/+*/+*/+*/+*1-,1-,1-,0,+0,+/+*/+*/+*1-,1-,1-,1-,1-,1-,1-,1-,3/,3/,3/,3/,3/,3/,3/,3/,40-40-51.62/62/73084184192,:3-;4,<5->5.>5.>5.>5,B8/B8/C9/E8/G:1I<3J=4K?3EC6FB6IC5NB4TA3\@2b>0h=-q<.w9*}8)…7*Œ:,•=/›B2 D5µE9¸F;ÀG<ÈH=ÒH>ßF@èC?ð@@î:9î:9é=;àA;ÑD:¾E4¬A-¢?(¦A-¦A-¥@.¥@.¦?.¥>-¤?-¤>/¢>.Ÿ@.œ?.˜?-•>+‘?*>)>+>->->-Œ=,Œ=.Š=-Š=-Š=-Š</ˆ<.ˆ<.ˆ<.ˆ<.‰=0Š>1‹?2‘D2–C1¢B4®B6¼C;ÄC>ÄC>¾D?»PJ²[T¥e\‘f]s_TYUJFNC>KA@70@72>71=6094.83-63,63.43.34.34.13.13..3-.3-.3--3/-3/-3/.3/.3/.3/.3/02/.0-00.22022000.0/-0/-10.8,,;,)B1*K7.S<4^IHtbn‡z–Š¸‹Ê‚ˆÒy€ÐrwÈik¸XV¡GD‹I<gG<fD<aC>^C@[ABV>DP>EMGQSKWUQ^WU`XS_UR^TT^SV`UaZHaZHaZH,-/,-/------------.-+.-+/.,/.,1-*0,)0,)0,)/+(0+'/+*/+*/+*/+*/+*/+*/+*0,+/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+1-,1-,2.-1-,1-,1-,1-,1-,1-,1-,1-,0,)1-*2.+3/,3/,3/,3/,3/,3/,3/,3/,3/,40-51.62/73081+92,:3-;4.=4/>5.>5.>5.?4.?5,@6-C6.D7.F90G:1H;2F?5H@5J@6N@5R>3W<1\:0a7+k9.t8-|8+…9,;/“=0˜?1›?2¨@3¬B5´D8¾E:ÊG=ÕF>ßD?çB>ë?=íA?çD?ÜE>ÉC8¶C1§B.¡B,¢A.¡@-¢?,¢?,¡=-¡=-¢>. ?.œ<,š=,˜=+•>-“=,=+Ž=*Œ>*‹<+‹<+‹<+‰<,‰<,‰<,‡;-‡;-‰=/†</†</‡=0‡?1ˆ@4‰A5ŠB6‘F3–E4£F7³H>½F@¾C>¾DA»KG·XR¯f]£qfth|rfik^S_SCSHQJBLE=D=5<8/95,74-63,33+43.34.23-13.02--2,,1+,1+-2.-2.-2.-2.-2.-2./1./1.02/02/11/11/11/11/11/11/5*2;/3A32C4/J;6]OOymy‹…Ÿ’‘½”–Ӕ݂‰×tzÈjn¸_b©YZPHmHBdA>]>>X?AVBHVLU^U`bbqnn}xv†|p€ulyoguh_k_T`Ta[Eb\Fc]G,-/,-/,-/,-/---------.-+/.,.-+.-+0,)/+(/+(/+(/+(.*).*).*).*)/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+0,+1-,1-,1-,1-,1-,1-,1-,1-,1-,1-,0,)0,)1-*2.+3/,3/,2.+2.+2.+2.+2.+2.+3/,40-51.62/80-91.:2/;30=4/>50>50=4-?4.?4.?4.B5-C6.E80G:2H;3H>5J=5L=6O>6Q=4V;2Z90_7/h8.p7.y6-‚8-‰9.’;1–<1š>1¢@3¦A5ªB5³E8¾E:ÉF<ÔE=ÜC=âC?ãD@ßF@ÕF>ÄF8±C2£B/›C-ŸB0 A/Ÿ@.ž?-ž?-Ÿ>-ž>.ž>.š=,™=.–=-“=,=+>-Œ=,‹>,Š=+Š=+‰<,‰<,‰<,‡;-‡;-…<-†</…=/…=1ƒ=1„>4†@6‡A7ˆB8‘H7•F7£G:±I@¹HB¹FAºJFµTM²dZªreŸ~op~|mlteYgZJZOPLAKI=EC7@>2=:1:7.44*11)23+23-12,/1,/1,.0+.0+.0-/1./1./1./1./1./1./1./1.02/11/11/11/11/11/11/11/5*:9-9<15?53H?:^VTxszŠˆž‘“º”—Εׄ‹ÓxÆpyºkt¯en¥__yXZsSUjRWjU]j\gmguvr‚v‡€‘‡ƒ•‰}v†yp€sfteXfW_YA`ZBb\D,-/,-/,-/,-/,-/---------.-+.-+.-+-,*/+(.*'.*'.*'.*+.*+.*+.*+-)*-)*-)*-)*/+,/+,/+,/+,/+,/+,/+,/+,.*+.*+/+,/+,/+,0,-0,-0,-0,-0,-0,-1-.1-.1-.1-.1-.0,+0,+1-,2.-2.-2.-2.-1-,1-,1-,1-,1-,2.-3/.40/51080-91.:2/;30=31=31=4/=4/?40?4.?4.A4.C60D7/F91G:2H;5J;6K<7N=6P;6S:5V72[60c60k6.t5,}7/‡9/Ž:0”<0˜<1œ@3ž@4¢@3§A3±C6¼C8ÇD:ÎC<ÖF>ÚG@×HBÍH?¾E:­C3ŸB0™B.B/œA.›@-›>-›>-›>-›>-œ?0˜<-–=-”=,“=.>-Œ=,Š=+Š=+‰<*‰<,‰<,‡;+‡;+…<-„;,ƒ;-„<0‚<0‚<2‚>3ƒ?4…A8†C:‡D;“K<–H; H>­JDµIF´KG´SM¯_V®rg¥qœz{Šwr€ocqbVdWPQCMN@HI;DD8@@4::055+/0(01)01+/0*/0+./*./*//-//-//-//-//-//-//-//-//-//-00.00.00.00.00.00.00.00.6*>6+;8.6;63HE>_^Yyz|Šœ“²’–ÃŽ•Ë„Æ}ˆ¾{‰¸|‹´|Œ°ˆ—yƒq~‡o|‚n}€o‚€yŽ‡ƒ™‹¡”‘¨˜¦”ˆŠƒ–ƒ|{j{iXiW\V<^X>`Z@-.0-.0-.0-.0-.0-.0......---.-+-,*-,*,+).*'.*'.*',*++)*+)*+)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+-+,-+,-+,-+,.,-.,-.,-.,-/-./-./-./+*0,+1-,1-,1-,1-,0,+0,+0,+0,+0,+0,+1-,2.-3/.40/91/:20;31<42=31=31=31=31>3/>3/>3/@3-A4.C60D71E82G83H94I:5L:6M:6N94Q83T50^72e60o6/x8/ƒ90Š:/’;1•=1™?4™?4›?2@1¥A2­C5¸D7ÀD:ÉF<ÌG>ÌIAÄH>¶F:©C4B0—B.˜A.˜A.˜?-—>,™>,™=.™=.™=.•<,”<.“=.=-Ž<.Š=-Š=-ˆ<,ˆ;)ˆ;+‡;+‡;+„;,„;,ƒ;-‚:,;/€<1€<1>5ƒ@7ƒC:…E<†F=’M>•I<œH>¨IC¯LG¯PL¯\Tªj^§€o y˜š‚Žœƒ„–€z‹ym{lam_UYHQUDKO@EI:@D6;=057,13(01)/0*/.).-).-).-+/.,0/-/.,/.,/.,/.,/.,/.,/.,/.,0/-0/-0/-0/-0/-0/-0/-0/-8*A6):3-1961HJ=bfX{€y‰‘“Œ“£–²Œ”¸ƒ³±…™²¤¶ªµ•§§¤£Œ ž‡ž–‚™}˜‰œ‹ˆ£”°š–²›”­—‹£‹…›†’~k|iUfSXT7ZV9^Z=+/2+/2-.0-.0-.0-.0-.0...------.-+-,*-,*,+),+),+),*+,*+,*++)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*++)*+)*+)*,*+-+,-+,.,-.,-/-./-./-./+*0,+0,+0,+0,+0,+/+*.*)/+*/+*/+*/+*0,+1-,3/.40/91/:20;31<42=32=32<20<20=20=2.=2.?1.@2/A4.B5/C60D63C84D95G96G96H94K84N51V72_60h70r7/}:1†<1=2>2˜?7—?5—?5—?3šA3£C5ªD6³E8ºE;¿F=ÀG>»F=°D8¤B5™@0–@/–A-–A-–?,•>+•<,•<,–=-–=/”<.’<-=-Ž<.‹<-‰<,ˆ<,ˆ<,‡;+†:*†:*†:*ƒ:+‚:+‚:,€:.;0€<1€=4?6‚B9ƒD;†G@‡HALA’H?˜HA¤KGªOLªWQªf]¥wh¡Œw˜›€’¥‰Š¤‡„ž…|’}t‚qlte\eRV_LMVCEL<?F6<@27;-68-01)00(.-(/+(/+(/+*2,,3--1-,1-,1-,1-,1-,1-,1-,1-,0/-0/-0/-0/-0/-0/-0/-0/-9*?5)73*-66*GL6_iPx„nˆ“…—–™¢™§†–¥‡›¤ª©šº¯ŸÁ±š¶¨š¶§›·¨˜¸£‘±š‰«’‰«²”’³”•´•­ˆ¢…ƒ›{’xgzdQcMTS5VU7XW9,03,03,03,03./1./1./1///..........-+.-+.-+-,*-,*-+,-+,-+,,*++)**()*()*()+)*+)*+)*+)*+)*+)*+)*+)*,*+,*++)*+)*+)**()*()*(),*+,*+,*+-+,.,-.,-/-./-./+*/+*0,+0,+/+*/+*.*)-)(0,+0,+/+*0,+1-,2.-3/.40/:12:12;23<42=32<21<21;1/=20<1/<1->0-?1.@2/A30A30?61@72@93A96A96B94E74G51O61W6/a6/j8/u9.€</‡=0Š>0•>7•>5“?5’@4•B4™C4ŸC4¥D4ªB5²C8´E:±E;©C7 @4˜?1•?2“A,’?-“=,“=,“<+“<+”<.”<.“;-’</<.;-Š;,‰<,‡;-…<-†:*†:*…9)ƒ:)ƒ:+9+:+9-€<1<3?5A8‚C<…F?†JB‡JEJAG@—HC¡NJ©VRª_Y©pe£„r›•{’¢…‹ªŠ„©ˆ€¡„~–~z‡uszjcqZ]iSR^JHT@BK:>E5:@29<134,22*1.)/+(/*'0**3*+4+,1++1++1++1++1++1++1++0,+1-,1-,1-,1-,1-,1-,1-,/.,;(;5(23+(56$CL-\hDt„`…”wŽ›‰’ž”Ÿšž–¥—•µ¡Æ¤¦Ð¨¥É¯¦Ê°§Ë¯¢Éª—¿‹³ˆ°‹³ŽŽ²Ž²¬Š„¢€€™{wŽrdx]MaHQQ5QQ5RR6,03,03,03,03./1./1./1./1/////////0/-/.,/.,.-+.-+/-..,-.,--+,,*++)*+)**()+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)**()*()*())'()'(+)*+)*,*+-+,.,-.,-/-./-./+*/+*/+*/+*/+*.*)-)(,('0,+0,+0,+0,+1-,2.-40/40/:12;23;23<34=32<21<21;10<1/<1/<1/=/,>0->0-?1.@2/;60;62;83<94=:5=:5?82A60F5.O4-W5+b6+n8,x:-<,„<.’:6‘<5=5Ž@4A4‘B3•B2™@0Ÿ?1¦@4ªB7ªB9¥@6?5—=2•?2‘@-’?-‘>,’<+‘;*‘;,“;-“;-‘;,<.;-‹<-‰;.‡;-„;,„;,…9)…9)…9)‚9*‚9*9+~8,}9,=1€=4€@7B9„E>…HCˆKFŠMHŒIAŽGA˜JF¢SOª\X«h`©{n£Žy—Ž©ˆ…¯‹«ˆ~£„€˜€‹w{nixacr[ZhQP]IIUACL;>D6<?467/44,30+0+(1)'1()3)*5+,2)*2)*2)*2)*2)*0**0**0**1++1++0,+0,+0,+0,+0,+0,+;&57(/4-%46?I$Ue8pT‚’kœ}‘Ÿ†’¡Œ¡ˆ¨‡•¹žÉ“¢Ò”©Ò°¨Ò®¥Ñ­ŸÌ¥‘¾•ƒ°…‚­‚†±„†¯ƒŒ±ˆ‰¬„Ÿ{{”tqˆk_sWJ^CMM1LL0KK/,03,03,03,03./1./1./1./10000000000/-0/-0/-/.,/.,0.//-./-..,--+,,*++)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)**()*())'()'((&'*()+)*,*+,*+-+,.,-/-./-./+*/+*/+*/+*.*)-)(,(',('1-,1-,1-,1-,2.-3/.40/510;23;23<34<34=34<21;10;10<1/<1/;0.=/.=/,>0-?1.?1.96/:729839839:4:94;83>71A2+I2*S2)^4(j6)s8*|:*~;+84:5=4Œ@3‹B3A1@/”>-˜<-Ÿ=0¥@4¦A7¢@7œ>4—=4•=3‘@-?,=+<*‘;*‘;,‘;,’<-‘;.<.;-Š;,ˆ:-‡;-„;,„;,…9)…9)‚9(‚9*9*€8*~8,}9,€>2?5€@7‚C<ƒG?†IDˆMGŠOIŒICHD˜MJ¥UT¬a^­ng«s¤•€–¡ƒŠ¬‰‚°‹|«‡|£„™y‚ql{dgv__nWXeQP\HIRAAG9=@579.66.41,1,)1)'2()3)*4*+2)*2)*2)*2)*2)*2)*2)*0**1++1++1++0,+0,+0,+0,+0,+:&27(+4."47=HRb1l~J€’b‰™rŽ|Ÿ‚ŠŸ~Š§{·€˜Æ…œÎ…œÉ¢šÉŸ™Èž”׉¸Š®€‚°‹¶ˆ‚¬~ˆ¯ƒ‡ª€~œvuml„dZnRG[?IL/GJ-DG*/0*/0*/0*01+01+01+21,21,32-63.63.63.52-50,4/+4/+8.,7/,6.+5-+4,*2-*1++0,-0,-.,/--/-,1,+0*+/)*.()./(0/(//(//(//(//)-.)-.*+/+,-,*-,(.-).-)-.(./)./)--/--/---.../-.0/-2.+3.+2-)4,)5.(7.)8/(;0*;1(<2)<5+=4+>5.>5.>5.=4-<3.<1-=2.<1-<1/;0.=/.>0/>0/?11H-&C1';5)2:++=-(=.-;.45-?-+H()R%(X((Z.+Z8.[A2\G6wC-{B.„C1A3’?1•;0–:/”8+“;-‘>.‘B1‘D0‘D0B.?,<*Ÿ63›83”:2Œ<1…@1B0|A/|A/‚C2„A1ˆ>1‰=0‰;/ˆ:.‡9-‡9-v:/|@5u=0n9)s@/s@/t<+{@0{<-ƒ?4ˆD9‹H?ˆLA„NBQC€RC—HK•TRd]…ue{…lw’sz|€£ƒ‰¦ˆŽ¥‰’¤Œ‘¥Œ‡¤ˆy¢‚kŸ{awhŽea†]\zV[sS]mR[cLVTEPH=J;6G53B,/=&,:#+:#-9#/8".#/-#-,$-,&*+))+-(.1'/2'/4'06&14'14'13'32(32(30(3.)-0,-0,)//'=>0WZErx\‹gœs‹žpŒ¢qŒ§r‹¨r‰ªs³{›¾†£¿Ž ¾Œ›¹‡’²€‹­{†ªz„ª{…ª~„§}…¥€€ž|z“vr‰oi{e[jWLZIKO@CG8>B3/0*01+01+01+12,12,21,32-43.63.74/74/63.61-50,50,7/,7/,6.+6.,5-+2-*1++0,+0,-/-./-0--/-,1+*/)*.()-/(//(//(//(//)-/)-.*+.*+/+*-,*.-).-)/.*./)./)./)..0....../-./.,/.,1-*3.+3.*5.(6/)8/(90);0*<2)=3*>5,>5,>5.>5.>5.=4-<3,=2.=2.<1-;0.;0.;0.=/.>0/?10F/'D0)A3*=4+96-85.83-<1-?-+D*)K)(P*'U.)[4-_:1c?3s@+xA-€A0‰?2‘?4”;3”:1“;19.‹<-Š>.ŠA0‹B1B/ŽA/@/š93—:3’;2‹=1„?0‚@0@/?/„A1†>0‰=0‰;/‡;.„:-‚:,‚:,w9.x<1s9-n9)r?.s>.q9*u:,}=1„@5‰E:‹H?‰K@†MB„PCQC›DJ›QR–d]vfƒ‡p}”w~ ƒ¦…ˆ§ˆŽ§Š’¦‹“¥Œ£‰‚Ÿƒwœ}o˜xa•g\`VƒZU}XWyXWpSPbJKVECI;@A998340-0,+/+,.)--(,*,+)+***,+),-(,/)-2(03(03(02(02(10)1/*1-*1,+3,+32-12./0,)--%9:,TWBox[€‹i‡–o†™l†žnˆ£p†¤p„¥pŠ­w“¶€›¹‡˜¶„“³Œ®{†«xƒ§w‚¨yƒ¨|ƒ¦|„¤{x’uqˆnh{eYjWL[HGK<@D5:>/12,12,12,12,23-23-43.43.54/74/85085085083/72.61-80-80-7/,6.,6.,3.+2,,1-,1-./-.0.1..0--/,+0+*/*).1'//(//(//)-/)-/)-.*+.*+0,+0,+/.*/.*/.*0/*/0*/0*/////////0./0/-1-,1-*2-)4/+70*90+:1*<1+=3*>4+?5,?6-?6-@7.@70?6/>5.=4->3/=2.<1-;0.;0.;0.;0.<1/=20C2*E0+H/+L,-N+/M*.J*/E+.A-,@.*@/(C/(M/'Y0*d1-j30i;+o;-w;0=4‰<4Ž;5Ž94:4‹;2‡=2†>2…@1†A2‰A3ŒB5C6‘=2=1Œ>1Š>0†>/…=.…=.†=.ˆ<.‰;.ˆ:-‡9,„;,€;+~=+z=*}=3z<1v:/u;-x@1x@1v<.v;-?3„B6ŠF=‹H?ŠJA‡KA‡NC†PDDHQQšc^’ug‰„n‘t~}€¥ƒ„©‡ˆª‰©Œ“§Œ‘£‰‹ƒ„˜€”{a›k[•eXaV‰`W…`W]QtVMiPC[E=RA6F9/<2*5-&1+%.)$-(1&*1&*1&*1&*1&*1(-2).1+//*0-+0,+0+,0),1(-1&.1&.14.24.0.*'**"66*PUAmv[~‰i€k~“h™jƒŸn€ n~ m€¥q‡¬xŽ®|‹­zˆªw„©v§t€¦u¦w€¥y¤y€¢}}›yw’sp‡mh{eYkUL[HEG:=?28:-23-23-34.34.34.45/54/54/650961961:72:72:51940940:2/91.91.80-7/-4/,4/,3/.3/.3/01/01/00.1..0--/,,.2).2).2).0*.0*,0*,0*,/+*1-,1-*0/+0/+10+10+10+10+11111100010.10.2.+2.+3.*91.92,;2+<3,>4+@6-@6-A7.A8/A8/B90A8/A81@70>5.?4.=2.=2.<1-;0.;0.<1/=20=20?5,E2.O-.W(0]#/\"0W#/L'.C/.:3-55);5)E1(U.'c+*l*+e;/j;1s=3}<6…;8‰;9Š;7ˆ:6‰>9†?9…B9ƒC9…B9†B9‡A9‰@7†B/†B/‡@.‡@.‡>-ˆ<,‰:+‹9+‹8*‹8*ˆ9*…9)€<)z=(w?(t@(ƒ=3{7,x8,z</v;-w=/{A5{?4€B7„D:‡G=‰I@ˆI@ˆLB‰NF‹PH“OL”YS’f[sb„€g}Œmz˜v{¡|©ƒ«‡†«‰‰«Š‹¦‡Šžƒ†˜~„”zm˜mi”iegdefŒgc†e]~_Zw[PhPI_J@Q?8D60:/-5**/(),%7$(7$(5%(4%(1&*1(+/+,.,-*+-(,-'--%-/%-/$./$./$./1(+1+-0+(.+$88,PUAiqYvƒe{Œhyf{–iœn}Ÿmyžkz m¥r‚§s€¥q}¤o}£p}¥s~¦t~¥v}¤w|¡x}Ÿzz™wuqn‡jg{bWkRK]GGE9?=1:8,45/45/45/560560560761761872:72;83<94<94=84<73<73<41<41;30;3083072/61.61.5106216213122011/00.//-.4+.4+.4+.4+.2,.2,,2,,2,,3/,3/,3/,10,21,21,32-32-22222032032032.51.61-61-;4.<5-=4-@6-A7.B8/E8/E8/C:1C:1E;2D:1C90B71@5/@5/>3/>3/=2.=2.=20=20>31>31>7/C41O/2Y*2_%3`#2Y%1N+1B3077-39+68*?5)N1)]-)e+)c;3h<3r=7z=:‚<<†<=‡;;…;:‚;9>8€A:C;‚C<ƒB<…@9„?8E/D/C.ƒ@-†=,‰<,‹9+Œ9+Œ6)Š7)†9)‚;)~=)w?(sA(qB(…6/|/'8/ƒ?4w5)s5*}A6}C7E9G<ƒI>„J?…K@‡LDŠOGŒSJycL~hSoYu]}bˆi„•u‚ |¥~|©€~¬…­†€ª„¥€|ž}{˜yn}ŽlyŒlwŒkwŒmt‰joƒgl~dbqZ[hTSZHIK=B@4=6,8/&5+":&(8%'6&'2&&0(&-)(++)).*'+*&,*&,*'+*'+,)*,**,**,-#$2*(50,85,BC5UZFfpWn}^tˆcqŠbt‘ex˜iw›ks™hs›iwŸmz¢mx lwŸkv¡ly£q{¥u{¥w|£wxžuzœww–tqŽom†hd{_WkPJ^CFB9>:195,560560671671782782872872983<94=:5>;6>;6?:6>95>95?74?74>63=52;62:5294194184184195484373243132021/6-.6-.6-.6-.6-.4..4/,4/,40-40-40-52-32-32-43.43.431431542540841850940:5/=60?6/@7.B8/C9/F90G:1H;2F<3F<3F<3F<3E;2C90B71A60@5/@51>50=4/=4/>42?53?53=82A64I35Q16V.6U-5R/5J22A62::08<.9;-?9)H6*P4)U3)]2+c4.k62t76}77‚89ƒ7978}75{:6|=8{?7@9ƒ@:…@;†?;|E0}D0€C0‚A/…=.‡;-‰:-ˆ9,‡8+…9+‚:+<+{>+x?+uA+tB+‹2,‹2,¡LE§XQŠA8|90‚F;€J>yH:zJ<{M@|NA~NB‚PE‡UJYN_uNgwRtzX€{^Š|b“i›s›—|™zˆ |ƒ¨¬ƒ|¬‚x¨~t£yq vŠpˆo†nƒŽp€p}px‹ms‡kk~bgu\_iQWZGPM<H@3B6*>0%:,+7,*5+)1,(-,'+.').((/().(+-*,,*/+*3)*6',7&,9&,2)$<3,E>4JF:QR@]bLgqVizXmƒ]j…\j‰]p‘bq•eo•do—eršhu krhq›itžlx¢rz¤vy¢vyŸvvštw™tu”rokj…fc|^UlOJ^BHA9@91;4,671782782782893893983:94:94=:5>;6?<7?<7@;7@;7@;7B:7B:7A96@85=84=84<73<73<74<74<74;74:6395284173080.80.80.80.80.80.61.61.61-52-52-52-63.63.54/54/540540651952:72=84=82@93?80A8/C90D:0E;1H;2I=1I=1H>4H>4H>4G=4F<3D:1B8/A60B71@70@72?61?61@72@72A83=84@85B86D97E:8G96G96E:4C90B90B:/B:-D;,F:*H;*H;*].&b0)n3/x73ƒ98‰;;Š<<‰>;‹A>†A<?6}=4~;3‚;5ˆ=8Œ>:~C3€B3€A2ƒ?2ƒ=1„<0ƒ;/;/;.|=.{=.|>/|>/|>/}>/}>/—.*£;8ÎkfÙ~y­ZTŒC<ˆLAN@tJ:qM=pQ?qR@tSB{VD‚[J‰_OUOe€Uz~[‘y_¥ra³of»rk»xo¶…vªz ›~•£€Œ¦ƒ¦~}¢yyŸvŒr‹rˆ‘r„“r€•t|–sv”ps’pl‹ig„eby\\lQU_GMP;ED0A<)>3-<3,92*41(01).1(+1'+0)/0*2/*6,*:*+@'+D%+G$+H#+A7+LC4WP@[XE`bLgmQiwVj{Wl‚[g‚Wf†WjŽ^n”an”an–bršfržko›hnšiqœnw¡sy¢vxžuu›ts—su—ts’pn‹li„cb{[TmMH`@MD=E<5@707827828938938939:4:94:94;:5>;6?<7@=8@=8A<8A<8A<8A<8A<8A<8@;7?:6>95>95=84>95>95>95>95=84<73:51940:0.:0.:0.91.91.91.91.72.61-61-63.63.63.74/74/74/540651961;83<94?:4@;5B;3A8/B90C9/E;1H<0I=1J>2K=2K>5K>5J=4J=4F<3E;2C90B8/B92B92A81@72@72@93A:4A:4?74>95=<7>?7?@8@@6D@5J=4J70N5.Q6-Q6+O8*M:+I<)H=)l3(r6,~;3‰@:•DA›HDŸJGŸLH QJ—MDD;„;2‚8-…7-Œ91;4…?7…?7†=6…<5ƒ=5€=4|>3y?3vA3uA3uA3y?3}=3ƒ:3‡83Š73Ÿ%$´<;í{zþ•’Åhc–G@‰K@wI:mN<gR=dU>fW@jX@r\E}aL„eQj{O{{U™w\´l`Ì^_ÚR\áM[àO^êmuÜxxÎ…~¿€²–€§—}ž•x˜“u•Žr”r‘‘u”u‡–u—s{–sx–rq‘lp‹hiadtW]gLVX@LJ3GB.L40H3.D3,?2*:1(70&40'40'81):/+?-+C++H(+M%-O$-Q#-PE1[P:d^FgfJilOnuTm{Wl~Vk„Zg„Vg‡Vm]p•ap—br™dvhrœlo™km—ip™mwtyŸxw›wt–us•tu”tsqoŠki„cb{[TmMGa>SJCKB;F=69:49:49:49:49:4:;5=<7=<7=<7?<7@=8@=8A>9C>:D?;D?;E@<E@<E@<D?;D?9C>8C>8D=7B;5B;5B;5B;5B;5B;5A:4A:4A83A83A83@72@72>71>71>71<71<71;60:5/85085074/74/761961961:72<71=82A:2B;1C:1E;1F<2J>2K?3L@2N@3N@3M@7M@7L?6K>5I<3F<2E;2E;2B90A81A81?80?80?82@93@93<5/LE?IB:E<5OB:K:2J3+\>6Z5-`5.`4+^/'\0%b8,g@1gB2‹I;G;–I?žLAŸF>›>7š=6žD;¥ND£QE¨VH«YK£PBš@5˜:0ž=4’9;9:Œ67†54„96ƒ@:{@8o?3oC6lB4m?2u:274Œ35’-3–(1ÏEEèbaÅEDÍWUáyv«VO†F<‚WGlS=f\CedFgfHgbEm_DyeL†nVŽdK­p]ÍphÞW]å8Kð(Dü&Hþ+Lþ<WðG\éXeånrà|zÙ}Ö†؉‚¸„wµ…w³ˆx®‹x¨x£ŽyŸy›‘xŽ‡mŽƒm~i‰taƒgY{YMtLBpE<r;>d02b22\31L)'D'#I2,J70F5.E2,E0+H0.I-,I)*O+-V24VK/`W:f_BgdEkoLu}Xu„]oWj„WlˆXnŽ]q“`s•bu˜bušdv›eq–ks˜ms˜oq•os•rw™xz™zy–zx•yqŽrm‡jj„ghƒdazZTnKIc@TKBSJAPG>9:49:49:49:4:;5;<6>=8?>9>=8@=8A>9A>9B?:D?;D?;D?;FA;E@:E@:E@:D?9D?9E>8E>8E>8E>6E>6D=5C<4D;4D;4C:3B92B92B92B92A81A81@91@93>71<71;60;60:5/85.74-74-96196/96/;60<8/>:1A:0C:1C;0E;1G=1J>0L@2M?2NA1NA1N@5N@5M?6J=4I<3H;2E;1E;2C:1B90A81@91@91@91?;2?;2C:3G81I0,V..j68u99{;;†ECƒD?„H@…I?†G>ŽJA›NH£PL¥MK’E3”C2šB4 B6 >36-7+¡<0£C5›@.™@. E3¦F6©E5¯H9¸N@´KR¯GN¥@F™9=‘8:Š?<€A:r@5k?2uK=€NC@:‚,-“(0µ8FÒK\àJIáMMÌ>=Ã>?Ò_\µXQ„@5€UDvbJa]@Z_?ekIonOshJ{fK†kPÌ]VÚ][êSZó<Nü'EÿDÿHÿ!Kÿ(Nÿ.Nù9RöF[òM^ëO]êO]ëS`ÝakÛclÚgnØkpÓnrÑstÎvuËwwÌ{zÌwzËuxËotÊirËcnÊ^kÊ\iÆ`n´Ra¦JWšGQDK„FIk79FS2-L0,F2+I6/J91I;2M>7SD=]P.dY9ga?ifCnrMz‚[z‰bt†^r‰]oŠ]oŒ^qŽ^u’bw•cw•cw•cr’mw—rz˜vy–w~˜}ƒ„…‡ƒ›…™ƒz’|q‰ql„jhc`yYTnKJdAWQEVPDUOC8938938939:4;<6<=7?>9@?:@?:B?:C@;C@;C@;D?;D?;D?;FA;FA;FA;E@:E@:G@:G@8F?7IB:HA9H?8G>5F=4E<3E<3D;2D:1D:1D:1C:1D;2D;4D;4C<4?80?80<71;60:5/:5/94.94.96/96/96/;7.<8/@9/A:0C;0E;1F<0I=/K?1M@0M@0NA1M@0N@5M?4L>3K=2I<3H;2E;1D:0C:1C:1A:0A:2?;2@<3@<3A=4SE<P40g35AG°JWÇS`Ï[fÇ^c›B>–I?•MA›OB¬RJÃSRÏNSÒENœE2B0 @0¥?1¦:-¥7*¦8+§=/¬E4¡>+˜7$:%¥>+®@/³B2¹C5§/8±9B¹DL¾KR¸NRªLL“B>}:1u;/q9,s5*2-›47º<GØEWéLaåFCÒ41Ò:9À21ÉMKÈb]”J?‹\JzdLebCbfEpqOysS~iL‹iNœrZûW`úNZû@Qþ3Iÿ-Hÿ-Nÿ*Mÿ&Hÿ-Mÿ,Ký.Jü2Lù1Kù.Kû.Lþ1Oø=Z÷?[öB]ôFaòJcñMfïQhíSkêPhéOiéLgêKiîKjôLoùOsüQuþh…ô_|æZtÖUkÎYlÊdr¨R[r-0]''X1,T<2N@5?<-7:)<C1GP=[N,aW4e_=heBstR†d~ŒhwˆdxŒgsŒer‹cr‹ctcwfz‘gz‘e~•x„›ˆŸ… Š‘¤—¨–˜©™–§—‘¢’‡˜†zyn„mg~b^wYTmMKfCXUFXUFYVG7827828939:4;<6=>8@?:A@;BA<DA<DA<DA<DA<E@<E@<E@<GB<GB<GB<FA;FA;HA9HA9HA9LC:KB9JA8I@7H>4G=3F<2E;1D:0D:0E;1E;1D;2E<3E<3E<3@91?80?80<71;60:5/:5/:5/96/96-;7.;7.=9.@9/C;0D<1F<0F=.J>0L?/M@0M@0O?/O?/O>4O>4N=3K=2J<1G:1G:1D:0D;2D;2B;1B;1@<3A=4A>5A>5Q9/X+&‰:?ÅP`ãOeñOfíPcÐGO¢20”:/Ž?.–C3®F=ËFGÞ>Hã2B§H6§F5©B3®@3°?1²>1³B4´D6²G5«B/£<)¤;&©<(­:(¯5&®3$¸7<»8>½7>½6=¿<BÅJMÄTS»ZT—@7ˆ6+….%œ62ÃHKÞNXå@Qà0Eß:4Ð-(Õ74Ê64ÈD@É\U©WKXFtX@rgIysS|qQhJdK©oYÂ~kÿGVÿAPú9Jû8Iÿ=Nÿ@Qþ:Nö5Hÿ@Sû:Mú4Ký3Kÿ0Jÿ-Iÿ-Lÿ1Sÿ1Tÿ1Tÿ3Wÿ3Wÿ6Zÿ9\ý;^ü<aþ@fü=fû<eû<gý<iÿ?mÿBpÿEsÿLuÿNuÿRvøPqëRnè`xÙdv·Wb|15h0/U3*L:,BA/:C.5G/5L2VH+_T6i`CokN||`ˆŽr‡‘v}‹qzq|s|szozŠm}Œmƒ’s‰–x•£Œœ©•£®¦±¡ª´©±¸°°·°­´­¡«¢” ”ƒ‘‚s„qh|c]tWSlLLgDVWEWXFYZH671671782893:;5<=7?>9@?:BA<DA<DA<DA<DA<FA=FA=FA=FC<GB<GB<HC=HC=JC;JC;JC9LC:KB9KA7J@6H>4G=1H<0G;/E;/E;/E;/E;1E;1D<1D;2D;2@9/@91@91?82<71;60;60:5/;7.;7.;7.<8-?8.A;/C;0D</G=1I=/K?/M@0M@/P@0O?/O?/O>4N=3N=3J<1I;0G;/F90D:0D<1D;2B;1@<1A=2A>5B?6C@7_4-t42¯KSâYiðH_ð:Qá2C½#+¬/)š9(;&•=)¬@3ÈA=Ý:?ä0;¨D4¨B3«?2®>2´?5¹C7½G;»J<¬>/ª?-¨=+¨:)ª9'²:*¹;-¼</ËEBÏCBÒ=?Ñ6:Ö7<àAFâLNÜRPÁD>ÃLDËTLÑTNÙKJÝ>Cã3>è.<Ù5+Û7.Ò0+Ò94Á82µ@9µ[P”UDxO9~dI„lPbF]F®eTÍqdÛsjü<Iô9Dì8Aç<DæCHäHKäJLåIMðLSïDMð:Iö5Hû1Gÿ-Fÿ0Jÿ5Pÿ7Vÿ7Xÿ7Xÿ8Zÿ:[ÿ<_ÿ>bÿ?eÿAiÿBkÿBmÿAmÿ@oÿ@oÿ@qÿAqÿBnÿ=hÿEmÿJpöGhíMièZrÛbs½YcŒ@D]($M-"PC2PR=CO76H.WH1eYCujT€{gŽy˜œ‹”Œ‡”ƒ~‰—ˆŽœŒ™ˆ‡’‚Š“‚—žŽ¤¨—²¶§¸¼®¿Á¶ÀÁ¹ÂþÅÅÃÃÃþ¾¾²´³¢©¢—Žy‡vh{e\sWTmONiHTYBUZCW\E560560671782893:;5=<7>=8@?:B?:C@;DA<EB=FA=GB>GB>GD=GD=HC=ID>IE<KD<KD<MD;LC:KC8LB8KA5L@4K?3J>0I=/G>/G>/F<0F<0E;/E;1D<1C:1B90A:2@91@91?82<71;60;60;7.;7.;7,<8-?8.A;/D</F<0H?0J>0K?/M@0NA0P@0O?/O@-P>2N>1M<2L;1I;0H:/F90C9/C;0B<0B;1@<1A=2A?3B@4C@7t50–FEÆY_ßUbã@Qä5FÚ0;À*+¯1%Ÿ9#•;!”: ¡=&·=.Æ90Ê2- :,¢:-¥9-¨6,°91¸A9»E;·E:­?2«@0§<,¤6'ª6)·=0ÄD9ÊG=¾9*Î@4áD=ïA@ö<?ø7<ï05á-.Þ63âH@èTJåNEÜ=7Ü0.å.0ñ27Ö3$Þ</Í,"Ñ7/Á2,±6/Ég\¶m^ŒXC„\CW?‰R=©\LÑjaãfbáUTúAIñ>Dâ<@×?>ÎC>ÍJB×RMåZWéPRìELï;Gõ6F÷2Dø/Bû1Gÿ6Lø:Tø:Tø:Tû:Wþ=\ÿ?aÿBeÿDiû<eû>hú?júAm÷@nõ?oò>mï=mÿFnÿ:aÿ>dÿInÿJløMmòSoæXnëp‚Å_j˜ILt:6\6-O9+OD2SN:`PArdWˆ|p”Ž‚Ÿœ“¦§¡¡¦ ”˜”Ÿ›¨¤¦¯¬¦¬ª¤¦¥§§¥µ´°ÄÀ½ÍÉÀÒÍÇÕÐÌ×ÏÍÖÍÐ×ÎÓÑÊÑËÆÌ¿½À°²±˜Ÿ˜€Œ€m~k^u[VoQSlNU_DV`EWaF560560560560671893:94;:5=<7@=8A>9C@;DA<GB>HC?HC?GD=HE>ID>ID>JF=LE=MF<NE<ME:MC9MC7OC7NB6MA3MA3N@3JA2JA2I@1H>2G=1F<0D<1D<1C:1B;1A:2@91?82?82<71<71<8/<8-<8->7-@:.B:/D</F<0H?0K?/M@0NA0NA0P@0O@-O@-O=1O=1M=0L;1I;0G9.E9-C9/B:/A;/A:0?;0?=1@>2B@4@@4+)¨JKÁSV¾=BÀ/6Ç.3Ä./»0)ª1 £9!›=!–=˜= ¡=#¥;#¦6"6- 8/¢5.¦3,®71·@:¹B<²@6±B7­A5¨</¦8+¯:0½B:ÄC=Ä@;Â@(Í?+Ù5)ä)$ñ #ÿ")ÿ'/ÿ-2ò((é.)ã2*ß4*à4*ä1*é0+î.+Õ6#×5&Ò2$Ð6,Æ6.½>7È`UÑq¤eSŽWC‡N:¡XGÊe[ãa_ëPTëBIùDKí@DÞ@?ÑB<ÅB8ÁB9ÌIAßPLìKPô@Kù9Hý7Hþ5Hø3Eö7G÷=K÷9R÷9Rø7Rú7Uý7Xÿ9]ÿ<aÿ=gÿ@kÿ@nÿBqÿDtÿCuûCuùCv÷BuÿFgúAaþEeÿJlÿJkÿUtÿ^zö\vôi~éo~Önw¯]a„CAh6/hB7vTHwf_Œ}v£–¬¤¡²®­¶¶¸²µºª¯µ°·¿¶½Å½ÁÊÂÂÌÃÂÊËÅÏÕÎÖßÕÞäÙÕèÝÛéÝÝæÚÞåØßä×àáÔÞÙÏØËÄË»¹¼¤¦£ˆ’‡t‚qexb[tWXqS\iK\iK[hJ560560560560560671872983<;6?<7@=8B?:DA<GB>HC?ID@HE>HE>ID>JE?JF=MF>MF<OF=NF;OE;ND8PD8PD6PD6QC6QC6OC5MD5KB3JA2H>2G=1E=2D<1C:1C:1A:2A:2@93?82<71<71<8-<8-<8-?8.@:.B:/D</F<0I@1K?/M@0NA0P@0PA.O@-O@-O=1O=1M=0L;1H:/G9.E9-C9/A9.@:.@9/?;0?=1@>2??3@@4”67Á]_ÈZ[¯78®,,µ/,±,#°0#¯8$®B(©G* G'šF$šF$–C!”? Ÿ81£;2¦92¨50°:6¹B>¹D=±>7«<3¨<2¦</«<1¸F<ÆKDÄE>»72»:Ê<$á:*ñ.(ÿ$&ÿ'ÿ'ÿ%ÿ%(ù,)ñ2*ë5*è3(è2'ê/&ì-%Ü=(Ñ2Þ>0Ñ5)Ê7/Â?7¯C9Çqd²m]–YF™VE¿i\ÝlfãSSë@Hù?Lï<Bä:=×<:Í@9Á>4¹6,½4.Î44ïBHø8Gÿ2Fÿ3Hÿ5Iú7Gö<JöBNÿ>Yÿ=Xÿ:Wÿ6Wÿ5Yÿ5\ÿ6_ÿ7eÿ;kÿ:mÿ;oÿ<rÿ<rþ=tû>tû>vôEbýNkÿTqúIfð?\ÿRqÿfƒÿf€ô^wêbváky×s{Ärvªfe”ZV‰TN’€~¨™–¾°°Ä»¼ÆÁÅÈÇÍÅÈÑÀÄÏÆÌØÈËÚËÍÜÓÐáÚÖåäÜëêßïîáòòäãõççöçêóâèñàêïßêìÜéå×äÓÉÒþĪ¬©—y‡vi|f`w[\uWbqRapQ`oP201312423653875984984983;:5<<4==5??5AA7CC9EE9EE9HH@HH>HH<HI9KJ6LK6MM5MM5LK7IG8EE;HGELIPKIWFCVA=TQF4NC1JA0KB1MD5LB6F>3B90E<5C:5@85?74@86?67>56:44F85E76B87@78>:;<:=<<>==????A@<DA:HB6JA2M@-P?+O?(CB0F?/K:2O62Q35Q28N5;F:<??=-=3)A1.J4/G-,?#5B&GP3Ô`S»J<§7)¢7'£:'ž9%ž;&£@)Ÿ;$£='¬?+¯?+²:)±6&³4%´2$Ÿ8'Ÿ8'Ÿ:(£>,§B0©D2©D0©B/¨?,«>*­<*µ=-¾C4ÅF7À>0·3&Í6+Ì8,Ì:-Ì=/Ï=.Ô</Ý90æ5/ï/,õ--ø.,ó0,ë4,à9)Ø=)Ó>(Þ9%Ô4Ï4 Î9%Å8&¾6&Æ@4ÕQEÒIAÜMIïUUüVXýJPø9Aü4?ÿ9DäCHßCFÓAAÆ?;¹=3®=/ª?/ª@0¿Q@ÉQCÑLCØC=å??÷@Eÿ>Gÿ8CúGMúENûEQþESüARú=Sü>XÿCbÿGiÿBhù<fô;gô=køDsûIyýK}ÿMyýNwóRtçTqÝQkáQlø[xÿdˆÿY…ÿ?lÿMxöX{ÍYp¿yƒca„}sª½§™ÑŹÚ×ÎÛÝÚÙÜáÞÜéåÙíëÔîôÓðùÔóýÙóüßóøæòõìñóïðøõðøõð÷òïôîîðêêíäçèßäæÝâÖÐÔÍÉÊ»¹º¤¤¢Š|zt|qpzo~…sy€nv}k0./1/0320542653762873872:94;;3==5??5AA7CC9DD8EE9HH@HH>HH<JH9KJ6LK6MM5NM8KJ6KI<KJEQORWU`ZWhVTjQNiSI@ND;H?6F=6G>7H?8F=6C:5C<6A:4?74?74@85>95=84;63>3/=4/>42<74=98<;9=<:>=;@?;C@9G@6J@4L@0O@-P?+P>(=B,?A,E=0H92K63J46F35A57>=;8=69?5?A4C=-J9)^B4sRC¼K=¬;- 2#¡6&£:'8$ž9%£?(¡;%¦=(­@,³@-¶=,·9*¸6(¹5(¦;+¤:*£9)¥;+¦?.©B/«B/«@.­?.«:(±<+¿E6ÆH9Á?1¼8+½7+Ï5+Ï7,Î:.Ï;/Ó=/×;/ß8/ç4/ð0-õ--÷-+ò/+ê4)ß8(Ö;'Ï=&á:'Ù7"×8%Ô=*Ì;*Á5&Ã;/ÍG<ÐG?ÙJFèPOóPQôGKò;@÷:Aÿ?GàDGÜDCÓB?Å>8·;1¬;-ª<-©>.µF5ÅM?ÓNEÜGCã?@ñ>Bý>Fÿ>H÷DJ÷CLúDPÿFTýBSú=Sü>XÿBaÿFhÿCiü?iù@lùBpûGvüJzþL|ÿIxÿHtõKpðRsò]zö`{ùXwýMqÿCkÿAlóCjÝJgÉ^p®pugNI†‚v´”‡Ì²¥äÔÇëäÜèéäéêîéçòíáõöâûýàüÿâýÿçþÿìÿÿòþÿ÷üþúûþûöýúõü÷ôúôôøïðôëîñèëïæëäÞâÜÖØÊÆŲ²°ž ›Ž“Œˆ…ˆ…–†‰€†}/.,0/-10.21/43/540762761:94::2<<4>>4@@6BB8CC9DD8IF=IG;JH;KJ8MJ7NL7NL7OL9KI:NKBTSQ_^dihxmm…lkŠihˆcYd[QZQGPJ@IH>FG>CC=A@:<A;;?:7<73<73=82>:1>:1=90:3-94.;60=82=:3>;4?<5?<3C?4F@4I?3L@2O?0P?-Q>-P>*3@&7?'<=+A;-B8/A62>42;31=85B:7H94O2.[+)o-.Š:= EJª9+¢2$Ÿ1"¤9'¥<)ž7$8$¢<&¤;&¨=)±A-¶A/¹>.»<-¾:-À:.®>0¬<.©9+¨:+ª<+¬>-­>-¬=,²?-®9(¸>/ÊL=ÊH:¼6*º2&Å;0Ó5*Ô6+Ò8,Ô:.×;/Û9.â7/é2,ñ/-õ.+õ.+ñ0)ç2'Ý6&Ó8$Ì:#à7$Ü5#Û8'Û>-Ó=.Æ7)Å8.ËA7Ç<5Ì?8ÙEAåKIìIJëCCí?Að@CÜDC×C?ÏB;Â=4¶:.­9*ª;*«<+ª9)¿E8ÔNEÝIEâ?@ë<AùAIÿFPôAGô@IùCOýGTþEUû@Uü>Xÿ@_ÿDfÿCiþDmÿFpÿIwÿK{ÿL|ýK{ÿCvÿGwÿJtúNtþZ|ÿa€ýUvòCdüHkÿRvÞ=\ÎH`Úz†µ}~\F;„r³‹Õ³§óÛÑúíåøóðøøú÷ôýôëüüêÿÿéÿÿëÿÿíÿÿòÿÿ÷ÿÿûÿÿýþÿþúÿýùÿûøÿøöþõöýòöûðôúïóðçêåßáÓÏξ½¹­®¨¢¥œ£™£—¤ªœŸ¥—œ¢”/.,/.,0/-10,21-32.54/650872991;;3==3??5AA7BB8CC9IE<JF;KG;OI9PK8QL8QL8OL;LJ=SPK^]bmlzzz’£€‚©~«|u–rkŒe^}YSoRMdMEZG@PB<HD?F@;?<87;62;7.<8-=9-<8,880991;;1><0?=1@<0?<-A;+F?/H?.K?/M@/O?/P?/Q>/P=.<@)=?*?>,?<-?;0=:3;:5:94<94D95N43[*-o&--8¨3C¶7H§7)¥7&§9(ª?-¨?, 9&Ÿ9#¤;&¥:&«<)³>,¹@/½>/Â<0Å=/Ç=0¹@5¶=2²:,®8*¯9+°:,²:,²:*¶;,¹;-ÄB4ËE9Ç?3¾1'À2(Ê:1Ú3+Ø4*Ù7,Ú8-Ü8.ß7,æ3,ì1,ó0,õ.+õ.)ï0(æ1&Ú4$Ñ6 Ê8Ü/Ú0Ú4$Ý;,Ø</Ð9.Ï<2ÒC;Ã6/Ä70Ê;5ÖE@âMIåLGÞC?Ù;8ÑA9Ï@8Ç>4¾</µ:+°8*®:+°<-¬4&½?3ÏHBÙHEßABæ@DôELÿLUð?Eð?GöBKþHUþHWüBWû?Wý@\ÿBbÿCfÿFmÿIsÿMyÿO|ÿL{þJyÿ@tÿL~ÿQ}ÿJrúLoÿUwÿUuùLjòEcïKfÒ>Vßetû §Í‘]=2aP@©wlÑ¥œöÔËþêãÿôòÿþÿÿüÿùóÿüïÿÿïÿÿðÿÿòÿÿôÿÿ÷þÿûýÿüûÿýùÿüøÿúøÿù÷ÿö÷ÿôøÿôøþó÷öëïìãäÚÔÔÉź¹´³´¬±´©²µª¶¾³°¸­¬´©10,10,0/+0/+10,21,43.54/77/880991;;1==3??5AA7BB8KD:LF:OG:QJ:RK9SL9RM:QK=OKBVTUfdowx††¨»“ÃŽ‘ÆŠÀ‡‚¸{w©rlœid_[~UPnNJaJGXEBM?=B;7696196-86*86)581692891;;/><-?<+C<)D<'I>*J?+L?,M@/M@0M?2M?4L>3M?4K?3F<2B90=909:25<44>57<5>:1H3.\0/{48œ;D¯9E²2Aª<+ª<+«@.¬A/©@-¥<'¥<'©>*§8%­:'µ<+¼=.Á;/Å;.Ê<0Ì<1ÁA6¾>3º:/·7,·7,¸8+¸8+º8+»7+ÇA5ÍC8Å8.Á1&Æ3)Ë7-Í6-à2+ß3)á5+â6,ã5,ç4-ê2*ð/*ö/,ø.*ô/)ì0'ã1#Ù4!Î6É7Ú/Ù/Ù2"Ù5)Ù9-Ô:0Ö?6ØE=ÕF>Í@9Ç<5Ë@9ÖKDÙNGÐF<Å;1Å=1Ä<0À</º;,·9*´:+µ=-¹?2µ9-½=4É@:ÒC?ÛBDãDHîIOöOVí>Cí>EóBJûJTÿJYýFXúCYýB]ù@_ûBdþFjÿJsÿOxÿOzÿLyýIxÿGwÿRÿQ}ÿIqûImÿStÿVtøNiëD^äF]èYkÿ—¢ÿ¶¼î žˆKFd2)©jcÍ–ôÇÁÿãÞÿòðÿüýÿýÿú÷ÿý÷ÿÿöÿÿöÿÿøÿÿùÿÿüÿÿýýÿýúÿüøÿûøÿúøÿø÷ÿ÷øÿõ÷ÿôøÿôøýñóóéêäÜÚÖÑÍÍÊÃÉÉ¿É˾ËÍÀÇÑȾȿ·Á¸84163.52-30+30+41,52-63,85.96/:70<90>;2@=4B?6B?6KC8ME:PF:SJ9TK:UL;SL<RL@QLHZW^kj|~Œº–™Î˜žÚ™žÞ™˜Þ“’Ö‹ŠÌ†„Ã~·xv¨ml–fe‡]ZwVTiMKXDAH><=;:6;8396/267465672880<:-A<)D>(G?(I?&J?)IA,JA0IA4IA6HA9G@:R9<N8;I68A57:65384.93+;12?517+=3'X:0{D=•GCž>?ž46§<*¨=+ª?-ª?-©>,©>*¬?+¯@-«8%²9(¹:+¿:+Ã9,É9.Î:0Ò;2É>7Æ;4Ã81Â8.Â8.Ã9/Â8.Ã6,Ä7-ÑC9Ò?5Ä0&Ã,#Ð7/Ö<4Î4,æ1*æ1*ç2)è3*ê3+í2+ð/*ó.(ø.*÷-)ò/)ì2&ã3$Ø5"Ï7 Ì7Ü5#Ù3#Ø2$Ö2&Õ5)Õ7,Õ;3Ö?8ìYRáRJÓHAÊD;ÉF<ÊJ?ÅG;½?3¼;(¼;(º;*¹:)·:(¸:+¼>0¿A3ÁA6Á<5Å<6ÏA?×EEÝGIãJMèMQëADì?EðCIúJTþN[üJZüF\üF]øA]ùBaýEiÿJpÿNwÿOzÿMxÿKxÿR{ÿR{þOvýOtÿVwÿ]{ÿSoîD^øUjîQd÷dtÿ’žÿ‹“òƒ‰Ç`c­KL²keÏŽˆñ¼¶ÿÞÙÿðìÿúúÿüþýûÿüûÿþûÿÿûÿÿûÿÿüÿÿûýÿûûÿûøÿûøÿüùÿûùÿûúÿøúÿöøÿòõÿðóûìïòææçÝÛßØÒÛ×ÎÝÛÏàÞÑàáÓÚãÞÏØÓÅÎÉ<94;8385052-41*41*52+63,74-85.96/;8/=:1?<3A>5B?6KA7MC7RF8UI9WK;WK;UL=SJASJK[Xcnl‚‚‚¨‘”Çš Þž§ì¡©ò¡¤óž í™›æ•˜ß”•Ö̈‰¿‚ƒ±zz rq‘fd|XWiPN\IGRFCJDBG=?K==G;:?;:8<92A;-D=*F@*F@(GA)GB.ED2CC7BC=AC@>BAG9HH<JG?LGDODGN@JL;II:ID?KA<@2F=.bH9QB‰K<Œ@2Ž;-¨=+©>,©>,ª?+­@,¯@-°?-°=*±8'¶8)½9*Ã9,È8-Ì8.Ò91Õ;3Î;4Í:3Ë81Ë81Ì92Í:2Ì70Ë6/Ó<3Õ>5Ò91Ì2*Ð3*Ù;2Ú<3Ó5,è0(é1)ì1*î1+ñ0+ò/)ô-(ö,(÷-)õ.)ñ0)ê2(â5%Ù6#Ò7!Í8 Õ8%Õ8%Õ5%Ñ4%Ò4(Ô6+Ô7.Ð7/ãNGèXPçZQØRIËH>ÃE9¼B5·?1¹<&¹<&¹<(¸;'¸9(º;*À>0Ä@4ÉD;Æ?9É@:ÑFCÕIHÖHG×IHÛJMìCFêADíDIöKSüQZýN]ûL]üJ`öD^÷DaùFfýIlÿNuÿOxÿOxÿNyðYzðWvóVuüYxÿ]{ÿZuûQkòI`ýWköUgêN\ö^kâKZçSaçSaåQ_¸jfÉ‚~窧ÿÓÑÿëèÿôòÿøùÿÿÿùýÿùüÿûüÿüüþüúûýùøüøõü÷ôÿú÷ÿûøÿüúÿûúÿøøÿòõýîñúëîðââëÝÝäÙÕâÙÒæßÕëçÛñîßóñâêóðÜåâÏØÕ@=6=:3:7074-52+52+52+63,74-74-96/;8/=:1?<3@=4A>5M@7OC7RF8WJ:XK:YL<WK=TICSJM^Xfpmˆ‚„­‘–Íœ£ç£¬ù¥°ÿª±ÿ¦«ü¡§õž¤îŸ£ê ã™›Ø•–Î’’ĉˆ´yyŸji‹`]|XUpSOhPLcMJeKG^FBS@=H?;<?:4B<0A>-C@-CB.BC3AE7>E=<EB;EF9DF:D]@JcHTjR]oXdt\fp]dj`ac`[W]LDgI>€UE’YFL7A+“A+«@,®A-®A-®A-°A.²A/²=+°7&µ7(¼8)Â8+È8-Í6-Ñ7/Õ8/Ù;2Ò73Ñ61Ñ61Ò72Ô94Ô94Õ81Ó6/ÞA:Ö8/Ñ3*Ø7/Þ=5Þ=5Û8/Ù6-ë0'ì0'ï0(ò/)õ.)ø-)ø+(ø+(ø-)ô/)ð1)é4)á5'Ù8&Ó8$Ï8#Í8$Î9%Î7$Ï6&Ð7)Ô8,Ó7+Î4*Ì3+ãNGôd\ë`YÔOFÂB9¸<2´:/·?&¸>&·=&¸;%º9&½9*Á;/Ä>3ÌC9ÊA9ÎE?ÕKHÓLIÎGDÌFEÐJIéFGæCDéDHòMSùRZùR\ùN^úOaõG^õGbøGdûIiÿNrÿRvÿRyÿRyå[uë\xõ`}ü_|øUpõMgùPgÿYnÿ[mÿbsóL]úSdøM_ÿRgüI_ýE]³d`¾tqÚš˜ûÈÅÿåãÿîëÿõôÿÿÿûÿÿùÿÿùÿÿúÿÿüþýýüúýùöýøõÿøõÿùöÿúøÿúùÿööþððøêêõåæìÜÝèÚÙæØÕèÞÕðèÝùóåþûêÿþíòûúâëêÔÝÜA>5@=4?<3=:1;8/96-74+63*52)52)63*74-:70=:3@=6B?8J@6OC7RF8VI9WJ9XK;ZL?[NHTIMXR`gd|}©’Ì—Ÿçž©ù¤°ÿª³ÿª³ÿ¬³ÿ«³þª±ùª®õ¨«î§«êŸ¡Ü™šÒÁ±ur¡he’]Z…XR~YP{YQxVOpOG_E?M?:@?;8@@6>>2@B5@F:>E=:C>9CB<GI?MP:YvKh†[udunx‘|zq‚|`n†]eX[œXU¥WM¥M?A,š:"Ÿ;#©<(«>*®?,±@.³@.´?-¶=,¹;,º6'¿5(Ä6*Ë7-Ñ7-Ö8/Ú91Û81×84Ø95Ù:6Ú85Ø61Ø61Û83Ý:3æC<à=6Ú70ã@7þ[Rÿlcÿ]Tã@7é1'î2)ò1*ô/)õ*&÷'%ø(&ú*(ø-)ó0*í2)ã1%Ú0#Ó1"Ò5$Õ:(É=&É=&Ë=)Ï<*Ñ;,Ò9+Ô8,Ó6-Ú@8Ð71ÜGAôc^ãXQÉB<Å@9·3.´<#¶<$¹<&º<&½:(¿:)Ä<.Ç=2È>4ÌC;ÙPJßXTÓOJÁ@;¿@:ÊKEäFEäFEèJKïPTòQWïNVïKVñL\ùRdøOf÷Ke÷JfüMnÿRsÿRvÿPtê[wêZuðZuú[wÿ]xÿZsÿWnÿViÿctþVgÿ\mÿYlõDXùBXÿMeÿIb·nh­hcËŽ‹èµ²ùÑÏÿêéýïîúù÷øþüøÿÿøÿÿøÿþúþýþþüÿûøþöôþùõÿû÷ÿùöÿöôÿööÿõõöèèç×ØäÔÔÞÐÍãÖÐñçÝüôçÿøèÿüéÿÿí÷ÿÿèñðØáàC?4B>3A=2?;0=90;7.:6-95,73*73*73*83-:5/=82@;5B=7I?5LB6QE7UH8VI8YI9YK>ZMEUKLXP_ebyz¦‰É”œäš§ö ¯ÿ«´ÿ¬µÿ­·ÿ¯·ÿ¯·ÿ¯¶ü¯³ú¯²÷§ªí¢£ä˜˜ØŒŠÉ€~½uq®ie¢b^›cVŽbU‹]TƒWOtNHdFCTBAIAAA;=8@C<DG@BD??A@BCGMNSWW_Vl“gyŸw¥€€¢Ž œ}œ£qŒ¥_w¯XkºTa¾OU¼FD¶=4±9(±:$°<#§8%¨7%©8&­:(°8'²9(µ7(¹5&»3%Â4(Ë7-Ó;0Ù<3Þ=5à;5à;5á>9ß<7ß<7â=9æA=èC=éB<èA;ç@:èA9ä@7Ü8/Õ1'Ø6+ëI>þ\Qô?4î6,ê+#î)#ù,)ÿ./þ,-ø((ú0.õ4/ï7/ç6,Ü4)Ö2&Ó3%Ò5&Å='Ç<'É<(Ì;(Í:(Ï7)Ï6(Ð4(Õ8/Ï5-Õ<6åPJçSOÛLHÏA?º/,¹=%º>&»='½<'¾9(À8(Ã9,Ä:/È>4ËB:ÕOFÜWPÒQKÃD=¿B<ÆKDáIFáIFåMLëSRíTVëPVéNVìOZ÷VføUhùSiúRküRmÿSqÿStÿRsïNoøTvÿ\|ÿ^{ÿ[vÿUoýQgûReüUføQbÿZhÿZjôM^úRcÿWiôI\§ha™\W·€{Ù©¥ïÇÅýáÞùêçýøõøýùøÿÿ÷ÿÿöÿýùÿýÿÿýÿûûÿö÷üùòþùõþùõþöóÿ÷õÿõõøêéêÜÛäÖÓÝÐÊáÔÌïåÙüõåÿùçÿýéÿÿì÷ÿýèñîÙâßEA5EA6C?4A=2?;0=9.<8-;7.84+84+73*83-:5/=82?:4A<6G>5JB7ND8RF6TG6WG7YI:YKBWKKXP[b^wsuž…ŠÂ™Þ—¤ó¬ÿª´û¬¶ý®¸ÿ±¹ÿ²ºÿ´»ÿ³ºÿµ¹ÿ¯²ùª­ô££ë™—àŽŒÕ‚€Éxt¾qm·l`¢i]dY“^V‡VQyNKhEDV@@J76;?=>HBBKABN?BYFJmX_}fnt¤}¬§‚®¬}§´w ¾p—Âc…ÃRpÅE^ÔI\×EPÊ9<¾3,»7(¸;%³; ¯<*¯<*°;)³;*·<,»<-À<-Ä<.Ä6*Ë8.Ô<1Û>5á@8á>7à<3á:2Ü73Ù40Ø3/à93èA;ìE?êA<å<5ã<4Û4,Ø4*Û7-Ô2'Ì, Ö6*èH<÷I>ò@6ï4-ð-)÷+*ý+,ý+,ø*,ñ))ì/+è3,â5.Ü4+Ö2(Ô2'Ô2'Ç:&È;'Ê<(Î;)Ñ;*Ò:,Ô8+Ô8,Ñ4+Ø;4Õ:5Õ<7çONîXYÙEEÅ02¾=(¿<(¿<(¿:'Á9)À8*Á7*Á7,Æ>2ÇA6ÏJAØUKÑRIÄH>¿E:ÃH@ÚIDÙHCÝLGäSPåSSâPQâMQåNWòXdöZhý[pþZrýUoûQlýPnÿRpÿFmÿOvÿZ}ÿ[{ÿVqÿSkÿVkÿ[mûYhúYhü`mö`kî\fñenífmÚT[’cY}ND™lfØ’ß¹¶ñÓÑôàßþöôøú÷÷ÿý÷ÿÿöÿýùÿýÿþÿÿýÿÿ÷ûúúòüùôüùôýøôÿùöÿøöùîìñãâçÙÖÝÐÈÜÒÈîäØýöäÿûèÿýçÿÿè÷ýùêðìÝãßIE9HD8FB6D@4B>2@<1?;0>:/:6-95,95,94.:5/<71>93@;5E>6HA7LD7QE5RE4UF3WG7WI<XMIXNW_Zppp–€†ºŒ•Ö”¢íšªø¨°ø©±ù¬´ü¯·ÿ±¸ÿ²¹ÿ´¸ÿ´¸ÿ®²ü«­ø¥§ôŸžì—–䌋قÏ{zÈxl´pf«h_ _Z’YW†QQwGGc@?Q<6DF9BS>C_@EmDJ€OU•]f¦jrÇe˜ÍkœÏl›Ïf‘Í]…ÎTyÌFgË8UÌ0Hß>PäBMÔ:<Æ7/Ã@.ºB*®<!­5$­5$®5$±6&¶7(¼8)Ã;-È</Ó@6×@5Ú@6Ý?6ß<5Þ:1Ý6.Û4,Ò/(Ò-'Ó.(Ú3-á:4ä;4á81Ý4-Ü5,Ò+"Í)Ù7,âB4Ü?0Ð4%Ê.éF7óI<ýH?ü<9ö,,ó"%÷&)û/2ñ-.ë/-ä2.Þ3,Ù2*×0(Ö/'Ö/)Ð8*Ò9+Ô;-Ö=-Ú>/Û?0Ü@3Ü@3Ò6*èKBåJEÎ50àFFóZ\áHKØ?BÆ=-Ä;+Ã:*Ã:*Ã:*Ã9,Á9+À8,Â<0Â>2ÈF9ÏOBÎPDÄH<¿C7¾D7ÑF?ÑF?ÕJCÛPKÝROÙMLÚKMÜKPëX`ó[hüaqÿauûWoõOgõMgúPkÿJuÿOyÿSwÿRqÿSmþ[pÿcuÿixÿguüaoôbmìelàglÔjjÉjh¼c_dVeH:_Tª‡Í«©åÇÇïÚÙÿóóùøöøþü÷ÿÿ÷ÿÿûÿÿÿþÿÿüÿÿ÷þûüôúûóûúõþûöÿýùÿûøþôòøíéêßÙÞÔËÝÓÇíæÖÿøåÿþèÿÿæÿÿçõúóêïèáæßLI:KH9JG8HD8FB6D@4B>3A=2=9.<8/;7.;60;60<71>93?:4B?8EA8JD8NE4PE1TE0VG4XH9ZMEVMR[Whkl‹~‚²‰“Ð’Ÿå™§ò§­÷©¯ù«±û­³ý°´þ°´þ°´þ¯³ý«®û¨«ø¥§ô ¢ïšœé“•âŠŒÙ„†Ó…É{u½mj­dd _a”X[†QQsNHbUFY_CRlBLEO˜LV¬U]¼[dÅ]fçJuéNxæPuàLn×FcÒ?YÍ5JÊ+?Ú5EçAMéFKÙ><Í>6ÊH8¿J6°B)·>-¸=-º<-½>/Ã?2ÊB4ÐD7ÕE:ÙE9ÚB7Û>5Û:2Ù6-Ù5,Ú3+Ù2*Ô1*×4-Û60Ý90ß80Þ7/Ý6.Ü5,Ö/&Ù5+Ø6)Ï2#Í1"Ò9)Õ>-Ó<+Ö=-æD7÷KAÿD?û56÷)-÷)-ù.2ø67í55â30Ú1,×/,×/,Ù0-Û/-ã80â:1â:1â<0à<0ß=0Ü?0Ú>1Ñ7+ïWLù`XÓ;6Ó;:èOQÞEHèOTÍ=2Ê:/Æ8,Æ8,Æ:-Å;.Ã;-À:.¾:-¾<.ÁB3ÇH9ÇI:ÂD6¾@2¼>0ÊE<ÊE<ÎI@ÕPI×RMÔNKÓKK×LOçZ`ð^hüfrÿhxü]qóOgóMeùQjÿPzÿQxÿQpûSmø\qûhxûjw÷epüfró_kí_kêkrÝsu¿lh¦f\¡l^ujXVI8kXJ–{t¾ŸœßÁÁïÕØþîïûõõúüûúÿÿùÿÿýþÿÿýÿÿûÿÿ÷ÿýÿ÷ûþõûüöÿþùÿÿúÿþúÿûõÿ÷òñèáäÜÑáÙÌðé×ÿúæÿÿæÿÿãÿÿäöùðíðççêáQK=PJ<OI;MG9KE9IC7GA5G@6B;1A:2@91?82?82?82A:4B:7@?:EB;IE9MF6PE1RF0UF1WG7YLCUKLZTbii…|«‰’É“žÞ—¦ë¨«ú©¬û«®ý­°ý®±þ®±þ­°ý­°ý©­÷§«õ¤¨ò¢¦ðŸ£íšžè•™â‘•Þ’’Ú‰‰Ï|€Àrx´nu«lpŸhhŽj_x`x‚WjO_¥OZ½R\ÑR[ÚOVÛHPñ:Pî=QéAPàCLØCIÑ?BË9:Ê45åIJèHHã@AÕ76Î93ÌB8ÅE8º@1ÃE6ÃE6ÅF7ÉE8ÌG8ÑG:ÖH<ÛG;Ö>3Õ;1Ö8/Õ4*Ö3*Ø4+Û4,Ü5-Ú9/Ý<2à=4ß<3Ý90Ü5-Ü5,Ý6-Ò.$Ý;.Ü<.Í1"Å.Í8$Ð=)Ì;&Ë:'Ò9+á:1ó=9ÿ@@ÿ;?ÿ27ô+1ê,.ß+,×+)Ó+(×/.Þ44ä88è:;ó55ò64î73é6/ã7-Ý5*×5(Ñ5&Í5'çPEÿmcÛHAÈ42×CCÓ>BêUYÙB;Ô=6Ì70Æ6-Ç9/Æ<1Ã=1Á=.»9)»<+½@.¿B0¿B0¾?.¼=,»<+ÃC8ÄD9ÈH=ÏPGÒSLÐOIÐOJÔOPç_cîaiûitÿm|ÿdu÷UjõRgýWoÿSxÿUtûWpð_pñoyôy~êmsÞXaïamò`mïaoðs{숊ɂ|¥wjšyhhpYMO:^WGƒqg±•’Ý¿¿ñÔØýéëþôõýûþûÿÿúþÿýþÿÿýÿÿûÿÿöÿüÿøùÿõúýôÿÿúÿÿúÿÿúÿý÷ÿþöùðçíåÚéâÒôïÜÿûåÿþåÿÿãÿÿâøúíòôçîðãSM=RL<QK=OI;MG9KE9JD8IB8E>4D=5B;3A:4@93A:4A96B:7@A;CC;IE:NG7QF2RF.UF/WH5XJ=RHFXR\jh€}§‹’Æ’žÚ–¤å¥¦ù¦§ú©ªý«¬þ¬­ÿ­®þ¬­ý«®û¨¬ö¦ªó¤¨ñ£§î¡¨î §ë¤è›¢æ™žâ’šÛŠ”Ò…Ê‚ŽÂ‚‰·‚©‡yšŽmˆšczªWi¾P]ÓKWäGPí?Hñ9Aî;6é<5âB6ÙH7ÎJ5ÅG1ÂD.Å@/ãUGàG?Ú;7Ø64Ø88Ö:;Ï98Ê66¼=.¾<.¿;.À;,Â8+Ä6*Æ3)È1&Í5*Ð3*Ñ3(Õ2)×3*Ù5,Ý6.Þ7/Ü>3Ý<2Ü;1Û8/Û7.Ú6,Ø4*×3)Õ3&Ó3%Ñ4%Ï6&Ò=)Ñ>*Ê9$À2Æ;(È5%Ó3'ç60ü;<ÿ=@ÿ7=ù27ê-1à..×--Õ0.Ü44ã9:é;=ë;>ý.4ú/3ö01î1/æ1*Þ2(Õ1%Ï3$È2#Ð>/új_ãTLÈ95Ð@@Ë:=ãRUçJEÝB=Ò93Ê5.Æ8.Å;0Â<0¿=-¹<*¼?-½@.¼?-º;(º;(½<)¾=*º>2º>2ÀD8ÈLBÌPFÊNFÌMGÐNLçbcêbføhqÿo{ÿhxøYm÷Ujþ[pÿXsü\tìbqãktç€í‰‡ãyyØ_dñhrÿl|öcsíkwø‘•é¤ŸÀ–Š¥‹z\pWFR<UVFtg^¤ŒˆÜ¾ÀóÔÙùâèÿóøÿúþýþÿüýÿýüÿÿüÿÿúÿÿôÿûÿøøÿõ÷ýóýÿùÿÿúÿýöÿý÷ÿÿöÿùïõïãòìÜúõáÿþçÿþâþÿàÿÿãýþðùúì÷øêUO?TN>RL<PJ<NH:LF:KE9JC9G@6F?7D=5B;5A:4A:4B:7C;8@A<DD<IG;MG7OG2RF.VG0WH3VH;RGCWRYjh~~‚§Œ”Å’žØ–¤ã¡ž÷£ ÷¦£ú©§û©ªýª«ýª«ûª¬ù§«õ¥©ò£§î §ë¢ªë£«ì¢ªë¡©è˜¡ä–¡á”ŸÝ“ŸÙјǒ‘¹™Š«‘m‰£c{´WjÇM\ÚBNë;Eø6>ÿ4:èB*âD)ÙH)ÎN+ÃO(¹L%¶H%»D&ÛWBÚF8Ú;5æ>>íBHé>Fß5>×08ÈF8ÇE7ÈD7ÉA3Ç=0Æ8,Æ3)Ç0%Ê0&Î1(Ó2(Ö3*Ù5,Ù5,Û4,Û4,áC8Û=2Ø7-Ø7-Ü:/Ý9/Ù5+Õ1'Ù7*Ð0"Ì0!Ð9&Ì9%Æ5 Ç9#ÑE.Á:&É:)Õ7+â3.í//÷05þ5;ÿ;BÿIMúGJîDDæ@@ä>>ã9:ã28á.4þ'/û(/ø*.ó-.ë0+ã2*Û5)Ô7(Æ0!¾/óeYê]TÌA<ÓEDÊ;=ÝNRïPMäFCÕ:6Ê5/Æ8.Ä:/À</»<+»>,¼A/½B0º=)·8%º9&¾;)Á>,²8+²8+¸>1ÁG<ÅK@ÄIAÆICÊJGå`aæ^bñdlÿlxÿix÷ZköTiýZoú^tòcuãgqØqrÝ…é”ꋇåruùq{ÿxˆõ`sßXgóŠ‘ý¶´Ö«¢¬•…TnSAS;PTCkaWž†‚Ý¿ÁõÖÛøßåÿóùÿûÿÿþÿüýÿýüÿÿüÿÿúÿÿôÿùÿø÷ÿôöüòüÿøýþøüüôÿýöÿÿöÿþôûõç÷ñáüúåÿþåþýáýþßÿÿãÿÿñýþîüýíXO@XO@WN?VM>TK<SJ;RI:QH9MD5LC4KB3I@1H?0H?0H?0H?0FC<GE9JG8NI6RJ5UJ4UJ4VK9XNDULMXTbii…{~©‰ŽÆ‘™Ú— å¦¢ù¦¡û¢¡þ¡¡ÿŸ£ÿŸ¨ÿ «ÿ¡­ÿŸ«÷ ªï¡©ê§¨ë«¨ï²§õµ¦ù¶¤ú—«ÿ“¨ùŒ£ç£Ö¢¦Ë´ ¹½„“ÆbnÑEPé:Gõ5Bø4>ñ8>æ=@ÙD@ÑHBå;Dà;BÞCGÉ99ÌB@ËD@½/-ÞHIëHKîAGï;Dì8Aé:?â<>Ú<;Ô<9ÏA=É>9ÊC=ÑLCËK@¼>2³7+¹;-¹9,¾8-Å7-Ê3,Ï0,Ô/-Ý11á34çA1à9)Ü1 á1"é8(ê;*ã6%×2Ñ2Ì4Ê5Ç4 É3"Ì3%Ñ3(Ô3)Í.(Ï2+Î6+Ì8*Ë8(Í7&Ð7%Ø6'ß3'é2,ð31ò01ð+2í*2í+4ï-6ú+1÷*/ñ+,î.-ë4.ä8,Ú7(Ð5#Ã.Ä3 çXHèZLÊ<2ÞOGÄ5/ÚIFÝQRÚLKÒDBË<8È80Ç7,È9+Ê;+È;)Å:'À9%½:&»<)º=+¸=+¶=,³9.µ;.¹=1½?1½?1¿@1Â@2ÅA4ïk_õqeêd[ômiùroécbðjiútuÿk|ûivñdmï_hòaføgjõnkîqk÷|wÿ}ƒþYjÿ[wîZpû¬±«°œaŸz]sMIZ6LR6snX£–†Ë·®íÕÓÿîðÿõ÷ÿ÷ûþøüüüþþÿÿþÿÿþÿÿýþÿæÿòàÿëâýêìÿð÷ÿôûÿôþÿóÿþñÿýïÿûîÿùèÿùæÿøãÿùãÿùáþúáýÿþþÿÿþÿÿYPAXO@XO@VM>UL=TK<SJ;RI:NE6MD5LC4KB3JA2JA2JA2JA2FC<GE9JG8OH6RJ5UJ4VK5VK9XNDUMKYUciiƒ{}¦†‹Â•Ô“œß œðŸñžžöžŸû¢þŸ¦ÿ ªÿ¡¬ü ¬ô «íŸ§æ¢¦æ¦£èª¢í« ïªï™ªü—§ô˜£åžžÒ¬šÂºª½r†ÃUbÓCMå;Dð7?ñ6=í8=ã=?ÛAAÕDAä:CÜ8?Û@DË;;ÊC@ÈA=¿41åOPäDFé>Dë:Bè7?ä7;Ü89Õ:8Ð;7ÓF?Ç<5Å<4ÌG>ÌLAÁC7¶;,·9+¹7*½7+Å7-Ë4-Ñ2.Ø3/á53æ66á?0ß<-Þ6)à4&á6%á6%Û4"Ó4Ð:"Ê:"Æ:#Æ;&É<*Í;,Ì8,Ì5*Ö3.Ö5-Ñ7-Î8*É6&Ç4"Ë4!Ð3"Ø2$ß1(å/+ç.,è,-æ,1æ-3ç.4î*,î,-í0.é2.á3*Û5'×7'Ò9'Ó@,»*ÔE5Î?1ÙF>êWPØC?ØBAåWVâRRÛKJÔC>Í=5É9.È9+Ç8(È;)Ä;(Á:'¾;'½>+º?-¹@/¶>-²9.µ;0·=0¹=1º?0½?1ÁB3ÅC6ëi\òmdçb[ðkfõolèbañklûuvÿp€ÿo|öirë^fêY^òadøqnù|vöyuÿx~ùRdÿUríXnö¥«¥¨“X”n[tLN_;QZ;us\ª×úøàÜÿôóÿúûÿúûÿûüüüþúþÿûÿÿúþÿûüþçÿñáÿêáýçéÿìóÿòøÿóýÿòÿÿóÿýïÿýíÿúëÿöåûóàúòÝûõßý÷ßúúøüüúÿÿýZQBYPAYPAWN?VM>UL=TK<TK<QH9PG8OF7MD5MD5MD5MD5MD5GD;JF;MG9PI7SK6VK5VK5VK9WMCVNL\Vbkiy{¢…ˆ»‹‘Í—Ø™—à™˜ä˜™éšœï›Ÿö£ùŸ§ø ©ö ªïž§èœ¤âœ¢àžŸàžáŸ™ãž—ä㖛ݠ–Ү¼ƒ®Ær“ÇZqÇCQ×AJá>Cæ<?è;=æ<?ã=Aá>Cß>Câ;CØ7=Õ?AÏA@ÉD?Â=8Ã96ëWWàBCæ=Bé:Aæ7<Þ58Ö66Ñ96Ì;6ÕHAÅ:3¾5+ÅA5ËK>ÆH:»=/¶8)¹7)¿7+Æ8,Î7.Õ60Þ63æ87ë;;Ó5)Ö6*Ú6*Ü6*Ý5(Ý7)Ú:*Ö?,Ã5¼5¸6 ¸7"»9)¼8+¼4(º0&é=;å>8Þ=5Ô</Ì9)Æ8$È7"Ì7#Ò7%Ö2&Ù.&Ú-'Ü-*Ü.-Û//Û//Þ*)á/+á4.Ý5,Õ3&Ð5#Ð9&Ñ>*ÓB/Â1 æTEÐ<0ÚA;ÞC?èJIòTSèVVçSSãOMÝIEÖC;Ï<2Ê8+Å6&Ä7&À7%¼7$»:'¹<*·>-µ=,²=,°:.±;/²<.µ=/·=.º?0ÀB4ÃE7Ü\Oêg]äaYñlgöpoçabìfgòkoäP`ï^kôhqòemñ`eödgûqqúzwövsÿnuõJ]ÿMjïUmñœ¡ŸžŠPˆcVoEOd=Va?ww]¯¤’âÐÄÿíæÿ÷óÿûøÿýûÿþüûÿüûÿýûÿýùÿû÷ýùãÿëÜþãÚøÞàúáèûåïüèöýëýþîýúëÿúêÿ÷èúñàòê×ðèÕôìÙùñÜýùöÿûøÿþû\PB\PB[OAZN@YM?YM?XL>XL>UI;TH:SG9RF8RF8RF8RF8RF8JF=KG<OI;RK9TL7WL6WL6WL:VL@UMJ\V`jh~yy‚„´ˆÄŽ”Д”Ò”•Õ••Û–˜ã˜›ê˜žìš¢í›£ëœ¥æ˜¢ß–ŸØ“œÕ“™Õ“—×’“ÖÖ†½Ž„¹£~²¸r¤Êe‘ÖTzÙDa×:Kà@HÞBCÞC?ÞC?áAAä?Cè=Fë;Fã?FÖ:>Ó>@ÐFCÅA<¸71Å>:ê[WÝABä?Cç=@ã:=Û89Ó97Î=8ÌA:ÏE;Ã9/»2(À</ÇE7ÄE6½>/¸9(¼8)Â8+É:,Ò:/Ù80á83è;7ì=:Ô3+Ö3,Ù5,Ý4-Þ6-Þ7.Ú:.Ô>/Æ9(Á<)½>-¹>.»=/½=2Á>6Ã>7ó?>î?<æ?7Ù=1Í:*Æ9%Æ;$È<%Ï<(Ï8'Ï2#Ñ1%Ó2(Õ4,Ñ2,Ï0*Ñ3*Ó5*Ñ7+Ï7)Ê7'É8%Ê<(Ì>*Ê<(Î=,ô^PàF<Ò3/Ò.-è?BþUXÿvuÿroÿjgö^YçPIÕA7Ç5(½.Ä8'À9&»8&¹:)¶=,µ=-±>,°<-­<.­<.®=/°<-±;-¶>0¼B3ÁE9ÉMAß`Wâa[ôpløtrå`aä]aå^dÙFVçYeógpôgo÷dlýjpÿstúxvõssûenóCXÿEbðRkë’˜œ—ƒN‚\Ql?Ri?ZhDy|_°ª”èÛËÿôêÿùðÿúóÿýöýÿùûÿúùÿúöÿøòüóîøïÔüÚÎóÒÊëÌÏìÎ×îÒàïØéòÝóöãöõãûõåüõãõìÛíáÑéÝÍíáÑóç×úõïü÷ñþùó\PB\PB[OA[OAZN@YM?YM?YM?WK=VJ<UI;UI;TH:UI;UI;UI;LH=OI=QI<TK:WL8XM7YM7XM;UK?UKI\U]hexut“|~§„ˆ¸ŒÄŽÁŽ‘Æ’Í’“Ô’•Ü“—à”˜á•šÞ•Ü’›ÔŒ•Ì‡‘ƃŒÃ‡Ã}‚ÂzÁ|vš‹q–¦h‘Ä[†ÚKvè>cî7Uí8IçAEßFAØIAØIAÞFCæAGð;Jõ9JãDI×>AÐ@?ÏJE¾?8²3,ÇD<âTPÜDCáACä>@â>?Ü>=Ô@<ÏE;ÌH<Ç=2Á7,½5'½9*¿=-¿=-»<+½<)À;*Ç;,Î<-Õ;/Û8/à70ç83ë95ã:7â64â22å31æ42ä50Û2+Ò1)É2'Ç9-Ä<0¿90¼5/¿52È<;ÒDCó57î66å61Ø5,Ë5&Ã6"Á9#Ã;#É>'Ê9&Ë5$Í5'Ñ9,Ó;0Ò:/Ï8-Í?1É;-Ä8'Ã7&Ã:'Å<)Å='Æ;&Í>-Í:*Ø>2ãB:Ö.+æ::á14å26Ò73Ö;7ÞC>åJEêQIêSHèTHäUGË?0Æ>.¾<,º<-¶>.³@.°?/®?.«=0«=.¬<.¬<.­<,±=.·A3¼D6ÆLAÞbZâc]ðnlôrrå`cå`eæ`gúixûozõltí`hñ^fÿkqÿw{ÿ{|öpqø^hö@Wý>]óOh懠•ƒX†aXuE\vIgwP‚ˆfµ±–éáÌÿùéÿüíÿýñþÿóûÿôøÿöôÿóíûìäòãÝëÜÁëŻ㾺޺¿Þ¼ÆáÀÍâÃØæÌãëÓìîÙôñÞøñßóêÛìàÒèÚÍìÜÏñáÔòçáòçáóèâ[OA[OA[OAZN@ZN@YM?YM?YM?XL>XL>WK=VJ<VJ<WK=WK=XL>PI?QI>SK>UL;XM9YM7YM7XM;WK=ULGYSWc_nmkƒtt–|~§ƒ†³†‰²‡Š·ŠŒ¿‹ÈŽÏŽŽÔÕÓ”Ó‹Ê‚‰¿{‚¶u|²ov­gp«ck©€n~ey­ZvÏMoê?cú2Vÿ0Lû6Gð@CâGBÙLB×MCÝIGèCJõ<Nü8NàFH×CCÌA>ÍID¸<4¯5*ÉI@ÕLF×CAÜ>=Ý:;Û;;Ù?=ÔE=ÌH<ÇI;Á7*Á7*À8(¾9(¼9'º9&½:(À;(Ä;)Ê=,Ò<-×;.Ü8.á6.ä6/è5.ê24è.1ê+0ð/2ö37÷69î45æ21Ø/,×31Ô63Ï42Î/3Ð/5Û5?ä=Gõ,2ñ.2è2/Ü3,Ñ5(É8'Æ;&Æ>(Ä9$Æ8$Ë8&Ò:,Ø?1ÛA5ÚB5ÙA6ÎI8ÇB1¿<*½:&Á<)Ã?*Å<)Ä9&Ì;*Î6)Î0'çB<Ý1/ñ>Aå.2à'-Ò3-Ó4.Ö71Ö92Ò8.Í5*Æ2&À1#ÎE5ÆA2¼=.µ:+±9)®:+ª:,ª:,ª</«=.¬>/«=.«<+¬=,°?/µA4ÉSGàg^ßd_èkiînoæchðjqõoxüp}ýt~õmwîcj÷dlÿqzÿw|ûsuökpöXfûAYÿ:[õKfâ}…©˜†l”ojŠXo‰ZxŠ`—r¶·˜âÜÂúôÞüúåÿÿïûÿïõÿïîÿëçúäÜïÙÐãÍÉÛÅ«Ù«¨Ó¦¨Ñ¥¯Ô©¶Ô®¼Ö±ÇÚºÒßÁàæÌêéÔòíÚòéÚïáÖìÛÑëØÑíÚÓèÛÒæÙÐåØÏZN>ZN>ZN>ZN>YM=YM=YM=YM=XL<XL<WK;WK;WK;XL<XL<YM=RJ?TJ@UL=XL<YN:ZN8ZN8ZM:YM?VKEXOP^Xbd_sifƒqp’yyŸ|¢~€§‚°ƒ„¼††Äˆ‡Ë‰ˆÎ‰ˆÌˆˆÈƒ„½{~µux­or§jm¤eg acž…ac“X^±O\×H\ó=Vÿ1Kÿ/Dÿ7Bö>@çE@ÝJBÚKCÞHGéBLó<Nú8PØDDÕEDÈA=ÈIB³:/°7,ÌPFÉB<Î=8Ñ64Ï10Ð51Ó>8ÏE;ÆF9¿E6Á8(Ã:*Â:*¿:'½8%½:&¿:'Á:&Ä9&Ë:)Ò;*Ù9+Ý7+á5+ä3+ç4-í)-ò)/ù,3ÿ.4ÿ07ÿ18ÿ28ý58ú7;õ8<ò9?ò9Aô9D÷6Gû6Hü5Jø)1õ,2î02ã4/Ø7-Ï9*Í<+Ì=,È7&Ï9*Ø</Þ>2á?4â>4â?6â?6ÑN<ÍH7ÇB1Â=,¿:'Á:'Å9(È9)Ç3%Ó9/á@8ëD>Þ0/á-.ì38í38×4-×6.Ù80Ø:1Õ;1Ó;0Î:.Ê:/ÖL?ÌF:¿?2´9*¯7)«7*©8*¨8*ª<-¬>/­?0­=/«<+«<+­<,¯>0ÀKAÚc[Ýc^èkiðosëhnõrzüvïer÷oyør{öjsÿlvÿvÿu}öioõfl÷RbÿA[ÿ6YôFaÝt{²›‰€¤~z›f{—f€–h‘u­±ŽÌË­áàÄéëÓî÷ÜåóÙÙíÑÎçÉÅÞÀ¼Õ·´Ë®®Å¨•Ã’”‘˜Ä“¡È™§Ë¬Ë¡µÎ§ÁÒ®ÎÙ»ÙÝÄåãÎìåÕïáÖëÚÒçÒÍäÏÊÞÐÇÚÌÃÕǾ[N>ZM=ZM=ZM=ZM=ZM=YL<YL<ZM=YL<YL<XK;XK;YL<ZM=ZM=TJ@TJ>XL>YN<ZM:ZN8ZN8ZM:[O?WMDWMKZSZ^Xfb]sjfspvw–xxœ|{§~µ„¿‡Çˆ‚ʉƒÉ‚}¿~zµzu­vq§vo¥sl¢og ldŸ‹PH•JE²FF×EOò@Lÿ7Dÿ3@ÿ8>ø<=íA=äE?àGBãDHèAKï=Mô:OÒBAÑGDÅA<ÂH=¯;.°</ÐVKÃ>5É83È.,Ç)&É.*Í:3ÌC9ÂD6¸@0Ã:(Ã<)Ã<)Á:'À;(Á=(Â;'Ã8%Ä6"Ê7%Ô8)Ù7*Ý5(á3(å3)è3*û03ÿ58ÿ7<ÿ38ÿ,2ÿ&-ÿ'-ÿ)1ÿ,3ù'0ô%/ú'6ÿ+=ÿ(Aÿ:ú2ö".ô&0î+1æ0/Ú1,Ò4+Ï5)Ð6*Ô6+Ü90æ>5ì>7ë:4é61è50é61ØL?×K<ÒF7Ê>/Ä6(Â3%È6)Í9-Í5*Ô6-æC<à74à21Ò ì89ê35Ó2(Ô3)Ò4)Ñ5)Ï5+Ì5*È5+Å7+ãYNØRFÊH;¾@4¶</´;0³=1³=1®:-°</±=0±=.­<,«:*«:*¬;-±<2ÐYQÜb]ìppôvyîltõrzör}ÿy…ÿ‰ýz‚òiqøeoÿp|ÿt}ýntó`j÷Naÿ@^ÿ3WôA^Ûnt¹ž‹Ž®‡~¡i}›g—hœq¡©‚µ¹–ÉÌ­ÕܽÌÙ»ÁÔ´²Ì©¥ÃŸž¼˜˜¶–²Œ”®‰…¶~†µ~ºƒ•À‹›Ã¡Ã‘¨Å—²ÉŸ¾ÎªÉÒµÚÚÂæßÍêÞÒéÖÐáÌÉÝÅÃÓºνµÈ·¯ZM=ZM=ZM=ZM=ZM=ZM=ZM=ZM=XK;XK;XK;YL<YL<ZM=ZM=ZM=YMAYM?ZM=[N=[N;\O<\P:\O<ZM=YMAWLHXNOXQX]Ub`Yka\pifƒokŽsp›vq§{u³ƒ}Ê‚ËŠƒÉˆŠ~¼‡z²ƒr¨†r§Œu­…l¥z^˜™G9¡C7´A:ÍC@á?=ì89ø:<ÿBCú<<ó=<ì>=ê@AéBIêCMëANê>NÌA<Å@9¾?6µ?3®=/±=0¿E8ÒMDÇ61Ô;6Ï1.Í2.ÖC<Ç?3´6'·?.½6#Á:'Ã<)Â;'À9%Á:&Ã:'Ç:&Ë:'Ð9(Ô7(Ö3$Ú."à/%ì7.ô=5ø72ù30ú.-û)(ý%&ÿ#%ÿ"'ÿ"'ÿ$*ù )ú!,ÿ%7ÿ'<ÿ;ÿ4ÿ3ý)7ð".ç"+ä*-Ý--Ó+(Ò-)Ü41â62é54ï64ó55ó12ñ-.ï+,í++Õ<4Ò91Ñ:1ëTK»"Ä+#ßF>È.&Ì/(Þ<7èE@â:7Ø/,Û.*ã41é:7Ý?3×;.Ï5)Ë3&Ì5*Î:.Ë;0Æ8.ìbWàZOÈD8¹6,º:/·9-¯3)²6,¯1%°2&®2&®4'¯7'²:,²<.³=/°:.ºC;Ö\Wìppñsvøv~ûyƒõq|ÿ{„ûx€øu}üs{ÿr~ÿq}ÿlxûisøbmôI\ÿ=\ÿ8[ñ:VÖek²–‡¦}~¡i|šd}•c‡—j”ŸuŸ¥ ¨ƒœ¨„’£Š£|€Ÿvx›qw›o|r t„£w¯uƒ³y‰¹½„“¾†—¾‡œ¾‹¢½§¼“¯½š¾Â§Ï̹ßÓÇãÒËÜÇÄÖ¾¾Ê»´Á²«¹ª£ZM<ZM<ZM<ZM<ZM<ZM<ZM<ZM<XK:XK:XK:YL;YL;ZM<ZM<ZM<ZL?ZL?ZM=]M=]N;^O<^O<\O<]P?[OA[NFYNJZPQ\SX_U^_Wbb\xibƒng‘qjžvp®€y½‡€ÆŠ€Å€Ã~ºt­Œn¢—q¤¡uªši ŒY‘©;.¨7)°6)À>1ÐB6Ü?6è?8ôA=ö=;ø:<÷:@ô<Dï?IèAIâ@KÜ?HÃ>7½=4¶<1°</ª:,¬;+¼B5ÐJAÚG@ÜA=Õ63Ò41Õ@9ÍC8¹:+¯6%¿8%Â;(Ä=*Ä=*Ä;(Ä;(Ç:(È:&Ï9(Ñ5&Ô2%Ú2%ã5*ê8.ï80ñ91ä2&æ0%ê.#ñ,$ö+%û+'ÿ,+ÿ-,þ)-ú%+û#.ÿ&5ÿ$9ÿ5ÿ1ÿ 0ð .ù-9ö2<å*1Û(,Ü.0Þ02Ý*.ò9>õ6;ú3:û06ú-2û.3ý14þ36×4/Ü:5Ù72æDAæDAÎ/+Ñ2.Á"Ö41á?<èE@à=8Ø3-Ù2,Ý60à91Ò<-Ï9*É5'È4&Ê8+Ë;0Ê<2Æ9/ícYáXNÉ@8¼3+À:1Á;2½7.À:1Á4+¾4*½4*»5*¸6(´6(²7(°6)´;0»B9ÓYTèllïqtöw~þ|†øv€ÿ|„ûyøv~þuÿsÿo}ÿiwùeqùanöI]ÿ<\ÿ9\ô=YÕdh«y€œsu˜`t’\w]cŠ•k—p‹•p…”mp†_lˆ_fŠ\g^j_q•ey›i}l€­r„²tŠ¸z»}½‘½‚–½„›»‰›µ†¡³­¶—¾½¨ÏÆ·ØÇ¿ÖÁ¾ÒººÅ·¶º¬«²¤£\L<\L<\L<\L<\L<\L<\L<\L<ZJ:ZJ:ZJ:[K;[K;\L<\L<\L<\L?\L=\L=]M=]N;^O<^O<^O<_RA^QA\PD[NFZOK[PN]QS]ST_RlcXvh]…jb“sk¦}w·†}Àˆ}¿—…Ù€¹›v©ŸoŸ¯t¢»v¥µi˜¤U…Ä92¾5-¹5)½>/ÇE5ÐG7ÚC8ä?9ó=<ú9>ü9Aú:Eò>GæAH×@EÏ@B¿<4¸90±8-«:*¨9(«:*»?3ÏF<ÙD>Ø96Ú65Ü:7ÜC=ÝOEÍI<²4%À9&Á:'Ã<)Æ=+Ç>,È=*É:)Ì9)Ï8'Ï2#Ó/#ß4*î=3ô?6ñ91í2+Ú7&Ý6&à3#å/"é-"î+%ñ,&ò+(ó++ð(+ò'-ú(5þ%8ÿ5þ2ÿ3ð(5ô.;ô4?ò8Cï;Dð<Eé5>å+6ñ1<ô/9ù-8ù+5ù,3ø-1ö.1ö01Ù1.ä<9Û64à;9ÿljæBAÒ.-Ð.,Û97á?<àA=Û<6Õ7.Ô6+Ô6+Ó5*Å8&Ã6%Ã6%Ä8)Ç;.Æ<1Æ<2Å;1ëaWáTMÉ<3¿0(Ë;3Ï?6Î;3Ñ>6Ú=8×<7Ô=4Ï<2É;/Â:.»7*¶6)·;/»@8ÏTMãgeíorøz~ÿˆý{…ý{ƒùzúx€ÿwÿsÿl}ÿftøbnø]kõG^ÿ:Zÿ9\÷AZÐ_c›gkŠ^e†Oh…Ol„Rt…X{ˆ\}ˆ^x„\q‚X`yO_P`†UeYm•`uœg{ j€£m­p…±tˆ¶v‹¹y‹¹yŒºz‘º~”º‘±•¬€›©†©­’ºµ¢Ç¹°Ë¸²Ì´²¶­®ª¡¢ —˜[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:ZJ:[K;[K;\L<\L<\L<]K=]K=]L<^M=^M;^O<^O<^O<`P@^Q@]P@\NC\NE[NF\OI]PJ`NdcSmfX{g^‰ohœzu¯„|¸†{µ™…º¥…´¯€ªºy¡ÈxŸÓušÍc‹¾OyêAFà@@ÕA=ÌF;ÈJ;ÉJ;ÐF9ÜB:î@?ø;Aþ:Dü<Gñ@HâAFÑAAÅ?<¾?6¶<1¯9+ª;*©:)­9*º?0ÎD:Õ<7Ö21â:9æA?áD?çTLÞVH½;+Á9)¾6&¿8%Ä;)É=,Ê=,Ë9*Î8)Ï3&Ò2&Ù3'å9/ñ>7õ>8ð50è-&×:)Ú8)Ý5(à2'æ/'é.'é,(é,*ç+*å(,è)1ï+7õ';ö";ú=ÿ"A÷8Gä(6ç/;ÿP\ÿ`lÿP\ò<Ió9Gé)8ï)8ô,9õ0:ô17ì01â*(Ü&#Õ2-Ú64Õ1/æBAÿrp÷TUÝ==æFFÛ=:Ú<9Õ:5Ò80Ñ7-Ï7*Ì4&É1#º7#¹6"»8&¿;,À</¿9.À:/Å<4åXQÜMGÊ70Ç/*×<7ÞA:Ú;5Þ=5ë<9ê=9æ?9â?8Ù?5Ð<0Ç;.¿9-»9,»<3ËOGàc_ìnoú|ÿƒŠý~…úx€øy€ùzÿx‚ÿt‚ÿl}ÿdtö_nóXhõE\ÿ6Vÿ7ZùC\ÇYZ‡mRWxIXv@\yCdzIl}PtVw‚XrXoWl‡Zl^o•buh{¤l¨o„ªq‡ªr„­q‡±rˆ´u‰·v‰·v‰·vŠ¸w¹z‘´|«z’¤|¤…­«–¾²¦È·¯Ë¶±¯¬³¡ž¥•’™[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:ZJ:[K;[K;\L<\L<\L<^K=^K<]L<^M=^M;_N<^O<^O<^O<^N>^N>^N?^N?_OB`PC`OEbM\cPdcUodZle‘vr¤~w«‚v¦“~©¬†«Â‰©ÐžÛw“âk‡ÝXuÓFfÿ=MüDPðJNÞJHÌG>ÇG<ÍG<ÙD>èBBó>Cù>Gø@HðCIÞDDÍB=À?9½A5µ=/®:+ª;*©:)­9*º<.Ì?6áFBä<;ïABíAAÞ:8ãJBæXLÔL>È@0À8(»3#Á8(È<-É:*Ë7)Ð8+Î0%×3)à8/é;4ï:3î50ë0+è+'Û4,ß4-ä2.ë31ð43õ45ö58õ6;é/4ç.6ê0=î2Cò.Fõ*Gý,Lÿ1Tð<Hå3?ð@Mÿ_lÿlzÿWfõCSõ>Pî3Dî2Aî3>ê5<æ89Ü73Ð3*Ç/$Ì2*È-(Ñ61óXT÷\ZóXVÜ@AâHHÜB@Õ<7Î70Í6-Ï8-Í9+Ê7'Æ3!³:%²9$´;(¸=-¹;-¶6)»8.Ä>5ÛNGÙEAÎ50Ð1-á>9è?:ã81ä71ð/0ï11ì42é73â92Ø:/Ð9.È:.¾6*º7-ÈIBÜ_Yënlû}€ÿ…‰ýƒõv}õx~ùzÿx‚ÿsÿj{ÿdtö_nðUeôF]ÿ6Vÿ7ZúF_ÀTRvaBJo<Us?[vCdzIn~QtVy„Zyˆ_wŒay”gv›hy¡l|§o«p„«r…«p†ªm‡­rˆ°r‰³tˆµt‡¶r…·r‡¹tŠ¸w·{Œ­x¤x™¤‚«­•À¹§ÎÀµÖüººÆªª¶œœ¨ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:^K<^K<^K<_L=^M;_N<^O<^O<]N;]N;^O<_P=_P=aP@bQAbQAeKTdN[aPc`Usga…rp˜xvž|r—Žv–®ƒžÌ‹ŸÝ‚“çr‚ïbsìObå>Rÿ-Hÿ:QþCTéDKÒ@AËA>ÎDAÖEBãEFêAFï@EïBFçDEÚEAÉC:¿?4º@3±;-©8(¨9(©:)®9(º:-Ë;3èIEë??î;>æ68Û2/ÞA:îZPõg[ÙQCÉA3¾4'À6)Ç9+Ê8+Í6+Ò8,Ñ0&Ü5-æ;4ë:4ê40è/,ê-+í-,ó4;õ3;ø3<þ2=ÿ1>þ0=ý0?ù0@ô1Añ2Dò5Kó5Oó0Põ-Qþ1Xÿ:dá7B÷O\ÿanÿ`nþXfùQbòEXé8Jó@Sê:GÝ2;Ò/2È3-Á9-º=+µ>(Æ9/¿2(ÙJBúkcÝLGáPMÍ<9Ï;9àLJÔ@<Ê7/Ê7-Î</Í<+Ë:'Ê9&®>(«;%­=)²?-±9)®4'º:1ÊC=ÕHAØC?Ô72×2.ç;7ì:6è2.ë2-÷)+÷+,ô.-ð3/é61â:1Ú<1Ò>2Â6)º4)ÅB:×XRçjhú|}ÿ†‰þ€„õv}öyú{‚ÿx„ÿqÿh{ýbtõ^oîSe÷I`ÿ9Xÿ9[ûI_ºQNmZ:Em8ZvCa|InSv†Y|‡]Šbg‚—lœl{ m|¤o}¨p~ªo‚ªnƒ©l…©lˆ«qˆ®qˆ°r†³r„³oƒµn„¸p‡¹t‹µv‰¬tŒ¦wš¨„°´™ÈïØ̾àÏŽÃÓ«±Á›¡±ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M;_N<_N<^O<^O<_P;_P;aP<aP<aP<aP<bP<fLOdMUaO]_Vkgb€sr’yx˜}t‘ŽvŽ­’Ά’á}…ñowýbjýOXö>Hÿ$Hÿ0Qÿ;Uñ<MÞ<GÖAEÓEDÔBCÜCEàBCäADäABÞDBÔC>ÇA6¾>1·?1¯9+¨7'¨:)¬=*²=,À>1Ñ>7ß=:ç79æ/3ã/0á32Û94åNEülaïj[ÙQCÆ</Æ:-È:.É7*Í6+Õ8/Õ4,Þ7/æ93é62é1/ê.,î1/ó32ÿ0Eÿ/Eÿ-Dÿ*Bÿ%@ÿ"=þ:ø:÷'Aó+Gô/Mó0Rò+Rô)Vÿ1bÿ=nêHSÿ`mÿiu÷VeíKZñL]êCUÚ1DéARÝ7CÉ,3¹)(®0$¨9&£A&ŸD'¼=.º;,ÜZMá\SÍG>ÍD>Á61É;7ãUQÕF@É91È8-É:,È9(È:&É;%ªB)¦<&¦<&¬=*©8(¬3(¼=4ÒMFÕGCÝEBÛ96Ü30é73í41ì/+ó2-ÿ)/ÿ*/ý--ö0/ï4/è7/ß;1Ø>2É:,¼4(À;2ÏNHßb^÷yzÿˆŠÿ„†ùzú}ƒü}„ÿx„ÿn~ÿdwù^pò[léN`öHaÿ8Wÿ7YøH]²JGcS1Al6ZtDf~NuˆZŽc…f‡’jˆ—n‰žs‡¤t‚§t§r}¨p}©n©mƒ©l…©k†§n‡ªp†¬o…¯o°l³k‚¶n…·p‡´s‡­rŒ¨wœ¬…²¹šÈƱ×οÞÐÅ·¿Ò¤¬¿’š­ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M=_N<_N<^O<`Q>aR=bQ=bQ=bR;bP:aO9`N8jNMgNRbQ[cWkjfuv’}}™y‘’{¯ŒËƒ‡ã{|ùqsÿgjÿTXÿAGÿ#Mÿ.Tÿ7Wù9Pé>NàEM×EHÑ?B×BDÚACÜ@AÛA?ØC?ÏB9Å?4¿=0·?1¯9+©8(«=,°A.·B1ÇC7×D=Ú64å57ã,0ç02è88Ó0+Ï5-éUKÿznæ^RÎD7É=0Ê<0É6,Í6+Ö90Ú70ß82ä71ç40é1/í10ò53ø87ÿ=ÿ>ÿ>ÿ>ÿ=ÿ=ÿ<ü=ò:ï@ð$Ið&Nï$Qó%Uÿ0eÿ=sÿgrþalôXeîR_ïQ`îM]â?RÖ1Bß:JÑ4?¿-0±-(¦5'ž>&–C%E"¯7&²9(ÒWHº<0ÁA8º7/º3/ÍC@ãXSÕHAÈ91Ä6*Å6&Ä5$Ä6"Ç9#¦B*¢<%£:%§<*¦7&©3'½A7ØSLØIEáGEÞ:8ß2.ê41î1-ï.)ù4.ÿ'-ÿ',ÿ)+ö*)í-(ä1*Ü5,Õ9-Ð>1½3(¼7.ÉHBÙ\Xôwuÿ‰‰ÿ‡‰ý~…ý€†þ†ÿx„ÿl|ý`sõZlïXiãHZóE^û4Sÿ3RóCX«E@\L*?j4Uo?d|LwŠ\†“h‹–l˜pŽtŽ£xŽ«{†«x©t|¨mz¦i}¥g¥h‚¦h…¤k…¦m„ªm‚¬l®j}±i€´lƒ·oˆ·sˆ°tŽ¬xœ®„²¹šÄ«ÐǶÖÈ»²½Óž©¿‹–¬]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^L8\J>]K?]M@\L=ZM=ZO=\Q?^SA_T@_R?^Q@aQAcRBdQCdNAcM@pKEjKIfOUgZknl„v|ž}†¯ƒŠ´Š…®Ÿ‰­¸Š¦Ìƒ”Þ{~îumøl]ûfRðN[æDQä>LéANïCQí>Ké:Gê<Få:Bá;?Û;;Ö<:Ï?7È>4Á;/¼8+ :$¬C0¬=,®6(Â?5ÑD=Ð;5Ó61Û83Ü71Ý6-Ý7)Ü9(Ý='Ù;"Õ7à74õPLõXOÛD9Ç8(Ì?.ÒC3Ñ;-Ò4+ðGDâ.1ï4;ö4?ï+9ÿ@Qí(9þ&+ÿ*-ÿ*-÷"û#$ÿ()þ((òð"ú+1ì )î&1ò.<ç$5ÿYnë+@ÿ`jÿ^iÿYcûT[öPTìHIÛ@;Ê:1ÅA2½F2®D.Ÿ;$”5–7#˜;)œ=+§81«83ÁEC¿;9¾23Æ45È44×CAÜKFÚKEÑD;È:0Ä4+È4*Ì3+Ì2*·?1³9,®.#­'¶,"Æ7/ÓC:ÚG=äPFßE;Ù80Ü1*ç/-ô01ý/3ÿ.4ò14ó12ô01ó/0ó0.î1+é4+à8-Ö=/¾2#¾?0·>3Õ`Wçtqÿù…†ôŠŒþ…Œÿwˆÿe}ÿ[wÿXuÿSoûJgûDcö7Y÷9]ç>[Ú]k„C=PI/F`;Xw<e‡Ku—[zcz e|¤h¨l€©o¨l~§k~¦j}¥g}£f£e£e€¢e}¥p~§o«n¬k~­g¯e±e„²g‡µjŠµpŠ²s°z–¶‡£¿™«Ä¤¬Å§¦±µ˜œz…‰]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^L8\J<^L>^N?^N?[N>ZO=\Q?^SA_TB]QA]P@_OB`NBbPFcOFcOFkLGjMOgS\h_rnoŽw~ª~ˆ»…ŠÁ›–Ì¢Œ»«£»wŽÕx‚í|x÷uhöjYüZgóN\ìFRòHUöJVõERï?Jë;Eä9Aà:>Ú::Õ=:Î?7Ç>4À</º;,¥>+ª?-¨9(²:,ÁA6Å<4Ç7/Õ<7Ó40×4-Ø4*Ø4(Ú7&Û:&Û;%Ù;"Þ52æA;ëMDàI>Ð>/Ç8(Ê8)Ó;.Ý<2öJFæ/1ò5<ø6Aò.<ÿ?Pì'8ö$'÷%(û),ý+,ü*+ù'(ø((ø*,ð$'í%(ê%,þ:DÚ'ð4CüATÞ#6ÿluÿblþZcüW]õOSæBCÙ;8Ñ>6¾8,¾E4¹H6¨?,–1)Ž()ž-'°:6ÑTRÎHGÃ54Æ45Ò<=ëWUØGBÖGAÏB9Ç9/Ä4+Ê6,Ð7/Ò5.Â?5À:1À5.Â3+É4.Ð83Ø?9ÞE=ãJBÞA8Ù6/Ü1*æ0-ó11ü03ÿ.3ò14ó12ô01õ/0ó0.î1+é4+à8-×>0¿3$¼=.¶=2Ó^Uévsÿù…†õ‡Šþ‚Šÿu…ÿe|ÿ[vÿWtÿQoþIhúAaö8Zö=_æF`ÅQ\{?7NH.Ga>Yx=e‡Ks•Yx›awbz¢f|¥i}¦j|¥i|¥i|¤h{£e{¡d}¡c}¡c¡d{¤l}¦n}©l}ªi}ªe}­c¯c‚±cƒ±f‡²k‡¯pˆ«u‹«|¬„©‰‹¤†z…‡doqR]_]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8^K<_N>aP@`P@]P?[O?[O?[RC[QE[QE\OF\OG_PKcQOfTRhTUiTQiVXi]kmi„sv¡zƒ¼ŠÍ‰Ö—‘ÙŸ‹Êª‚¶º}ŸÒ‘烅ð~tïveÿ`k÷S\íGQðFQöHR÷EQô@Kî=Gå6=à7:Ù99Ô<7Í@7ÅA4½?0¸=-©@-¨=+ª;*¸B4ÅI?À;2»0)Ì92Í6/Ò5.Õ7,Ù7*Ù7(Ú7$Ü:%Þ<'ß3/Û4.âA9éOCÜH:Ç6%Æ3#Ù@2á>5õHDé13ó4;ú6@ø4@ÿES÷3Añ),í"&î#&û03÷--ï''í%%÷12ì(*ø7:è+1â)1ë3?ÿR^ï=KÿYiúafñV\îOTðMRêEIÞ:;Õ74Ô?9À6,¿?2»C5²>1ª8-¥3)Ÿ,%œ' ˜% §0*ÆFCÂ::¼,,È44×ABô^]Ò>:ÒC;ÐA9Ë=3Ì9/Ô=4Ú@8Ý@9ÙA>×=;Ü>=ãA?ã?>à;9ã?=ëIDàA;Û=4Ø5,Û2+å2-ð31÷12ú/2ó04ô02ö01õ/0õ/.ð0+é4+à8-Ø?1À4%¸9*´;0Ð[Rízwÿ’’û‡ˆøƒ‹ü~‰ÿr‚ÿcyÿZtÿTqÿMmÿFgü=_ø:^ôBbåQg§?Fn<1OK2KcA[z?h‡Lr“Zu˜^tš_wŸc{£gz£gy¢fy¢fy¡cx byŸb{Ÿa| b}Ÿby¢j{¤j{§h{¨e{©azª^|­^®`…³hŠµnŠ²s‰¬t†¦w‚žvy“pn‡gVb`COM4@>^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^L6`N:aP<`Q>]P?ZN>YPAXPEXOH[RM_UTcWYeX_iYcl\fm]hlbclemolrtšx¶~†Ï„ŒßŠŽç‹‡ÞŠÙ¬‰É³­½y’Í{ßyê†vÿnrÿbgùU\öLUöFPöBMó>Gð;Dæ5;á7:Û97Ò=7ËA6ÄB4»B1·?.©;,­=/¯>0»G:ËRGÇH?¹6.º1)È91Í81Ó;0Ú<0Û;-Ù6%Ü6&à9'á40Û2-à=4ëOCãK=Ñ;,Ð8*àB6Þ7.ð>:é/0ò16÷4<ü8BÿNZÿKWý>Cò38â$&í/1ê,,ð22ç+*é0.ò::Ñæ37Ü-2ç9BïENÿYcôLYÔ?AÚADßCFá>CÞ9=Ü89Ø88Ó:5É83Â91½:2ÀA:ÍNHÖVSÐNNÆAB¯82µ:5ÏKGØNLãQRïYZêRQñYXÉ51Î>6ÑC9Ð@7Ó?5ÚA9àC<àA;í<Bê7=í8?õ>Cñ:?é58í=?øLJà93Ú70Ø4+Ü3,ã5.ì30ò21ô01ô04ô02ö01ö.0õ/.ñ0+ê3+à8-Ù@2Â6'µ6'²9.ÉWMî}yÿ“’û‰‰þ€‹ý{‡üoücwÿXqÿNmÿFhÿ?cþ8\ù=`íIdÙYhˆ25d<0SQ8TgG`}Ej‰Ps’Yt•\u˜^wby¡ey¢fw dv awŸavž`xŸ`zž`{Ÿa| by¢hz£g|¦fz§bz¨_z¨]|«]~­_†²eŠµmŒ³rŠ­s†¦u€œstŽii_RaZDSL8G@^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;_K2_M5aO9_P;\O>ZN@XPEXQKYQO^X\g`hnfsshysg{sg}tfnnzor…rw•v|¬y‚Ã~†×ƒŠåˆ‹ì’뛌ߞƒÆžt¢¡kƒ®mq¾vjÈ{iþllÿklÿfiÿ]`üQWöEMð;Bí5=è59ã68Ý98Õ>7ÎA7ÅC5¼C0¶A-¬8+´@3¯;.°;1ÇRHÓ]SÈNCº;2¾90Á7,Ì9/Ö>1Ý=1Ú6*Ü4'á7(á2-ã60ä=5åE9âF9ÜC3ÝA2á?2Û0&ì62ì0/ð-1ò-4ú7?ÿOYÿZdÿ[_ÿOSá.1ã03ß--÷EEè66Ü,,Û-.ë>@Û25Ù37ÿchÞ=CÊ*2Ê-4¾()Ô;=àAEÚ7:Ù37á8;Ü89Î..Ì43Í<9ÓHEÝSSì`c÷hnõdkî[e¿B<ÆE@å^[÷igÿopÿjjåKK×=;É4.Ñ>7ÕE<ÖC;Ó?5Ö<4Ø93Ø7/ö0=ò,9ó+6õ-8ò*5î+3õ8<þJKà3/Û4.Ø4+Ü4+â5.ê40ï4/ð3/ö/4ö/2÷/1ø-0ö..ñ0+ê3+â7-Û?2Å9*²3$±8-ÃNEî}yÿ’‘üŠŠÿ}‹ÿw…ùl|öatùUmÿHgÿ>bÿ8_þ4\õ@aâMcÂWap/+\A0XX>]lMbIl‰St’\u–_v™_xžcy¡ex buŸ`uŸ`u_vž_wž_zž`{Ÿa| by£d{¥f|¦dz¨`y§^y¨Z{ªZ}¬\€¬_…¯g‡®m‡ªp…¥sƒ t{•nrŠffvi[k^RbU_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<`L1aM2`N6^O:[N>YOE[RMZTT_ZahbprmzuŒ{t“yr“zp“yo”ov’pyšt}¨w€·zƒÈ~…Õƒ‰á‹‹å”ã—ŠÒ™„¼¡ƒ§ª„“«~yŸl[ŽX>ÈH?ÕPIäVRìVUòRRôJMî=Cè38ì7<ç9;à;9Ø=8ÑA8ÈC4¿B0¹@-³9.ºA6«5+£.$¼J?Øh\×eZÊVI·=2¸6)¾4)Î:0Ù;0Ü5,ß3)ä6+á/+å61ã;2Ü:/Ü?0ãF7ãC3ß9+ß1&ê3-ð31ï-.î*.ô17ÿEJÿS[ÿ_dÿ\aâ9<â9<Õ+.ôJKâ89×//Û55Ì()Ë(+÷YZÛ?BÔ9=Ð7:· %Ã))Û=>åBEÝ49Ù,2Þ17Ú/5Í(,Ò37äKNöaeûhnùcl÷_kû_mý_nÒNIÔOJè]ZêVTçMMãGHÑ32Î31ÙA<àKDãPHßKAØA8×:3×50Õ2+ÿ,;þ+:ü(7ø%4÷'4û/:ÿ=CÿILà1.Ü3,Û4,Ü5,á4-ç4-ì5/ï4/ö/4÷/2ù.1ù-0ø..ò/+ë3+â7-Ù=0É;-³1#°7,¹D;ìyvÿþŠ‹ÿyŠþqõhxó`söTlüCcÿ7^ÿ3_ÿ3\óDcÒM^ JMb6+TE0W[@^kMc~Kk‡Tt‘[w•_x™`{ždz cvž`s›]s›\s›\tœ]v^wž_{Ÿa| by¡bz¤b|§b{¦_x¦[x§Yz©Y{ªZ~ª]ƒ­e…¬i†ªm‰§s‰¥u„s|•mv‡unmfwe_P=_P=_P=_P=_P=_P=_P=_P=^O<^O<^O<^O<^O<^O<^O<^O<cP2cO4aO7^O<[OA[RK^UV_Zakgvso†}z™‚~£|¥}w¥{u¥{t§pz«s}°w‚¸{ƒÁ~†Ç„‰Í‹ŽÓ“’Ô˜“Í ”«›¸¼¦³Ç®ªÅ¦”ªˆlmJ©?/¯A2¶@4ÄA9ØGBëMLñHKí?Aî;?ê:=å;;ß=:ØA:ÏA5Ç?1Á=.»;2¾?8¯4,¦1'ºJ>ÏcWÔh[ÔfYÁPB¹?2¹5)Ç7,Ô:0Ù5,ß2+ç6.ã0,ã4/â7/Ü8.à>1åC4â?0Þ4'æ4*é1)ò2/ð..ï-.ò14ô68ü?CðOTúY^éFKõRW×47ëFJÝ8<åBEÚ7:Î.0Ð15ãIKÑ8;Î8:¸#%Ñ<>Ü89ä;>ê=Aç6<â-4Þ)2â19ç<DñLSû^eÿksÿisú`l÷YhùXhûXkðgaèZVèWTØ@?Ï10Ô44Ó41áC@ãJDéRKèSLáJAØ?7Ø93Û81Ü71ý)8ÿ/>ÿ/>ý)7ÿ-:ÿ9CÿAHûABã1/ß4-Ü5,Ý5,á4-æ3,ì5/ð50÷.4ù.2ú.1ù-0ø..ò/+ë3+ã7-Ø:.Ì>0´2$±7,±<3çtqþŠŠþŠ‹ÿr†ýj}ñbtð]pôRjûBbÿ6`ÿ5aÿ8_ïKfÁN[z;6Y?.LH/TZ@]cIbzJj„TrŽ[v”^yšc{ždxžas›\p˜Yp˜Yq™Zq™Zt›\uœ]y_zž`x¡_y¢^z¥^y¤\x¤Wv¥Uw¦V{§X~ª]‚¬d„«h†¨l‡¥o†¢r€šmx‘gr„lk}ecu]_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>^N>eQ6cR8aP<]P@ZPG\TR_Zab^otrŠyx˜€¨ƒ°~~²yx±wv°xw³t}Âw€Ã}…Æ‚ˆÆ…ŠÂÀ—–¾ ¼¬§»¶¬´¾³¯È¸©Ð¿¥Õ¡ϼ”Dz‡·kS®\F¤G5©=0ÂH=áVQðVTòNOì?Aë=?è<<ä<;ß=:×=5Ï;1Ë8.¿82Á<5¹:3·>5ÀPDÅYMÅ]PÎgXÐdWÁM@º:-Å8.Ò91Ø3-ß2,è50æ40á2-à5-ã<3çC7æC4â:-à3%ê5*è-&ð0+ð.,ò21ò44ç.,è00áEIõY]öW\ÿpuåDJéHNÞ=Cü[aÿouÝ>Cÿ~‚ÿmqêQTÔ>@Å02Ñ<>øEIî9>ð7=ø=Fô6@è-8ö>Jÿ\hÿmwÿitÿdl÷]gú^kÿapÿ]nüWhî_YãOKâJGÕ74Ò0.Ù54Ó/.Ø95ßD?ãJDáJAÙ@8Ó6/Ö5-Ü71â94ð$0ý/<ÿ1=ø*6û/:ÿ>Eÿ>Cì44â3.Þ5.Ý6-Ý5,á3*è3,ï4/ò5/÷.4ù.2ú.1ù-0ø..ô.+í2+ä6-×9-Ï@2µ1$²6,°7/èpoþˆˆÿŠŒÿkƒücxð]pïZnôPiýAdÿ7aÿ8dý=bæPi°QW^2'RG3DH/PV<X\C_vHi€Rq‹[v’_z˜b|dxœ_r™Zn—Un—Un—Uo˜Vr™Xt›\uœ]y_vŸ[x¡[y£[w£Xv¢Uv¢Sw£Ty¥Vz¤X~¦_¦c¡d~œf{—frŒ_k‚V`uVZoPRgH\L<^N>`P@`P@_O?_O?_O?aQAbRB_O?]M=]M=aQAcSCbRB`P@eS;aP<_O?^QH[QOZSZeapsq‰xxšz|¥~€±€¹}¼xy¹rs¶no²qwÏv{̓̋Ȗ—䤾²±¹½¸²ÌŲÓÍ­ÙЩÛУÛÑ ÝÑ¡ØÌšÒƔզŠ·gŸ_FËzgØte¾G?ØQMøbaìILç>Aä79æ9;ã99Ü75Ù61Û94È95À50ÇB;¹=5¾I?ÄXK·PAËeVÎdVÊYKÃG;Ä:/Í6-Ù6/â5/å3/á/-ß2,â70ä=4à<0Û8)Ý5(å8*å/$ê/(î.)ð0-ï20ë40è51æ40Ó8<åJNõY]ëOS×7?×6>ùX`ÿ~†ÿ~†ÿowÿgoÿipÿfjõ\_ïY[ô^`ÿRYÿCKü8Bü7A÷1>ï+9î/>ñ=IÿS_ÿ`kÿgpÿepþboÿbpÿ`oÿ[lìTOßFA×85×31Ù10×/.Ú21Ü86áD=ÜB:Ø?7Ö<4×90Û81á83ä84ô5=ó4;õ3;÷4<ø5;ó49ë33ã1/Þ3,Ý6-Þ7.à5+ä3+é2,ñ1,õ2.ø/5ø03ú/2ú.1ù//õ/,î3,å7.à@4Ë9,½7+®/&·<5ÒXWÿ˜šù~ÿhÿe|ö]rîRhòHeÿAeÿ9bÿ5`üJlÕRd‰==K. >>&?I.IO5]]EWlAcxMqˆZx’by–`t•\r–Xq˜Wl•Sm–Rn—So˜Vr™Xt›\uœ]uœ]tœVtWv Xw¡Wv¢Uv¢Uu¡Tt S{¥[{£\zŸ\u—Zn‹Uc}MXrCSj>AW1?U/<R,[K;^N>`P@`P@`P@_O?`P@aQAbRB`P@_O?`P@bRBcSCbRB`P@fVF_QD\OF_TRcZ_f`nmkƒwv˜wy¢{}°}¸x|»qt·lo¶ln¸oq»suÙ|}Ù‰ˆÔ˜—Ш§Æ¹¶½ÉƵÓÏ©Ý×£âÜžçßžæÞäÜžâÙ ÙÒœÑʖѼ¸€¦~dÄ‹wÉ}m¶VJÓ`Y÷qnîZZêJLä>@é<>ì>@è:;ã56á34Õ=:Ë73Ê?8¹6.·>3¼L@³I;Å^OÛp`ÒaSÄH<½5)Ä0&Ö5-Ý4-Ü/)â43å95å<7à<3Ü8.Ù5)Ý5(ã5*í6.ï4-î1+ë0+ç0,ã2,á4.Þ5.Ò9;×>AäIMóW[ü\dü\dþ]eÿ`kôR]ïMXñQ[ÿ_gÿjqÿflô[`ëRU÷07ó+5ô+5ù-9ó&5è/ç'6í7DüP\ÿ[dÿclÿemÿepÿdoý[hõP^åFBÞ<9Û64ß63á53Þ20Û2/Û62à>9Û>7Ö<2×:1Ú91ß82å95è96é9;ê7:ë7:î79î79ì57å31Þ3,Û4,Û7-Þ7.á6,å2+ì1*ó0,ø1.÷05÷03ú/2ù.1ù//õ/,î3,ç6.ß=2Ò>2Â8-µ2*·82ØZ[ÿ“õw{ÿa{ÿ^v÷WqöOkøFfý=bÿ:cú=cëLhºJVw<8F5#7=#9C(DH/UP<Tf>`rJnƒXw_v“]t“Zp”Vn•Tk’Ok”Pl•Qm–Ro˜Vr™Zsš[sš[tœVuWuŸWuŸUtžTržQqPq›Qn˜Pl”NhŒLbFXu?Nh8F]/@W+@W-@W-AX.YL<[N>^QA^QA^QA^QA_RB`SCaTD`SC_RB`SCaTDaTD`SC^QAbUM^QK[QPcYakesqm„vu•y{¤y{®y~¶w}»ns·ei°bf°jn¸rvÀ}zᇃᖔߩ§Ù¼¸ÏÍÊÃÝظçá­êå¡ïéŸðêžíæžéá¢âÛ¤×Ï ËĘ´°“¦œ˜„k§„p¥p`œRG»]UÞmi÷usð^_çHLæ@Dí@Dí=@ë7:ç36Ü>;Ô;6ÔA:Â70·7.µ?3­=/µG8Új\Þj[×\MÊB6Å2(Ñ4+Ú6-Ú1*Þ44éA>ìGCà=6Õ2)Õ1'Ú2'Þ0%è3*é1)ç.)æ/)ã2,â7/á=4âA7Ã-,Ê43ÜCEðVXú^bùYaóS]òP[èFQêHSðNYü\fÿmvÿmtôY_ÜAGó*2õ,4ý1<ÿ1>÷*9ï&6ö6EÿJX÷ISõOY÷W_ü_fÿdkÿai÷Q[éBJÞ95Þ63ã75é<8ë<9ç85â51Ý60Ý:3Ù;2Ö90×90Û81á83ç:6ì:8à;9â:9ã99ç98è88å84à40Ú3+Ú6,Ú8-Ü8,á6,å3)ì/)õ/,ú0.ô15õ13ø02ù.1÷//ó0,î3,ç6.Ý9/ÛD9Æ9/»4.´0,â`bÿƒˆônuÿ_zþWsúPmþLlýDfø8_ö9_ðGf×ReDJi=4K@,7@%8@(ED/LE2N^9YkEg|Qr‰[tZqUmRkMi‘Kh‘Ki’Lk”Pm–To–Up—Xq—ZuWuWtœUrœTpšRm—Mk•Kj”LdGaˆE\~AUt;Li3E_/AX*>U'B\/E_2Ic6WJ:ZM=\O?^QA]P@^QA_RBaTD`SC`SC`SCaTDaTD`SC_RB]P@YNR[PVbXcjcsqm†vu•xz£z|­w|´sy·mr¶bi±]c­ag±lr¾v|È‹‡æ”‘褡淴áÇÄ×ÕÒËáÞ¿èå²ëç¨ïê¦îé¥éã¥ãܨÛÒ§Ëß¾µ–Ÿ§˜š…‰v—‚q—se™cW³i`Ïrmû‹‰õutë[[çKNéCGî?Dî;?í8=ß:8Ý;8ßD?ÓC;Ã:0¹;/¯7)¦2#¾J;ÚbRék]ÛSGÉ9.Í3)Ö5+Ø4+Ù33ñMLý[XíKFÙ80Ö3*Û4+Þ2(à-&á,%á,%ß,'Ý0)Ú6-Ø<0×?2À0(Ä4,Î:6ÙCBßFHàEKäGPìLVñQ]öVbøXdû[gÿgpÿmuôY_Ø=Cñ.2ò-4ô-4ò*4í%2ì(6û<KÿS_í?IçBIèGMòQVþ[`ÿX]ôGMä5<á51ä73ê;8ó?>ô@?ð<;ç85à72Ü92Ø:1×90Ù80Ü71ã73ê86ì87Þ<9ß;9â:7ä;8æ:8ä84Þ5.Ø4+Ù7,Ú8-Ü8,á7*å3)ì/)ô/)ù/+ó25ô23õ12÷/1÷//ó0,î3,ç6.Ü8.ßG<É90¾3.´-*îfjÿy€ójrÿ`{ýTqþKkÿFjÿ=cö3[î<^äPhÄXe…DBbE7WP=DH1@D-JH3JB/IW4Sc?btLmƒUp‹XoŒRkŽNiŽKgIg‘Ih‘Kj“Mk”Pm–To–Wp–YtœVs›Uq™Sn—Qj”Lg‘IeŽHdG`‡D]AWy=Rq8Mi6Lf6Ne7Pe:Lf6Oi9Sm=UH8WJ:[N>\O?]P@]P@_RBaTD_RB`SCaTDaTD`SC_RB_RB_RBTLY`Xgnf{tp‰xt•xw¡xz«y{´sy·jqµ`g¯\b¬`f°kq»v|Æ~„Ε”äžžè­­é½¼æËÉßÕÓÔÝÜÊãàÁåâ¹çã¶æß³àسÚÑ´ÐůÀ´¤¯¥™”œ‰ˆ†y‰}qwk›sk§ngºoi扄î~ósróedòVYòLNðCEî>Aå95â:7äB=ÞE?Ì<3Æ=3ÂB5­1%¬1"ÇI;ÛYKÖN@Ì=/Î8*Ò6*Ñ3'Ö34õUUÿkhú]XâE>Ü;3ß;2ã80â4-ä1,â1+Ý0)Ö/'Ì0$Æ/$Â0#Ã9,À4'Á3)Ë:5×CAÛEGÛBGÛ@HàDOìOZóVaòVaú^iÿgoóYaÝDIð88í55ï26ð18ò3;÷9CÿHSÿVaä6?Ý4;Ý7;êAFøKOüIMô;@ê05å61ë95ñ;8ó;9ó;9ð:7é73â70ß;2Ü;1Ù;2Û:2ß82ä73è64ì65á<8ã;8ä;8è:9è;7æ95á6/Û4,Ú8-Û9,Ý9-á7*å3)ë0'ò/)÷0+ð45ñ33ô22ô01ö0/ò1,î3,ç6.Þ7.ÞD:Ê7/¿1-¾21÷jpÿrzøhrû]vúPmÿCfÿ<dÿ7cù6^éDbØ[m©W[uF>_L;_ZFQP;KI4PI6MB0DR1M[8[kFf|Nm…SmŠPlŒMhHfŽGgHg‘Ii’Lj“Ol•Sn•Vo•Xt™Vq˜Un–Pj’LfIcŒFaŠF_ˆDZ@X|?St;Pn8Pj:Tk=XmB[pEUp=Vq>Wr?RE5UH8XK;ZM=[N>\O?^QA`SC`SCaTDaTDaTD`SC`SCbUEdWG]Ulje|yu}yœzy£wyªvx±sw¶lqµcj²[c¬]e®hp¹w}LjІՙܡ¦à¯²å»¿åÆÇãÍÏÞÔÓØ×ÖÑÙ×ËÙÕÉ×ÑÅÒÉÂÌÂÀŹ»´§®¥˜¡‡Œ†xzuwvqulg~mfŒoib[œa[¾sm×zuï{ü|yÿrpýccöSTîHHñB=ê>:ã<6àA;Ñ:1ÒD:ÝTJÂ>2¸6)¼:,Â=.È?/ÏA3×C5×?1Ñ8*Ð23èLMú_]ñXSßD?Ø;4Û81à70æ92ç92ç92â92Ú9/Ñ9.È9+Ä8)®)¸3"È@2ÓI>ÒE>Ë;:Ì7;Ð9@Ï8AâHTïUaðYbõ^g÷`iêU[ØCIè?:ë?;ñAAúGJÿMRÿQYÿT]ÿV^á4:Ú/5Ú03ç7:ô=Aù:?ø48÷/2é61ï95ð95í41í1/ê20ç40á4.ã<4à=4Þ=3Þ;2à93ä73è43ë33æ:8ç98ê88ì89ì87é75ã4/Ü4+Û7-Û9,Ý9-ß7*ã2(è0&ï0(õ0*î45ð43ó32ó11ô1/ò1,î3,è5.à90Ù<3Ì70Á0-ÑAAÿnuýku÷coïSkóIfÿ;cÿ1`ÿ3bÿ<dçMgÇ]i†IFeH:YN<\WCXQ>RJ7QF4MB0AL.GU4Sc>`rHgMj‡MjŠKh‹GeFfŽGfHgJi’Nk”Rl”Um“Vq–So”Qj‘NgŽKcŒH`‰E_ˆF_†G\‚E[~DWxAVr?Uo?YpB]rG_tKYtAYtAXs@NB2QE5UI9WK;XL<ZN>\P@^RBaUEbVFbVFaUE_SCaUEfZJj^Nkg‚up|x›{y¡wx¨vw­pt±jo±ah®^f¯_g°em¶pxÁ~…͉ؖܙ¡Ï ¨Öª±Û´¹ßº¿ß¾ÂßÂÄÝÅÆÛÆÃÖÅÁÒÁºÌ¼³Æ»¯Å´¨¾¦˜±—‰¢†‡‰qqstpqogevhe†nj`Y”e_š[T·g`×tnî{vÿ{wÿwsÿhfù[ZÿQKöGBè=6èC=Ø;4ÛG=ê\RÅ;0Ä<0½7+¾6(Ç>.ÑD3ÔC2ÔA1×A0Ò8:Ø>@ÜDCÛC@Ö=8Ó91Ø7/Þ7/å:3æ93å:3â;3Û>5ÕA5ÑE6ÌG8¬.¼;%ÌK8ÑL=Æ=3»0+¿10Ë8>ÕBJáKVëU`ðZeð]eìYaßLRÐ?DÑ4+Ö8/ß<7ê@@ñDFôEJñBIî?Fâ5;ß26ã36ï8<õ79ù14þ-2ÿ.4ë40ð95ò64ì0.è,*è/,è2.á2-ä=5à=4ß>4ß<3ã:5ç85ì65í55ì57ì57í57ï56ï56ì42å2.Þ1*Þ7.Ü:-Ý:+Þ8*á3(ç1&í1(ò1*í55î53ñ42ó11ó1/ò1,î3,è5.ã;2Ò4+Ò;4Æ20çUVÿpxùcnñ[gãKbóEfÿ7bÿ+]ÿ1bÿ@hÞKe­RYd8/ZI7SN:UN;[P>VI8M@0MA1=H*CN.K[6Xj@ayGf‚HhˆIgŠFeŠDc‹BcEeŽHgLh‘Oi‘Rj’Tn“Pl‘NhLd‹Jb‰H_ˆF_‡H`‡H_…H_‚H]~I]yH]wH`wKcxOdyP[vA[vAZu@MA1PD4SG7VJ:WK;YM=[O?]QAcWGdXHdXHbVFaUEcWGj^NpdTvq‘yu˜xvtsŸrr¤su®lp¯bg«Za©^f¯em¸lt½u}ƈДڕœâš¤ÈŸ©Í¦°Ô¬´Ù°µÛ±µÚ²´ÚµµÛ³±Ö²®Ñ®¦Ë«¡ÄªžÂ¦˜»™‹®‹{Ÿ|y€dbgidhbY\g[[xeauXRe]ˆOHŸVO»aY×jcóvpÿ}zÿwuÿljÿZUÿPJñD>ôMGàB9ßF>êWOº,"¼2'½5'Ç=0ÑE6Ë>-Á2!É8%ÙF4ÞDFÒ9;Ë32Ë62Ó;6×<7Û<6á<6æ;4å82à5.Ø4+Ï5+Ê8+Ä<.Â>/ÑU;ÅI/»='½;+Ã=2Ä;5Â65Â37ÜKRÞLVâOYåS]éWaæU\ÝLSÒCGÉ5)Ð8-Õ81Ú64Ý55ß58á4:ß28å8<å6;ì9=ö<?ú6:ú,0ÿ).ÿ.4ë4.ò94ô86í0.é,*ë/-ê40ã5.ä;4à=4à=4á=4ä;4è96í76ï56í36î15ï05ð24ñ35ì31æ0-Ý/(ß7.Ý9-Ý:+Þ8*à4&æ1&ì1(ñ2*ì65í53ð42ò21ó1/ñ1,î3,è5.å=4Í/&×>8É53øceÿpyô\hêR_ÞHaõGhÿ:eÿ*]ÿ/aÿ@hÓE]–AFQ-!UJ8PN9OH5\O>YH8L<-NB2:D)?J*GU2Rd:]sBcEf†GeˆDcˆBa‰@a‹CcŒFeŽJfMgPhRlPkOfLcŠIaˆG_‡H_‡H`†I\‚G]€H]~I`|Ka{Ld{Of{Rg|S]xC^yD_zEAC8CE:IF=OH@RGAWI@]M>`O=aQ:aS9`T>_VGaZTfaeljwro€wožzt¢~wªzu«ro¨hf¥a`¢^^¦ba­hg·qoÃ|xÏ…€Ú‰ã—í–ó¢žÙ£ŸÚ¥¡Ü¦¢Ý§¡Ý¦¡Û¥ Ú¦žÙ¥Ö£œÒ¢™Ð¡˜Íž–É—ÁŒ‚´ƒy«mrvghlc_`e[ZlYUtUP€ULVK–RG¨ZN²ZP½\SÔmdç|tò…~üˆðxyõyyæabÜPQ×EEñYVÎ61È1(Ç5(Ä7&Â6%Ã8%Æ9'Ì:+Ð<.Õ?1Ô8+Ö=/Ø?1Ó;-Í5'Í4&Ø:.ã?5à90á90Þ7.×7+Ï7)È;)Ä@+ÁC,Ä;3È?7ÍD<ÏF>ÌC;Å<4»2*µ,$Ä>5ÍG>×QHÞXOá[RßYPÖPGËE<Ì<!Ò<$Û:(å4,ë--ó'0÷%2û$6ÿ(@ÿ'@ÿ'Bÿ&Bÿ%Bÿ$Bÿ!Aÿ!Aÿ:ÿ"<ÿ'>ÿ)<ö*6í.6ç48å;;Ü94Ü:5Ý<4à;5ã:5æ93é73é62ì25ì44ë54è64ä71ß7.Ú6,Ø6)Û9*Û:(Û:&Ü9&ß8%á8%â7#â7#í41ï4/ñ4.ó3.ó4,ï5)ê6(å8*à:.Ø7/×96Ý>BÿlyÿasþRlöGdÿIjû5Yÿ5]ÿ;eú=cãPj©LVT)":1 9<)EF4RL>PH;BC39E15K4FGHJ#MQ,U\:\jGcuOf}QeNc…Hb‡BaŠ>cŒ@eDjIl‘Nm‘Qj’IiFgŒFf‹Ff‹Hf‰Ic…Ic‚GdƒJdIc~Gc~Gd€FfFe~Dc|BX}8[€;^ƒ><?4?A6FC<JE?OF?TG>[K>^M;`O;`Q:^S?^WGa\Vhcinlyrqƒtnšvpžtp¢pm¢gfŸaaŸ]^Ÿ\\¤ed°kjºtrÅ}{φ‚ÙŽˆà”Žè˜’ì›—Òœ˜Ó™Öžš×™Ö—Õœ–Ò•Ñž–Ñœ”Íœ“Ê›’Ç™‘Ä“‰»ˆ®€w¦tmtkdkf]`e[YiZSoWMzVJŠVI›UK°\RºYRÁXRÓf_Þqjãvoêwý‡…ÿˆ‡÷uuðfdäTSíYUÇ2+Â/%Æ7)Ã7&À7%Á8%Ä9&É:*Ï;-Ó=/Ö8,Õ9,Ó:,Ò:,Ñ9+Ñ9+Ô8+Ø8,ß;1à90Ü8.Ø8,Ð8*Ç:(¿;&¼;%¿4-Á80Æ=5É@8ÊA9È?7Å<4Â91¾5-Ç>6ÑH@ØOGÚQI×NFÌC;À7/Ê8Ñ9"Û8)å4,ï./ö*3û(7ÿ(:ÿ+Bÿ*Bÿ)Aÿ&Aÿ$@ÿ >ÿ=ÿ<ÿ8ÿ9ÿ$;ÿ);÷-9ï29ê7;å;;Ü94Ü:5Ý;6à;5ã:5æ93é73é62ì25í36ë54è64ä71ß7.Ü5,Ø6)Û9*Û:(Û:&Ü9&Þ9%á8%â7#â7#é4-ê3-ì4,ì4*ì4*ë5(æ6)á7*Þ</Ó5,Ó52óTYÿesÿ[põGbüKhÿ@dÿ:`ÿ1[ÿ7aùImÐJb‰8?O,&=7'3:(:=,C@1F@0@?-;C.:H1@CKP'\b<eoLhvRezSd~Qd‚LaƒFa†@aŠ>cŒ@eDiŽHkMlPl’IjGhGf‹Ff‹Hf‰Id†JdƒHe„KdIc€HdHeGeGfEd}C\<_„?b‡B69.:<1??7E@:KB=OE<VH=[K<^O<\O<\TA_WLc^[helol}sq†sm™qk™jg–c`•\[”ZZ˜\]ž\_¦hjµno¿wxÊÒ†„Ø‹‡ÜŠà’Œâ“’Γ’Γ‘ЕДѓŽÐ“ŒÏ’‹Î•ŒÍ“‹Ç“‹Ä”‹À“‹¼Œ„³ƒz¥{r€dpt_fiZ]c\Vc\ReYKqWH„TF£ZQ¾_YË[YÐXWÛcbßliÝpkàwqûŠ†ÿŠ†ÿ…ÿ|yømhï`ZÄ4+À2&Ä8)Á:'¾:%À9%Â9&Ç:)Ì:+Î:,Ù9-Ó5)Î5'Ð8*Ô>/Ô>/Î6(Ë/"Ú:.Û7-Ù7,Ö8,Ñ9+É:)Â9&¼8#¾4*À6,Â8.Ä:0Ç=3Ê@6ËA7ÌB8Å;1Ê@6ÏE;ÐF<ÒH>ÑG=Ê@6Â8.Í6!Ô7&ß7,é3/ñ03ø,5ý*9ÿ*<ü'=ü'=û%=ù#;û!:ü8ü7þ7ÿ6ÿ6ÿ#8ý*;ù1<ñ6=é9;ã;:Ü86Ü:5Þ;6à;5ã:5ç85é73é62ï26î47í55ê65å61ß6/Ü5,×5(Ù9)Ù9)Ú9'Û8%Ý8%Þ7$à7$à7$â4+â4)å4*å5(ã6(â7&Þ7'Û8)Ý=1Ï2+×98ÿltÿ]nþPið=[ÿJlÿ5\ÿ=eü4[ô<`êTq«?Oa#(H1+79+-8'18&:;)B=*A<(@>)@B*?GY`4s~T€Œfw‡bi~Ub|MaI`ƒC`…?aŠ>cŒ@hŽEjJkMlPn”Kk‘HhGgŒGgŒIh‹KfˆKf…Je„Ke‚Jc€HeGf‚Hf‚GeFcDb‡BeŠEhH06*58-;<4A>9G@:KB;RE<VJ<XL<YN<YRB^WOc_`igrom‚ppˆpm˜jg”`^WW‹TUŽWY–\_¢ad«ko¹qtÃ{|Ì‚ƒÕˆ†ÙŠˆÛŒ‰ÚŠÛÍŽŽÌÎŽ‹ÎŠÑŽˆÐ‡Ï…Άʎ…ÆŽ†Á‡¼‡¶‰‚«€xxq“‹[i}WbmWYa]T\`Q\^IhYF}SCŸULÂZYÔW[ÝV\çbeçkkàplâysê}vì{uýƒ~ÿ†€ÿ{õkaÉ<2Â9)Â;(¿:'¾<&½;%Á:&Å:'È9)Ë9*Û9.Ö6*Ð4'Î8)Ñ>.Ð?.Ë8(Ç/!Ò6)Ó5)Ô4(Ò6)Ñ9+Í<+È=*Ä;(Æ9/Æ9/Æ9/Æ9/Ç:0È;1É<2Ê=3ÒE;ÒE;ÐB8Ë=3Ë=3ÏA7ÏA7Ë=3Ñ4#Ø6)â5.ë31ò/5÷+6û(7ü)<ù&9÷&;÷&;ø'<û&<ý%<ÿ$:ÿ#:ÿ!7ÿ"7ü%7ù-9÷5>ñ:?ç9:à87Ü86Ü:5Þ;6à;5å95ç85ê65ë54ñ27ð37î66ê65æ72á6/Ü5,×5(Ø8*Ø8(Ø9&Ù8&Ú7$Ü7$Ý6#Ý6#Ù6'Ú7(Û8'Ü9(Ü9(Û:(×:'Ö:+Õ;/Î3.éIKÿo{ÿVjøDaö=_ÿCiÿ/[ÿ7`û=cëLlÆOe€0=G >3--3'+8'2=,=B.B@+C;$G="MA'R_*q}MŸp—¨|ƒ˜mj„W_{J]~E_ƒCa†@b‹?fCk‘Hl‘Lm‘Qm‘So•Ll’IiŽHhHhJiŒLhŠMiˆMf…LdƒJdGe‚Hf„Hh„If‚EeDf‹FiŽIl‘L-3'17-7:3<;6B=9G?<MD=QG=SI=SK>UOCZUQa_dhgukkƒllˆjg’baXV‡PP†QQXYš`cªfj´orÁuxÉ|Ѓ„Ö†‡×‰ˆØŠ‰×Œ‰ØŒŒÌ‹‹ËŠ‰Í‰‡Ð‰…ш„ÑŠƒÓ‰‚ÐŒ„Ï‹„È…Á†º†²‡¥}x–vpŠ“ScƒQ\qUT`^RVcOTbH_]DvUB’LB¼RRÖPWàPYé\dèejâljâwqâvláphõ~vÿ‚{ÿ‡~ôkaÉ?2À8(À;(¿='¾='¿='Â;'Å:'Ç8(Ê8)Ü8/Ú7.Ô8,Ï9+Ê;+È;*Ç:)É7(Ï9+Ñ7+Ô8,Ó7+Ï7*Ì8*Ë<,Ë>-É=0Ê<0Ê<0É;/È:.Æ8,Å7+Å5*Ð@5Ð@5Í=2Ë8.Ë8.Î;1Í:0É6,Ò.$Ù0)ä2.î23ô/8ù-9û+;ü+>ü-?û.?ú0@ü/@þ/Aÿ.?ÿ-?ÿ->ÿ)9ý)8ø*7õ0:ó6=ì9=ã77Ú53Ü86Ü:5Þ;6â:7å95ç85ê65ë54ò38ñ48ï56í76æ74á6/Ú6,×5*Ö9*Ö9*Ö9(Ø9&Ø9&Ù8&Ú7$Ú7$Ô9%Õ:&Ô<'Õ=(Ô=(Ô=(Ó>*Ó=.Ð8-Ù;8ÿ^eÿaqÿPi÷;\ÿAiû6aÿ/]ÿ.WøIjÛYq•>NX'-?+,730*1)-9-5@/:B+<<"B;VG(iV6v‡P£lª¾‹¨¾Ž¥wo‹[aK^F`…BcˆBeŽBj“Go•Lp•Po“So“Uo•Ll‘KiŽHgŒGiŒJiŒLi‹NhŠNf…Je„IdƒHfƒIg…Ih†Hg…Gf„FgIi‘Kl”N*2%.4*470894<;7B=:HA;KD<NH<NH<OKBUTR_^ffewggfg†ba[YŠQQ…NO‡RS“[^£ei³lo¾sxÊx}ÑÖƒ…؆‡Ù†‡×ˆ‡Õ‰ˆÔ‡ˆÈ†‡È……Ë…ƒÎ„Ð…€Ô…€Ô‡Ò„ÓŒ…Ë…Á…¸‹…«„{vŒrn•N\ƒNTqTPa_PWgMReI\`EsXCOCºTRÔSXàPZëYcé`gähjçqqê{rärhö}tòsjþxmæ\QÄ:-¾5#À<'À>(À>(Á=(Ä;(È;)Ì9)Î8*Ú3+Ù6-Ö:.Î:,Ç:)Â9'Ä;)É=,Í>.Ö@2ÙA4×=1Ï7*Ê4&Ê8)Ë<,È:,È:,É;-Ê;-Ê;-È9+È6)Ç5(Ê6*Ï;/Ò>2Õ>3Ö?4Õ>3Î7,Å.#Õ)%Ü-*ç02ñ29ø0;ü/>þ/?ý0Aú0@÷1@ö2@ö0=÷/:ù-9ú,8ü*7ý/<ù/;õ0:ñ2:í6;æ68ß55Ù42Ü86Ý:5ß:6â:7æ87é77ê67ë54õ49ó49ð69í76æ74ß6/Ú6-Ö6*Õ7+Ô8)Ô8)Ô9'Õ8'Õ8%×8%×8%Ï:$Î<%Î>&Í?'ÍA(ÍA*Î@,Ï=.Ð71éIKÿgrÿOdÿHfû7]ÿAmý/_ÿ1^ø1XåOj¹Wfh39@*,?994443524925>-2<#29ECl`8Ž}R™±u©Á‡µÎ—­È•’®}v”be†Q_ƒF`…Bc‰@gDo•Jr˜Or—Rq•Up”Vo•Ll‘KhGf‹Fh‹IiŒLi‹Ni‹Og†Kf…Je„If…IhˆIjˆJi‡Gg…EhJk“Mn–P(0#*2'/4-350664<87@<9C>8IE<HE<KHCQQQ[[eabvab~`a€_]ŽZXŠTTŠTT\] gi´psÄtyÍ{Ø~‚Û…Þ„†Ýƒ…؃„Ö…„Ò†…Óƒ‡Ç„…ȃƒË‚̓Ó„€Õ†€Øˆ€Õ„Õ‹„Ê‹ƒ¾‹ƒ²ˆ‚¤|’uqlirŒOVNQpUNc`OYgMVfI]dEo]EˆTF²[TÌXYÙSZæYaé\dèaeðknñ|rìsj÷xoÞYPå[QÒD8Ã5'Æ:)Ã:'Ã<(Ä='Æ=*É<*Í:*Ð8*Ó7+Ö/'Õ2)Ò8,Í;,Å<*À;(À;(Ã<)Ç;*ÕC4áK=ßG:Ô</Ê4&É5'Í;,È9)È9)È9)È9)Ê8)Ê8)Ë7)Ë7)Í7)Ó;.×?2Ù?3Ú@4ÝA5×;/Ï3'Þ..å12î49÷5>û3>ú0>ú0@ø/?ò.<ï/<í/9í07í.5ï,2ò+2ò)/õ1;õ3<ò5;ì59ç47á55Þ65Û75Ü86Ý97ß:6ã:7æ87é77ê67ë46ö5:ô5:ñ7:î87æ74à72Ù6-Ô6+Ñ8*Ð8*Ð9(Ð9(Ð9(Ñ8&Ñ8&Ó8&È:"Ç;"È>$Ç?%ÇA(Ç@*Ê>-Î;1Õ:6üU\ÿ_oÿGcÿ>bÿ8cÿ6gÿ0cÿ4\òCbÈMa…BIL44:97<<>948>58<7379+3="8DS[,ƒPª£o«Èˆ¯ËŽ¯Ì’¦Ã‘¯}{™ggˆQ^‚E^ƒ@c‰@iDo•Js™Ps˜Sq•Uo“Un“MkJgŒGeŠEgŠHh‹Ki‹Ni‹NfˆLd†Id†Ig‡Hi‰JjŠIi‰FhˆEi“Kl–No™Q&.!(0%-2+130333756:97>;6GD=DD<GFAOOQZZd_`t^_{\]|`^\ZŒYX‘\\œgg¯qrÂz|Ó}܄ゅ䃆ㄅႄۂՂ҃‚ЄˆÈƒ†É„„̃‚Î…Õ†‚׈‚Ø‹ƒØ…ÒŒƒÆ‹‚¹‰‚«…›xˆsntjfgSPuRLjWIe`MafO\gI`cFn`FxR?[M·ZSÆRRÚUZåV\ëX`ö`iótkïof÷qhÑD;ÔA9Å1%È4&ÔC2Ç9%Ç:&È;'Ë=)Î;+Ó:,Ø8,Ù7,Ð,#Ð/%Î6)Ë<,Ç@-Á>*½<'»8$¾5#ÑB2ãOAäN@ØB4Í7)Ë7)Ð>/Ê;+É:*Ç8(È6'È6'Ê6(Î8*Ð8+Ó;.Õ;/Õ9-Ó5*Õ7,Ü;1Ý<2Ú9/ë7:ñ8=÷:Aü8Bü4A÷.>ò,;ï,:í/;é19è38é58í57ñ48ô36ö45î49ï6;í9<é69â45Ý33Ý86ß;9Ü86Þ97á98å99æ89é69ê67ë46ö5:ô5:ñ7:î79ç85ß82Ø7/Ó7+Ð8+Í9+Í:*Ì;*Í:*Í:*Í:(Ï9(Ä: Â: Ã=$Á?%Â@(Ä@+É=.Í81ß<?ÿ[hÿQhÿHhÿ7]ÿ<jü,]ÿ7iì;XéYp§LUX00?<5<E@99;B3:G08F21?9+<E(DW*at=Žœ_²»|®ÌŒ«É‹¥Ä‰œº„Ž¬zy™gf‡PZ|@]‚?a‡>hŽCo•Jr˜Or—Rp”Tn’To“MkIgŠFeˆFf‰Gh‹Ki‹Ni‹NfˆKe‡Jd‡GeˆHgŠHh‹Gh‹GfŠDj”Lm—OpšR(0!'/"(-&+-*.0/333775:94==5?@8DE?JLKQQYVWiZ\s]^|YW†[Y‹^]–ee¥nn¸wxÊ€Ú„„䊌ðŠŒðŠŠì†‡ä‚‚Ü€Ô‚€Óƒ‚Ò€„ĄǃƒÉ„„ΆƒÒˆƒÕ‹ƒÖŒƒÒŠ€ÇŠ€½‰±…~ €xwpxkeec^XpZMm[Mi\Kf^Kd_IcaHfbGl`FlR;„UA£^O¿aYÑYXßPTñQ[ÿXbôkcæYRÔD<Î70Ñ7/×;/Ø</Ô;+Ï9(Í:(Í:(Ð:)Ô8)Ù7,Ü5,ß4,Ð/'Ï2)Ì8,Ê>/Å@/Á@-¾=*¼9'Â9)¾0"êVJáJ?Å.#Ñ=1Î</Ç8*Ê;*É:)È9(É8'É6&É6&Ë5&Ì4&Ð7)×;.Ü>2Ü<0Ù7,Û7-â>4éE;øAFó8?ð3:ö4?ö2>ñ-;ï,:í2=ì7@æ5;ã68å78é99ð:9ñ86ò65ï==î<<ê:<æ89á77ß76Ü75Ü75Þ97á98ã99æ::é9;ì9<í9<ï8<÷6;ô5:ñ7:í9:è:9à;5×90Ï7,Ë7+È9)Ç:)Ç:)Ç:)Ç:)È;*È;)Á9!Ä>%½;#µ5»:$ÈE3Í@6Ê0.ÿ^eÿVgÿHcÿ;\ú0Xø/[ý5cÿ<jã\m¯EOo33G6.9C8:E==9:B+3P-4N00D7'CJ)Wo=}›_œ¹v«Å~«ËŒŸ¾‚˜·~”²~‚ nf„RXvBY{?]€>c‡?iDn”Im•Ll”Nk’Qj‘RjŽHfŠDc†Bc†Df‰Gh‹Kg‰LdˆJg‹MhŒNg‹Kf‹HeŠEf‹EjIm“Jp›SrUtŸW*0")/#).'+-(-/.222553782;<4>@5BC;HJGOPTSUaXYm[[s\Z‚^]‰da–kj¦us¼}Ї‡á‹‹íŒòŒ‹ñ‰‰í…„ ڀ~Ò€σ€Ï…†Æ†‡È‡ˆË‰ˆÎ‹‡ÑŒ†Ð…ÎŽ„ÉŠ€½‰³†{£‚x‘{s€tknkd^e\SbaLb`Ke^Kh]Ii\Ij^Hk_Gm_EraG{]CŽ[Fª[LÆWPàQS÷PXÿS`ìWQãKFÛ>9×50Ú5/Ý90Ü8,Ø8*Ó8&Ñ8&Ñ8&Ô8)×7)Ü5,à3,ã2,Ë1'Ë4)È9+Æ=-ÄA/Á@-¾=*¾9(Â9)Ë<.åQEÜH<È4(Ì:-È:,Á5&Ê=+Ê=+Ê;*Ì;*Ë:)Î8)Ï7)Ï6(Ó7*Ö8,Ù7,×3)Õ1'Ø1(ß7.å=4ûBHò7>í07ï/:ò0;î.;ì1<ê6?ã6<Ü36×32ß:8îEB÷JFøEAõ?<è:9æ:8å97â96á85à85á98á98à87â88å99ç9:é9;ì9<í8=ì7<ô5:ò59î68ê88æ:8Ý:5Ó91Ë7-Æ8*Ã:*Â:*À;*À;*Á<+Á<+Á<+½9"Á?)¹;$²5¸;'À</É:2Ø<=ÿ]iÿOdÿ@[ü6Yù5[ø:`ö=fô@g¡EJ„>>];2@>/3A05?4E=:X;?T-0X51ZI7bjEu[Š±pšÄ|žÈ|š¹}š¹€™·ƒ©yr`YuESq?\{B_>b†>iCm“Fl”Kk“Mh‘MhQhŒFeˆDc†Bc†DgŠHiŒLhŒNg‹MiOiMiŽKgŒGgŒGfŽGj’Im•LnœQoRr U-1"-1#,/&,.).0-11/34/45-9;0<>1@B5EH?KMLQRWUTbXWi\Yx^]fcŽpm¢zx¹…‚ÏŠáíŽñŽŒïŠˆé‡ƒá~Õ|Í}È}Ç…‡ÄˆˆÆŠŠÊŒŠËŒŠËŒ‡ÇŒ„À‹‚¹‰€¯†|¡€v‘{p€ujpod`i_Ue\MXeK]bKa_Jh[HmZIp[Hq\Go]EtcItZ?‚V= WDÅYMäTSûNTÿIUß@<Þ<9Ý84ß61á6/á6.Þ6+Ú7(Ö6&Ó8&Ó8&Õ8'Ø6)Ý5,á3,ä1,Ç5(Å6(Â9)Á<+Á@-Á@-À=+À8(Ã5'ÜJ=ÜE:ÕA5Î</Ä6(Ä;+¼7&Æ:)Ç:)Ç:)É:*Ê8)Ë7)Í5(Í3'Ö8-×6,Ö3*×3*Û2+ß6/å:3è=6ò;?í4:ë07î0:ð2<í3>ë7@ê=CÜ7;áAAìNK÷ZUüZUùRLïB>è62à72à74à74ß74à85á96ã;8ä::á77ä88æ89è8;é9<ë8<ì7<ì7<ò38î47ì57ç77â:7Ù:4Ï8/Ç7,Â8+¿:+½;+»<+»<+»<+»<+»<+º9$¾@*³9$°7$¶;+´2%Ã40îOTÿZiÿH`ù8Uó6Vó>]ñFfçHfÞEat?9e?6QA2@C04?.29)>5,O61K*#W:,j\Bˆ_«t”½{“ÃyÃv•²|œ¸…™µ…€šm\uKHa7Nh9[xB_}?c„?hŒBl’Ej“Gh’JgLeMe‰Cd‡Cc†BeˆFh‹IjŽNkOjŽNkOkOiMhJgHi‘Hl•Ip™Ms¡Vt¢Wv¤Y25$13&02'01+12-23.34.46+9;-;>-?B1DF9IJBNNNRQWTR]XVd\Zoda~nl”zw®„ÄŒ‰Ø‘Žå”‘ì“펋扅ڂÎ{Å|¿‚}¿ƒƒ¿……Á‰ˆÂŠÃ‹ˆ¿‹„¸‡®…}¦…{€vŽzm~sfmoa`k^Vi[NgZJVdJZbJa_JjZJpYIsYJtZIs]FqY?tU9†T;§ZFÌ\PæRNóEGù:AØ3/Ü41á51ä50ã5.â4+à6)Û8)Ö7$Ó8$Ñ8&Ô9'Ø6)Ý5*à3,ã2,Â8+¿7)»7(¼:*¿=-Â>/Ã;-Ä8+Æ3)ëTKÔ;3Ì8.ÑA6¾4'À<-½>-Ã7&Ä8'Æ9(Ç:)Ê8)Ë7)Ì6(Í3'Ó5*Ô3)Ö2)Û4,ã:3é>7ì?9ë>8è47ì59ï6;î5;ê2:æ39ä7=á<@óUVûc`ÿnjÿidóVQäA<ß61à3/Þ71Þ71Þ71ß82á85â96å97æ::å78æ89è8;é9<ë8<ë8<ë8<ë8<ñ48î68ê67æ87à;7Ö<4Ì9/Å8.½9,º;,¶;+µ<+´<+´<+³;*³;*³:'·@,­8&¬9'±;-«+"Ã54ÿ_gÿSdýE]ó;Uí<XéG_áOdÐP_ÄKZcPAVI8JE2CF1AF0<?*<7#>1B2SE*okHŠ“f•¬t´t‹¹q‹½t¡¹‰¡¸Š§}l‚\K_:BV1Lc7Yq?_{@dƒ@i‹Ak‘Di’Fg‘IdJbLc†Bc†Bd‡CgŠHjMkOm‘Qn’Rj‘Pj‘Nj’Li‘Jg‘Gi“Gm—KqœMu¥Yv¦Zx¨\78(78*66,56056156167/68+;>-=@+@C.DG4IK=NNFQPNSQTVUSYY[a_lkius›€}´ˆ…ÈŒ‰Ö•’ã”äÞ‹‡Ó„Æ}º|µ€{±~¸‚º‡„»‰…¸Š„²†¨z›€xs‡znzrfjm_\j[Tk[NjZKjYI^bK_aKe^Kk[KpZLtZKw\Kz[G{WAƒS=—U?³XFÍSFÝF?å76ê01Û2-ß3/â5/å4.ã2*à2'ß5(Ü9(Ô7$Ð9$Ï:$Ñ:'Ô8)Ù7*Ý5,à3,½>-¹:)µ6%·8'½;+Â=.Ç;.É6,Ñ80ö\T×=5Ë4+ÏA5¸3$·:(¹@-Â9)Ã:*Æ:+È:,Ê;-Ì:-Ï8-Ñ7-Ñ3*Ò1)Ö1+Þ71ç;7ë>:è;7æ74é77ï;<ð<?ê69ä15ã6:èBFìNOÿxwÿqnða[ÛKCÐ83Ñ2.Ü73è?<à93à93ß82à72à72ã75å76å78æ68ç79è8;ë8<ë8<ë8>ê7=ê7=ð69î79ê7:ä::ß=:Ö=7Ë;2Ã;/¸9*´;*±<*¯<)­=)¬<(¬<(¬<(«:(¬=*¤9'¥:*©9-«0)ËAAÿgr÷L^÷E[ðBYèF[ÛN^ÈT]´VW§SQSU@LN9JG4JE1FD-AA'>C#@G%MU.^g<xTŒ˜f‘¤m©nŽ²r’¼z µŒ’§€u†dRcC?O2BS3Oa;Vl=b{Be‚@iŠCjEi’Fe‘FbH`Ie…Bd‡CgŠFiŒJkŽNlPn’Ro“Sj‘Pk’Oj“Mi“Ki“Ik•InšKržOu¥Yv¦Zw§[?>,?=.==1==5=<7;<6;=2;=/?B-@D+CG,GI1KM8NOASPITQLYXDZ[M_^Zgepqo‡{y¡ƒ€·‡…ƌӋՊъ…ǃ€¹~z­zw¤{u¡zw°|y°€|®~©‚~£y•|t‰zrvkqrffm`Zl[QlZNl[KmZKmZIg^Mi]Mi]Mj]Mn]Ms^My^M€[I“`OšWG§N@¹I=Æ@5Ð6.Ù0)á0*á51â5/ã4/â4-à2)ß3'Ü6&Ú;(Ð9$Í;$Ì<$Í<'Ñ:)Õ9*Ù7,Ü5,ºA.´;(¯6#°5#¹:)Â=.É;/Í6-Û>7ùZTåHAÐ90Ì@3¸6&«4 ±>)¿7'¿7'À7'Ã7(Å7)É7*Î7,Ð8-Ù<3Û:2Þ93å<7ê>:ê=9ç85ã41è96ë<9ê::è8:ì>@øORÿccÿqpùheàUPÈ=8¿2+È5.Ö;7à<:â:9à<3á:2á:4á83ã73ä65å55æ68é69é69ê7;ë8<ë8>è7=è7=ç6<ð8:ì8;è8:ã;:Ý>:Ó>7É<2À</´9)°;*¬;)ª;(©<(¦;'¥:&¥:&£<)Ÿ:(Ÿ<)ž:*¡7*´?8ÛTXüdpðK\ñH]ìI\ÝL[ÉRX±WVœ\R^OAP9FN9NI5K>+>467>O#Jh4gTt•\„›c‹™dŽ›f‘¢l•¬t•²x„”pn}\Q`C=J09F,BO3O_;Xi=czDgBkŠDk‘Dh’Fe‘F`G`Gf†Ci‰FjKlMlOkOm‘Ql“Rm”Qm”Qm–Pl–Lk—Jm™JržOu¢Qy¬]y¬]x«\CB0DB3DB6EB9CC;CC;BB8AD3CG0EH-GJ-JM0OO7RQ?TREURI[\:\\@\]Kaa_ihvrq{z¦~µ†‚¿ˆƒÃˆ„Á„¸{­ysŸtp•qmŽol£rn¡tq wršwrtoƒskxrilmb^l_Vj\OlZLn[Lo\Kq\Kq\KrZNq[Nn\Nl_Ol`PqaQy_N†[KŸ_S¦OE°A8½:2È5-Ï1(Ø1(Ý5*â70á6/á4-á3*à4(ß5(Ù6%Ô9#Í;"Ê<$È>$Ê>'Í<'Ò;*Õ9,Ø8,·D/±<(¬5!­4!¸9(Ä<.Ì9/Ï5-Ú83ñNIòSMÙB9ÌB5½@.¥2¬?(À;,Á9+À8*À6)Å7+É9.Ï;1Ô;3áD=ãA<ä?;ç>;é=;é;:è88ç77æ93æ95å84é;:ôJJÿ\[ÿdc÷caË=9¿82»4.Ã81ÓB=ÞE@ß=;Ù42â;3â;3â92ä84å84æ66é77é77ê69ë6;ë6;ë8<ë8>è7=è7=ç6<í68ê69æ89à;9Û>9Ñ>6Æ<1¾<.²8)®;)ª;(¦;'¤;&¡;%¡:' 9&ž?-”7%š=,—:)˜3'ÂQKíkmï\fïN^ìI\àHWÎJU·SS¡]RŒfQ‚jP=S<CL7JB/L7$F5FH!Tq;c–Txµo€µo‚¦f~‘Y…ŒX–cŒ–d|YXeGGT89E-8A,:C.?I0JX7Wh>g{Fh‚Cl‹Ek‘Di“Gc‘Fa‘G^Gi‰FlŒImNn‘OlOjŽNkOk’Qp—Tp™SpšRo›Po›NqNv£Rw¦Uz­^z­^y¬]GD3HE6HF9HE<GG?GG?FF:FG5GI1HK.JM.LO0QQ7SR=VSDWSG[\4Z\7[[C\\Rcbhmkusšzx©~{´€|·‚¸€|¯zw¢so”mj‰kf„gb˜hd—lf”lh‹lhleuibij`^g]Th\NjZJl[Io\Ks^Ms^Ms\LzWQvYQp\Ql`PkbQpcR{aPŠ\OžUL§D>±61Á3/Î5/Ö5+Ù7*Û8)ß6/ß4-à3,à4*â6*Þ7'Ø7%Ï7 Ì<"È>"Æ>$Ç?'Ê>'Ï<*Ó:,Õ9,µE/­='¨3¬3 ·8'Å;.Ì9/Ò5.Ò/*ä?;ûYTàI@ÎD7ÆI7¥5®D,ËF7ÉD5ÉA3É?2Í?3ÒB7ÚF<àG?ßB;à>9à;7à74â64ä65ç77é99é>7ç:4ä73è<:ñIHñMLØ=;¹(%¸-(¼5/Å@9ÌC=ÐA;Ö=8Ý>;ã?>á:2á:2â92ä84æ95è96ë99í9:ë7:ë6;ì7<ë8<ë8>è7=ç6<æ7<ì59è58å78ß:8Ù<7Ï<4Ä<0º:-°8(«:(¨;'¤;&¡:'Ÿ:&Ÿ:&ž9%š?,4"—>,“:*“1&Ì\X÷y|æT_ðTbèI[ØDRÃGO®SPšbS†lS{rSC[C?H3B7%O6"_K0prJ€£iˆÇ€yÃt{¾qu¢]oƒHy}J‡†Xy|O\d5:D)3=$4>&<E2=D2:B+EP2Ve<g{HiƒDl‹Em’Ei“Gd’Ga‘G^Gk‹HnŽKo’Po’PlOiMjŽNj‘PsšWsœVsUržSržQu¡Rw¦U{ªYt§Xs¦Wq¤USJ;SJ;SJ;SJ;SJ;SJ;SJ;SJ;VM>WN?XO@YPAZQB\SD]TE]TEcZKbYJbXNcXRg\Zmacsfmwjs|n{~p}s€s€~p}wjtobli\fcb]a`[a^W_\U_[R^ZOa[ObZMe\Kg\Ji\Ii]Gk\El]Fm]Dm]D_gOkiTqZH{M@•RI©WL®TI³WH¦N:¢G2¢?*ª;(¾:.Ò72à23å,1Þ7.Þ7.Þ7.Ü8.Ü8.Û7-Ø6+Ø6+×7+Õ7+Õ7+Õ7+Ô8+Ô8+Ô8+Ô8+¸=.·=.°8(§2!ª2!´;*½>/Â:,Æ6+Í6-Ô:2ÜB8àI>ÖG9Ç;,¹1!ßOGÙIAÔE=ÓE;ØH?ÜG@àC>á<:ã54ê67ï8:í9:ç77à72Ý:3Ü>5ÎKAÈE;½=0µ7)°5&³8)¹>.ÀA2Á;/Ê<2Õ>5ß=8ç;9î79ò67ô68æ7>æ7>æ7<å8:å99å97ã:5ã:3Þ5.ß6/ã81ä84å97ç98ç9:ç9:ë;>ç9;á99Ü<<ÖA=ÌC;ÀB6´@3¦;+¢=+>,™<*–;(•:'”9&“8%‡F2‡>/†/%”-(ÀIKèkoçlqÊWZ¶OP©TQŸVO˜YP•[P–]R™^Vœ`XMb!:O3JOf x’I˜²h¡½r »t™²pƒ›akN\lEWdHS\GHN@=C9;<,AB4=?2:=2<B6:C2AN4Rc?\tBgƒHpKo“Il’Gj’Ij’KgJlUm‘To“Ul“Pk“Lk”Hl—Hm˜FpJoŸIp Jr¢Ns¥Pv§UyªYz«Z{¤jo˜^dSWN?WN?WN?WN?WN?WN?WN?WN?XO@YPAYPA[RC\SD]TE^UF_VGd[JcZIcYMcYOf[Uj_]nbdpcjrentgpvirvirsfom`ggZacW[\\T\YRYVOWTKXTIXTI\VJ^VIb[Ic[Hf[Gh[Hi]Gj^Fm^Gm^G]eNmhTt]M‚RFšVM­VM²QH¶QE®H9ªC2©>,¯:)½9,Ì70Ø42Þ22Ý6-Þ7.Ü8.Ü8.Û7-Ú8-Ù7,×7+×7+Õ7+Õ7+Ô8+Ô8+Ô8+Ô8+Ò9+¸>/·=.®9(¥2 ¦3 ²:)»=.¿;,Æ:-È4*Ì3+Ó;0ÜE:ßPBÞRCÚQAÝE@Ø@;Ñ<6Ð;5Õ>7Ø=8Û96Ý33é69í68ï79í68é77å97â=9á?:ÆC9¿?2¸:,±6'¯5&²8)¸=-¿@1ÅA4ÍA4×@7ß=8å97ê67ï56ô68ç6<ç6<ç7:æ89æ87å97å95ã:3â92ã:3ã:3ä;6æ:8æ:8å99å99æ9;ä:=à<=Ú?=Ñ@;Å?6¸<2¬;-¥;+ <,œ=+—<)–;(’:&‘8&7%z;)€8)‰5*ž;5ÁQPÚceÔ]a¹MM­NL¤SOYP˜\R—^S—^U˜_V™^VSg*Sg(^r3zO—°l¥¾z™²nˆ¡`j‚Fau@Sf9IY5FP7?H59?358/;<,AB4=?2:=2;A5:C2@M3Rc?]uCgƒHqLp”Jm“Hk“Jk“Lh‘Km‘Tn’To“Sm”Qk“Lj”Hl—Hm˜HpJnžJp Ls£Ou¦Tx©Xx©Xx©Zm–\b‹QY‚H]TE]TE]TE]TE]TE]TE]TE]TE[RC\SD]TE^UF_VG`WHaXIaXIe]He]Jd[Jd[Le[Qf[Uh]Yh\\i]]j^`k_ak__i]]f[YbWU`USYVMWTKTQHRNCQMBSOCWQCXRB^WG^WEaYFc[Fg\Hi^Hk`Jk`J^cOmhUy_PˆXN¤[T³VQ´HE¸E>¹@7¸>3·<-·9*¼8+Ã9.Ê:/Ï;1Û7-Û7-Û7-Ü8.Ú8-Ù7,Ø8,×7+Õ7+Õ7+Õ7+Ô8+Ô8+Ô8+Ò9+Ò9+º@1¶>.®9(£2 ¢3ª:&µ=,»=.Ä?0Å7+Æ2(Ê3(Ð<0ØF9ÛM?ÝQBÜ87Ø43Ô20Ô52Ù:7à>;å=<é;<ï8<ï5:ì27ê24é56å97á<8à=8¹;-·9+±6'®4%­5%°8(µ<+»=.ÈD7ÏC6ÖB8Ü=7â96è64í55ò67ê5:é6:é69ç79ç77æ95å:3å:3ã:3ä;4ã<6ã<6ã;8â:9á99à88Ý9:Þ;<Û@>ÕA=É>7º:1­7+¥7(¡;,œ=+˜=*”<(’;(9&8%Ž7$u8%y6%ˆ9,¢E=ºROÂVT¹OO¬HH¤LHœSL˜ZO—^S–bU—aW˜_V˜]UgxB{ŒU“¦n¥¸€«À‡ž³zz‘YYp:?R$AS)AQ-?L0:C.6<.690581:;+@A3=?29<1;A59B1@M3Qb>_wEi…Js’Nr–Lo•Jm•Lm•Nk”Np”Vq•Uo–Sn–Pl”Kk•Il—HmšIpJpJp Lu¤Sx©Xyª[u¦Wq¡U_ˆNVEOx>aXIaXIaXIaXIaXIaXIaXIaXI_VG`WH`WHaXIbYJcZKd[Ld[Le]Ff^Gf^Ig_Lg^Of\Pf\Rf\Sh]Wh]Wh^Uh^Ug]Se[QdZNdZN]YNZVKVRFRNBPL@PM>RO@UO?WQAYTA[VC^WDaZGd]Jf`JgaKadSleUt]O‹[Q«b\»YXºDD¾9:Æ;8É:6Ç80Â8-½8)¼:*½@.¾C1Ù7*Ù7*Ú8+Ú8+Ú8+Ø8*Ø8*Õ8)Õ8)Õ8)Ô8)Ô8)Ô8)Ò9)Ò9)Ò9)»A2¶>.¬9'¡4 2¢8"¬=)µ@.¼>/Á9+Ä6*Ç4*Ë7+Í;.Î</Í>0å26á14Ý02Ý34à88å;<ë=?î;?ï6<í38ì/5é05ç47ã77Û64Õ30±7(°6'®6&¬7&¬7&®9'²:)µ:*ÃA3ËA4ÔA7Ü?8â:7ç85í76ð67í6:í6:í68ë76ê86è94ç:4æ;4â92á:2ß:4à;7Þ:8Ý98Û97Û89Ö<:Õ@<ÓB?ÊA;»;2¯6+¥5'ž7(œ;*—<)“<)‘<(:&8$Œ7#Œ6%z@,v5#6'™E;¬OH¬MI©LG¨PLPH–VL“ZO“_R“bT•aV—aW™`W~‹]™©z­½Ž¦·Š¡ts†YN`8/A->3B%:F.=F3;A3:=2;<4<=79:*?@2<>19<1:@49B1?L2Pa=`xFj†Kt“Os—Mq—Lo—No—Pm–Pp—Tq˜Up˜Ro—Pm•Ll–Jn™JoœKqžMrŸNt£Sy¨X|«]w§[mSd”J[„LS|DNw?cZKcZKcZKcZKcZKcZKcZKcZKcZKcZKd[Ld[Le\Mf]Nf]Nf]Nf_Eg`Fh`IiaLiaNi`Oh_Ng^OjaRi`Qi`Qh_Nh`Mh`Mh`KiaLb_P^[LYVGTQBPM>NK<NK:NK:PM<RO>TQ>VS@YVC\YF^[H^]I`aSf^QmWJ†[R­hcÁb`ÄLMÌ@CÔ:<×79Ö74Î70Á9+·>)²D+°H-×7)×7)Ø8*Ù9+Ù9+Ö9*Ö9*Õ8)Ô8)Ô8)Ô8)Ò9)Ò9)Ò9)Ò9)Ò9)¼A2¶>.«:( 7"™5š7 ¢>&¯B-±<*º;*Â:,È8-Ë8.Î:.Ð<0Ò>2ò5<î3:é27ã36â46â46â46ä15ì5:ì39ê38ê5:æ8:Ü66Ñ2/Ç,(®9(­:(­:(«:(«:(«:(¬9&¯7&¸:+Á<-Í?3Ø?7à=8æ:6ê86ì87ï56î66î66í74ë84ê93ç:3æ;3á:2ß;2Þ=5Ü=9Û=:Ù><Ø=;×==ÌA<ËB<ÆA:»<3­7-£5(ž7(š;)–;)“<)=(Œ;(Š9&‰8%ˆ7$‡6#}C/s4"y4$“G:¤RG¡NFžNE¡WN˜UL’XL[NŒ\NŽ^R”`U—aW›bYƒŽd˜¤|©ƒ€Žj]kJDS42@&$2-:&0;*5=.9?3<?6=>6:;3::29:*>?1;=08;09?38A0>K1Pa=ayGk‡Lu”Pt˜Nr˜Mq™Pq™Ro˜RršSršSršQp˜Om—Km˜Ip›LržOt Qv¢Sx§Y{©^z¨_qŸVd’JY‡?]†NVGQzBe\Me\Me\Me\Me\Me\Me\Me\Me\Mf]Nf]Nf]Ng^Og^Oh_Ph_Pg`Fh`IiaJjbMjbMjbOjbOjbOjbOiaNh`Kh`Ih`IhaGibHjcGe`Mb]J^XHXRBSM=MJ9KH7IH6KJ8LK9LM;NO=PQ?QTASVESVEYYM]WKcQEzXN¡ha¸eaÇUUÛORÞ=Cã8>à67Õ62È:.¹@+­E*¦I*Ô7(Ô7(Õ8)Ö9*Ö9*Õ9*Õ9*Ô8)Ô8)Ò9)Ò9)Ò9)Ò9)Ò9)Ò9)Ñ:)¼@4µ=/«<+ :$—7’6š<#¦B*°C.¹@/¿;,Ã7*Å2(Ë4+Ó:2Ù@8ó1<ð2<î5=ë8>ç:>å;>ä:=ã9<á48ä5:å8<ä;>Þ;<Ò86Å1-¼-'«<+«=,«>*©>*¨=)©<(©:'«8%¯6%¹7)Å;.Ñ=3Ù<5à;7ä;8è;7ð75ï75ï75î84ì94é;4è;4å=4â>5à?7ÞA:ÚA;ÙA>ÕA?Ñ??Ñ??¾B:»@8µ<3ª8-¡5(›5'˜8(•<*‘;*<)Š<(‡:&†9'„7%ƒ6$‚5#y<)r3!}:*—OA£YLœRG•OE–VJ”ZN[MŒ[M‹[OŽ\Q”^T™`Yœa[s}Xyƒ`r|ZU`B9F,/;'0;+1;03=44;35<4:?8?B9?A6<<277+89)>?1:</7:/8>27@/=J0O`<ayGk‡Lu”Pu™Os™Nq™PršSp™Sr›OrœPq›Oo™Mn™Jp›LsžOu¡Ry¥X{§Z|¨]x¦]qŸWg”O]ŠEVƒ@`‡PY€ISzCg^Og^Og^Og^Og^Og^Og^Og^Og^Og^Og^Oh_Ph_Ph_Ph_Pi`QjbOjbOjbOjbOiaNiaNiaNiaNiaLh`Kh`Ih`IhaGhaEhaEhaEf_Le^Kb[H\WDWR?PM:LI6IH6GH6GH8GJ9GK:HL;IM>HO?HO?PPDVRGYOChREYM˜UL³RLØXWàGJç<Bå79Ý54Ñ:1¿@-°D*¥D$Ò6'Ó7(Ô8)Ó:*Ó:*Ó:*Ó:*Ó:*Ò9)Ò9)Ò9)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)½?3¶</¬=,£<)—9 6”:  B)¬C-¶A/¿=/Â6)Â/%È/'Ð6.Ú=6ð0;ð5>ï:Aì?CæBCáACÞ@AÚ>?Ï12Ñ56Ô::Ò<;Ê;7¾73µ4.¯3+¥>+¥>+¥>+¦?,¥>+¤>(¥<'¨;'ª7$²7'¼8+Å8.Ì8.Ö92Þ<7ä?;î85î85î84ì94ë:4è;4å=4â>4âA7ÝC9ÚC<ÕB;ÐA=Ê?<Ç=;Ã<9®>3©:/¢8+œ6(˜7'”8)‘:)Œ;(‹=)ˆ=*…<)ƒ:'‚9&€7&6%~5$v4$x5%…B2˜UEœXK“QCPD•ZL’ZM[NŽ]OŽ\Q’\R•\U˜[V™\W`hCX_=JS4>G,6?*2=-4>35?74=88>:=B<CF?EG<CC7@>/;9*78(=>0:</7:/8>26?.=J0N_;`xFk‡Lu”Pu™Os™NršQršSp™SqœMrNqœMp›LošKrNu¡Ry¥X«`~©az¥]qœUf‘L_‰G[ˆE\‰Hb‰RY€ISzCh_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Pg^Oh_Ph_Ph_Ph_Ph_Pi`Qi`QmcWlbVjaRi`Qh_Pg^Og^Mh_NiaNiaLiaLiaJh`IhaGhaGhaGh`Kg_Je_Ib[H\WCUR?PM:ML:EF4DG6DH7BI9BI9BJ;BJ;BJ;JJ@QQERPAUN<bM:qF6“I>ÄYSÛQOãCEå8:ß55×:3Ê>/¸>)¬<$Ï8'Ï8'Ð9(Ò;*Ò;*Ò;*Ò;*Ò;*Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)½=2¶:.­<,¥>+˜9#Œ59ž@' :$¯<)¾?0È;1Ì8.Ñ7/Ù<5àA;ð;Bï>FëBGãCEÖ@?Ê;7À50»1.·0,¼51¾:5»<6³:2©9.£9,¡9,Ÿ>+Ÿ>+ ?,¡@-¡@-¡A+£>*¤=*©<(­:(²7(¹5)Á4*Ë80Ö?8ÝD>é:5é:5è;4è;4ç<4ä=4á?4Þ@5ÝC9ØD:ÒC;ÊA9Ä?:¼;6¸85´73ž9-™7*•5'’6'‘:)<*‰:)„9&†=*„=+=*€<)~:'|7'{6&{6&y1#€8*ŒG8–RE’PB‹K?ŽSE™_SXKZN’\R–]T—\V˜[V˜YT—XSV^7EM(6@8A&>G2<D53=2-7/1737>7@E>GJ?GI;BC1?>);;#78(=>09;.69.8>26?.<I/N_;`xFj†Ku”Pt˜Ns™NršQršSp™SqœJqœLpLoœKo›LržOw£V{§\‚­e€«dx£^j•P]‡EYƒC^ˆHeOcŠUZLSzEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj_Yj_Yj`Wj`Wj`Vj`Vj`TjaRjaPjaPjbOjbOjbOjbMjbMjbMg_Jg_Jf^Ie_Ib]I\WCSP=ML:HI7EH7AE6>E5>F7?G8=H8<G7HJ=HL>AE4HK6YS;_F0€K9Àj]Ýf`åSSçDEè@@ã?=Ö=5É=0Â>/É3$Ë5&Ì6'Í7(Í7(Î8)Ñ;,Ó=.Ò<-Ò<-Ò<-Ò<-Ñ;,Ñ;,Ñ;,Ñ;,¸3,·7.±;-¦;)˜8"‘7’8š:"«B-±<+¹7)Á4*Í6/×<7âC?êHCëBGéDHÝCCÉ:6»61´80®8.§5+ª:/¨9.¤8. 8-›9,–:+’<+>-˜=*˜=*™>+š?,›@-œA.žB-¡@-¡<*¥:(«7(°6)¶6+¾8-Å;1Ê=4ß:4á<6â?6ã@7âA7ßA6Ú@4×@5ÚG=ÒE;ÇA6»;2±6.ª3-¤1,¢1+”;-’:,:+:*‰:)ˆ;)…<+„=+~:'|9(|9({:({:(z9'x6&w4$z, A4˜NC“MAŽL>RE‘VHŽRG˜\R˜\R‘UMTL™ZU—XS–WR `^R[0IQ(AK&BK,>H/7@-2=-4>34;3HPEX^RW[LLO<DF.AA'==!:;+>?1;=0:=29?34=,;H.Pa=bzHlˆMu”Ps—Mq—Lp˜OršSqšTpJqžKrŸLrŸNsŸPv¢U{§\ªb‚­fx£^i”O_‰G]‡G`ŠJfŽOhRd‰U[€LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^^j_]j_]j_[j_Yj`Wj`Vj`Vj`TjaRjaRjaRjaRjaRjaRjaRj_Kh`Kg_Jg_Jd]J^YEUR?ON<IJ8EH7AE6>E5?E7>F7>F7=E6BF8>E5=F1DN5HK0PB'yS<¹ubÉdXà_YíUTêFGä>>â@=Û>9Ñ82Ì:+Î<-Ï=.Ð<.Ï;-Î:,Í9+Í9+Î:,Î:,Î:,Ð:,Ð:,Ð:,Ð:,Ð:,È?9ÆA:½A7®=/6#•2•2™3¦5#²7(Á;0ÑA8ÞE?æIDéJFìJGÞBCÛEDÎC@¼;5®9/¨>1¢A1œ?.œ@1™@0–>0’?/Œ?-ˆ?.„A.ƒB.‘;*‘;*’<+“=,”?+”?+–?,™>+Ÿ@.¡=-¤:,§9*¬8+±8-¶:0¹:1Ð90Ò;2Õ>5ÕA7×C7ÖD7ÔD9ÑE8ÊB6ÃA4¹=1°:0¨8-¢5.5,œ5.Ž=,Œ=,Š;,ˆ;+†:*„;*<,€=,~;*|;)y:)y:)x9(w8'u6't5&„1)‘C9˜NC‘K?ŒJ>PD’TIRG“SJšWQ˜UO™UR\X”WTŽSO—\XT]0Zc8_j@[eBIT66C)4@*<G6MXGYbQ_fTW\FJN5BE*?@!<=9:*=>0:</9<1:@45>-;H.Pa=c{IlˆMu”Pt˜Nq—Lq™PršSqšTq¡Kp LpJqžMt Qx¤W|§_ªc{¦aošUcŒJ]…Fa‰JeNeNc‹Ld‰U[€LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^`j^`j^^j_]j_[j_Yj`Wj`Vj`Vj`Tj`Tj`Tj`Tj`Vj`Vj`VlaMk`LiaLiaNf_La\I[VCTQ@ML:HI9DG6AE6AE6?E7>D6=C5=F57@-?H3EM5AA%QA']E³u`³WHÙbZðebîRSéEFìFHèBDÝ79È9+É:,É:,É:,É:,Ê8+È6)È6)Ê8+Ë7+Ë7+Ë7+Ë7+Ì8,Ì8,Î7,Â3/¾5/¸5-¬3( 0"›0Ÿ1 ¥4$»A2ÇC7ÖG?ãKFçLGéJFåFBâC?ÕCCÏDAÁ@:°;1£=/žC1™F4•G3’E3E2ŒC2‰B0ƒB0B/{B.xD.Š8*‹9+‰:)Š;*‹<+<+Ž=,<*–?.–=-›;+9* 8+¥9-©:/«;/¼7.¾90Á;0Ä>3Å?3Æ@4Ä@3ÁA4¸:,²:,ª9+£7+7+™7,–8.–91‰=-ˆ<,…<+„;,‚:+€;+<+<,};+z;*z;,w9*v8)u7(t6's5&Œ91”F<—MBŽJ?ˆH<OD‘SH”QI“NGšSOšSOšVSœ]X“YUZT—f_wƒS~Š\€‹`lxPJX46D#=J.MZ@eqYeoW\fMNW<DJ.?D&=@!:=89);<.8:-9<1;A56?.<I/Pa=c{Im‰Nv•Qt˜Nr˜Mq™PršSp™Ss£Mp LnLpŸOu¤V{§\}¨`|§bošUfM\„E\„EdŒMhQeN_†GcˆUZLSxEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRjaRk_ak__k__k`^k`\kaXkaWkaWkaUkaUkaUkaWkaWkaWkaXkaXncQmbPjbOjbOhaNe^L_ZGYVERO>MK<GH8DF8CE7AE6@D5>B3;I27C-EJ3IG0K<%mN9—dO§`NŸA5ÆSLçc_ð^^îRUíJMêDHç>CÉ;/Ç9-Å7+Å7+Ç9-Ê:/Ë;0Ë;0Ñ>4Ñ>4Ñ>4Ò>4Ó?5Ó?5Ó?5Ó?5Ó?=ÑB>ÍD>ÆF=ÁG<ÂI>ÆN@ÎPDÙSJÞOGäLGäIEåFCâC?àA=ß@<ÔFDÊC?º?7«<1ž>.—D2“H3‘J6‹G4ŠF3‡D3„C1B0zA.wC.uB/†8+…9+…9+†:,†:,‡;-‡;+ˆ;+‰:+‹:)Ž8)8*•9,™<-=/ž>0«9/­8.®9/°:.°:.²:,¯9+®8*¨7)¥7*ž7(›6*•7+’8-9/;0†=.…<-ƒ;,9*:+~9*}:*};-|:,z;,y;,w9,s8*q6(q7)q7)B8”G=‘K?ŠH<‡I<‹OD“UJ—TL—PLSP˜QO–RO—\X_Xh^žzn™k…’fu‚VYh=CR)?O(P`<crQetS\iKNY;CL/?E)>B'=A&;>#78(:;-79,9<1;A57@/<I/O`<ayGlˆMv•Qu™Os™NršQršSp™Sq¡MoŸKožMs¢Rz¨]|ªaz¥^u [bŒJ^†G[ƒD_‡HgŽMj‘PfL`‡Fb‡TY~KRwDi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRjaRk`^k`^k`\k`ZkaXkaWkaUkbSkbSkbSkbSkaUkaWkaWkaXkaXocSnbRmaQkbQkbQhaOd]M`ZJVSBRO>MK<IG8EF6DE5BC3@A19K1>H/JH1Q?+e>-”ZL¬`S›>6œ4+µ@9ØXUóigödeëRUèINìKQ×J@ÓF<Í@6Ë>4Í@6ÒD:ÕG=×G>ÚJAÚJAÝJBÝJBÞKCßJCàKDàKDëRTéSTãTPÜSMØSLØSLÛTNàUNàLHâHFäEBäB@äB@äB@ãEBãEBØJHËD@¹>7ª>2žA2–C1F3I6‰F3‡D3†C3ƒ@0@1}?0y@/x@1ƒ9.ƒ9.‚:.‚:.ƒ;/ƒ;-ƒ;-ƒ;-9*‚9*…9+‡9,‰:+;-<.=/›;/œ:/ž9- :.¡9,¢8*¢8*¢8*Ÿ8)œ8)˜8(”8)9*Œ:,ˆ:-‡;-ƒ;-‚:,9+~9*}8)}7+|8+{9+z8*y9-x:-t9+q5*o5)q7+r:-G;ŽH<‰I=„I;…K=ŒRF“WMšWO˜QMžTQ™RP•VQ’`YˆbW‚h[ŠwhivKZi>JY.AR&IZ0Wi?dvLj|TXjDL\8?M,:D)<D,>C-=@-:=*89):;-68+8;0<B67@/;H.L]9^vDi…Jt“Ot˜Ns™NršQs›TqšTmŸJmžLp¡Px§Y|ª_z¨`rXi“QYƒC\„E`ˆIeŒKgŽMgŽKfJd‹Hc…SY{IRtBi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSla[lbYlbYlbXlcTlcRldQldQldQldQlcRlcTlbVlbXlbXlbYocSnbRmaQlcTlcTkbSg`Pd]M]WGYSCSM=MJ9KH7HE6DB3B@16J.>H-NC-b=-„D:¯VP¶MJ¡++´:9º=;ÑTPòpnýwvñehêY^ò]cáVOÚOHÒG@ÎC<ÑD=ÔG@ÖGAÖGAÙHCÚIDÚIDÝIEÞJFÞJFàKGàKGãGJáGIÝGHÙGG×HD×HDØGDÝEBàBAåABé@CêBBèBBäB@ßA>ÜA=ÚJIÌB@»<6®>3¢@3—A2B0D3‰A2ˆ@2ˆ>1…=1‚<2€<1=1}=1ƒ:3;3;1;1€<1€<1=/=/=/€</€=-€;,€;,9+9+8)Œ:/9.9/“;/—;.š=.=/ž>.™9)•9*“:*Ž;+Š;,‡;+ƒ;,€;+‚:,9+7)~6*{5){5)z6)z6+x6*x8,w9.s7,o5)o5)r:-u=0ŽL>‰K>„J<‚M=…QC‹VH’XM—WN”MIœRQšTR•[We\y_PcXFb]IBP,?M)?O(K\2_qGk~QcyKVk@M_7@R,6E&7D*=F1=D4:=27:19:*:;-68+8;0<B67@/9F,IZ6Zr@eFr‘Ms—Mr˜MršQs›TqšTlKo Os¤Ux¨\z¨_s [i“Q`ŠJX‚B^†GdŒMgŽMfJeŒIgŒGhHaƒQXzHQsAi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSlbXlbVlcTlcRldQldOldMldMldMldMldOldQlcRlcTlbVlbXocUmaSkbSlcTmdUlcTi`Qf_Ob[K^WGWQARL<OI9LF6IC3F@02K+>G*SA+{E9¦NL¸EH»5<¾19Ë@EÄ?@ÊJIÞb`îrpïopçbeáZ^ÛRJÕLDÏD=ÍB;ÏD=ÒE>ÐC<Î?9ÒC=ÓB=ÔC>×C?×C?ØD@ÙEAÚEAà?Dß@DÞDFßFHßIHàJIãIIæFHçACëADîAEîACéAAâ@>Ù>:Ö=8ÛEGË=<»73°;4¦@4˜?1>0ŽA1‰=/Š<0‰;1‰92‡81†93…:4„;4:4:4€<3€<3<3}=3}=3|<0{=0{=0{=.{<-z;,y:+z8*z8*€:0‚:.„:-ˆ:.Œ:.‘;.”<.–=-’9)‘:):*Š;*‡;+ƒ;,<+}<*€8,€8,~6*}5)|4(z4(z4*y5*u3'v6,v8-r6+n4(n5*s:/v@4‹PB†N?N=R@…VF‰XIŽUJ‘RI“NI™RP”SO‘\VŠfZl\LML7BL3@O.KZ9WgC`rJezOdzLVl=G]/AV+7I#0A!5C*=F5<D98=7796:;+;<.68+9<1=C77@/7D*FW3Um;a}BoŽJq•Kr˜MršQtœUr›UnŸNq¢Qu¦Wv¦\s¡Yj—R`J[…E^†G`ˆIbŠKeŒKfJhHf‹EeŠD`‚PWyGPr@i`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcRldQldOldMleKleIleIleKldMldOlcRlcTlbVlbVnbTmaSkbSkbSmdUlcTjaRh_Pd]M`YIZSCUN>QJ:MG7IC3GA13M*>G*[B.PGºVVº7?»'3ÜBNÐ:CÄ9>»;:ÂHGÓ][ßgf×[]ÇILÓJDÏF@ÌC=ÎC>ÒGBÒGBÐB>Ë=9ÒC?ÓB?ÔC@ÕDAØDBÙECÙECÚFDá>Cà?DÞBEßEGáGGàFFàBCâ=AëADí>Cì;Aê<>æ>>ãA?ßD@ßFAÙ@CÉ78¹30±:4§?4š>1=/Ž?2Š;.‹9.‹80‹61Š71Š73‰84‰:5:3:3:3~;3|<3|<2{=2{=2u9.v;-w<.w<.x=-x=-y;,y;,{;1};/~8,7*„6)‡5'‰6(‹5&7(‹8(‹:)ˆ;)…<+<,~=+{<*€8,7+~6*|4(|4({2)y3)y5*t1(u5+v8-r6+n4)n5*t;0xB6ŒTE„Q@P>‚UB„YHˆYI‰SGNG˜SN˜RPPKˆVO‚bUeZHFK4;K0IX;[jKgxVewQYnCSi;Me5I`28M"-B*;2@):E7;B;8<;7;<<=-<=/79,9<1=C77@/6C)DU1Rj8_{@mŒHp”Jq—LršQtœUr›Uq¢Qt¥Vu¥Ys£Ym›Sd‘N\‰HZ„DdŒNa‰J`‡HcŠIfJiŽIeŠDa‡>`‚PWyGPr@i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTo\Nq_QtdUrdWnbTj`Th`ShbTgaSebQa^K[VBVQ;TN6NH.GA'RD)N=#cI2iV²zm·ng³[W¸PQ¶BEÁ@EÉ@GÑBFÖDGÚEIÜGIÝGIÔBEÔBE×BDÙEEØDBÒC;ÎD:ÌH;ÄF7ÃH9ÆH:ÊG?ÐEB×BDÜ?FÞ=EâBDâBDâBDâDEâDEãEDãEDãEDâDAâC@áB?â@>ã?=ã?=ã?=å@>ÎE?Ä?8¶:2©80Ÿ:0•>4Œ@3ƒ?2A4|@5}?4<3ƒ:3‡83Š73Œ72…<-…<-…<-„;,ƒ;-‚:,‚:,‚:,9-9-9-~:/~:/~:/~:/~:/~80~80}90}90}90}90|90|90|90|90z:0y9/y9/x8.w9.w9.w8/w8/v7.t8.s7-r6,q5+p6+l2'q7,m4)l3(o6+m4)q8-H=ULƒTL†QK‹PJNJ•NL˜NM—PL”SM‹UK†\NdOkaFTW8JX5N_;gT`zMWpFTkARg@O`<IX7DQ39C*5=&49%7:)=>0CA4B@4@<12:/2:/4:.5;-9=.<?.>A,>D*T^<bqHq…TtVt”UršSsSržQv^¦g¦gq˜YcŠK_†G_†G^…F`‡Hb‰Jd‹LfNeŒMcŠK`‡H^…F_OTvDKm;i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTsaSr`RrbUqcVrfZpfZmeZjdXgdUkhYmjYlgThcOd^H[U=RL4PJ0F?%P@)kP;WG„NB‰D=–C?´VT»SR¾PQÂNOÄLMÆLKÅKHÆJHÔRTËFGÄ<<Ç;:ÑA@ÔE?ÏB9Ç>4ÉE9ÈF9ÊG=ÍG>ÒGDØCEÜAEß?GáCDáCDáCDâDEâDEáFDáFDáFDàEAáC@àB?ßA>àA=àA=â@=ãA>ÑFAÉB<¼=6¬:0 90“;/‰=0=0A4|@5}?4<3ƒ:3†91Š71Œ72…<-…<-„;,„;,ƒ;-‚:,‚:,‚:,9-9-9-~:/~:/~:/~:/~:/}90}90}90}90}90}90|90|90|90z:0z:0y9/y9/x:/w9.w9.w8/w8/t8.s7-r6,r6,p6+p6+k1&q7,m4)l3(o6+l3(p7,~H<‚SK„TJˆQJ‹PJ‘PL•OM–PN–RO‹OG…SH€[K{ePsiPhkLdrOgxT\uKXoEPf?Ka:K_:K\:GV7CP4<F-8@)6;'7:)<=/?@2@>2><03;03;05;/6<09=/<?.>A,>D*Q[9^mDmPpŒRr’Sq™RsSsŸRxža|¢exžak‘T`†I]ƒF]ƒF\‚E`†Ia‡Jc‰Le‹NdŠMbˆK`†I^„G]MRtBIk9i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtbTo_Pm]Pm_ToeYog\keYhbVfbVpl`{xi~{jzgzuapiVf`JPV<DF.A?(MB.S@/U8(^6*m=3p7.x71:3‰@9•HBžOH¦WPª\RÁ[W»RO¸FE½A?ÉCBÑFCÓD@Ð?:ÐA9ÐC:ÐE>ÔG@ÖGCÚFFÛEFÝDGáCDßCDßCDßCDàDEßECßECßECÞDBÞE@ÝD?ÜC>ÜC=ÜC=ÝB=ÝB=ÕF@ÎE=ÃC:³>5¢:/’8-ˆ9,<-€A2~@3}?2=1ƒ:1†91ˆ81‹80…<-„;,„;,„;,‚:,‚:,‚:,€:.9-9-9-~:/~:/~:/~:/~:/}90}90}90}90|90{8/{8/{8/{;1{;1z:0y;0x:/x:/x:/x:/t8.t8.s7-s7-r6,q5+o5*o5*k1&o6+m4)k2'n5*i3'm7+}G;†QI‡PIŠQJŽQL‘RM“RN•TP’UPVO‡[P^OtbNoiQnrWjwYfwWPf@K_:EY6BV3EV6GV7FU8ER8?I1<D-9>*7;*:<.<>0<=/:;-5<45<46<26<09=/<>0=@-=C)MV7Zi@h|KlˆNpOq™RuŸSt Sz cw`n”Wc‰L\‚E\‚E\‚EZ€C_…Ha‡JbˆKdŠMc‰La‡J_…H]ƒF[}KPr@Gi7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtdWqaTm_Rk_SkaWlcZle[jf]jf]wuiˆ„y‘•’Œ|‰‚r€ygZfNLV>AI2CF1ED0D?,I=-TD5M:+O8*R6*T7)X8+];/a?3eA5‹KAœSL­UQ¶NK½EDÇABÓCCÛEF×?>Ø@=×B>ØD@ÙEAÚFDÛEDÛEDßCDßCDÞDDÞDDÞDDÝEDÝEBÜGCÛFBÚE?ØE>ØE>×D=×D=ØE=ØE=ÖC<ÔE?ÊE>»@8§;/–8,‹9+…;.‚@2@1~?0=/;/„:/‡9/‰90„;,„;,ƒ;-‚:,‚:,‚:,9+9-9-9-~:/~:/~:/~:/~:/~:/}90|90|90{8/{8/{8/y9/x8.{;1y;0y;0y;0x:/x:/v:/v:/s7-s7-s7-r6,p6+o5*o5*n4)j1&o6+l3(h2&k5)h2&l6*|F:ŠOGŒPHQIRMSN’UPWPŽYQ‰]R…aUy_PiZGd_IciOZgKN]@EU8AQ4=M0<K.?M3CQ7FR:GS;BK6>G2:A/7>,9=,9=.8<-7;,6=66=66;46<29<1;=/<?,<A*JS4Ve>dxGj†LpOs›Tw¡Uw£T{¡dr˜[e‹N\‚EZ€C\‚E\‚EZ€C_…H`†Ia‡JbˆKa‡J`†I^„G]ƒFY{INp>Ef7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTseXugZsg[mcYjaXle]snhzwp~w† –©¥œ«§œª£™£‘œ”‰v~i`hSLSADK9AJ7>G4>G4BI7GN<FJ9CF5?@0=;,<:+<9*<9*U5(lD8‹PHŸPL°HIÂEIÏDIÖAEÙ>BÛ?@ÛAAÛC@ÚEAÚEAÚEAÚEAÞDFÞDFÞDFÞDDÝEDÝEDÛEDÙEAÚFB×FAÕF>ÔE=ÓF=ÓF=ÓF=ÔG>×@9ÕB;ÏD=ÁB9®>3œ:-‘;.‰=/„?0?/~?0=/<-„:-†:-ˆ:.ƒ;-ƒ;-‚:,‚:,‚:,9+9-9-9-~:/~:/~:/~:/}:1}:1}:1|90|90|90{8/y9/x8.x8.v8-y;0y;0x:/v:/v:/u9.u9.u9.s7/r6.q6.p5-o4,n3+m4+m4+j1(o6-j4*h2(j4*g1'k5+zF;MGNH‘PJ’SLUOŽWPŠZP…ZQ{YMv\OkZJ]UBYXDY^HOYA>L3;G18D.5A+5A+8D.=I3AM7EN;BK8?H5<E29B/7@/7>.5<,4;+5;75<56;56;48;2:</;>-;@)GP1Ra:buGi…Kq‘PuVy£Wx¤Uzcn‘W`ƒIZ}C[~D^G^G]€F`ƒIa„Jb…Kb…Ka„J`ƒI_‚H^GW{KLp@Bf6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTmaUndXpf\lcZkd\rmg„|‘‹¥¤ ³²®ÄÁ¼ÉÆÁÉľÅÀºÀ¹±¹²ª¤œˆ‚tfcTPQAEI8=F38E18G45F35F44E36D58D6;E:?G<@H=<6(L</b@7EA£OOÁW[ÎOVÍBI×DJÚDFÝDFÝEBÝEBÞE@ÝD?ÞC?ÞDFÞDFÞDFÞDFÜDCÜDCÚDCÙECÙEA×FAÕF@ÓF=ÐF<ÏF<ÐG=ÐG=Ø=8×@9ÑB:ÆC9¶A7¤>0–=/Œ=.†>/‚?/€>.=-<-ƒ;,„;,‡;-‚:,‚:,‚:,‚:,9+9-9-~8,~:/~:/~:/~:/}:1}:1}:1}:1z:1z:1y90y90x8/v7.v7.v7.u9/u9/u9/s9.s9.s9.r8-r8-q6.q6.p5-o4,n3+m4+l3*l3*h2(l6,i3)f2'h4)e1&i5*xD9’KE’MF“PJTLVO‡XNYO|\Os\Nk[L_XFUTBPS@JQ?@I64@,3<+2;*09(09(2;*5>-9B1<E4?H7=H7<G6:E48C25A-3?+1=)3973954954937:19;0;>-;@*CL/O^7_rDi„Mr’SwŸXy£Wv¢Us–\f‰OZ}CX{A\E]€F]€F^G`ƒI`ƒI`ƒI`ƒI`ƒI_‚H^G]€FVzLJn@Ae7haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTiaVjbWkdZmf^upjˆ…€Ÿžš°°®ÂÂÀÓÒÐâáßéåäçãàãÞÚÞÖÓ×ÏÌÒº°º¤™˜†zym__YIKL:>F19E1<K8;J79G68D68@57<57947836A3>>2J91`94ˆHH²\_È_dÍVZÐOSÕMOÚLKÜJJàHEáFBãDAåA?ÞDFÞDFÞDFÝCEÝCEÜBBÛCBÛCBÚDCØD@ÔE?ÓF?ÐF<ÏF<ÐG=ÎH=Ý>8Ú?:ÒB9ÉC:¼C8«A4™<-Œ9)‡>-ƒ>.>-€=,€=,<,ƒ;,…<-‚:,‚:,‚:,9+9-9-~8,}9.~:/~:/~:/}:1}:1}:1}:1}:1y:1y:1x90x90w8/t8.s7-s7-s9.s9.r8-r8-q8-p7,p7,p7,p5-o6-n5,n5,m4+l3*i3)i3)g1'k7,h4)e1&h4)d0%f4)uC8•JE“LH“PJTL‰WNYOx[Mp]Nj^N]WGPQAKN=CJ:9B12:+08)36-17-06,/5+/5)17+2:-4<-9D4;F6=H7<I7:G56C/3@,1>*0640641622716929;0:<.:?)?H+KY5]pChƒLs“TwŸYw¡WržQiŒT^IUx@WzB[~F[~F[~F]€H_‚J_‚J_‚J_‚J^I^I]€H]€HUvKJk@@a6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcToh^ng_lh_tqj…„¡ ž¼¼ºÏÏÏÎÏÑààâòòòúøùû÷öøòòñìéêåâïÍÃàÀµÅ©¥€sbaZGML7CH2AI4AH6BF7BD7C@9D<9C98C772?5;@9@93H/+c76QR³giÇmmÂ[\ÉYWÑUS×QNÝKKåGFèBBê@AÞCGÞDFÞDFÞBEÞBEÝADÜBBÜBBÜDCÙCB×C?ÔC>ÒE>ÐE>ÏF<ÐG=â@;Ý@9Õ@9ÌC9ÀD:°B5›;-‹5&Š=-…=.>-€=,€=,<,ƒ<*„=+‚:,‚:,€:.9-9-~8,}9.}9.~:/~:/}:1}:1}:1}:1}:1{;2w;1w;1v:0u9/t8.s9.r8-q7,r8-q8-p7,p7,n8,m7+m7+m7+o6-o6-n5,m4+j4*j4*i3)h4)f2'k7,h4)c1&e3(b0%e3(uC8”JG“NIQJ‹TM„XOzZMq[Mh\LXUDHK:=D4=E69A208+/7*5=056157257247005.06,08-19,6A3:E5=J9>K9;J77F12A,0?*.42.420511605818:/:<.:?+<E*IW4[nAg‚Mr‘UvZuŸWo›Pb…MX{CSv>WzB[~FY|DY|D\G_‚J_‚J^I^I^I]€H]€H]€HSsJHh?>^5icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUfc\gd]vsn“’Ž¯¯­ÄÆÅÚÛÝìíïóôöö÷ùüüþÿÿÿÿþÿÿûúüööùôñÿÞÏöÖÇãÈ·É´Ÿ­ž‡ŠƒicbFGG-EG/DF0GD3IC5H;3F42G34M797@;;@:@;8G85cGF‘kjŔ譩ҋ‡ÇtnÀ]XÆSNÖNNâIKëEIðCGÜFHáHKÜCFÕ:>Ø>@âFIàDGÖ:;Ú@@Ú@@ÙA@ÖB>ÔC>ÑB<ÏB;ÏB;ãA<Ý@9Ô?8ËA7¾B8°@4;.8*‹>.†>/‚?.>-€=,<+=*=*9-9-9-~8,~8,|8-|8-|8-}9.|90|90|90z:1z:1z:1z:1x=5w<4v;3u:2t91r7/p7.p7.o6-m7-m7-m7-m7-l8-l8-l8-i2+m6/p92o81k4-g2*g2*h3+e0(i7.d2)^,#`0&_/%b2(p@6’LJOKŠQJ‚QJ}YMv_QfYIRO>CF5=F58C35@02=/3;04:04:077577566446135016/05..6+.9+2=/6C29H5:I68G42D./A+,20,2.-2..3-36/780:</:?+6>&DR1YkCh‚Ru”[wž_r›Wj•N\}HXyDTu@Tu@WxCZ{F[|GZ{F^JbƒNbƒN^J\}H_€K`L^JTrNFd@:X4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUed_onj…†¤¤¢ÁÃÂÖÚÛêîï÷ûþ÷ûþøüÿüýÿþþþÿþÿÿýüÿüùÿûøÿïÚüêÒîÞÅØͱÀ»¤£„‚ƒcgkJMP1II/EC,HA/J>2L93M85Q99;;9BA?MHE\RQyjg¢‹Ì³®åÇ¿ÿÙÏ괪̃|Àc\ÌVTÛPSãFMâ=DÕEEÕEEÙGHÞIKÛEGÖ<>Ö<>Ü@CÚ>?Ù??Ú@@ÙA@ÖB>ÓB=ÒA<ÐA;ß@:Û@;Ô?8ÌA:¿C9±A6 ;/‘9+Œ=.‡>/ƒ>.>-€=,<+€=,<,9-9-9-~8,}9.|8-|8-|8-|90|90|90z:1z:1{;2{;2{;2v=4u<3t;2s:1r90p7.m7-m7-m7-l8-l8-l8-l8-j8-j8-j8-l5.n70n91n91l7/i4,g2*e3*c1(e3*_/%^.$b2(^.$`0&n?5„IEˆQLˆWRWOrVKdRDQJ:>?/:A16A14A02>02<14<15;17:388677577557446116005./7,.8-1<.4A07E49H58G44E22D.062.40.3--2,14-45-8:-9=,7?'DQ3YkEh‚Sv”`wbp˜YfNZzHWwETtBTtBVvDYyGYyGYyG[{I_M_M\|J[{I^~L^~L\|JTmOF_A9R4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUneVneVneVddby{x—™˜²¶µÍÑÒäéìôùüúÿÿûÿÿûÿÿûÿÿýÿþþþüÿÿûÿÿúÿÿúÿüßúùÛïðÐáåÄÒØ´¼Äž©‡’j`hCRW7DG,EC.KD4MC9N?8L=8C:;SJKi`a€xv›“¼µ¯×ÐÈçÝÓúêÝÿôéÿåÛ画Äec¸ACËBIáNVÚVRÒLIËDAÎBAÔFE×EFÙCDÛBD×=?Ø>>Ù??Ø@?×A@ÕA=ÓB=ÒA<Ü?:Ù@:ÔA:ÍD<ÀD<²B7¡<2“9.Œ=0‡=0ƒ>/>.€=-<+€=,€=,9-9-9-}9.}9.|8-|8-{8/}:1}:1{;2{;2{;2{;2{;2{;2t;2s:1p:0o9/n8.m7-k7,k7,l8-l8-j8-j8-j8-j8-i9-i9-n91m80m80m80m80i7.f4+c1(c3)a1']-#_0&c4*\-#_0&sD:OK‚UPXQqSK^J?OC7?<-37(2:+/<+0<.2=/4<15;17:37:388688668557257227016/08-.8-0;-2?.6C27E48G48G48G46=53:2/4-,1*.1(13(57*6:)6>'DQ5[lHk„Zy–fwœfl”X^‡KWwEUuCRr@Rr@TtBVvDWwEWwEXxF[{I]}K[{I[{I]}K\|JXxFPfOAW@3I2icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVneVneVofWgklƒ‡ˆ£§¨¹¾ÁÐÕØåíðóûþõýÿùÿÿûÿÿüÿÿüþûýþùþýøÿþ÷ÿÿöóÿâñÿÞëùÖäòÎÛêÃÌÛ²³Â™ ¬„}‰cdnKLS4EI0HJ5KI:GE9D@7QEEk__‹€¤š™µ°­ÊÇÂÜÜÔççÝ÷óèÿýñÿøíÿÝÕú·±èŽŽÌbd±>CÃPIÉTMÉOJÃF@ÊFBÔMJØJIÑ??Ò>>Ô>?Õ?>Ö@?ÕA?ÓB?ÓB?ÒC?×>8×?:ÒC=ÌE?ÀE>±B9¢=5•;2Œ<1‡=0ƒ=1=0=-~<,€=-€=-~:/~:/~:/}9.}9.|8-{8/{8/~;2|<3|<3{;2{;2z;4z;4z;4p:0o9/o9/m9.l8-k7,j6+h6+i7,i7,h8,h8,h8,h8,h8,h8,o:4j81h6/i70j81j81e4-a0)e4-b1*].&a2*b3+Y*"_3*zNE~]XvWRiNGWC:J<3@:.:;-8<.08)/:,1<.2=/5=25;169078079468368349338138119.19..9+/:,1<.2?.5B18E4:I6;J7;C87?428.-3)-0%/1&24'48)4<'ER8_pPr‹d}šnwœifXT}EUrBTqASp@Sp@TqAUrBVsCVsCWtD[xH]zJ\yI^{K_|L\yIVsCK\J<M;.?-gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVofWofWpgXmru‡Œ¤©­·¿ÂÍÕØãíïòüþôþÿøÿÿøÿþúÿüûÿúûþõúüñùùíù÷ëòÿçñÿäîÿßëúÙçõÒÝéÅÈÒ­´¾™œ¤|ƒbX_@GL5DL7DK;AG9>D8f\Z†|z«¡ŸÁ·µËÃÁÕÐÍãâÞîïé÷øðùöíüòèÿóéÿóíÿäß즤´if«K=³QDÁYNÇ[QÆQH¿D=ÂA<ËD@Ë@=Ï?>Ð@?ÑB>ÒC?ÒC?ÑC?ÑC?Ö>9Ô@<ÒD@ÉE@½D<¯@9 >5•<4Œ<3‡=2ƒ=1=0=/~<.=/€</~:/~:/~:/}9.}9.{8/{8/{8/~;2|<3|<3{;2z;4y:3y:3y:3m80m80l7/l7/k6.h6-h6-h6-h8.h8.h8.h8.g8.g8.g8.g8.k92h6/f4-g5.i70h70e4-b1*b3+b3+_0(_0(]1(V*!b6-SJn[U`OHN?8A7.=6,;9-9;.7=12:-3;.4</6<06<07:167/56.49249238139/39/2:/19.19,.9+.9+/:,0;+2?.6C29F5;H7=E6:B35;-06(/3%/1$13&15&29'GS;dtWwm~šrq•g\‚QIq?Qn>Qn>Qn>Qn>Qn>Qn>Sp@Sp@WtD[xH]zJ]zJ_|L_|LZwGQn>ESF6D7(6)gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXpgXpgXinrz‚…“š «´¹ÄÍÒÜåêì÷ùôþÿôþýöÿüúÿúûÿ÷ûþóøúìõöæòóãòþêôýèôüåóøáòöÛëëÏØ×¹ÅÄ¥±°’ŽregOMP;EL:EM>EODGSG~zqŸ›’ƽ¸ÙÎÌáÓÒçÛÛôêéü÷ôðïëûüöÿÿöÿþôÿúñÿôêÿçÞÿÚÒß‘}·fS¢K:²UF½WKµF;·@8ÈKEÇC>ÊC?ÌB?ÎC@ÎC>ÍD>ÍD>ÌC=Ô@<ÒC=ÎE?ÅD?¸A;ª=8ž;5•<4Œ<3‡=4ƒ=3=2=1~<0=1=/~:/~:/~:/}9.|90{8/{8/{8/|<3{;2{;2y:3y:3x92w81w81m80l7/j8/j8/i7.i7.g7-g7-g7-g7-f7-f7-f7-f7-f7-d8-i70h6/g5.f5.g6/h70g6/e6.a2*e6.^2)\0'`4+a5,i=4|PGQJBE>6:6-85,99/8:/47,36+4:.5;/5;/69.69.68-57,46+19,19,19,19,19,19,19,19,08+.9+.9+/:*0;+3>.6A17B2<E4:C28?/5<,37)24'13%04%07%HT>gw]umv‘nf‰_RwKAh;Mj:Nk;Pm=Pm=Nk;Nk;Ol<Qn>VsCZwG]zJ^{K_|L_|LVsCLi9=H@/:2#.&gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXqhYqhYcjpmtz„’£¬±¾ÉÍÓÞâåðòðüüòüûõþùøÿ÷úÿôüÿòúýìøùçöøãööìù÷ëúöêýöæÿôâøëØçØÁÖƯÀ±šŸ“}vn[ZWFOQCQWKYcZbme–˜‹²²¦ÕÎÆêÜÙõããüéëÿñôÿ÷ùÿýýýþùøûôõûñúýòÿÿóÿÿóÿÿñÿãÊ¹q[¨WD¬SCµQB¹MA¿JAÂG@ÆE?ÉE@ÊE@ÊE>ÉD=ÈC<ÈC<ÒC?ÒD@ÌEAÂC=³=9¦;5œ;5•<6Œ<5‡<6ƒ=5=4<3~<0=1€<1~:/~:/~:/}9.|90{8/{8/y90{;2{;2z:1x92w81v70v70u6/k90j8/j8/j8/j8/h8.h8.h8.g7-f7-f7-f7-d8-d8-d8-d8-h6/h70i81i81h70i81j;3l=5g80k<4b6-a5,oC:xLCtI@uJA:=647036/7:18;247.14+25,58-58-57,46+46+46+46+46)/7(08)08)08)08)08)08+08+19,08+08+/7*08+19,3;.4</9B/:C0;B0:A19=.68*24&/3$29'IU?eu[m„ghƒbWyTInE>e9Jg9Li;Nk=Nk=Li;Li;Mj<Ol>UrDYvH[xJ]zL^{M\yKQn@Eb47@;+4/!*%gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVofWpgXpgXqhYriZhowmt|‚‹’¥®µÂÍÑÔßãäïñòþþóýüôÿùöÿ÷úÿôüÿñýÿíýÿêýÿêÿöñÿøóÿ÷ïÿ÷íÿöëÿïáöÜÍäʹƯ§”ƒ€sce]P[YM_bYovo|…€¦­¾À³ÚÖÍñãàÿìíÿñôÿñ÷ÿñ÷ÿ÷ûûúøøÿøøÿúôÿõîÿïòÿï÷ÿóÿñÖÿðÖÿÈ°Å}g¢O=®Q@¸RD³C8ÀIAÄH@ÇF@ÇF@ÈE=ÇD<ÆC;ÆC;ÓD@ÐE@ÊE@¾A=±;7£74š93•<6Œ<5‡<6ƒ=5=4<3~;2<3=1~:/~:/~:/}9.|90{8/{8/y90z:1z:1y90w81v70u6/u6/t5.k90k90j8/j8/j8/i9/i9/h8.f7-f7-f7-d8-d8-d8-d8-d8-f5.i81l;4k:3j92j92m>6qB:n?7pD;g;2g;2SJŒaXTKpE<6=52913:27<5492/5+25,9<345-35*24)13(13(35(46)57*,7',7'-8(-8(-8(-8(-8(/7(19*08)08+/7*/7*/7*08+08+7@+9B-=D2=D2=A29;-35'/3$3:*JVBcr[f}a\wVLnICgA=c:He7Kh:Nk=Nk=Kh:Jg9Li;Nk=TqCWtFZwI[xJ]zLZwINk=A^05;9*0.!'%heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVg`MjeOnlWnl]ff^eeeqqy‡‘“–ž¡«³¶ÃÈËÙÝàìíï÷÷÷ûùúþýûÿþúÿÿûýþøûüöùüóúýôùÿõùúõùúôøúïúûëûýèöùÞäçÈÒÖµ¶¼š”›ymvW\fK`lTq~lƒ‘€žŽ··µËËÉââàïïíôôòøøöúúøùù÷þþüþþüþþüþþüþþüþþüþþüþþüæÿÿðÿÿûÿÿýïîЪ§ a\™D=¸MEÄKBÈC:ÊA7ÎD:ÑH>ÏJAÉI>ÆG>ÁJ2¿K4¹L5¯K4 H2”F2ŒE3‡E5‚D5C6€@4‚>3…;2‡9/Š7/6-~:1~:1}90|8/{7.z7.y6-x5,w7-w7-x8.x8.v8-u7,s5*q3(h91h91h91g80h70g6/g6/g6/f5.h6/i70j81i70h6/f4-g2,k1-k4/n70m80k9.j:.i>.iB1dC2gJ8aJ8raOyn\ƒ|j…‚qOL;4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4./4..3-.3-/4./4.05/0;32=55A77C98D86B64@22?.3@.DQ=WeN\jSSaHHV=DR8FT:Ic>Ke@Ke@Ke>Je<Je<Lg>OjAUpGYtK\vO]wR]wTWpPHaC8Q3).2&+/$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVjcPlgQmkVlj[gg_lll~~†’ž§±³¹ÁÄÏ×Úâçêðô÷ûüþÿÿÿÿþÿþýûÿþúÿÿûþÿùûüôøûòøûò÷ýóøùóøùñøúíøùéùûåòõÚáâÃÌЯ´¸—‘–vkrSYaI_kUtoŒ˜Š›©œÀÀ¾ÓÓÑççåóóñ÷÷õûûùüüúûûùþþüþþüþþüþþüþþüþþüþþüþþüîÿÿôÿÿüÿÿÿüúÿíêñ¿¸Ã}u¢J@³K@»J<ÅK>ÈJ>ÄD9½=2¿?6ÃD;ÂH3ÃJ7½M9³J7¦G5™C4D6‹F7ƒC7C8A7>5‚<4„:1†91‡81}:2}:2|91z:1y90x8/w7.v7.u6-v7.t8.t8.t8.r6,p4*o3)i81i81i81h70h70h70g6/g6/e3,e3,g5.h6/j81j81j81k92k60l71m80l:1k;/l>1j@0iD2hG6kP=gR?ufSvd‹†s†ƒrML:4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4..3-.3-.3-.3-/4.05/-80/:21=34@66B66B66B45B16C1CP<P]IR`IIW>AO6BP7FT:Ic@Jd?Ke@Ke>Ic<Hc:Id;Je<SnEXrK\vQ]wT[tTTmOC\>3L/).2',0$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVmhTmhRmkVjk[jkcvxw‘‘™¨ª¶¾ÈÊÓÛÞêòõ÷üÿüÿÿþÿÿÿÿÿÿþÿþýûÿþúÿÿúýþøúûóõøïóöëñ÷ëô÷îöøíöøêö÷åõ÷áîîÔÛÛ¿ÉÊ«°±’“–yuy^kpZt{iˆ§œ¬¶­ÎÎÌÞÞÜïïíøøöûûùþþüþþüýýûþþüþþüþþüþþüþþüþþüþþüþþü÷ÿÿùÿÿþÿÿÿüúÿúôÿöíÿÑÄÙž•L=§Q@¬K;ª>1¸G9ÑXMÐTJ¾?6ÆD6ÇH9ÄJ=¹I=ªB7?5•A7’E=‡A9„A9@:>8~>5<4<4€;4x<2x<2w;1w;1v:0u9/t:/t:/s9.r9.r9.r9.q8-n8,l6*k5)j81j81j81j81i70i70i70h6/g5.g5.g5.g6/h70i81k:3k:3l;4k:3i:0j;1k?2lB4iD2fE2fI7lVAjYEviV†l‘Ž{€mEF439/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4./4./4..3--2,-2,.3-/4./4.*5-+6.-9//;12>24@46B47D38E3?L:ER>CQ:;I28F->L3ES:H`>Jb@LdBKc?Ia=G`9F_8G`9RkDXpL]uS^vVZqTPgK=T8,C)).2',0%*.heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\kd\md]meZmfVniUljSlkVlm]pqi€‚ž¡¨º¼ÈÃÍÏÜäçóûþûÿÿúþÿüýÿýýýüûùÿþüÿÿûÿþùûüôõöîîñæëîãçíáíñãðôåñôãòôßðòÜêêÐÙؼÈÇ«²±•¡¡‡‘“}‘’€œžª­¢¶»´ÀÅ¿ÜÜÚééçööôûûùýýûÿÿýÿÿýýýûþþüþþüþþüþþüþþüþþüþþüþþüüúÿÿþÿÿþÿöòïûôîÿýóÿûíÿõäêı·ƒn”Q>¡P=¸XH¸L?¸D7ÀG<Ç>4ÉD;ÈH?¿F>°?9¢;6š=8–A>?;‡@<@<}@;z?9y@9x?8v?8v=4v=4v=4u<3s=3r<2r<2q;1o;0o;0o;0l:/k9.j8-j8-i7,n72n72m61l71l71k60i70i70l:3j92h70g6/f7/f7/h91h91j?6f>4e=1f>2hC3iE5gF3cG2cJ6hV@k\GskV‡‚nŽzor_9>*28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3-.3-.3--2,-2,-2,-2,.3-.3-)4,)4,*6,+7-.:01=14@25A36C2:G5<I58E12@)2@)8F/?M4DX<G\=K`ALa@K`?I_;H^:H^:SiEZoN`uV`tXZnSNbI9M4(;%',/%*-$),heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\kd\md]meZmfVlgSkiRnmXop`svmƒ‡†£¨®¿ÃÎÍ×Ùçïòùÿÿûÿÿùýÿýþÿÿÿÿþýûÿÿûÿÿúþýø÷øðïñæçêßâæØÞäÖçëÚêïÛíðÛíïÙîîÖéçÎÚØ¿Îʱ½§¹´ ±®¶´§Á¾µÉÈÃÒÓÎÙÙ×èèæòòðúúøüüúýýûÿÿýÿÿýüüúþþüþþüþþüþþüþþüþþüþþüþþüÿûÿÿûÿÿúúûûùûÿùûÿøüÿôýÿíÿÿìõàËÈœcP–K8§L:¶O@»M>Æ=7ÈA;ÈD?ÀC?´<;©98 9:›==‘==Š>>„@?|A=xA<sB=rC=pC=s>6s>6s>6r=5p>5p>5p>5n>4n>4m=3l<2j;1j;1i:0i:0i:0p62p62p62o51m61m61k60i70l;4k:3h91e90e90e90e:1f;2dB6cA5cC4dD5fG5eH6cH3_I2^L6eV?jbKrmW„ƒn„‡r[`L3;&28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3--2,-2,,1+,1+,1+,1+-2,-2,,6.+5-*4,*4++5,.8-0:/2=/2=-5@06A05A-1=)1=)5A+9E/=O5AS9FY=I\@J]?J]=K^>L_?TgG\oQcvZbtZYkSK]G6G4$5"&+.$),"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\lc\md]meZlfVlgSljSlnXorasvm…„Ÿ¤ª¸¿ÉÖßäîöùùÿÿûÿÿùýÿþÿÿÿÿÿþýûÿÿûÿÿúüüôóõêëíâãçÙßãÕÜãÓäéÒçìÕéíÖêìÔëëÓèæÏßÚÄÔθÔͺÍƶËøÐÉÁÙÒÌàÛØëååòîïòòðùù÷ýýûýýûýýûÿÿýþþüüüúþþüþþüþþüþþüþþüþþüþþüþþüÿøüÿöùÿýýþÿý÷ÿýïÿøëÿõòÿøëúçÿÿíÿïÛ̧”£lX£ZG­VCªM;ÁA8ÃB<ÃD>¿D?·?>­;;£99œ:;–<<Ž>?…?=}@=wB<pC=mE=lF=q?8q?8q?8q?8p?8o>7o>7n?7o@8n?7m>6i=4h<3h<3h<3i=4r73q62q62p62o51m61l71j81h70g80e90e:1d<2f>4f@5gA6]C4aG8cL:dM;cM8`K6]K3]M4]Q9`Y?miPss[€„mt|eFO:2>(39/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0*+0*+0*,1+-2,,6.,6.*4,*4+*4++5*-7,.9+-8*0;+4?/5@/4?.3>-3?+4@,7F/;J3@P6DT:GW<JZ?M]@O_BUeJ^nSdtZbqZXgRIXE4B1$2!&+.$),"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTjdVjcYkd\lc\md]meZlfVljUllTkmWjn]lrhy}•œ¢¯¶ÀÒÛàëòøùÿÿùþÿ÷ûþþÿÿÿÿÿúù÷ÿÿûþýøùùññóèéëÞãçØáåÖàç×äêÐçíÓèìÑçéÑèèÐçåÎáÚÇ×оÛÒÃÚÐÆÞÔËçÜØîäãóéêúñôÿøýùù÷þþüÿÿýýýûýýûÿÿýÿÿýüüúþþüþþüþþüþþüþþüþþüþþüþþüÿ÷÷ÿùùÿýýüÿÿôÿþêÿûíÿÿíÿýñÿúðûíÿþíÿûèôλ­va‘P:¦^H»I>ºH=ºH>ºG@·F@°C@¦=:97—<;‘=;ˆ>;€A<wB:sD<nF<lH<q?8q?8q?8q?8p?8p?8p?8p?8qB:pA9n?7j>5i=4j>5j>5k?6s63r73q62p62n72l71j81i81d8/d90c;1d>3d@4cA5cA5bB5VG4^O<gVBhWCbS<^O8[O5\R7]V<]Y>mmSsw^z‚jcmU2>(5C,4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1+,1++0**/)*/)+0*,1+,1++5-+5-*4,*4,+5,+5,,6+-7,,7)/:,2=/6A17B27B25@/4?.2?+5B.:G3>L5AO6ES:JX?M[BTbI]kTcqZ_lXUbPERA2>0#/#(..&,,$**heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdTjdVjcYkd\lc\md]lfZlfVomXmmUimVgkZembr{xŽ—œ¨±ºÊÓØäëñöþÿ÷üÿøüÿþÿÿÿÿÿúù÷ÿÿúýýõøøîðòåéëÝåéÚåéØåìÚæíÎèïÐéîÐæéÎèæÏèãÏáÚÈÙÏÃÚÍÄßÒÌìÞÛúììÿôöÿõùÿõûÿøþýýûÿÿýÿÿýþþüþþüÿÿýÿÿýýýûþþüþþüþþüþþüþþüþþüþþüþþüÿüúÿýúÿûøùýüøÿÿôÿÿðÿÿêþüðÿûùÿûÿÿôÿöæÿôßÿãÍ×­”¢sY°SA®Q?®N>°O?±OB¯J@¥C:š<4—<7‘>8‰?6ƒ@7{B7tD6qE8nG8s>:s>:s>:q>:q>:q>:q>:p?:sB=rA<p?:m>8l=7l=7m>8n?9r73r73q73n72m82j81i81f:1f;2d>3d@4bB5`C5]A3\@2[?1QI4[S>f^Gg_H`Y?ZS9ZS7\W:ZV;WW;knSrx^u}eUaI%37E.4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0**/)*/)+0*+0*,1+)3+)3+*4,+5-+5,,6--7.-7,,6+.8-2=/6A39D69D67B46A1/<*2?-5B09F2<J3@N7FT=JXAR`I[iRanZ\iWQ^MBN@/;/!-!+1/(.,&,*heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeUkeWkdZle]md]ne^mg[mgWqoZkmUkoXkr`jrgozv†‘•Ÿ©²»ÄÉÑØÞèðóöûÿúþÿþÿÿÿÿÿþýùÿÿúþþöúúîöøêô÷æðôãìñÝçïÚð÷ÖíòÒëîÑììÒèæÏáÜÉÝÕÈÞÔÊáÔÎèÚ×òääúëîÿñöÿ÷ûÿùÿÿúÿþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüÿþùÿþùþþüýÿþûÿÿúÿÿøÿÿúÿÿüÿÿÿÿÿÿü÷ÿüñÿýìÿûåÿóÛÿíÑÁe¦cI—O7 T=ªYF¤Q?ŸI:¢L?;0Œ=0‡=0=/x=/t?/rC3sE5s<9s<9t=:s>:u@<u@<t?;q>:s@<r?;q@;q@;p?:o>9o>9o>9n72n72n93m;4l;4j;3g<3d<2c?3^>1dG9cG9T=-O8(M8'D/TR;PN7KI0MK2]Y>ieJeaDVU7XX<]`CosXz€fcmT=I1,:#1?(5;15;14:04:04:039/39/39/39/39/39/28.17-17-17-06,16016005/05//4./4./4./4.,1+,1+,1+,1+,1+,1++0*+0*.5.-4--4-,3,-4--4-.5-.5-+2*-4,08-5=29A6=E:?G<AI>7B25@03>-1<+2>*9E/BN8IU?O[EVbN]hWYdTLWI<F;/90)3*)/-(.,'-+heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeUkeWkdZmd]md]mf^mg[khWonYjlTjoXkr`jtiq|x‰”˜¡®¶¾ÇÌÓÚàéðö÷üÿûÿÿþÿÿþþüþýùÿÿúþþôûûï÷ùëô÷æðõáìñÛæî×êðÎæëËäçÊææÌãáÌßÙÉÝÕÊßÔÎçÙØíßßöçêýîóÿôøÿ÷ûÿúÿÿûÿþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüúÿùûÿúýÿüþþþÿýÿÿüÿÿúÿÿúÿÿûÿÿûÿÿúùÿüõÿþñÿÿìÿüãúöÛÿéÌß²•§uZ‘[A–ZB›YCœUAšQ>F5F4‰D4…D2}B0yB.s@-o?+v?:t=8u>9v?:t?9q<6r=7sA:q?8q?8q?8o>7o>7n=6n=6n=6l;4m<5m>6k?6j?6h@6eA5cA5dG9[A2^G7\I8N=+F7$G8%A4!IM4GK2DG,BE*MM1[[?abC`aBYY=dgJsw\sy_X`H8D,/;%6D-7=36<26<26<25;15;15;15;15;15;15;14:04:039/39/39/27127127116016016005/05/.3-.3--2,-2,,1+,1++0*+0**1**1*)0))0))0)*1*+2+,3,.5--4,.5-07/4;39@8?F>BIA:G69F56C13@.2?+5B.;I2?M6KXDR_KXeSVcRKWI<H<0<2*6,+1-*0,)/+heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeUkeWlcZmd]md]mf^mg[khWmlWimTjoXktaiuiq}yŠ˜›¤³ºÀÉÐÕÜâëòø÷üÿúþÿýþÿþþüþýùÿÿ÷ýýóúûí÷úéô÷äïôÞéîØãëÓâèÆÞáÂÛÞÁÞÞÆÞÛÈÞÖËßÖÏäÙ×îâäóçëúîòÿôøÿ÷ûÿøüÿúýÿüÿþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþü÷ÿúøÿüúÿþþþÿÿûÿÿúÿÿøÿÿ÷ÿÿøÿÿùÿÿúúÿýøÿÿôÿÿñüÿíöþçÿóÙÿùÞÿíÓâÀ¥«ƒj‡YA…Q;“[D—]GR=€F2w=)t=)t@+vC.xE2s>8p;5q<6vA;sA:p>7r@9xG@n=6n=6n=6m>6l=5l=5l=5l=5g?5h@6gA6gC7eC7cC6`C5^D5aL;UB1ZI7`S@RG3C;&E=(GA+>G,BH.@F*<@%?B%LO2_`AijKaaEnqTvz_gmSHP84<%4=(=F18>48>48>48>47=37=37=36<28>48>47=37=37=36<26<26<25:449349349338238238227105/05//4..3--2,,1++0*+0*(/((/((/((/((/()0)*1*+2+070.5.+2++2+.5.5<5<C<AHA?L;>K:<I78E34A-2?+3A*5C,DQ=KXDQ^LQ^MHTF<H<2>4-9/-3/-3/,2.gdUgdUheVheVheVheVifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWmlWimThpXht`hthm|wˆ—š¥´»ÀÉÐÔÛáéðööûÿúþÿýþÿÿÿýÿþúþþöýýñúûí÷úéô÷âîóÝçìÕàèÐÜà¿×Ú»ÖÖ¼Ù×ÂÝ×ÉßÖÍåÛÙìàâøìðüïöÿõûÿùþÿúýÿûûÿûûÿýúþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüöÿþ÷ÿþúÿþþþÿÿüÿÿùÿÿøÿÿ÷þÿøÿÿøüÿùùÿýúÿÿøþÿøúÿõöÿóÿþìÿýéÿòßÿñÛÿðÚñÒ½³zyS<tJ2uH1wI2{M6~O;zK7o@.e8%{LBsD:qB8sD:qB8g;0d8-h<1j>3i?3i?3i?3f>2f>2f>2f>2aA4`C5`C5_C5^D5[D4ZE4VE3XI6OB/\T?oiSc^HMK4IG0LJ3;E*?H->G*<B&<A#FI,VY:deFmmQxx\tw\[_F@D-6;%8@+<D/9?59?59?58>48>47=37=37=39?58>48>48>48>48>48>48>47<67<67<66;56;56;55:45:438238216005//4.-2,,1+,1++0,+0,*/+*/++0,,1--2.-2.051.3/+0,+0,-2.2738=9<A=?L;@M<@M;=J88E13@,1?(0>'<I5BO;HUCIVEDPB;G;2>4.:0.5..5.-4-gdUgdUgdUheVheVifWifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWjnUiqYgs_drejyt…”—¡²¹¾ÇÎÓÚâèïõôùýùýÿýþÿÿÿýÿÿúÿÿøÿÿóþÿñûþë÷úåðõÞèîÔàéÎÛܽÕÕ¹ÑÑ·ÔѾÚÔÈáØÓêàßôéíþóùÿöþÿûÿÿýÿÿþÿÿþúÿþúþÿùþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüøÿÿøÿÿûÿÿþþþÿýþÿûüÿûúÿúúÿùùÿù÷ÿù÷ÿüùÿÿûþÿûûÿüùÿûùôîÿÿöÿþôÿýóÿüîÿ÷çùçÓéӾϴŸ¶š„•u`yVBlI5mH6rM;uP>mF7iB3gB2jE5nI9oJ:pK;oK;eA1eA1cB1cB1cB1cB1cB1bC1\G6\G6\G6ZG6YH6WH5TG4RG3PH3MH2fdM~~fprZVX@IM4HL3;E*<F+?H+AG+AF(DG*MN/TU6xw[{z^nnTUU=AC-?A,>A.;>+9?59?59?58>48>47=37=37=38>48>48>48>48>48>48>48>49>89>89>88=78=78=77<67<66;55:449338227105//4./4.-2.-2.,1-+0,+0,,1--2.-2.,1-,1-,1-,1-.21043376598:H7=L9@O<@O:<K67F/4C,2A*6E.:I4@O<BP??M>8F91?2,9/.5.-4-,3,fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWioUiqYgs_bpcgxr‚”– ³¹ÁÊÑÕÜäéðöõúþùýÿýÿþÿÿýÿÿúÿÿöÿÿôÿÿñÿÿïúýèò÷àéïÕàéÎÙÚ»ÑѵÍË´Î˺ÖÏÅßÕÓìâãøíóÿöþÿùÿÿüÿÿýÿÿÿýþÿúýÿ÷þÿøþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüýýÿýþÿýþÿýÿþþþüþÿùþÿ÷ÿÿõýýóýýõþýøþýùÿþüÿýÿÿýÿÿþÿþùÿÿüÿÿúþúöõýøôÿþöÿþñÿþïÿûéÿóàöåÓåÓ¿Ò»©¹ŸŸƒuŽrd|]I}^JrVAaE0W;&Y=(Z?*X=(`E0`E0_F0_F0`G1`G1^H1^H1[L9ZM:ZM:XM9XM9UM8RL6QL6NL5QQ9ikS|€glrXSY?DM2>G,:G+<F+?H+DJ.EJ,DG*HI*ML.yx\tsWfdKTR;LJ5KJ6FE3<=+:@69?59?59?58>48>48>48>47=37=38>48>48>48>49?59?5:?9:?9:?9:?99>89>89>88=78=78=77<66;55:4493382382/40.3/-2.,1-+0,+0,+0,+0,+/.,0/-10.21/32/32/32.210A.5F3;M7>P:=O7:L47I/6H.3E-6H0:L6<M::K95F6/?2*:--4,-4,,3+fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[jiWjlVhnThrYfs_aqdhys…—™¤·½ÈÑØÛâêîõûøýÿúþÿýÿþÿÿýÿþùÿÿõÿÿóÿÿðüÿêøüåïõÛäêÐÛäÇÖÕ¹Î̳ÇÅ°ÊÄ´ÐÉÁÚÒÐêßãöìôÿ÷ÿÿúÿÿýÿÿþÿÿÿýûÿùüÿøûÿöþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüÿûÿÿüÿþýÿýÿþúÿúøÿ÷÷ÿó÷ÿò÷ÿòøÿóûÿøýÿúÿýþÿüÿÿûÿÿúÿýõÿÿúÿÿüÿÿýÿÿþÿýýûúûõ÷ùìÿÿóÿÿïÿÿïÿþíÿýíÿöçÿîâüêÞúäÍýçÐáË´¥xt^GdP8aM5\H0\J2\J2\J2]K3\L3]M4]M4]M4WO:WO:VP:VP:TO9QO8PN7NN6MO7PT;`fLfoTU^CEO4AK0:G+=J.?I.CL/HN2HM/FI,OP1YX:qmRjfKa]D[V@YT@TQ>MJ9EB1;A7;A7;A7;A7:@6:@6:@69?58>48>48>49?59?5:@6:@6:@6;@:;@:;@::?9:?99>89>89>8:?9:?99>89>88=78=77<67<6495273162/40-2.,1-+0,+/.,0/,0/-10.21.21.23-12,01):'/@-6H2;M5=O7<N4:L2:L25G-7I1:L6<M::K96G70@3+;..5--4,,3+fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^kg[jiWikUhnThrYgt`brej{u‰›©¼ÂÎ×Þàçïòùÿúÿÿûÿÿýÿþþþüþýøúúðúúîúûë÷úåó÷àéïÕÞäÈÕÞÁÓÒ¶ÊȯÂÀ«Å¿±ËļÖÎÌæÝâôêòÿöÿÿùÿÿþÿÿÿÿýÿúûÿùûÿöûÿôþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüÿùÿÿúÿÿüÿûÿþøÿúôÿõóÿòñÿðòÿñõÿóøÿöüÿûÿþÿÿüÿÿùÿÿøÿÿùÿÿúÿÿûÿÿýÿýýÿùýÿúÿûüÿúöüðùýîûüìýûìÿúìÿúîÿýñÿüñÿðÖÿûáíÜŸŽtaP6RB(XH.XH.[M2[M2\N3\N3[P4[P4\Q5\Q5TO9TO9TO9QO8PN7NN6KM5IM4JN5LR8S\AOY>?I.9F*?L0=J.AN2DN3HQ4LR6IN0JM0ZY;miLhdIc]C_YA_ZD`[GZUBQN=LI8=C9=C9=C9<B8<B8<B8;A7;A79?59?59?5:@6:@6;A7;A7;A7;@:;@:;@::?9:?99>89>89>8;@:;@:;@:;@::?9:?9:?9:?99>:8=95:6384162/40.3/.21.21.21-10-12,01,01-12-12$5"*<&3E/9K3<N6;M3;M3;M38J09K3;M7<M:<M;7H81B2,<//6..5--4,ZgM[hN\hP_iQakSckTfkWhkXfgUhgUheVheVjdVldWldYmeZjgVkhYkg[kg^kg^jf]hfZgeVfiVfkUenYbo^dqhsƒ‚–§®¶ÈÒÓÚàäéíò÷ú÷ýýùþúúÿøüÿôüþñöùèùúèø÷åòñÝïìÙìéÖáÞË×Ò¿Úͼ̿¯À²¥¿²©Â·³ÍÁÁÜÑ×êàèúòýüöÿþûÿÿþÿþýÿüýÿüýÿüýÿþþþþþþþþþþþþþþþþþþÿþüÿþüÿþüÿýúÿüùÿüùÿüùÿýùÿþúÿþúÿþýÿýüÿüûÿýþÿþÿÿþÿÿýþýûüÿþÿÿúúÿûøÿýøÿüöÿúòÿøïÿùñÿûÿÿýÿÿýþÿÿýÿÿûýÿüýÿþüýÿþÿÿÿþÿÿüÿÿýþÿý÷ÿþîÿÿæÿÿâööÜýûâãâƉnTO2UN1RL,SJ+WN/UO/UN1TO1SO2QP4QP4PP6QM2PO3QO6PP6MO7KO6HM6EM5HQ6FO4AJ-?F'@G&EK)GM)FL(ST2RS3MN.JK,TT8bbHccIZZB[YB\ZC][B][B[Z>XW9UT6SR3KE/JD.FA-D?,A>/@>1??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B79A6:B7;C8<D9=E:>F;7B:7C97A66A16?.4<-39-270.5./51-7/-9+-<%.B3J7O7Z 8Y$8W+:U2:R8;P==O?>O=:L6@R8EX:EZ;DY:>U93J0(>'.5-,3++2*ZgM[hN\hP_iQakSckTglXhkXghVihVifWifWkeWmeXmeZnf[khWkhYkg[kg^jf]jf]hfZgeVgjWglVfoZerajwnzŠ‰š«²·ÉÓÑØÞáéìò÷úøþþùþúúÿøûþóúüï÷úé÷øæõôâíìØéæÓåâÏÜ×ÄÑ̹˾­Á´¤º¬Ÿ¼¯§Á¶²ÌÀÀÛÐÖèÞæûóþý÷ÿþûÿÿþÿþýÿüýÿüýÿüýÿþþþþþþþþþþþþþþþþþþÿþüÿþüÿþüÿýúÿýúÿüùÿüùÿýùÿýùÿþúÿþýÿýüÿüûÿýþÿþÿÿþÿÿýþýûüÿþÿÿýýÿüùÿøóøíçòåÝöèßÿïçÿûÿÿýÿÿýþÿÿýÿÿûýÿüýÿþüýÿýþÿþýÿÿýÿÿýþÿý÷ÿþîÿÿæÿÿâ÷÷ßýûââàÇ‹‡lRM0TM0QK+SJ+WN/UO/UN1TO1SO2QP4QP4PP6QM2PO3PN5PP6MO7KO6HM6EM5HQ6EN3BK.AH)BI(GM+JP,KQ-NR/PT1VZ9^aBaaE[[?VV<UU=VV>VV>XV=YW>XW;XW9WV8VU7QK5OI3LG3ID1DA2B@3??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B7:B7:B7;C8<D9=E:>F;<G?<H><F;;F6<E4:B39?38=67>76<83=51=/3B+9M*BY-Ia1Nq7Mn9Ji=Fa>AY?<Q>:L<:K9=O9DV<K^@LaBLaBF]A:Q7/E.-4,+2*)0(ZgM[hN\hP`jRakSdlUglXilYijXkjXkhYkhYlfXmgYnf[og\khWkhYkg[jf]jf]ie\hfZhfWgjWejTdmXgtco|sŽ›¬³³ÅÏÎÕÛÞåëñöúøþþúÿûùþ÷øûòõ÷êòõäðñßêé×áàÌÜÙÆ×ÔÁÐ˸ÆÁ®À³¢½° ½¯¤Ã¶®ËÀ¼ÖÊÌãØÞíãëüôÿý÷ÿþûÿÿþÿþýÿüýÿüýÿýÿþþþþþþþþþþþþþþþþþþþÿþüÿþüÿþüÿýúÿýúÿýúÿüùÿüøÿüøÿüøÿýüÿüûÿûúþüýÿþÿÿþÿÿýþþüýÿþÿÿýýÿýúüóîêßÙâÕÍëÝÔüëãÿûÿÿýÿÿýþÿÿýÿÿûýÿúýÿþüýÿýþÿþýÿÿþÿÿþÿÿý÷ÿýíÿþåÿþáøøàþüåáßƉ…jPK.RK.QJ-SJ+VM.UO/UN1UP2TP3QP4QP4OO3QM2ON2PN5OO5MO7KO6IN7FN6HQ6FO4CL/EL-FM,KQ/OU1SY5QY0W_8jpLy]qvVY^@LO4MO7QQ9QQ9QQ9SQ8TR9UT8WV:ZV;XR<VP:RM9NI6HE6DB5AA5?A6<=5;>5:@69A67B47B47C57D3:B7:B79A69A69A69A6:B7:B7:B7:B7:B7:B7;C8<D9>F;>F;>IA>J@?I>>I9?H7>F7>D8=B;>E>;A=6@85A39H1BV3Pg;ZrB]€F\}HVuIMhEBZ@9N;5G74E3<N8EW=NaCRgHShILcG@W=4J3180/6.-4,YgM[hN\hP^jRblTemVhmYjmZklZklZlj[liZnhZnhZog\ph]liXkhYjfZjf]ie\ie\hfZhfWehUbgQajUerao|s~Ž”¥¬¨ºÄÈÏ×Úáçìô÷öûþ÷ýûõúôóöíïñäèêÜãäÒÜÛÉÔѾÎ˸ËƳþ«¼·¤Ä·¦ÇºªÎÀµÖÉÁßÔÐêÞàóèîúðùýõÿþøÿÿüÿþýÿýüÿüýÿüþýýÿþþþþþþþþþþþþþþþþþþþÿþüÿþüþýûÿýúÿýúÿýúÿýúÿüøÿû÷ÿû÷ÿýüÿüûþúùýûüÿýþÿþÿÿýþþüýÿüýÿýýÿýúýôïíâÜæÙÑðâÙÿðèÿûÿÿýÿÿýþÿÿýÿÿûýÿúýÿüüýÿýþÿþýÿÿþÿÿþýÿþõÿýíÿýäÿüßûûãÿþçâàÇŠ†mPJ0SL0SL/UL-VM.UO/VO2UP2TP3QP4PO3NN2PL1NM1OM4NN4LN6KO6JO8HP8JS8GP5GP3KR3MT3PV4V\8]c?fsGtU‡”i›s…lnuTZaBRV;LN6NN6MM5NL5OM6TP7WS:YU<ZT>XR<TO;QL9KH9GE8CC7@B7=>6<?6:@69A67B47B46B46C2;C8:B79A69A69A69A6:B7;C8;C8:B7:B7;C8;C8=E:>F;?G<<G?<H>>H=>I9?H7>F7>D8=B;=D=;A=6@85A39H1DX5Ri=]uEY|BXyDRqEIdA<T:2G4.@0->,6H2@R8L_AQfGShIMdH@W=4J329107/-4,YgMZhN\hP^jRblTemVgoZjo[lo\lm[mk\mj[nhZnhZoi]ph]liXkhYjfZie\ie\ie\ig[igXfiVchRajUerao|s{‹ŠŽŸ¦Ÿ±»ÂËÒÕÜäéðöòúüôúøñöðíðçéëÞáãÕÚÛËÒÑ¿ÌɶÉıþ«¾¹¦»´¢Ë¾®ÓŸÝÏÄæÙÑíâà÷ëíÿôúÿøÿÿ÷ÿÿúÿÿüÿþýÿýüÿûüþüþýþÿÿþþþþþþþþþþþþþþþþþþÿþüÿþüþýûÿüùÿýúÿýúÿýúÿû÷ÿúöþùõÿýüÿûúýùøüúûþüýÿýþÿþÿÿýþÿüýÿüüÿüùÿøó÷ìæòåÝøêáÿóëÿûÿÿýÿÿýþÿÿûÿÿûýÿúýÿüüýÿüýÿþýÿÿþÿÿþýÿþõÿüìÿüãÿúÝþýèÿÿëåãÌŒˆoRL2UN2TM0WN1VM.UO/WP3VQ3UQ4QP2ON2MM1PL1NM1NL3MM3LN6LP7KP9JR:LU:IR7JS6QX9SZ9U[9]c?gmI€”a’¦sŸ±š«’¡xˆ”pr|Z\bFLP7KM7LK6KI4NI5PK7TM:VP:WQ;VP:SN:QL9LI:IG:EE9CE:=>6<?6:@69A67B47B46B46C2;C8;C8:B79A69A6:B7;C8;C8;C8;C8;C8;C8<D9=E:>F;?G<<G?<H>=G<=H8>G6=E6=C7=B;:A:9?;5?75A39H1BV3Ne9Wo?Sv<St?NmAE`=8P6-B/*<,+<*1C-<N4H[=OdERgHLcG@W=3I2.5-+2*'.& \ No newline at end of file
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimgp.jpg b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimgp.jpg
new file mode 100644
index 0000000..ca6acad
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testimgp.jpg
Binary files differ
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testorig.jpg b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testorig.jpg
new file mode 100644
index 0000000..9816a0c
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testorig.jpg
Binary files differ
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testprog.jpg b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testprog.jpg
new file mode 100644
index 0000000..920fee2
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/testprog.jpg
Binary files differ
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.c
new file mode 100644
index 0000000..fe34a3a
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.c
@@ -0,0 +1,1597 @@
1/*
2 * transupp.c
3 *
4 * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains image transformation routines and other utility code
9 * used by the jpegtran sample application. These are NOT part of the core
10 * JPEG library. But we keep these routines separate from jpegtran.c to
11 * ease the task of maintaining jpegtran-like programs that have other user
12 * interfaces.
13 */
14
15/* Although this file really shouldn't have access to the library internals,
16 * it's helpful to let it call jround_up() and jcopy_block_row().
17 */
18#define JPEG_INTERNALS
19
20#include "jinclude.h"
21#include "jpeglib.h"
22#include "transupp.h" /* My own external interface */
23#include <ctype.h> /* to declare isdigit() */
24
25
26#if TRANSFORMS_SUPPORTED
27
28/*
29 * Lossless image transformation routines. These routines work on DCT
30 * coefficient arrays and thus do not require any lossy decompression
31 * or recompression of the image.
32 * Thanks to Guido Vollbeding for the initial design and code of this feature,
33 * and to Ben Jackson for introducing the cropping feature.
34 *
35 * Horizontal flipping is done in-place, using a single top-to-bottom
36 * pass through the virtual source array. It will thus be much the
37 * fastest option for images larger than main memory.
38 *
39 * The other routines require a set of destination virtual arrays, so they
40 * need twice as much memory as jpegtran normally does. The destination
41 * arrays are always written in normal scan order (top to bottom) because
42 * the virtual array manager expects this. The source arrays will be scanned
43 * in the corresponding order, which means multiple passes through the source
44 * arrays for most of the transforms. That could result in much thrashing
45 * if the image is larger than main memory.
46 *
47 * If cropping or trimming is involved, the destination arrays may be smaller
48 * than the source arrays. Note it is not possible to do horizontal flip
49 * in-place when a nonzero Y crop offset is specified, since we'd have to move
50 * data from one block row to another but the virtual array manager doesn't
51 * guarantee we can touch more than one row at a time. So in that case,
52 * we have to use a separate destination array.
53 *
54 * Some notes about the operating environment of the individual transform
55 * routines:
56 * 1. Both the source and destination virtual arrays are allocated from the
57 * source JPEG object, and therefore should be manipulated by calling the
58 * source's memory manager.
59 * 2. The destination's component count should be used. It may be smaller
60 * than the source's when forcing to grayscale.
61 * 3. Likewise the destination's sampling factors should be used. When
62 * forcing to grayscale the destination's sampling factors will be all 1,
63 * and we may as well take that as the effective iMCU size.
64 * 4. When "trim" is in effect, the destination's dimensions will be the
65 * trimmed values but the source's will be untrimmed.
66 * 5. When "crop" is in effect, the destination's dimensions will be the
67 * cropped values but the source's will be uncropped. Each transform
68 * routine is responsible for picking up source data starting at the
69 * correct X and Y offset for the crop region. (The X and Y offsets
70 * passed to the transform routines are measured in iMCU blocks of the
71 * destination.)
72 * 6. All the routines assume that the source and destination buffers are
73 * padded out to a full iMCU boundary. This is true, although for the
74 * source buffer it is an undocumented property of jdcoefct.c.
75 */
76
77
78LOCAL(void)
79do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
80 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
81 jvirt_barray_ptr *src_coef_arrays,
82 jvirt_barray_ptr *dst_coef_arrays)
83/* Crop. This is only used when no rotate/flip is requested with the crop. */
84{
85 JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;
86 int ci, offset_y;
87 JBLOCKARRAY src_buffer, dst_buffer;
88 jpeg_component_info *compptr;
89
90 /* We simply have to copy the right amount of data (the destination's
91 * image size) starting at the given X and Y offsets in the source.
92 */
93 for (ci = 0; ci < dstinfo->num_components; ci++) {
94 compptr = dstinfo->comp_info + ci;
95 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
96 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
97 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
98 dst_blk_y += compptr->v_samp_factor) {
99 dst_buffer = (*srcinfo->mem->access_virt_barray)
100 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
101 (JDIMENSION) compptr->v_samp_factor, TRUE);
102 src_buffer = (*srcinfo->mem->access_virt_barray)
103 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
104 dst_blk_y + y_crop_blocks,
105 (JDIMENSION) compptr->v_samp_factor, FALSE);
106 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
107 jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
108 dst_buffer[offset_y],
109 compptr->width_in_blocks);
110 }
111 }
112 }
113}
114
115
116LOCAL(void)
117do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
118 JDIMENSION x_crop_offset,
119 jvirt_barray_ptr *src_coef_arrays)
120/* Horizontal flip; done in-place, so no separate dest array is required.
121 * NB: this only works when y_crop_offset is zero.
122 */
123{
124 JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;
125 int ci, k, offset_y;
126 JBLOCKARRAY buffer;
127 JCOEFPTR ptr1, ptr2;
128 JCOEF temp1, temp2;
129 jpeg_component_info *compptr;
130
131 /* Horizontal mirroring of DCT blocks is accomplished by swapping
132 * pairs of blocks in-place. Within a DCT block, we perform horizontal
133 * mirroring by changing the signs of odd-numbered columns.
134 * Partial iMCUs at the right edge are left untouched.
135 */
136 MCU_cols = srcinfo->output_width /
137 (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
138
139 for (ci = 0; ci < dstinfo->num_components; ci++) {
140 compptr = dstinfo->comp_info + ci;
141 comp_width = MCU_cols * compptr->h_samp_factor;
142 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
143 for (blk_y = 0; blk_y < compptr->height_in_blocks;
144 blk_y += compptr->v_samp_factor) {
145 buffer = (*srcinfo->mem->access_virt_barray)
146 ((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,
147 (JDIMENSION) compptr->v_samp_factor, TRUE);
148 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
149 /* Do the mirroring */
150 for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
151 ptr1 = buffer[offset_y][blk_x];
152 ptr2 = buffer[offset_y][comp_width - blk_x - 1];
153 /* this unrolled loop doesn't need to know which row it's on... */
154 for (k = 0; k < DCTSIZE2; k += 2) {
155 temp1 = *ptr1; /* swap even column */
156 temp2 = *ptr2;
157 *ptr1++ = temp2;
158 *ptr2++ = temp1;
159 temp1 = *ptr1; /* swap odd column with sign change */
160 temp2 = *ptr2;
161 *ptr1++ = -temp2;
162 *ptr2++ = -temp1;
163 }
164 }
165 if (x_crop_blocks > 0) {
166 /* Now left-justify the portion of the data to be kept.
167 * We can't use a single jcopy_block_row() call because that routine
168 * depends on memcpy(), whose behavior is unspecified for overlapping
169 * source and destination areas. Sigh.
170 */
171 for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {
172 jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
173 buffer[offset_y] + blk_x,
174 (JDIMENSION) 1);
175 }
176 }
177 }
178 }
179 }
180}
181
182
183LOCAL(void)
184do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
185 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
186 jvirt_barray_ptr *src_coef_arrays,
187 jvirt_barray_ptr *dst_coef_arrays)
188/* Horizontal flip in general cropping case */
189{
190 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
191 JDIMENSION x_crop_blocks, y_crop_blocks;
192 int ci, k, offset_y;
193 JBLOCKARRAY src_buffer, dst_buffer;
194 JBLOCKROW src_row_ptr, dst_row_ptr;
195 JCOEFPTR src_ptr, dst_ptr;
196 jpeg_component_info *compptr;
197
198 /* Here we must output into a separate array because we can't touch
199 * different rows of a single virtual array simultaneously. Otherwise,
200 * this is essentially the same as the routine above.
201 */
202 MCU_cols = srcinfo->output_width /
203 (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
204
205 for (ci = 0; ci < dstinfo->num_components; ci++) {
206 compptr = dstinfo->comp_info + ci;
207 comp_width = MCU_cols * compptr->h_samp_factor;
208 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
209 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
210 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
211 dst_blk_y += compptr->v_samp_factor) {
212 dst_buffer = (*srcinfo->mem->access_virt_barray)
213 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
214 (JDIMENSION) compptr->v_samp_factor, TRUE);
215 src_buffer = (*srcinfo->mem->access_virt_barray)
216 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
217 dst_blk_y + y_crop_blocks,
218 (JDIMENSION) compptr->v_samp_factor, FALSE);
219 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
220 dst_row_ptr = dst_buffer[offset_y];
221 src_row_ptr = src_buffer[offset_y];
222 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
223 if (x_crop_blocks + dst_blk_x < comp_width) {
224 /* Do the mirrorable blocks */
225 dst_ptr = dst_row_ptr[dst_blk_x];
226 src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
227 /* this unrolled loop doesn't need to know which row it's on... */
228 for (k = 0; k < DCTSIZE2; k += 2) {
229 *dst_ptr++ = *src_ptr++; /* copy even column */
230 *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */
231 }
232 } else {
233 /* Copy last partial block(s) verbatim */
234 jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
235 dst_row_ptr + dst_blk_x,
236 (JDIMENSION) 1);
237 }
238 }
239 }
240 }
241 }
242}
243
244
245LOCAL(void)
246do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
247 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
248 jvirt_barray_ptr *src_coef_arrays,
249 jvirt_barray_ptr *dst_coef_arrays)
250/* Vertical flip */
251{
252 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
253 JDIMENSION x_crop_blocks, y_crop_blocks;
254 int ci, i, j, offset_y;
255 JBLOCKARRAY src_buffer, dst_buffer;
256 JBLOCKROW src_row_ptr, dst_row_ptr;
257 JCOEFPTR src_ptr, dst_ptr;
258 jpeg_component_info *compptr;
259
260 /* We output into a separate array because we can't touch different
261 * rows of the source virtual array simultaneously. Otherwise, this
262 * is a pretty straightforward analog of horizontal flip.
263 * Within a DCT block, vertical mirroring is done by changing the signs
264 * of odd-numbered rows.
265 * Partial iMCUs at the bottom edge are copied verbatim.
266 */
267 MCU_rows = srcinfo->output_height /
268 (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
269
270 for (ci = 0; ci < dstinfo->num_components; ci++) {
271 compptr = dstinfo->comp_info + ci;
272 comp_height = MCU_rows * compptr->v_samp_factor;
273 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
274 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
275 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
276 dst_blk_y += compptr->v_samp_factor) {
277 dst_buffer = (*srcinfo->mem->access_virt_barray)
278 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
279 (JDIMENSION) compptr->v_samp_factor, TRUE);
280 if (y_crop_blocks + dst_blk_y < comp_height) {
281 /* Row is within the mirrorable area. */
282 src_buffer = (*srcinfo->mem->access_virt_barray)
283 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
284 comp_height - y_crop_blocks - dst_blk_y -
285 (JDIMENSION) compptr->v_samp_factor,
286 (JDIMENSION) compptr->v_samp_factor, FALSE);
287 } else {
288 /* Bottom-edge blocks will be copied verbatim. */
289 src_buffer = (*srcinfo->mem->access_virt_barray)
290 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
291 dst_blk_y + y_crop_blocks,
292 (JDIMENSION) compptr->v_samp_factor, FALSE);
293 }
294 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
295 if (y_crop_blocks + dst_blk_y < comp_height) {
296 /* Row is within the mirrorable area. */
297 dst_row_ptr = dst_buffer[offset_y];
298 src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
299 src_row_ptr += x_crop_blocks;
300 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
301 dst_blk_x++) {
302 dst_ptr = dst_row_ptr[dst_blk_x];
303 src_ptr = src_row_ptr[dst_blk_x];
304 for (i = 0; i < DCTSIZE; i += 2) {
305 /* copy even row */
306 for (j = 0; j < DCTSIZE; j++)
307 *dst_ptr++ = *src_ptr++;
308 /* copy odd row with sign change */
309 for (j = 0; j < DCTSIZE; j++)
310 *dst_ptr++ = - *src_ptr++;
311 }
312 }
313 } else {
314 /* Just copy row verbatim. */
315 jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
316 dst_buffer[offset_y],
317 compptr->width_in_blocks);
318 }
319 }
320 }
321 }
322}
323
324
325LOCAL(void)
326do_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
327 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
328 jvirt_barray_ptr *src_coef_arrays,
329 jvirt_barray_ptr *dst_coef_arrays)
330/* Transpose source into destination */
331{
332 JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;
333 int ci, i, j, offset_x, offset_y;
334 JBLOCKARRAY src_buffer, dst_buffer;
335 JCOEFPTR src_ptr, dst_ptr;
336 jpeg_component_info *compptr;
337
338 /* Transposing pixels within a block just requires transposing the
339 * DCT coefficients.
340 * Partial iMCUs at the edges require no special treatment; we simply
341 * process all the available DCT blocks for every component.
342 */
343 for (ci = 0; ci < dstinfo->num_components; ci++) {
344 compptr = dstinfo->comp_info + ci;
345 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
346 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
347 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
348 dst_blk_y += compptr->v_samp_factor) {
349 dst_buffer = (*srcinfo->mem->access_virt_barray)
350 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
351 (JDIMENSION) compptr->v_samp_factor, TRUE);
352 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
353 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
354 dst_blk_x += compptr->h_samp_factor) {
355 src_buffer = (*srcinfo->mem->access_virt_barray)
356 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
357 dst_blk_x + x_crop_blocks,
358 (JDIMENSION) compptr->h_samp_factor, FALSE);
359 for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
360 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
361 src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];
362 for (i = 0; i < DCTSIZE; i++)
363 for (j = 0; j < DCTSIZE; j++)
364 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
365 }
366 }
367 }
368 }
369 }
370}
371
372
373LOCAL(void)
374do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
375 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
376 jvirt_barray_ptr *src_coef_arrays,
377 jvirt_barray_ptr *dst_coef_arrays)
378/* 90 degree rotation is equivalent to
379 * 1. Transposing the image;
380 * 2. Horizontal mirroring.
381 * These two steps are merged into a single processing routine.
382 */
383{
384 JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
385 JDIMENSION x_crop_blocks, y_crop_blocks;
386 int ci, i, j, offset_x, offset_y;
387 JBLOCKARRAY src_buffer, dst_buffer;
388 JCOEFPTR src_ptr, dst_ptr;
389 jpeg_component_info *compptr;
390
391 /* Because of the horizontal mirror step, we can't process partial iMCUs
392 * at the (output) right edge properly. They just get transposed and
393 * not mirrored.
394 */
395 MCU_cols = srcinfo->output_height /
396 (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
397
398 for (ci = 0; ci < dstinfo->num_components; ci++) {
399 compptr = dstinfo->comp_info + ci;
400 comp_width = MCU_cols * compptr->h_samp_factor;
401 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
402 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
403 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
404 dst_blk_y += compptr->v_samp_factor) {
405 dst_buffer = (*srcinfo->mem->access_virt_barray)
406 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
407 (JDIMENSION) compptr->v_samp_factor, TRUE);
408 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
409 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
410 dst_blk_x += compptr->h_samp_factor) {
411 if (x_crop_blocks + dst_blk_x < comp_width) {
412 /* Block is within the mirrorable area. */
413 src_buffer = (*srcinfo->mem->access_virt_barray)
414 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
415 comp_width - x_crop_blocks - dst_blk_x -
416 (JDIMENSION) compptr->h_samp_factor,
417 (JDIMENSION) compptr->h_samp_factor, FALSE);
418 } else {
419 /* Edge blocks are transposed but not mirrored. */
420 src_buffer = (*srcinfo->mem->access_virt_barray)
421 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
422 dst_blk_x + x_crop_blocks,
423 (JDIMENSION) compptr->h_samp_factor, FALSE);
424 }
425 for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
426 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
427 if (x_crop_blocks + dst_blk_x < comp_width) {
428 /* Block is within the mirrorable area. */
429 src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
430 [dst_blk_y + offset_y + y_crop_blocks];
431 for (i = 0; i < DCTSIZE; i++) {
432 for (j = 0; j < DCTSIZE; j++)
433 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
434 i++;
435 for (j = 0; j < DCTSIZE; j++)
436 dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
437 }
438 } else {
439 /* Edge blocks are transposed but not mirrored. */
440 src_ptr = src_buffer[offset_x]
441 [dst_blk_y + offset_y + y_crop_blocks];
442 for (i = 0; i < DCTSIZE; i++)
443 for (j = 0; j < DCTSIZE; j++)
444 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
445 }
446 }
447 }
448 }
449 }
450 }
451}
452
453
454LOCAL(void)
455do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
456 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
457 jvirt_barray_ptr *src_coef_arrays,
458 jvirt_barray_ptr *dst_coef_arrays)
459/* 270 degree rotation is equivalent to
460 * 1. Horizontal mirroring;
461 * 2. Transposing the image.
462 * These two steps are merged into a single processing routine.
463 */
464{
465 JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
466 JDIMENSION x_crop_blocks, y_crop_blocks;
467 int ci, i, j, offset_x, offset_y;
468 JBLOCKARRAY src_buffer, dst_buffer;
469 JCOEFPTR src_ptr, dst_ptr;
470 jpeg_component_info *compptr;
471
472 /* Because of the horizontal mirror step, we can't process partial iMCUs
473 * at the (output) bottom edge properly. They just get transposed and
474 * not mirrored.
475 */
476 MCU_rows = srcinfo->output_width /
477 (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
478
479 for (ci = 0; ci < dstinfo->num_components; ci++) {
480 compptr = dstinfo->comp_info + ci;
481 comp_height = MCU_rows * compptr->v_samp_factor;
482 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
483 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
484 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
485 dst_blk_y += compptr->v_samp_factor) {
486 dst_buffer = (*srcinfo->mem->access_virt_barray)
487 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
488 (JDIMENSION) compptr->v_samp_factor, TRUE);
489 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
490 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
491 dst_blk_x += compptr->h_samp_factor) {
492 src_buffer = (*srcinfo->mem->access_virt_barray)
493 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
494 dst_blk_x + x_crop_blocks,
495 (JDIMENSION) compptr->h_samp_factor, FALSE);
496 for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
497 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
498 if (y_crop_blocks + dst_blk_y < comp_height) {
499 /* Block is within the mirrorable area. */
500 src_ptr = src_buffer[offset_x]
501 [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
502 for (i = 0; i < DCTSIZE; i++) {
503 for (j = 0; j < DCTSIZE; j++) {
504 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
505 j++;
506 dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
507 }
508 }
509 } else {
510 /* Edge blocks are transposed but not mirrored. */
511 src_ptr = src_buffer[offset_x]
512 [dst_blk_y + offset_y + y_crop_blocks];
513 for (i = 0; i < DCTSIZE; i++)
514 for (j = 0; j < DCTSIZE; j++)
515 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
516 }
517 }
518 }
519 }
520 }
521 }
522}
523
524
525LOCAL(void)
526do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
527 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
528 jvirt_barray_ptr *src_coef_arrays,
529 jvirt_barray_ptr *dst_coef_arrays)
530/* 180 degree rotation is equivalent to
531 * 1. Vertical mirroring;
532 * 2. Horizontal mirroring.
533 * These two steps are merged into a single processing routine.
534 */
535{
536 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
537 JDIMENSION x_crop_blocks, y_crop_blocks;
538 int ci, i, j, offset_y;
539 JBLOCKARRAY src_buffer, dst_buffer;
540 JBLOCKROW src_row_ptr, dst_row_ptr;
541 JCOEFPTR src_ptr, dst_ptr;
542 jpeg_component_info *compptr;
543
544 MCU_cols = srcinfo->output_width /
545 (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
546 MCU_rows = srcinfo->output_height /
547 (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
548
549 for (ci = 0; ci < dstinfo->num_components; ci++) {
550 compptr = dstinfo->comp_info + ci;
551 comp_width = MCU_cols * compptr->h_samp_factor;
552 comp_height = MCU_rows * compptr->v_samp_factor;
553 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
554 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
555 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
556 dst_blk_y += compptr->v_samp_factor) {
557 dst_buffer = (*srcinfo->mem->access_virt_barray)
558 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
559 (JDIMENSION) compptr->v_samp_factor, TRUE);
560 if (y_crop_blocks + dst_blk_y < comp_height) {
561 /* Row is within the vertically mirrorable area. */
562 src_buffer = (*srcinfo->mem->access_virt_barray)
563 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
564 comp_height - y_crop_blocks - dst_blk_y -
565 (JDIMENSION) compptr->v_samp_factor,
566 (JDIMENSION) compptr->v_samp_factor, FALSE);
567 } else {
568 /* Bottom-edge rows are only mirrored horizontally. */
569 src_buffer = (*srcinfo->mem->access_virt_barray)
570 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
571 dst_blk_y + y_crop_blocks,
572 (JDIMENSION) compptr->v_samp_factor, FALSE);
573 }
574 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
575 dst_row_ptr = dst_buffer[offset_y];
576 if (y_crop_blocks + dst_blk_y < comp_height) {
577 /* Row is within the mirrorable area. */
578 src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
579 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
580 dst_ptr = dst_row_ptr[dst_blk_x];
581 if (x_crop_blocks + dst_blk_x < comp_width) {
582 /* Process the blocks that can be mirrored both ways. */
583 src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
584 for (i = 0; i < DCTSIZE; i += 2) {
585 /* For even row, negate every odd column. */
586 for (j = 0; j < DCTSIZE; j += 2) {
587 *dst_ptr++ = *src_ptr++;
588 *dst_ptr++ = - *src_ptr++;
589 }
590 /* For odd row, negate every even column. */
591 for (j = 0; j < DCTSIZE; j += 2) {
592 *dst_ptr++ = - *src_ptr++;
593 *dst_ptr++ = *src_ptr++;
594 }
595 }
596 } else {
597 /* Any remaining right-edge blocks are only mirrored vertically. */
598 src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];
599 for (i = 0; i < DCTSIZE; i += 2) {
600 for (j = 0; j < DCTSIZE; j++)
601 *dst_ptr++ = *src_ptr++;
602 for (j = 0; j < DCTSIZE; j++)
603 *dst_ptr++ = - *src_ptr++;
604 }
605 }
606 }
607 } else {
608 /* Remaining rows are just mirrored horizontally. */
609 src_row_ptr = src_buffer[offset_y];
610 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
611 if (x_crop_blocks + dst_blk_x < comp_width) {
612 /* Process the blocks that can be mirrored. */
613 dst_ptr = dst_row_ptr[dst_blk_x];
614 src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
615 for (i = 0; i < DCTSIZE2; i += 2) {
616 *dst_ptr++ = *src_ptr++;
617 *dst_ptr++ = - *src_ptr++;
618 }
619 } else {
620 /* Any remaining right-edge blocks are only copied. */
621 jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
622 dst_row_ptr + dst_blk_x,
623 (JDIMENSION) 1);
624 }
625 }
626 }
627 }
628 }
629 }
630}
631
632
633LOCAL(void)
634do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
635 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
636 jvirt_barray_ptr *src_coef_arrays,
637 jvirt_barray_ptr *dst_coef_arrays)
638/* Transverse transpose is equivalent to
639 * 1. 180 degree rotation;
640 * 2. Transposition;
641 * or
642 * 1. Horizontal mirroring;
643 * 2. Transposition;
644 * 3. Horizontal mirroring.
645 * These steps are merged into a single processing routine.
646 */
647{
648 JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
649 JDIMENSION x_crop_blocks, y_crop_blocks;
650 int ci, i, j, offset_x, offset_y;
651 JBLOCKARRAY src_buffer, dst_buffer;
652 JCOEFPTR src_ptr, dst_ptr;
653 jpeg_component_info *compptr;
654
655 MCU_cols = srcinfo->output_height /
656 (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
657 MCU_rows = srcinfo->output_width /
658 (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
659
660 for (ci = 0; ci < dstinfo->num_components; ci++) {
661 compptr = dstinfo->comp_info + ci;
662 comp_width = MCU_cols * compptr->h_samp_factor;
663 comp_height = MCU_rows * compptr->v_samp_factor;
664 x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
665 y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
666 for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
667 dst_blk_y += compptr->v_samp_factor) {
668 dst_buffer = (*srcinfo->mem->access_virt_barray)
669 ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
670 (JDIMENSION) compptr->v_samp_factor, TRUE);
671 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
672 for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
673 dst_blk_x += compptr->h_samp_factor) {
674 if (x_crop_blocks + dst_blk_x < comp_width) {
675 /* Block is within the mirrorable area. */
676 src_buffer = (*srcinfo->mem->access_virt_barray)
677 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
678 comp_width - x_crop_blocks - dst_blk_x -
679 (JDIMENSION) compptr->h_samp_factor,
680 (JDIMENSION) compptr->h_samp_factor, FALSE);
681 } else {
682 src_buffer = (*srcinfo->mem->access_virt_barray)
683 ((j_common_ptr) srcinfo, src_coef_arrays[ci],
684 dst_blk_x + x_crop_blocks,
685 (JDIMENSION) compptr->h_samp_factor, FALSE);
686 }
687 for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
688 dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
689 if (y_crop_blocks + dst_blk_y < comp_height) {
690 if (x_crop_blocks + dst_blk_x < comp_width) {
691 /* Block is within the mirrorable area. */
692 src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
693 [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
694 for (i = 0; i < DCTSIZE; i++) {
695 for (j = 0; j < DCTSIZE; j++) {
696 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
697 j++;
698 dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
699 }
700 i++;
701 for (j = 0; j < DCTSIZE; j++) {
702 dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
703 j++;
704 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
705 }
706 }
707 } else {
708 /* Right-edge blocks are mirrored in y only */
709 src_ptr = src_buffer[offset_x]
710 [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
711 for (i = 0; i < DCTSIZE; i++) {
712 for (j = 0; j < DCTSIZE; j++) {
713 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
714 j++;
715 dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
716 }
717 }
718 }
719 } else {
720 if (x_crop_blocks + dst_blk_x < comp_width) {
721 /* Bottom-edge blocks are mirrored in x only */
722 src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
723 [dst_blk_y + offset_y + y_crop_blocks];
724 for (i = 0; i < DCTSIZE; i++) {
725 for (j = 0; j < DCTSIZE; j++)
726 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
727 i++;
728 for (j = 0; j < DCTSIZE; j++)
729 dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];
730 }
731 } else {
732 /* At lower right corner, just transpose, no mirroring */
733 src_ptr = src_buffer[offset_x]
734 [dst_blk_y + offset_y + y_crop_blocks];
735 for (i = 0; i < DCTSIZE; i++)
736 for (j = 0; j < DCTSIZE; j++)
737 dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
738 }
739 }
740 }
741 }
742 }
743 }
744 }
745}
746
747
748/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec.
749 * Returns TRUE if valid integer found, FALSE if not.
750 * *strptr is advanced over the digit string, and *result is set to its value.
751 */
752
753LOCAL(boolean)
754jt_read_integer (const char ** strptr, JDIMENSION * result)
755{
756 const char * ptr = *strptr;
757 JDIMENSION val = 0;
758
759 for (; isdigit(*ptr); ptr++) {
760 val = val * 10 + (JDIMENSION) (*ptr - '0');
761 }
762 *result = val;
763 if (ptr == *strptr)
764 return FALSE; /* oops, no digits */
765 *strptr = ptr;
766 return TRUE;
767}
768
769
770/* Parse a crop specification (written in X11 geometry style).
771 * The routine returns TRUE if the spec string is valid, FALSE if not.
772 *
773 * The crop spec string should have the format
774 * <width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>
775 * where width, height, xoffset, and yoffset are unsigned integers.
776 * Each of the elements can be omitted to indicate a default value.
777 * (A weakness of this style is that it is not possible to omit xoffset
778 * while specifying yoffset, since they look alike.)
779 *
780 * This code is loosely based on XParseGeometry from the X11 distribution.
781 */
782
783GLOBAL(boolean)
784jtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)
785{
786 info->crop = FALSE;
787 info->crop_width_set = JCROP_UNSET;
788 info->crop_height_set = JCROP_UNSET;
789 info->crop_xoffset_set = JCROP_UNSET;
790 info->crop_yoffset_set = JCROP_UNSET;
791
792 if (isdigit(*spec)) {
793 /* fetch width */
794 if (! jt_read_integer(&spec, &info->crop_width))
795 return FALSE;
796 if (*spec == 'f' || *spec == 'F') {
797 spec++;
798 info->crop_width_set = JCROP_FORCE;
799 } else
800 info->crop_width_set = JCROP_POS;
801 }
802 if (*spec == 'x' || *spec == 'X') {
803 /* fetch height */
804 spec++;
805 if (! jt_read_integer(&spec, &info->crop_height))
806 return FALSE;
807 if (*spec == 'f' || *spec == 'F') {
808 spec++;
809 info->crop_height_set = JCROP_FORCE;
810 } else
811 info->crop_height_set = JCROP_POS;
812 }
813 if (*spec == '+' || *spec == '-') {
814 /* fetch xoffset */
815 info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;
816 spec++;
817 if (! jt_read_integer(&spec, &info->crop_xoffset))
818 return FALSE;
819 }
820 if (*spec == '+' || *spec == '-') {
821 /* fetch yoffset */
822 info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;
823 spec++;
824 if (! jt_read_integer(&spec, &info->crop_yoffset))
825 return FALSE;
826 }
827 /* We had better have gotten to the end of the string. */
828 if (*spec != '\0')
829 return FALSE;
830 info->crop = TRUE;
831 return TRUE;
832}
833
834
835/* Trim off any partial iMCUs on the indicated destination edge */
836
837LOCAL(void)
838trim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)
839{
840 JDIMENSION MCU_cols;
841
842 MCU_cols = info->output_width / info->iMCU_sample_width;
843 if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==
844 full_width / info->iMCU_sample_width)
845 info->output_width = MCU_cols * info->iMCU_sample_width;
846}
847
848LOCAL(void)
849trim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)
850{
851 JDIMENSION MCU_rows;
852
853 MCU_rows = info->output_height / info->iMCU_sample_height;
854 if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==
855 full_height / info->iMCU_sample_height)
856 info->output_height = MCU_rows * info->iMCU_sample_height;
857}
858
859
860/* Request any required workspace.
861 *
862 * This routine figures out the size that the output image will be
863 * (which implies that all the transform parameters must be set before
864 * it is called).
865 *
866 * We allocate the workspace virtual arrays from the source decompression
867 * object, so that all the arrays (both the original data and the workspace)
868 * will be taken into account while making memory management decisions.
869 * Hence, this routine must be called after jpeg_read_header (which reads
870 * the image dimensions) and before jpeg_read_coefficients (which realizes
871 * the source's virtual arrays).
872 *
873 * This function returns FALSE right away if -perfect is given
874 * and transformation is not perfect. Otherwise returns TRUE.
875 */
876
877GLOBAL(boolean)
878jtransform_request_workspace (j_decompress_ptr srcinfo,
879 jpeg_transform_info *info)
880{
881 jvirt_barray_ptr *coef_arrays;
882 boolean need_workspace, transpose_it;
883 jpeg_component_info *compptr;
884 JDIMENSION xoffset, yoffset;
885 JDIMENSION width_in_iMCUs, height_in_iMCUs;
886 JDIMENSION width_in_blocks, height_in_blocks;
887 int ci, h_samp_factor, v_samp_factor;
888
889 /* Determine number of components in output image */
890 if (info->force_grayscale &&
891 srcinfo->jpeg_color_space == JCS_YCbCr &&
892 srcinfo->num_components == 3)
893 /* We'll only process the first component */
894 info->num_components = 1;
895 else
896 /* Process all the components */
897 info->num_components = srcinfo->num_components;
898
899 /* Compute output image dimensions and related values. */
900 jpeg_core_output_dimensions(srcinfo);
901
902 /* Return right away if -perfect is given and transformation is not perfect.
903 */
904 if (info->perfect) {
905 if (info->num_components == 1) {
906 if (!jtransform_perfect_transform(srcinfo->output_width,
907 srcinfo->output_height,
908 srcinfo->min_DCT_h_scaled_size,
909 srcinfo->min_DCT_v_scaled_size,
910 info->transform))
911 return FALSE;
912 } else {
913 if (!jtransform_perfect_transform(srcinfo->output_width,
914 srcinfo->output_height,
915 srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,
916 srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,
917 info->transform))
918 return FALSE;
919 }
920 }
921
922 /* If there is only one output component, force the iMCU size to be 1;
923 * else use the source iMCU size. (This allows us to do the right thing
924 * when reducing color to grayscale, and also provides a handy way of
925 * cleaning up "funny" grayscale images whose sampling factors are not 1x1.)
926 */
927 switch (info->transform) {
928 case JXFORM_TRANSPOSE:
929 case JXFORM_TRANSVERSE:
930 case JXFORM_ROT_90:
931 case JXFORM_ROT_270:
932 info->output_width = srcinfo->output_height;
933 info->output_height = srcinfo->output_width;
934 if (info->num_components == 1) {
935 info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;
936 info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;
937 } else {
938 info->iMCU_sample_width =
939 srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
940 info->iMCU_sample_height =
941 srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
942 }
943 break;
944 default:
945 info->output_width = srcinfo->output_width;
946 info->output_height = srcinfo->output_height;
947 if (info->num_components == 1) {
948 info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;
949 info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;
950 } else {
951 info->iMCU_sample_width =
952 srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
953 info->iMCU_sample_height =
954 srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
955 }
956 break;
957 }
958
959 /* If cropping has been requested, compute the crop area's position and
960 * dimensions, ensuring that its upper left corner falls at an iMCU boundary.
961 */
962 if (info->crop) {
963 /* Insert default values for unset crop parameters */
964 if (info->crop_xoffset_set == JCROP_UNSET)
965 info->crop_xoffset = 0; /* default to +0 */
966 if (info->crop_yoffset_set == JCROP_UNSET)
967 info->crop_yoffset = 0; /* default to +0 */
968 if (info->crop_xoffset >= info->output_width ||
969 info->crop_yoffset >= info->output_height)
970 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
971 if (info->crop_width_set == JCROP_UNSET)
972 info->crop_width = info->output_width - info->crop_xoffset;
973 if (info->crop_height_set == JCROP_UNSET)
974 info->crop_height = info->output_height - info->crop_yoffset;
975 /* Ensure parameters are valid */
976 if (info->crop_width <= 0 || info->crop_width > info->output_width ||
977 info->crop_height <= 0 || info->crop_height > info->output_height ||
978 info->crop_xoffset > info->output_width - info->crop_width ||
979 info->crop_yoffset > info->output_height - info->crop_height)
980 ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
981 /* Convert negative crop offsets into regular offsets */
982 if (info->crop_xoffset_set == JCROP_NEG)
983 xoffset = info->output_width - info->crop_width - info->crop_xoffset;
984 else
985 xoffset = info->crop_xoffset;
986 if (info->crop_yoffset_set == JCROP_NEG)
987 yoffset = info->output_height - info->crop_height - info->crop_yoffset;
988 else
989 yoffset = info->crop_yoffset;
990 /* Now adjust so that upper left corner falls at an iMCU boundary */
991 if (info->crop_width_set == JCROP_FORCE)
992 info->output_width = info->crop_width;
993 else
994 info->output_width =
995 info->crop_width + (xoffset % info->iMCU_sample_width);
996 if (info->crop_height_set == JCROP_FORCE)
997 info->output_height = info->crop_height;
998 else
999 info->output_height =
1000 info->crop_height + (yoffset % info->iMCU_sample_height);
1001 /* Save x/y offsets measured in iMCUs */
1002 info->x_crop_offset = xoffset / info->iMCU_sample_width;
1003 info->y_crop_offset = yoffset / info->iMCU_sample_height;
1004 } else {
1005 info->x_crop_offset = 0;
1006 info->y_crop_offset = 0;
1007 }
1008
1009 /* Figure out whether we need workspace arrays,
1010 * and if so whether they are transposed relative to the source.
1011 */
1012 need_workspace = FALSE;
1013 transpose_it = FALSE;
1014 switch (info->transform) {
1015 case JXFORM_NONE:
1016 if (info->x_crop_offset != 0 || info->y_crop_offset != 0)
1017 need_workspace = TRUE;
1018 /* No workspace needed if neither cropping nor transforming */
1019 break;
1020 case JXFORM_FLIP_H:
1021 if (info->trim)
1022 trim_right_edge(info, srcinfo->output_width);
1023 if (info->y_crop_offset != 0)
1024 need_workspace = TRUE;
1025 /* do_flip_h_no_crop doesn't need a workspace array */
1026 break;
1027 case JXFORM_FLIP_V:
1028 if (info->trim)
1029 trim_bottom_edge(info, srcinfo->output_height);
1030 /* Need workspace arrays having same dimensions as source image. */
1031 need_workspace = TRUE;
1032 break;
1033 case JXFORM_TRANSPOSE:
1034 /* transpose does NOT have to trim anything */
1035 /* Need workspace arrays having transposed dimensions. */
1036 need_workspace = TRUE;
1037 transpose_it = TRUE;
1038 break;
1039 case JXFORM_TRANSVERSE:
1040 if (info->trim) {
1041 trim_right_edge(info, srcinfo->output_height);
1042 trim_bottom_edge(info, srcinfo->output_width);
1043 }
1044 /* Need workspace arrays having transposed dimensions. */
1045 need_workspace = TRUE;
1046 transpose_it = TRUE;
1047 break;
1048 case JXFORM_ROT_90:
1049 if (info->trim)
1050 trim_right_edge(info, srcinfo->output_height);
1051 /* Need workspace arrays having transposed dimensions. */
1052 need_workspace = TRUE;
1053 transpose_it = TRUE;
1054 break;
1055 case JXFORM_ROT_180:
1056 if (info->trim) {
1057 trim_right_edge(info, srcinfo->output_width);
1058 trim_bottom_edge(info, srcinfo->output_height);
1059 }
1060 /* Need workspace arrays having same dimensions as source image. */
1061 need_workspace = TRUE;
1062 break;
1063 case JXFORM_ROT_270:
1064 if (info->trim)
1065 trim_bottom_edge(info, srcinfo->output_width);
1066 /* Need workspace arrays having transposed dimensions. */
1067 need_workspace = TRUE;
1068 transpose_it = TRUE;
1069 break;
1070 }
1071
1072 /* Allocate workspace if needed.
1073 * Note that we allocate arrays padded out to the next iMCU boundary,
1074 * so that transform routines need not worry about missing edge blocks.
1075 */
1076 if (need_workspace) {
1077 coef_arrays = (jvirt_barray_ptr *)
1078 (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
1079 SIZEOF(jvirt_barray_ptr) * info->num_components);
1080 width_in_iMCUs = (JDIMENSION)
1081 jdiv_round_up((long) info->output_width,
1082 (long) info->iMCU_sample_width);
1083 height_in_iMCUs = (JDIMENSION)
1084 jdiv_round_up((long) info->output_height,
1085 (long) info->iMCU_sample_height);
1086 for (ci = 0; ci < info->num_components; ci++) {
1087 compptr = srcinfo->comp_info + ci;
1088 if (info->num_components == 1) {
1089 /* we're going to force samp factors to 1x1 in this case */
1090 h_samp_factor = v_samp_factor = 1;
1091 } else if (transpose_it) {
1092 h_samp_factor = compptr->v_samp_factor;
1093 v_samp_factor = compptr->h_samp_factor;
1094 } else {
1095 h_samp_factor = compptr->h_samp_factor;
1096 v_samp_factor = compptr->v_samp_factor;
1097 }
1098 width_in_blocks = width_in_iMCUs * h_samp_factor;
1099 height_in_blocks = height_in_iMCUs * v_samp_factor;
1100 coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
1101 ((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
1102 width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);
1103 }
1104 info->workspace_coef_arrays = coef_arrays;
1105 } else
1106 info->workspace_coef_arrays = NULL;
1107
1108 return TRUE;
1109}
1110
1111
1112/* Transpose destination image parameters */
1113
1114LOCAL(void)
1115transpose_critical_parameters (j_compress_ptr dstinfo)
1116{
1117 int tblno, i, j, ci, itemp;
1118 jpeg_component_info *compptr;
1119 JQUANT_TBL *qtblptr;
1120 JDIMENSION jtemp;
1121 UINT16 qtemp;
1122
1123 /* Transpose image dimensions */
1124 jtemp = dstinfo->image_width;
1125 dstinfo->image_width = dstinfo->image_height;
1126 dstinfo->image_height = jtemp;
1127 itemp = dstinfo->min_DCT_h_scaled_size;
1128 dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
1129 dstinfo->min_DCT_v_scaled_size = itemp;
1130
1131 /* Transpose sampling factors */
1132 for (ci = 0; ci < dstinfo->num_components; ci++) {
1133 compptr = dstinfo->comp_info + ci;
1134 itemp = compptr->h_samp_factor;
1135 compptr->h_samp_factor = compptr->v_samp_factor;
1136 compptr->v_samp_factor = itemp;
1137 }
1138
1139 /* Transpose quantization tables */
1140 for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
1141 qtblptr = dstinfo->quant_tbl_ptrs[tblno];
1142 if (qtblptr != NULL) {
1143 for (i = 0; i < DCTSIZE; i++) {
1144 for (j = 0; j < i; j++) {
1145 qtemp = qtblptr->quantval[i*DCTSIZE+j];
1146 qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];
1147 qtblptr->quantval[j*DCTSIZE+i] = qtemp;
1148 }
1149 }
1150 }
1151 }
1152}
1153
1154
1155/* Adjust Exif image parameters.
1156 *
1157 * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.
1158 */
1159
1160LOCAL(void)
1161adjust_exif_parameters (JOCTET FAR * data, unsigned int length,
1162 JDIMENSION new_width, JDIMENSION new_height)
1163{
1164 boolean is_motorola; /* Flag for byte order */
1165 unsigned int number_of_tags, tagnum;
1166 unsigned int firstoffset, offset;
1167 JDIMENSION new_value;
1168
1169 if (length < 12) return; /* Length of an IFD entry */
1170
1171 /* Discover byte order */
1172 if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49)
1173 is_motorola = FALSE;
1174 else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D)
1175 is_motorola = TRUE;
1176 else
1177 return;
1178
1179 /* Check Tag Mark */
1180 if (is_motorola) {
1181 if (GETJOCTET(data[2]) != 0) return;
1182 if (GETJOCTET(data[3]) != 0x2A) return;
1183 } else {
1184 if (GETJOCTET(data[3]) != 0) return;
1185 if (GETJOCTET(data[2]) != 0x2A) return;
1186 }
1187
1188 /* Get first IFD offset (offset to IFD0) */
1189 if (is_motorola) {
1190 if (GETJOCTET(data[4]) != 0) return;
1191 if (GETJOCTET(data[5]) != 0) return;
1192 firstoffset = GETJOCTET(data[6]);
1193 firstoffset <<= 8;
1194 firstoffset += GETJOCTET(data[7]);
1195 } else {
1196 if (GETJOCTET(data[7]) != 0) return;
1197 if (GETJOCTET(data[6]) != 0) return;
1198 firstoffset = GETJOCTET(data[5]);
1199 firstoffset <<= 8;
1200 firstoffset += GETJOCTET(data[4]);
1201 }
1202 if (firstoffset > length - 2) return; /* check end of data segment */
1203
1204 /* Get the number of directory entries contained in this IFD */
1205 if (is_motorola) {
1206 number_of_tags = GETJOCTET(data[firstoffset]);
1207 number_of_tags <<= 8;
1208 number_of_tags += GETJOCTET(data[firstoffset+1]);
1209 } else {
1210 number_of_tags = GETJOCTET(data[firstoffset+1]);
1211 number_of_tags <<= 8;
1212 number_of_tags += GETJOCTET(data[firstoffset]);
1213 }
1214 if (number_of_tags == 0) return;
1215 firstoffset += 2;
1216
1217 /* Search for ExifSubIFD offset Tag in IFD0 */
1218 for (;;) {
1219 if (firstoffset > length - 12) return; /* check end of data segment */
1220 /* Get Tag number */
1221 if (is_motorola) {
1222 tagnum = GETJOCTET(data[firstoffset]);
1223 tagnum <<= 8;
1224 tagnum += GETJOCTET(data[firstoffset+1]);
1225 } else {
1226 tagnum = GETJOCTET(data[firstoffset+1]);
1227 tagnum <<= 8;
1228 tagnum += GETJOCTET(data[firstoffset]);
1229 }
1230 if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */
1231 if (--number_of_tags == 0) return;
1232 firstoffset += 12;
1233 }
1234
1235 /* Get the ExifSubIFD offset */
1236 if (is_motorola) {
1237 if (GETJOCTET(data[firstoffset+8]) != 0) return;
1238 if (GETJOCTET(data[firstoffset+9]) != 0) return;
1239 offset = GETJOCTET(data[firstoffset+10]);
1240 offset <<= 8;
1241 offset += GETJOCTET(data[firstoffset+11]);
1242 } else {
1243 if (GETJOCTET(data[firstoffset+11]) != 0) return;
1244 if (GETJOCTET(data[firstoffset+10]) != 0) return;
1245 offset = GETJOCTET(data[firstoffset+9]);
1246 offset <<= 8;
1247 offset += GETJOCTET(data[firstoffset+8]);
1248 }
1249 if (offset > length - 2) return; /* check end of data segment */
1250
1251 /* Get the number of directory entries contained in this SubIFD */
1252 if (is_motorola) {
1253 number_of_tags = GETJOCTET(data[offset]);
1254 number_of_tags <<= 8;
1255 number_of_tags += GETJOCTET(data[offset+1]);
1256 } else {
1257 number_of_tags = GETJOCTET(data[offset+1]);
1258 number_of_tags <<= 8;
1259 number_of_tags += GETJOCTET(data[offset]);
1260 }
1261 if (number_of_tags < 2) return;
1262 offset += 2;
1263
1264 /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */
1265 do {
1266 if (offset > length - 12) return; /* check end of data segment */
1267 /* Get Tag number */
1268 if (is_motorola) {
1269 tagnum = GETJOCTET(data[offset]);
1270 tagnum <<= 8;
1271 tagnum += GETJOCTET(data[offset+1]);
1272 } else {
1273 tagnum = GETJOCTET(data[offset+1]);
1274 tagnum <<= 8;
1275 tagnum += GETJOCTET(data[offset]);
1276 }
1277 if (tagnum == 0xA002 || tagnum == 0xA003) {
1278 if (tagnum == 0xA002)
1279 new_value = new_width; /* ExifImageWidth Tag */
1280 else
1281 new_value = new_height; /* ExifImageHeight Tag */
1282 if (is_motorola) {
1283 data[offset+2] = 0; /* Format = unsigned long (4 octets) */
1284 data[offset+3] = 4;
1285 data[offset+4] = 0; /* Number Of Components = 1 */
1286 data[offset+5] = 0;
1287 data[offset+6] = 0;
1288 data[offset+7] = 1;
1289 data[offset+8] = 0;
1290 data[offset+9] = 0;
1291 data[offset+10] = (JOCTET)((new_value >> 8) & 0xFF);
1292 data[offset+11] = (JOCTET)(new_value & 0xFF);
1293 } else {
1294 data[offset+2] = 4; /* Format = unsigned long (4 octets) */
1295 data[offset+3] = 0;
1296 data[offset+4] = 1; /* Number Of Components = 1 */
1297 data[offset+5] = 0;
1298 data[offset+6] = 0;
1299 data[offset+7] = 0;
1300 data[offset+8] = (JOCTET)(new_value & 0xFF);
1301 data[offset+9] = (JOCTET)((new_value >> 8) & 0xFF);
1302 data[offset+10] = 0;
1303 data[offset+11] = 0;
1304 }
1305 }
1306 offset += 12;
1307 } while (--number_of_tags);
1308}
1309
1310
1311/* Adjust output image parameters as needed.
1312 *
1313 * This must be called after jpeg_copy_critical_parameters()
1314 * and before jpeg_write_coefficients().
1315 *
1316 * The return value is the set of virtual coefficient arrays to be written
1317 * (either the ones allocated by jtransform_request_workspace, or the
1318 * original source data arrays). The caller will need to pass this value
1319 * to jpeg_write_coefficients().
1320 */
1321
1322GLOBAL(jvirt_barray_ptr *)
1323jtransform_adjust_parameters (j_decompress_ptr srcinfo,
1324 j_compress_ptr dstinfo,
1325 jvirt_barray_ptr *src_coef_arrays,
1326 jpeg_transform_info *info)
1327{
1328 /* If force-to-grayscale is requested, adjust destination parameters */
1329 if (info->force_grayscale) {
1330 /* First, ensure we have YCbCr or grayscale data, and that the source's
1331 * Y channel is full resolution. (No reasonable person would make Y
1332 * be less than full resolution, so actually coping with that case
1333 * isn't worth extra code space. But we check it to avoid crashing.)
1334 */
1335 if (((dstinfo->jpeg_color_space == JCS_YCbCr &&
1336 dstinfo->num_components == 3) ||
1337 (dstinfo->jpeg_color_space == JCS_GRAYSCALE &&
1338 dstinfo->num_components == 1)) &&
1339 srcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor &&
1340 srcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) {
1341 /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed
1342 * properly. Among other things, it sets the target h_samp_factor &
1343 * v_samp_factor to 1, which typically won't match the source.
1344 * We have to preserve the source's quantization table number, however.
1345 */
1346 int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;
1347 jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);
1348 dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;
1349 } else {
1350 /* Sorry, can't do it */
1351 ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);
1352 }
1353 } else if (info->num_components == 1) {
1354 /* For a single-component source, we force the destination sampling factors
1355 * to 1x1, with or without force_grayscale. This is useful because some
1356 * decoders choke on grayscale images with other sampling factors.
1357 */
1358 dstinfo->comp_info[0].h_samp_factor = 1;
1359 dstinfo->comp_info[0].v_samp_factor = 1;
1360 }
1361
1362 /* Correct the destination's image dimensions as necessary
1363 * for rotate/flip, resize, and crop operations.
1364 */
1365 dstinfo->jpeg_width = info->output_width;
1366 dstinfo->jpeg_height = info->output_height;
1367
1368 /* Transpose destination image parameters */
1369 switch (info->transform) {
1370 case JXFORM_TRANSPOSE:
1371 case JXFORM_TRANSVERSE:
1372 case JXFORM_ROT_90:
1373 case JXFORM_ROT_270:
1374 transpose_critical_parameters(dstinfo);
1375 break;
1376 default:
1377 break;
1378 }
1379
1380 /* Adjust Exif properties */
1381 if (srcinfo->marker_list != NULL &&
1382 srcinfo->marker_list->marker == JPEG_APP0+1 &&
1383 srcinfo->marker_list->data_length >= 6 &&
1384 GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 &&
1385 GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 &&
1386 GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 &&
1387 GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 &&
1388 GETJOCTET(srcinfo->marker_list->data[4]) == 0 &&
1389 GETJOCTET(srcinfo->marker_list->data[5]) == 0) {
1390 /* Suppress output of JFIF marker */
1391 dstinfo->write_JFIF_header = FALSE;
1392 /* Adjust Exif image parameters */
1393 if (dstinfo->jpeg_width != srcinfo->image_width ||
1394 dstinfo->jpeg_height != srcinfo->image_height)
1395 /* Align data segment to start of TIFF structure for parsing */
1396 adjust_exif_parameters(srcinfo->marker_list->data + 6,
1397 srcinfo->marker_list->data_length - 6,
1398 dstinfo->jpeg_width, dstinfo->jpeg_height);
1399 }
1400
1401 /* Return the appropriate output data set */
1402 if (info->workspace_coef_arrays != NULL)
1403 return info->workspace_coef_arrays;
1404 return src_coef_arrays;
1405}
1406
1407
1408/* Execute the actual transformation, if any.
1409 *
1410 * This must be called *after* jpeg_write_coefficients, because it depends
1411 * on jpeg_write_coefficients to have computed subsidiary values such as
1412 * the per-component width and height fields in the destination object.
1413 *
1414 * Note that some transformations will modify the source data arrays!
1415 */
1416
1417GLOBAL(void)
1418jtransform_execute_transform (j_decompress_ptr srcinfo,
1419 j_compress_ptr dstinfo,
1420 jvirt_barray_ptr *src_coef_arrays,
1421 jpeg_transform_info *info)
1422{
1423 jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;
1424
1425 /* Note: conditions tested here should match those in switch statement
1426 * in jtransform_request_workspace()
1427 */
1428 switch (info->transform) {
1429 case JXFORM_NONE:
1430 if (info->x_crop_offset != 0 || info->y_crop_offset != 0)
1431 do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1432 src_coef_arrays, dst_coef_arrays);
1433 break;
1434 case JXFORM_FLIP_H:
1435 if (info->y_crop_offset != 0)
1436 do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1437 src_coef_arrays, dst_coef_arrays);
1438 else
1439 do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset,
1440 src_coef_arrays);
1441 break;
1442 case JXFORM_FLIP_V:
1443 do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1444 src_coef_arrays, dst_coef_arrays);
1445 break;
1446 case JXFORM_TRANSPOSE:
1447 do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1448 src_coef_arrays, dst_coef_arrays);
1449 break;
1450 case JXFORM_TRANSVERSE:
1451 do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1452 src_coef_arrays, dst_coef_arrays);
1453 break;
1454 case JXFORM_ROT_90:
1455 do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1456 src_coef_arrays, dst_coef_arrays);
1457 break;
1458 case JXFORM_ROT_180:
1459 do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1460 src_coef_arrays, dst_coef_arrays);
1461 break;
1462 case JXFORM_ROT_270:
1463 do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
1464 src_coef_arrays, dst_coef_arrays);
1465 break;
1466 }
1467}
1468
1469/* jtransform_perfect_transform
1470 *
1471 * Determine whether lossless transformation is perfectly
1472 * possible for a specified image and transformation.
1473 *
1474 * Inputs:
1475 * image_width, image_height: source image dimensions.
1476 * MCU_width, MCU_height: pixel dimensions of MCU.
1477 * transform: transformation identifier.
1478 * Parameter sources from initialized jpeg_struct
1479 * (after reading source header):
1480 * image_width = cinfo.image_width
1481 * image_height = cinfo.image_height
1482 * MCU_width = cinfo.max_h_samp_factor * cinfo.block_size
1483 * MCU_height = cinfo.max_v_samp_factor * cinfo.block_size
1484 * Result:
1485 * TRUE = perfect transformation possible
1486 * FALSE = perfect transformation not possible
1487 * (may use custom action then)
1488 */
1489
1490GLOBAL(boolean)
1491jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
1492 int MCU_width, int MCU_height,
1493 JXFORM_CODE transform)
1494{
1495 boolean result = TRUE; /* initialize TRUE */
1496
1497 switch (transform) {
1498 case JXFORM_FLIP_H:
1499 case JXFORM_ROT_270:
1500 if (image_width % (JDIMENSION) MCU_width)
1501 result = FALSE;
1502 break;
1503 case JXFORM_FLIP_V:
1504 case JXFORM_ROT_90:
1505 if (image_height % (JDIMENSION) MCU_height)
1506 result = FALSE;
1507 break;
1508 case JXFORM_TRANSVERSE:
1509 case JXFORM_ROT_180:
1510 if (image_width % (JDIMENSION) MCU_width)
1511 result = FALSE;
1512 if (image_height % (JDIMENSION) MCU_height)
1513 result = FALSE;
1514 break;
1515 default:
1516 break;
1517 }
1518
1519 return result;
1520}
1521
1522#endif /* TRANSFORMS_SUPPORTED */
1523
1524
1525/* Setup decompression object to save desired markers in memory.
1526 * This must be called before jpeg_read_header() to have the desired effect.
1527 */
1528
1529GLOBAL(void)
1530jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
1531{
1532#ifdef SAVE_MARKERS_SUPPORTED
1533 int m;
1534
1535 /* Save comments except under NONE option */
1536 if (option != JCOPYOPT_NONE) {
1537 jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
1538 }
1539 /* Save all types of APPn markers iff ALL option */
1540 if (option == JCOPYOPT_ALL) {
1541 for (m = 0; m < 16; m++)
1542 jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
1543 }
1544#endif /* SAVE_MARKERS_SUPPORTED */
1545}
1546
1547/* Copy markers saved in the given source object to the destination object.
1548 * This should be called just after jpeg_start_compress() or
1549 * jpeg_write_coefficients().
1550 * Note that those routines will have written the SOI, and also the
1551 * JFIF APP0 or Adobe APP14 markers if selected.
1552 */
1553
1554GLOBAL(void)
1555jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
1556 JCOPY_OPTION option)
1557{
1558 jpeg_saved_marker_ptr marker;
1559
1560 /* In the current implementation, we don't actually need to examine the
1561 * option flag here; we just copy everything that got saved.
1562 * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
1563 * if the encoder library already wrote one.
1564 */
1565 for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
1566 if (dstinfo->write_JFIF_header &&
1567 marker->marker == JPEG_APP0 &&
1568 marker->data_length >= 5 &&
1569 GETJOCTET(marker->data[0]) == 0x4A &&
1570 GETJOCTET(marker->data[1]) == 0x46 &&
1571 GETJOCTET(marker->data[2]) == 0x49 &&
1572 GETJOCTET(marker->data[3]) == 0x46 &&
1573 GETJOCTET(marker->data[4]) == 0)
1574 continue; /* reject duplicate JFIF */
1575 if (dstinfo->write_Adobe_marker &&
1576 marker->marker == JPEG_APP0+14 &&
1577 marker->data_length >= 5 &&
1578 GETJOCTET(marker->data[0]) == 0x41 &&
1579 GETJOCTET(marker->data[1]) == 0x64 &&
1580 GETJOCTET(marker->data[2]) == 0x6F &&
1581 GETJOCTET(marker->data[3]) == 0x62 &&
1582 GETJOCTET(marker->data[4]) == 0x65)
1583 continue; /* reject duplicate Adobe */
1584#ifdef NEED_FAR_POINTERS
1585 /* We could use jpeg_write_marker if the data weren't FAR... */
1586 {
1587 unsigned int i;
1588 jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);
1589 for (i = 0; i < marker->data_length; i++)
1590 jpeg_write_m_byte(dstinfo, marker->data[i]);
1591 }
1592#else
1593 jpeg_write_marker(dstinfo, marker->marker,
1594 marker->data, marker->data_length);
1595#endif
1596 }
1597}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.h b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.h
new file mode 100644
index 0000000..6e4d65a
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/transupp.h
@@ -0,0 +1,213 @@
1/*
2 * transupp.h
3 *
4 * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains declarations for image transformation routines and
9 * other utility code used by the jpegtran sample application. These are
10 * NOT part of the core JPEG library. But we keep these routines separate
11 * from jpegtran.c to ease the task of maintaining jpegtran-like programs
12 * that have other user interfaces.
13 *
14 * NOTE: all the routines declared here have very specific requirements
15 * about when they are to be executed during the reading and writing of the
16 * source and destination files. See the comments in transupp.c, or see
17 * jpegtran.c for an example of correct usage.
18 */
19
20/* If you happen not to want the image transform support, disable it here */
21#ifndef TRANSFORMS_SUPPORTED
22#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */
23#endif
24
25/*
26 * Although rotating and flipping data expressed as DCT coefficients is not
27 * hard, there is an asymmetry in the JPEG format specification for images
28 * whose dimensions aren't multiples of the iMCU size. The right and bottom
29 * image edges are padded out to the next iMCU boundary with junk data; but
30 * no padding is possible at the top and left edges. If we were to flip
31 * the whole image including the pad data, then pad garbage would become
32 * visible at the top and/or left, and real pixels would disappear into the
33 * pad margins --- perhaps permanently, since encoders & decoders may not
34 * bother to preserve DCT blocks that appear to be completely outside the
35 * nominal image area. So, we have to exclude any partial iMCUs from the
36 * basic transformation.
37 *
38 * Transpose is the only transformation that can handle partial iMCUs at the
39 * right and bottom edges completely cleanly. flip_h can flip partial iMCUs
40 * at the bottom, but leaves any partial iMCUs at the right edge untouched.
41 * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.
42 * The other transforms are defined as combinations of these basic transforms
43 * and process edge blocks in a way that preserves the equivalence.
44 *
45 * The "trim" option causes untransformable partial iMCUs to be dropped;
46 * this is not strictly lossless, but it usually gives the best-looking
47 * result for odd-size images. Note that when this option is active,
48 * the expected mathematical equivalences between the transforms may not hold.
49 * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
50 * followed by -rot 180 -trim trims both edges.)
51 *
52 * We also offer a lossless-crop option, which discards data outside a given
53 * image region but losslessly preserves what is inside. Like the rotate and
54 * flip transforms, lossless crop is restricted by the JPEG format: the upper
55 * left corner of the selected region must fall on an iMCU boundary. If this
56 * does not hold for the given crop parameters, we silently move the upper left
57 * corner up and/or left to make it so, simultaneously increasing the region
58 * dimensions to keep the lower right crop corner unchanged. (Thus, the
59 * output image covers at least the requested region, but may cover more.)
60 * The adjustment of the region dimensions may be optionally disabled.
61 *
62 * We also provide a lossless-resize option, which is kind of a lossless-crop
63 * operation in the DCT coefficient block domain - it discards higher-order
64 * coefficients and losslessly preserves lower-order coefficients of a
65 * sub-block.
66 *
67 * Rotate/flip transform, resize, and crop can be requested together in a
68 * single invocation. The crop is applied last --- that is, the crop region
69 * is specified in terms of the destination image after transform/resize.
70 *
71 * We also offer a "force to grayscale" option, which simply discards the
72 * chrominance channels of a YCbCr image. This is lossless in the sense that
73 * the luminance channel is preserved exactly. It's not the same kind of
74 * thing as the rotate/flip transformations, but it's convenient to handle it
75 * as part of this package, mainly because the transformation routines have to
76 * be aware of the option to know how many components to work on.
77 */
78
79
80/* Short forms of external names for systems with brain-damaged linkers. */
81
82#ifdef NEED_SHORT_EXTERNAL_NAMES
83#define jtransform_parse_crop_spec jTrParCrop
84#define jtransform_request_workspace jTrRequest
85#define jtransform_adjust_parameters jTrAdjust
86#define jtransform_execute_transform jTrExec
87#define jtransform_perfect_transform jTrPerfect
88#define jcopy_markers_setup jCMrkSetup
89#define jcopy_markers_execute jCMrkExec
90#endif /* NEED_SHORT_EXTERNAL_NAMES */
91
92
93/*
94 * Codes for supported types of image transformations.
95 */
96
97typedef enum {
98 JXFORM_NONE, /* no transformation */
99 JXFORM_FLIP_H, /* horizontal flip */
100 JXFORM_FLIP_V, /* vertical flip */
101 JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */
102 JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */
103 JXFORM_ROT_90, /* 90-degree clockwise rotation */
104 JXFORM_ROT_180, /* 180-degree rotation */
105 JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */
106} JXFORM_CODE;
107
108/*
109 * Codes for crop parameters, which can individually be unspecified,
110 * positive or negative for xoffset or yoffset,
111 * positive or forced for width or height.
112 */
113
114typedef enum {
115 JCROP_UNSET,
116 JCROP_POS,
117 JCROP_NEG,
118 JCROP_FORCE
119} JCROP_CODE;
120
121/*
122 * Transform parameters struct.
123 * NB: application must not change any elements of this struct after
124 * calling jtransform_request_workspace.
125 */
126
127typedef struct {
128 /* Options: set by caller */
129 JXFORM_CODE transform; /* image transform operator */
130 boolean perfect; /* if TRUE, fail if partial MCUs are requested */
131 boolean trim; /* if TRUE, trim partial MCUs as needed */
132 boolean force_grayscale; /* if TRUE, convert color image to grayscale */
133 boolean crop; /* if TRUE, crop source image */
134
135 /* Crop parameters: application need not set these unless crop is TRUE.
136 * These can be filled in by jtransform_parse_crop_spec().
137 */
138 JDIMENSION crop_width; /* Width of selected region */
139 JCROP_CODE crop_width_set; /* (forced disables adjustment) */
140 JDIMENSION crop_height; /* Height of selected region */
141 JCROP_CODE crop_height_set; /* (forced disables adjustment) */
142 JDIMENSION crop_xoffset; /* X offset of selected region */
143 JCROP_CODE crop_xoffset_set; /* (negative measures from right edge) */
144 JDIMENSION crop_yoffset; /* Y offset of selected region */
145 JCROP_CODE crop_yoffset_set; /* (negative measures from bottom edge) */
146
147 /* Internal workspace: caller should not touch these */
148 int num_components; /* # of components in workspace */
149 jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
150 JDIMENSION output_width; /* cropped destination dimensions */
151 JDIMENSION output_height;
152 JDIMENSION x_crop_offset; /* destination crop offsets measured in iMCUs */
153 JDIMENSION y_crop_offset;
154 int iMCU_sample_width; /* destination iMCU size */
155 int iMCU_sample_height;
156} jpeg_transform_info;
157
158
159#if TRANSFORMS_SUPPORTED
160
161/* Parse a crop specification (written in X11 geometry style) */
162EXTERN(boolean) jtransform_parse_crop_spec
163 JPP((jpeg_transform_info *info, const char *spec));
164/* Request any required workspace */
165EXTERN(boolean) jtransform_request_workspace
166 JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
167/* Adjust output image parameters */
168EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
169 JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
170 jvirt_barray_ptr *src_coef_arrays,
171 jpeg_transform_info *info));
172/* Execute the actual transformation, if any */
173EXTERN(void) jtransform_execute_transform
174 JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
175 jvirt_barray_ptr *src_coef_arrays,
176 jpeg_transform_info *info));
177/* Determine whether lossless transformation is perfectly
178 * possible for a specified image and transformation.
179 */
180EXTERN(boolean) jtransform_perfect_transform
181 JPP((JDIMENSION image_width, JDIMENSION image_height,
182 int MCU_width, int MCU_height,
183 JXFORM_CODE transform));
184
185/* jtransform_execute_transform used to be called
186 * jtransform_execute_transformation, but some compilers complain about
187 * routine names that long. This macro is here to avoid breaking any
188 * old source code that uses the original name...
189 */
190#define jtransform_execute_transformation jtransform_execute_transform
191
192#endif /* TRANSFORMS_SUPPORTED */
193
194
195/*
196 * Support for copying optional markers from source to destination file.
197 */
198
199typedef enum {
200 JCOPYOPT_NONE, /* copy no optional markers */
201 JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */
202 JCOPYOPT_ALL /* copy all optional markers */
203} JCOPY_OPTION;
204
205#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */
206
207/* Setup decompression object to save desired markers in memory */
208EXTERN(void) jcopy_markers_setup
209 JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
210/* Copy markers saved in the given source object to the destination object */
211EXTERN(void) jcopy_markers_execute
212 JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
213 JCOPY_OPTION option));
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/usage.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/usage.txt
new file mode 100644
index 0000000..c91ddff
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/usage.txt
@@ -0,0 +1,637 @@
1USAGE instructions for the Independent JPEG Group's JPEG software
2=================================================================
3
4This file describes usage of the JPEG conversion programs cjpeg and djpeg,
5as well as the utility programs jpegtran, rdjpgcom and wrjpgcom. (See
6the other documentation files if you wish to use the JPEG library within
7your own programs.)
8
9If you are on a Unix machine you may prefer to read the Unix-style manual
10pages in files cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1.
11
12
13INTRODUCTION
14
15These programs implement JPEG image encoding, decoding, and transcoding.
16JPEG (pronounced "jay-peg") is a standardized compression method for
17full-color and gray-scale images.
18
19
20GENERAL USAGE
21
22We provide two programs, cjpeg to compress an image file into JPEG format,
23and djpeg to decompress a JPEG file back into a conventional image format.
24
25On Unix-like systems, you say:
26 cjpeg [switches] [imagefile] >jpegfile
27or
28 djpeg [switches] [jpegfile] >imagefile
29The programs read the specified input file, or standard input if none is
30named. They always write to standard output (with trace/error messages to
31standard error). These conventions are handy for piping images between
32programs.
33
34On most non-Unix systems, you say:
35 cjpeg [switches] imagefile jpegfile
36or
37 djpeg [switches] jpegfile imagefile
38i.e., both the input and output files are named on the command line. This
39style is a little more foolproof, and it loses no functionality if you don't
40have pipes. (You can get this style on Unix too, if you prefer, by defining
41TWO_FILE_COMMANDLINE when you compile the programs; see install.txt.)
42
43You can also say:
44 cjpeg [switches] -outfile jpegfile imagefile
45or
46 djpeg [switches] -outfile imagefile jpegfile
47This syntax works on all systems, so it is useful for scripts.
48
49The currently supported image file formats are: PPM (PBMPLUS color format),
50PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster Toolkit
51format). (RLE is supported only if the URT library is available.)
52cjpeg recognizes the input image format automatically, with the exception
53of some Targa-format files. You have to tell djpeg which format to generate.
54
55JPEG files are in the defacto standard JFIF file format. There are other,
56less widely used JPEG-based file formats, but we don't support them.
57
58All switch names may be abbreviated; for example, -grayscale may be written
59-gray or -gr. Most of the "basic" switches can be abbreviated to as little as
60one letter. Upper and lower case are equivalent (-BMP is the same as -bmp).
61British spellings are also accepted (e.g., -greyscale), though for brevity
62these are not mentioned below.
63
64
65CJPEG DETAILS
66
67The basic command line switches for cjpeg are:
68
69 -quality N[,...] Scale quantization tables to adjust image quality.
70 Quality is 0 (worst) to 100 (best); default is 75.
71 (See below for more info.)
72
73 -grayscale Create monochrome JPEG file from color input.
74 Be sure to use this switch when compressing a grayscale
75 BMP file, because cjpeg isn't bright enough to notice
76 whether a BMP file uses only shades of gray. By
77 saying -grayscale, you'll get a smaller JPEG file that
78 takes less time to process.
79
80 -rgb Create RGB JPEG file.
81 Using this switch suppresses the conversion from RGB
82 colorspace input to the default YCbCr JPEG colorspace.
83 Use this switch in combination with the -block N
84 switch (see below) for lossless JPEG coding.
85
86 -optimize Perform optimization of entropy encoding parameters.
87 Without this, default encoding parameters are used.
88 -optimize usually makes the JPEG file a little smaller,
89 but cjpeg runs somewhat slower and needs much more
90 memory. Image quality and speed of decompression are
91 unaffected by -optimize.
92
93 -progressive Create progressive JPEG file (see below).
94
95 -scale M/N Scale the output image by a factor M/N. Currently
96 supported scale factors are M/N with all N from 1 to
97 16, where M is the destination DCT size, which is 8 by
98 default (see -block N switch below).
99
100 -targa Input file is Targa format. Targa files that contain
101 an "identification" field will not be automatically
102 recognized by cjpeg; for such files you must specify
103 -targa to make cjpeg treat the input as Targa format.
104 For most Targa files, you won't need this switch.
105
106The -quality switch lets you trade off compressed file size against quality of
107the reconstructed image: the higher the quality setting, the larger the JPEG
108file, and the closer the output image will be to the original input. Normally
109you want to use the lowest quality setting (smallest file) that decompresses
110into something visually indistinguishable from the original image. For this
111purpose the quality setting should be between 50 and 95; the default of 75 is
112often about right. If you see defects at -quality 75, then go up 5 or 10
113counts at a time until you are happy with the output image. (The optimal
114setting will vary from one image to another.)
115
116-quality 100 will generate a quantization table of all 1's, minimizing loss
117in the quantization step (but there is still information loss in subsampling,
118as well as roundoff error). This setting is mainly of interest for
119experimental purposes. Quality values above about 95 are NOT recommended for
120normal use; the compressed file size goes up dramatically for hardly any gain
121in output image quality.
122
123In the other direction, quality values below 50 will produce very small files
124of low image quality. Settings around 5 to 10 might be useful in preparing an
125index of a large image library, for example. Try -quality 2 (or so) for some
126amusing Cubist effects. (Note: quality values below about 25 generate 2-byte
127quantization tables, which are considered optional in the JPEG standard.
128cjpeg emits a warning message when you give such a quality value, because some
129other JPEG programs may be unable to decode the resulting file. Use -baseline
130if you need to ensure compatibility at low quality values.)
131
132The -quality option has been extended in IJG version 7 for support of separate
133quality settings for luminance and chrominance (or in general, for every
134provided quantization table slot). This feature is useful for high-quality
135applications which cannot accept the damage of color data by coarse
136subsampling settings. You can now easily reduce the color data amount more
137smoothly with finer control without separate subsampling. The resulting file
138is fully compliant with standard JPEG decoders.
139Note that the -quality ratings refer to the quantization table slots, and that
140the last value is replicated if there are more q-table slots than parameters.
141The default q-table slots are 0 for luminance and 1 for chrominance with
142default tables as given in the JPEG standard. This is compatible with the old
143behaviour in case that only one parameter is given, which is then used for
144both luminance and chrominance (slots 0 and 1). More or custom quantization
145tables can be set with -qtables and assigned to components with -qslots
146parameter (see the "wizard" switches below).
147CAUTION: You must explicitly add -sample 1x1 for efficient separate color
148quality selection, since the default value used by library is 2x2!
149
150The -progressive switch creates a "progressive JPEG" file. In this type of
151JPEG file, the data is stored in multiple scans of increasing quality. If the
152file is being transmitted over a slow communications link, the decoder can use
153the first scan to display a low-quality image very quickly, and can then
154improve the display with each subsequent scan. The final image is exactly
155equivalent to a standard JPEG file of the same quality setting, and the total
156file size is about the same --- often a little smaller.
157
158Switches for advanced users:
159
160 -arithmetic Use arithmetic coding. CAUTION: arithmetic coded JPEG
161 is not yet widely implemented, so many decoders will
162 be unable to view an arithmetic coded JPEG file at
163 all.
164
165 -block N Set DCT block size. All N from 1 to 16 are possible.
166 Default is 8 (baseline format).
167 Larger values produce higher compression,
168 smaller values produce higher quality
169 (exact DCT stage possible with 1 or 2; with the
170 default quality of 75 and default Luminance qtable
171 the DCT+Quantization stage is lossless for N=1).
172 CAUTION: An implementation of the JPEG SmartScale
173 extension is required for this feature. SmartScale
174 enabled JPEG is not yet widely implemented, so many
175 decoders will be unable to view a SmartScale extended
176 JPEG file at all.
177
178 -dct int Use integer DCT method (default).
179 -dct fast Use fast integer DCT (less accurate).
180 -dct float Use floating-point DCT method.
181 The float method is very slightly more accurate than
182 the int method, but is much slower unless your machine
183 has very fast floating-point hardware. Also note that
184 results of the floating-point method may vary slightly
185 across machines, while the integer methods should give
186 the same results everywhere. The fast integer method
187 is much less accurate than the other two.
188
189 -nosmooth Don't use high-quality downsampling.
190
191 -restart N Emit a JPEG restart marker every N MCU rows, or every
192 N MCU blocks if "B" is attached to the number.
193 -restart 0 (the default) means no restart markers.
194
195 -smooth N Smooth the input image to eliminate dithering noise.
196 N, ranging from 1 to 100, indicates the strength of
197 smoothing. 0 (the default) means no smoothing.
198
199 -maxmemory N Set limit for amount of memory to use in processing
200 large images. Value is in thousands of bytes, or
201 millions of bytes if "M" is attached to the number.
202 For example, -max 4m selects 4000000 bytes. If more
203 space is needed, temporary files will be used.
204
205 -verbose Enable debug printout. More -v's give more printout.
206 or -debug Also, version information is printed at startup.
207
208The -restart option inserts extra markers that allow a JPEG decoder to
209resynchronize after a transmission error. Without restart markers, any damage
210to a compressed file will usually ruin the image from the point of the error
211to the end of the image; with restart markers, the damage is usually confined
212to the portion of the image up to the next restart marker. Of course, the
213restart markers occupy extra space. We recommend -restart 1 for images that
214will be transmitted across unreliable networks such as Usenet.
215
216The -smooth option filters the input to eliminate fine-scale noise. This is
217often useful when converting dithered images to JPEG: a moderate smoothing
218factor of 10 to 50 gets rid of dithering patterns in the input file, resulting
219in a smaller JPEG file and a better-looking image. Too large a smoothing
220factor will visibly blur the image, however.
221
222Switches for wizards:
223
224 -baseline Force baseline-compatible quantization tables to be
225 generated. This clamps quantization values to 8 bits
226 even at low quality settings. (This switch is poorly
227 named, since it does not ensure that the output is
228 actually baseline JPEG. For example, you can use
229 -baseline and -progressive together.)
230
231 -qtables file Use the quantization tables given in the specified
232 text file.
233
234 -qslots N[,...] Select which quantization table to use for each color
235 component.
236
237 -sample HxV[,...] Set JPEG sampling factors for each color component.
238
239 -scans file Use the scan script given in the specified text file.
240
241The "wizard" switches are intended for experimentation with JPEG. If you
242don't know what you are doing, DON'T USE THEM. These switches are documented
243further in the file wizard.txt.
244
245
246DJPEG DETAILS
247
248The basic command line switches for djpeg are:
249
250 -colors N Reduce image to at most N colors. This reduces the
251 or -quantize N number of colors used in the output image, so that it
252 can be displayed on a colormapped display or stored in
253 a colormapped file format. For example, if you have
254 an 8-bit display, you'd need to reduce to 256 or fewer
255 colors. (-colors is the recommended name, -quantize
256 is provided only for backwards compatibility.)
257
258 -fast Select recommended processing options for fast, low
259 quality output. (The default options are chosen for
260 highest quality output.) Currently, this is equivalent
261 to "-dct fast -nosmooth -onepass -dither ordered".
262
263 -grayscale Force gray-scale output even if JPEG file is color.
264 Useful for viewing on monochrome displays; also,
265 djpeg runs noticeably faster in this mode.
266
267 -scale M/N Scale the output image by a factor M/N. Currently
268 supported scale factors are M/N with all M from 1 to
269 16, where N is the source DCT size, which is 8 for
270 baseline JPEG. If the /N part is omitted, then M
271 specifies the DCT scaled size to be applied on the
272 given input. For baseline JPEG this is equivalent to
273 M/8 scaling, since the source DCT size for baseline
274 JPEG is 8. Scaling is handy if the image is larger
275 than your screen; also, djpeg runs much faster when
276 scaling down the output.
277
278 -bmp Select BMP output format (Windows flavor). 8-bit
279 colormapped format is emitted if -colors or -grayscale
280 is specified, or if the JPEG file is gray-scale;
281 otherwise, 24-bit full-color format is emitted.
282
283 -gif Select GIF output format. Since GIF does not support
284 more than 256 colors, -colors 256 is assumed (unless
285 you specify a smaller number of colors). If you
286 specify -fast, the default number of colors is 216.
287
288 -os2 Select BMP output format (OS/2 1.x flavor). 8-bit
289 colormapped format is emitted if -colors or -grayscale
290 is specified, or if the JPEG file is gray-scale;
291 otherwise, 24-bit full-color format is emitted.
292
293 -pnm Select PBMPLUS (PPM/PGM) output format (this is the
294 default format). PGM is emitted if the JPEG file is
295 gray-scale or if -grayscale is specified; otherwise
296 PPM is emitted.
297
298 -rle Select RLE output format. (Requires URT library.)
299
300 -targa Select Targa output format. Gray-scale format is
301 emitted if the JPEG file is gray-scale or if
302 -grayscale is specified; otherwise, colormapped format
303 is emitted if -colors is specified; otherwise, 24-bit
304 full-color format is emitted.
305
306Switches for advanced users:
307
308 -dct int Use integer DCT method (default).
309 -dct fast Use fast integer DCT (less accurate).
310 -dct float Use floating-point DCT method.
311 The float method is very slightly more accurate than
312 the int method, but is much slower unless your machine
313 has very fast floating-point hardware. Also note that
314 results of the floating-point method may vary slightly
315 across machines, while the integer methods should give
316 the same results everywhere. The fast integer method
317 is much less accurate than the other two.
318
319 -dither fs Use Floyd-Steinberg dithering in color quantization.
320 -dither ordered Use ordered dithering in color quantization.
321 -dither none Do not use dithering in color quantization.
322 By default, Floyd-Steinberg dithering is applied when
323 quantizing colors; this is slow but usually produces
324 the best results. Ordered dither is a compromise
325 between speed and quality; no dithering is fast but
326 usually looks awful. Note that these switches have
327 no effect unless color quantization is being done.
328 Ordered dither is only available in -onepass mode.
329
330 -map FILE Quantize to the colors used in the specified image
331 file. This is useful for producing multiple files
332 with identical color maps, or for forcing a predefined
333 set of colors to be used. The FILE must be a GIF
334 or PPM file. This option overrides -colors and
335 -onepass.
336
337 -nosmooth Don't use high-quality upsampling.
338
339 -onepass Use one-pass instead of two-pass color quantization.
340 The one-pass method is faster and needs less memory,
341 but it produces a lower-quality image. -onepass is
342 ignored unless you also say -colors N. Also,
343 the one-pass method is always used for gray-scale
344 output (the two-pass method is no improvement then).
345
346 -maxmemory N Set limit for amount of memory to use in processing
347 large images. Value is in thousands of bytes, or
348 millions of bytes if "M" is attached to the number.
349 For example, -max 4m selects 4000000 bytes. If more
350 space is needed, temporary files will be used.
351
352 -verbose Enable debug printout. More -v's give more printout.
353 or -debug Also, version information is printed at startup.
354
355
356HINTS FOR CJPEG
357
358Color GIF files are not the ideal input for JPEG; JPEG is really intended for
359compressing full-color (24-bit) images. In particular, don't try to convert
360cartoons, line drawings, and other images that have only a few distinct
361colors. GIF works great on these, JPEG does not. If you want to convert a
362GIF to JPEG, you should experiment with cjpeg's -quality and -smooth options
363to get a satisfactory conversion. -smooth 10 or so is often helpful.
364
365Avoid running an image through a series of JPEG compression/decompression
366cycles. Image quality loss will accumulate; after ten or so cycles the image
367may be noticeably worse than it was after one cycle. It's best to use a
368lossless format while manipulating an image, then convert to JPEG format when
369you are ready to file the image away.
370
371The -optimize option to cjpeg is worth using when you are making a "final"
372version for posting or archiving. It's also a win when you are using low
373quality settings to make very small JPEG files; the percentage improvement
374is often a lot more than it is on larger files. (At present, -optimize
375mode is always selected when generating progressive JPEG files.)
376
377GIF input files are no longer supported, to avoid the Unisys LZW patent.
378(Conversion of GIF files to JPEG is usually a bad idea anyway.)
379
380
381HINTS FOR DJPEG
382
383To get a quick preview of an image, use the -grayscale and/or -scale switches.
384"-grayscale -scale 1/8" is the fastest case.
385
386Several options are available that trade off image quality to gain speed.
387"-fast" turns on the recommended settings.
388
389"-dct fast" and/or "-nosmooth" gain speed at a small sacrifice in quality.
390When producing a color-quantized image, "-onepass -dither ordered" is fast but
391much lower quality than the default behavior. "-dither none" may give
392acceptable results in two-pass mode, but is seldom tolerable in one-pass mode.
393
394If you are fortunate enough to have very fast floating point hardware,
395"-dct float" may be even faster than "-dct fast". But on most machines
396"-dct float" is slower than "-dct int"; in this case it is not worth using,
397because its theoretical accuracy advantage is too small to be significant
398in practice.
399
400Two-pass color quantization requires a good deal of memory; on MS-DOS machines
401it may run out of memory even with -maxmemory 0. In that case you can still
402decompress, with some loss of image quality, by specifying -onepass for
403one-pass quantization.
404
405To avoid the Unisys LZW patent, djpeg produces uncompressed GIF files. These
406are larger than they should be, but are readable by standard GIF decoders.
407
408
409HINTS FOR BOTH PROGRAMS
410
411If more space is needed than will fit in the available main memory (as
412determined by -maxmemory), temporary files will be used. (MS-DOS versions
413will try to get extended or expanded memory first.) The temporary files are
414often rather large: in typical cases they occupy three bytes per pixel, for
415example 3*800*600 = 1.44Mb for an 800x600 image. If you don't have enough
416free disk space, leave out -progressive and -optimize (for cjpeg) or specify
417-onepass (for djpeg).
418
419On MS-DOS, the temporary files are created in the directory named by the TMP
420or TEMP environment variable, or in the current directory if neither of those
421exist. Amiga implementations put the temp files in the directory named by
422JPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with adequate free
423space.
424
425The default memory usage limit (-maxmemory) is set when the software is
426compiled. If you get an "insufficient memory" error, try specifying a smaller
427-maxmemory value, even -maxmemory 0 to use the absolute minimum space. You
428may want to recompile with a smaller default value if this happens often.
429
430On machines that have "environment" variables, you can define the environment
431variable JPEGMEM to set the default memory limit. The value is specified as
432described for the -maxmemory switch. JPEGMEM overrides the default value
433specified when the program was compiled, and itself is overridden by an
434explicit -maxmemory switch.
435
436On MS-DOS machines, -maxmemory is the amount of main (conventional) memory to
437use. (Extended or expanded memory is also used if available.) Most
438DOS-specific versions of this software do their own memory space estimation
439and do not need you to specify -maxmemory.
440
441
442JPEGTRAN
443
444jpegtran performs various useful transformations of JPEG files.
445It can translate the coded representation from one variant of JPEG to another,
446for example from baseline JPEG to progressive JPEG or vice versa. It can also
447perform some rearrangements of the image data, for example turning an image
448from landscape to portrait format by rotation.
449
450jpegtran works by rearranging the compressed data (DCT coefficients), without
451ever fully decoding the image. Therefore, its transformations are lossless:
452there is no image degradation at all, which would not be true if you used
453djpeg followed by cjpeg to accomplish the same conversion. But by the same
454token, jpegtran cannot perform lossy operations such as changing the image
455quality.
456
457jpegtran uses a command line syntax similar to cjpeg or djpeg.
458On Unix-like systems, you say:
459 jpegtran [switches] [inputfile] >outputfile
460On most non-Unix systems, you say:
461 jpegtran [switches] inputfile outputfile
462where both the input and output files are JPEG files.
463
464To specify the coded JPEG representation used in the output file,
465jpegtran accepts a subset of the switches recognized by cjpeg:
466 -optimize Perform optimization of entropy encoding parameters.
467 -progressive Create progressive JPEG file.
468 -arithmetic Use arithmetic coding.
469 -restart N Emit a JPEG restart marker every N MCU rows, or every
470 N MCU blocks if "B" is attached to the number.
471 -scans file Use the scan script given in the specified text file.
472See the previous discussion of cjpeg for more details about these switches.
473If you specify none of these switches, you get a plain baseline-JPEG output
474file. The quality setting and so forth are determined by the input file.
475
476The image can be losslessly transformed by giving one of these switches:
477 -flip horizontal Mirror image horizontally (left-right).
478 -flip vertical Mirror image vertically (top-bottom).
479 -rotate 90 Rotate image 90 degrees clockwise.
480 -rotate 180 Rotate image 180 degrees.
481 -rotate 270 Rotate image 270 degrees clockwise (or 90 ccw).
482 -transpose Transpose image (across UL-to-LR axis).
483 -transverse Transverse transpose (across UR-to-LL axis).
484
485The transpose transformation has no restrictions regarding image dimensions.
486The other transformations operate rather oddly if the image dimensions are not
487a multiple of the iMCU size (usually 8 or 16 pixels), because they can only
488transform complete blocks of DCT coefficient data in the desired way.
489
490jpegtran's default behavior when transforming an odd-size image is designed
491to preserve exact reversibility and mathematical consistency of the
492transformation set. As stated, transpose is able to flip the entire image
493area. Horizontal mirroring leaves any partial iMCU column at the right edge
494untouched, but is able to flip all rows of the image. Similarly, vertical
495mirroring leaves any partial iMCU row at the bottom edge untouched, but is
496able to flip all columns. The other transforms can be built up as sequences
497of transpose and flip operations; for consistency, their actions on edge
498pixels are defined to be the same as the end result of the corresponding
499transpose-and-flip sequence.
500
501For practical use, you may prefer to discard any untransformable edge pixels
502rather than having a strange-looking strip along the right and/or bottom edges
503of a transformed image. To do this, add the -trim switch:
504 -trim Drop non-transformable edge blocks.
505Obviously, a transformation with -trim is not reversible, so strictly speaking
506jpegtran with this switch is not lossless. Also, the expected mathematical
507equivalences between the transformations no longer hold. For example,
508"-rot 270 -trim" trims only the bottom edge, but "-rot 90 -trim" followed by
509"-rot 180 -trim" trims both edges.
510
511If you are only interested in perfect transformation, add the -perfect switch:
512 -perfect Fails with an error if the transformation is not
513 perfect.
514For example you may want to do
515 jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg
516to do a perfect rotation if available or an approximated one if not.
517
518We also offer a lossless-crop option, which discards data outside a given
519image region but losslessly preserves what is inside. Like the rotate and
520flip transforms, lossless crop is restricted by the current JPEG format: the
521upper left corner of the selected region must fall on an iMCU boundary. If
522this does not hold for the given crop parameters, we silently move the upper
523left corner up and/or left to make it so, simultaneously increasing the region
524dimensions to keep the lower right crop corner unchanged. (Thus, the output
525image covers at least the requested region, but may cover more.)
526
527The image can be losslessly cropped by giving the switch:
528 -crop WxH+X+Y Crop to a rectangular subarea of width W, height H
529 starting at point X,Y.
530
531Other not-strictly-lossless transformation switches are:
532
533 -grayscale Force grayscale output.
534This option discards the chrominance channels if the input image is YCbCr
535(ie, a standard color JPEG), resulting in a grayscale JPEG file. The
536luminance channel is preserved exactly, so this is a better method of reducing
537to grayscale than decompression, conversion, and recompression. This switch
538is particularly handy for fixing a monochrome picture that was mistakenly
539encoded as a color JPEG. (In such a case, the space savings from getting rid
540of the near-empty chroma channels won't be large; but the decoding time for
541a grayscale JPEG is substantially less than that for a color JPEG.)
542
543 -scale M/N Scale the output image by a factor M/N.
544Currently supported scale factors are M/N with all M from 1 to 16, where N is
545the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted,
546then M specifies the DCT scaled size to be applied on the given input. For
547baseline JPEG this is equivalent to M/8 scaling, since the source DCT size
548for baseline JPEG is 8. CAUTION: An implementation of the JPEG SmartScale
549extension is required for this feature. SmartScale enabled JPEG is not yet
550widely implemented, so many decoders will be unable to view a SmartScale
551extended JPEG file at all.
552
553jpegtran also recognizes these switches that control what to do with "extra"
554markers, such as comment blocks:
555 -copy none Copy no extra markers from source file. This setting
556 suppresses all comments and other excess baggage
557 present in the source file.
558 -copy comments Copy only comment markers. This setting copies
559 comments from the source file, but discards
560 any other inessential (for image display) data.
561 -copy all Copy all extra markers. This setting preserves
562 miscellaneous markers found in the source file, such
563 as JFIF thumbnails, Exif data, and Photoshop settings.
564 In some files these extra markers can be sizable.
565The default behavior is -copy comments. (Note: in IJG releases v6 and v6a,
566jpegtran always did the equivalent of -copy none.)
567
568Additional switches recognized by jpegtran are:
569 -outfile filename
570 -maxmemory N
571 -verbose
572 -debug
573These work the same as in cjpeg or djpeg.
574
575
576THE COMMENT UTILITIES
577
578The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
579Although the standard doesn't actually define what COM blocks are for, they
580are widely used to hold user-supplied text strings. This lets you add
581annotations, titles, index terms, etc to your JPEG files, and later retrieve
582them as text. COM blocks do not interfere with the image stored in the JPEG
583file. The maximum size of a COM block is 64K, but you can have as many of
584them as you like in one JPEG file.
585
586We provide two utility programs to display COM block contents and add COM
587blocks to a JPEG file.
588
589rdjpgcom searches a JPEG file and prints the contents of any COM blocks on
590standard output. The command line syntax is
591 rdjpgcom [-raw] [-verbose] [inputfilename]
592The switch "-raw" (or just "-r") causes rdjpgcom to also output non-printable
593characters in comments, which are normally escaped for security reasons.
594The switch "-verbose" (or just "-v") causes rdjpgcom to also display the JPEG
595image dimensions. If you omit the input file name from the command line,
596the JPEG file is read from standard input. (This may not work on some
597operating systems, if binary data can't be read from stdin.)
598
599wrjpgcom adds a COM block, containing text you provide, to a JPEG file.
600Ordinarily, the COM block is added after any existing COM blocks, but you
601can delete the old COM blocks if you wish. wrjpgcom produces a new JPEG
602file; it does not modify the input file. DO NOT try to overwrite the input
603file by directing wrjpgcom's output back into it; on most systems this will
604just destroy your file.
605
606The command line syntax for wrjpgcom is similar to cjpeg's. On Unix-like
607systems, it is
608 wrjpgcom [switches] [inputfilename]
609The output file is written to standard output. The input file comes from
610the named file, or from standard input if no input file is named.
611
612On most non-Unix systems, the syntax is
613 wrjpgcom [switches] inputfilename outputfilename
614where both input and output file names must be given explicitly.
615
616wrjpgcom understands three switches:
617 -replace Delete any existing COM blocks from the file.
618 -comment "Comment text" Supply new COM text on command line.
619 -cfile name Read text for new COM block from named file.
620(Switch names can be abbreviated.) If you have only one line of comment text
621to add, you can provide it on the command line with -comment. The comment
622text must be surrounded with quotes so that it is treated as a single
623argument. Longer comments can be read from a text file.
624
625If you give neither -comment nor -cfile, then wrjpgcom will read the comment
626text from standard input. (In this case an input image file name MUST be
627supplied, so that the source JPEG file comes from somewhere else.) You can
628enter multiple lines, up to 64KB worth. Type an end-of-file indicator
629(usually control-D or control-Z) to terminate the comment text entry.
630
631wrjpgcom will not add a COM block if the provided comment string is empty.
632Therefore -replace -comment "" can be used to delete all COM blocks from a
633file.
634
635These utility programs do not depend on the IJG JPEG library. In
636particular, the source code for rdjpgcom is intended as an illustration of
637the minimum amount of code required to parse a JPEG file header correctly.
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wizard.txt b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wizard.txt
new file mode 100644
index 0000000..02418ba
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wizard.txt
@@ -0,0 +1,211 @@
1Advanced usage instructions for the Independent JPEG Group's JPEG software
2==========================================================================
3
4This file describes cjpeg's "switches for wizards".
5
6The "wizard" switches are intended for experimentation with JPEG by persons
7who are reasonably knowledgeable about the JPEG standard. If you don't know
8what you are doing, DON'T USE THESE SWITCHES. You'll likely produce files
9with worse image quality and/or poorer compression than you'd get from the
10default settings. Furthermore, these switches must be used with caution
11when making files intended for general use, because not all JPEG decoders
12will support unusual JPEG parameter settings.
13
14
15Quantization Table Adjustment
16-----------------------------
17
18Ordinarily, cjpeg starts with a default set of tables (the same ones given
19as examples in the JPEG standard) and scales them up or down according to
20the -quality setting. The details of the scaling algorithm can be found in
21jcparam.c. At very low quality settings, some quantization table entries
22can get scaled up to values exceeding 255. Although 2-byte quantization
23values are supported by the IJG software, this feature is not in baseline
24JPEG and is not supported by all implementations. If you need to ensure
25wide compatibility of low-quality files, you can constrain the scaled
26quantization values to no more than 255 by giving the -baseline switch.
27Note that use of -baseline will result in poorer quality for the same file
28size, since more bits than necessary are expended on higher AC coefficients.
29
30You can substitute a different set of quantization values by using the
31-qtables switch:
32
33 -qtables file Use the quantization tables given in the named file.
34
35The specified file should be a text file containing decimal quantization
36values. The file should contain one to four tables, each of 64 elements.
37The tables are implicitly numbered 0,1,etc. in order of appearance. Table
38entries appear in normal array order (NOT in the zigzag order in which they
39will be stored in the JPEG file).
40
41Quantization table files are free format, in that arbitrary whitespace can
42appear between numbers. Also, comments can be included: a comment starts
43with '#' and extends to the end of the line. Here is an example file that
44duplicates the default quantization tables:
45
46 # Quantization tables given in JPEG spec, section K.1
47
48 # This is table 0 (the luminance table):
49 16 11 10 16 24 40 51 61
50 12 12 14 19 26 58 60 55
51 14 13 16 24 40 57 69 56
52 14 17 22 29 51 87 80 62
53 18 22 37 56 68 109 103 77
54 24 35 55 64 81 104 113 92
55 49 64 78 87 103 121 120 101
56 72 92 95 98 112 100 103 99
57
58 # This is table 1 (the chrominance table):
59 17 18 24 47 99 99 99 99
60 18 21 26 66 99 99 99 99
61 24 26 56 99 99 99 99 99
62 47 66 99 99 99 99 99 99
63 99 99 99 99 99 99 99 99
64 99 99 99 99 99 99 99 99
65 99 99 99 99 99 99 99 99
66 99 99 99 99 99 99 99 99
67
68If the -qtables switch is used without -quality, then the specified tables
69are used exactly as-is. If both -qtables and -quality are used, then the
70tables taken from the file are scaled in the same fashion that the default
71tables would be scaled for that quality setting. If -baseline appears, then
72the quantization values are constrained to the range 1-255.
73
74By default, cjpeg will use quantization table 0 for luminance components and
75table 1 for chrominance components. To override this choice, use the -qslots
76switch:
77
78 -qslots N[,...] Select which quantization table to use for
79 each color component.
80
81The -qslots switch specifies a quantization table number for each color
82component, in the order in which the components appear in the JPEG SOF marker.
83For example, to create a separate table for each of Y,Cb,Cr, you could
84provide a -qtables file that defines three quantization tables and say
85"-qslots 0,1,2". If -qslots gives fewer table numbers than there are color
86components, then the last table number is repeated as necessary.
87
88
89Sampling Factor Adjustment
90--------------------------
91
92By default, cjpeg uses 2:1 horizontal and vertical downsampling when
93compressing YCbCr data, and no downsampling for all other color spaces.
94You can override this default with the -sample switch:
95
96 -sample HxV[,...] Set JPEG sampling factors for each color
97 component.
98
99The -sample switch specifies the JPEG sampling factors for each color
100component, in the order in which they appear in the JPEG SOF marker.
101If you specify fewer HxV pairs than there are components, the remaining
102components are set to 1x1 sampling. For example, the default YCbCr setting
103is equivalent to "-sample 2x2,1x1,1x1", which can be abbreviated to
104"-sample 2x2".
105
106There are still some JPEG decoders in existence that support only 2x1
107sampling (also called 4:2:2 sampling). Compatibility with such decoders can
108be achieved by specifying "-sample 2x1". This is not recommended unless
109really necessary, since it increases file size and encoding/decoding time
110with very little quality gain.
111
112
113Multiple Scan / Progression Control
114-----------------------------------
115
116By default, cjpeg emits a single-scan sequential JPEG file. The
117-progressive switch generates a progressive JPEG file using a default series
118of progression parameters. You can create multiple-scan sequential JPEG
119files or progressive JPEG files with custom progression parameters by using
120the -scans switch:
121
122 -scans file Use the scan sequence given in the named file.
123
124The specified file should be a text file containing a "scan script".
125The script specifies the contents and ordering of the scans to be emitted.
126Each entry in the script defines one scan. A scan definition specifies
127the components to be included in the scan, and for progressive JPEG it also
128specifies the progression parameters Ss,Se,Ah,Al for the scan. Scan
129definitions are separated by semicolons (';'). A semicolon after the last
130scan definition is optional.
131
132Each scan definition contains one to four component indexes, optionally
133followed by a colon (':') and the four progressive-JPEG parameters. The
134component indexes denote which color component(s) are to be transmitted in
135the scan. Components are numbered in the order in which they appear in the
136JPEG SOF marker, with the first component being numbered 0. (Note that these
137indexes are not the "component ID" codes assigned to the components, just
138positional indexes.)
139
140The progression parameters for each scan are:
141 Ss Zigzag index of first coefficient included in scan
142 Se Zigzag index of last coefficient included in scan
143 Ah Zero for first scan of a coefficient, else Al of prior scan
144 Al Successive approximation low bit position for scan
145If the progression parameters are omitted, the values 0,63,0,0 are used,
146producing a sequential JPEG file. cjpeg automatically determines whether
147the script represents a progressive or sequential file, by observing whether
148Ss and Se values other than 0 and 63 appear. (The -progressive switch is
149not needed to specify this; in fact, it is ignored when -scans appears.)
150The scan script must meet the JPEG restrictions on progression sequences.
151(cjpeg checks that the spec's requirements are obeyed.)
152
153Scan script files are free format, in that arbitrary whitespace can appear
154between numbers and around punctuation. Also, comments can be included: a
155comment starts with '#' and extends to the end of the line. For additional
156legibility, commas or dashes can be placed between values. (Actually, any
157single punctuation character other than ':' or ';' can be inserted.) For
158example, the following two scan definitions are equivalent:
159 0 1 2: 0 63 0 0;
160 0,1,2 : 0-63, 0,0 ;
161
162Here is an example of a scan script that generates a partially interleaved
163sequential JPEG file:
164
165 0; # Y only in first scan
166 1 2; # Cb and Cr in second scan
167
168Here is an example of a progressive scan script using only spectral selection
169(no successive approximation):
170
171 # Interleaved DC scan for Y,Cb,Cr:
172 0,1,2: 0-0, 0, 0 ;
173 # AC scans:
174 0: 1-2, 0, 0 ; # First two Y AC coefficients
175 0: 3-5, 0, 0 ; # Three more
176 1: 1-63, 0, 0 ; # All AC coefficients for Cb
177 2: 1-63, 0, 0 ; # All AC coefficients for Cr
178 0: 6-9, 0, 0 ; # More Y coefficients
179 0: 10-63, 0, 0 ; # Remaining Y coefficients
180
181Here is an example of a successive-approximation script. This is equivalent
182to the default script used by "cjpeg -progressive" for YCbCr images:
183
184 # Initial DC scan for Y,Cb,Cr (lowest bit not sent)
185 0,1,2: 0-0, 0, 1 ;
186 # First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits:
187 0: 1-5, 0, 2 ;
188 # Send all Cr,Cb AC coefficients, minus lowest bit:
189 # (chroma data is usually too small to be worth subdividing further;
190 # but note we send Cr first since eye is least sensitive to Cb)
191 2: 1-63, 0, 1 ;
192 1: 1-63, 0, 1 ;
193 # Send remaining Y AC coefficients, minus 2 lowest bits:
194 0: 6-63, 0, 2 ;
195 # Send next-to-lowest bit of all Y AC coefficients:
196 0: 1-63, 2, 1 ;
197 # At this point we've sent all but the lowest bit of all coefficients.
198 # Send lowest bit of DC coefficients
199 0,1,2: 0-0, 1, 0 ;
200 # Send lowest bit of AC coefficients
201 2: 1-63, 1, 0 ;
202 1: 1-63, 1, 0 ;
203 # Y AC lowest bit scan is last; it's usually the largest scan
204 0: 1-63, 1, 0 ;
205
206It may be worth pointing out that this script is tuned for quality settings
207of around 50 to 75. For lower quality settings, you'd probably want to use
208a script with fewer stages of successive approximation (otherwise the
209initial scans will be really bad). For higher quality settings, you might
210want to use more stages of successive approximation (so that the initial
211scans are not too large).
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrbmp.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrbmp.c
new file mode 100644
index 0000000..2b8146e
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrbmp.c
@@ -0,0 +1,442 @@
1/*
2 * wrbmp.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to write output images in Microsoft "BMP"
9 * format (MS Windows 3.x and OS/2 1.x flavors).
10 * Either 8-bit colormapped or 24-bit full-color format can be written.
11 * No compression is supported.
12 *
13 * These routines may need modification for non-Unix environments or
14 * specialized applications. As they stand, they assume output to
15 * an ordinary stdio stream.
16 *
17 * This code contributed by James Arthur Boucher.
18 */
19
20#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
21
22#ifdef BMP_SUPPORTED
23
24
25/*
26 * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.
27 * This is not yet implemented.
28 */
29
30#if BITS_IN_JSAMPLE != 8
31 Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
32#endif
33
34/*
35 * Since BMP stores scanlines bottom-to-top, we have to invert the image
36 * from JPEG's top-to-bottom order. To do this, we save the outgoing data
37 * in a virtual array during put_pixel_row calls, then actually emit the
38 * BMP file during finish_output. The virtual array contains one JSAMPLE per
39 * pixel if the output is grayscale or colormapped, three if it is full color.
40 */
41
42/* Private version of data destination object */
43
44typedef struct {
45 struct djpeg_dest_struct pub; /* public fields */
46
47 boolean is_os2; /* saves the OS2 format request flag */
48
49 jvirt_sarray_ptr whole_image; /* needed to reverse row order */
50 JDIMENSION data_width; /* JSAMPLEs per row */
51 JDIMENSION row_width; /* physical width of one row in the BMP file */
52 int pad_bytes; /* number of padding bytes needed per row */
53 JDIMENSION cur_output_row; /* next row# to write to virtual array */
54} bmp_dest_struct;
55
56typedef bmp_dest_struct * bmp_dest_ptr;
57
58
59/* Forward declarations */
60LOCAL(void) write_colormap
61 JPP((j_decompress_ptr cinfo, bmp_dest_ptr dest,
62 int map_colors, int map_entry_size));
63
64
65/*
66 * Write some pixel data.
67 * In this module rows_supplied will always be 1.
68 */
69
70METHODDEF(void)
71put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
72 JDIMENSION rows_supplied)
73/* This version is for writing 24-bit pixels */
74{
75 bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
76 JSAMPARRAY image_ptr;
77 register JSAMPROW inptr, outptr;
78 register JDIMENSION col;
79 int pad;
80
81 /* Access next row in virtual array */
82 image_ptr = (*cinfo->mem->access_virt_sarray)
83 ((j_common_ptr) cinfo, dest->whole_image,
84 dest->cur_output_row, (JDIMENSION) 1, TRUE);
85 dest->cur_output_row++;
86
87 /* Transfer data. Note destination values must be in BGR order
88 * (even though Microsoft's own documents say the opposite).
89 */
90 inptr = dest->pub.buffer[0];
91 outptr = image_ptr[0];
92 for (col = cinfo->output_width; col > 0; col--) {
93 outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */
94 outptr[1] = *inptr++;
95 outptr[0] = *inptr++;
96 outptr += 3;
97 }
98
99 /* Zero out the pad bytes. */
100 pad = dest->pad_bytes;
101 while (--pad >= 0)
102 *outptr++ = 0;
103}
104
105METHODDEF(void)
106put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
107 JDIMENSION rows_supplied)
108/* This version is for grayscale OR quantized color output */
109{
110 bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
111 JSAMPARRAY image_ptr;
112 register JSAMPROW inptr, outptr;
113 register JDIMENSION col;
114 int pad;
115
116 /* Access next row in virtual array */
117 image_ptr = (*cinfo->mem->access_virt_sarray)
118 ((j_common_ptr) cinfo, dest->whole_image,
119 dest->cur_output_row, (JDIMENSION) 1, TRUE);
120 dest->cur_output_row++;
121
122 /* Transfer data. */
123 inptr = dest->pub.buffer[0];
124 outptr = image_ptr[0];
125 for (col = cinfo->output_width; col > 0; col--) {
126 *outptr++ = *inptr++; /* can omit GETJSAMPLE() safely */
127 }
128
129 /* Zero out the pad bytes. */
130 pad = dest->pad_bytes;
131 while (--pad >= 0)
132 *outptr++ = 0;
133}
134
135
136/*
137 * Startup: normally writes the file header.
138 * In this module we may as well postpone everything until finish_output.
139 */
140
141METHODDEF(void)
142start_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
143{
144 /* no work here */
145}
146
147
148/*
149 * Finish up at the end of the file.
150 *
151 * Here is where we really output the BMP file.
152 *
153 * First, routines to write the Windows and OS/2 variants of the file header.
154 */
155
156LOCAL(void)
157write_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)
158/* Write a Windows-style BMP file header, including colormap if needed */
159{
160 char bmpfileheader[14];
161 char bmpinfoheader[40];
162#define PUT_2B(array,offset,value) \
163 (array[offset] = (char) ((value) & 0xFF), \
164 array[offset+1] = (char) (((value) >> 8) & 0xFF))
165#define PUT_4B(array,offset,value) \
166 (array[offset] = (char) ((value) & 0xFF), \
167 array[offset+1] = (char) (((value) >> 8) & 0xFF), \
168 array[offset+2] = (char) (((value) >> 16) & 0xFF), \
169 array[offset+3] = (char) (((value) >> 24) & 0xFF))
170 INT32 headersize, bfSize;
171 int bits_per_pixel, cmap_entries;
172
173 /* Compute colormap size and total file size */
174 if (cinfo->out_color_space == JCS_RGB) {
175 if (cinfo->quantize_colors) {
176 /* Colormapped RGB */
177 bits_per_pixel = 8;
178 cmap_entries = 256;
179 } else {
180 /* Unquantized, full color RGB */
181 bits_per_pixel = 24;
182 cmap_entries = 0;
183 }
184 } else {
185 /* Grayscale output. We need to fake a 256-entry colormap. */
186 bits_per_pixel = 8;
187 cmap_entries = 256;
188 }
189 /* File size */
190 headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */
191 bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
192
193 /* Set unused fields of header to 0 */
194 MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
195 MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader));
196
197 /* Fill the file header */
198 bmpfileheader[0] = 0x42; /* first 2 bytes are ASCII 'B', 'M' */
199 bmpfileheader[1] = 0x4D;
200 PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */
201 /* we leave bfReserved1 & bfReserved2 = 0 */
202 PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */
203
204 /* Fill the info header (Microsoft calls this a BITMAPINFOHEADER) */
205 PUT_2B(bmpinfoheader, 0, 40); /* biSize */
206 PUT_4B(bmpinfoheader, 4, cinfo->output_width); /* biWidth */
207 PUT_4B(bmpinfoheader, 8, cinfo->output_height); /* biHeight */
208 PUT_2B(bmpinfoheader, 12, 1); /* biPlanes - must be 1 */
209 PUT_2B(bmpinfoheader, 14, bits_per_pixel); /* biBitCount */
210 /* we leave biCompression = 0, for none */
211 /* we leave biSizeImage = 0; this is correct for uncompressed data */
212 if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */
213 PUT_4B(bmpinfoheader, 24, (INT32) (cinfo->X_density*100)); /* XPels/M */
214 PUT_4B(bmpinfoheader, 28, (INT32) (cinfo->Y_density*100)); /* XPels/M */
215 }
216 PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */
217 /* we leave biClrImportant = 0 */
218
219 if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)
220 ERREXIT(cinfo, JERR_FILE_WRITE);
221 if (JFWRITE(dest->pub.output_file, bmpinfoheader, 40) != (size_t) 40)
222 ERREXIT(cinfo, JERR_FILE_WRITE);
223
224 if (cmap_entries > 0)
225 write_colormap(cinfo, dest, cmap_entries, 4);
226}
227
228
229LOCAL(void)
230write_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)
231/* Write an OS2-style BMP file header, including colormap if needed */
232{
233 char bmpfileheader[14];
234 char bmpcoreheader[12];
235 INT32 headersize, bfSize;
236 int bits_per_pixel, cmap_entries;
237
238 /* Compute colormap size and total file size */
239 if (cinfo->out_color_space == JCS_RGB) {
240 if (cinfo->quantize_colors) {
241 /* Colormapped RGB */
242 bits_per_pixel = 8;
243 cmap_entries = 256;
244 } else {
245 /* Unquantized, full color RGB */
246 bits_per_pixel = 24;
247 cmap_entries = 0;
248 }
249 } else {
250 /* Grayscale output. We need to fake a 256-entry colormap. */
251 bits_per_pixel = 8;
252 cmap_entries = 256;
253 }
254 /* File size */
255 headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */
256 bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
257
258 /* Set unused fields of header to 0 */
259 MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
260 MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader));
261
262 /* Fill the file header */
263 bmpfileheader[0] = 0x42; /* first 2 bytes are ASCII 'B', 'M' */
264 bmpfileheader[1] = 0x4D;
265 PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */
266 /* we leave bfReserved1 & bfReserved2 = 0 */
267 PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */
268
269 /* Fill the info header (Microsoft calls this a BITMAPCOREHEADER) */
270 PUT_2B(bmpcoreheader, 0, 12); /* bcSize */
271 PUT_2B(bmpcoreheader, 4, cinfo->output_width); /* bcWidth */
272 PUT_2B(bmpcoreheader, 6, cinfo->output_height); /* bcHeight */
273 PUT_2B(bmpcoreheader, 8, 1); /* bcPlanes - must be 1 */
274 PUT_2B(bmpcoreheader, 10, bits_per_pixel); /* bcBitCount */
275
276 if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)
277 ERREXIT(cinfo, JERR_FILE_WRITE);
278 if (JFWRITE(dest->pub.output_file, bmpcoreheader, 12) != (size_t) 12)
279 ERREXIT(cinfo, JERR_FILE_WRITE);
280
281 if (cmap_entries > 0)
282 write_colormap(cinfo, dest, cmap_entries, 3);
283}
284
285
286/*
287 * Write the colormap.
288 * Windows uses BGR0 map entries; OS/2 uses BGR entries.
289 */
290
291LOCAL(void)
292write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,
293 int map_colors, int map_entry_size)
294{
295 JSAMPARRAY colormap = cinfo->colormap;
296 int num_colors = cinfo->actual_number_of_colors;
297 FILE * outfile = dest->pub.output_file;
298 int i;
299
300 if (colormap != NULL) {
301 if (cinfo->out_color_components == 3) {
302 /* Normal case with RGB colormap */
303 for (i = 0; i < num_colors; i++) {
304 putc(GETJSAMPLE(colormap[2][i]), outfile);
305 putc(GETJSAMPLE(colormap[1][i]), outfile);
306 putc(GETJSAMPLE(colormap[0][i]), outfile);
307 if (map_entry_size == 4)
308 putc(0, outfile);
309 }
310 } else {
311 /* Grayscale colormap (only happens with grayscale quantization) */
312 for (i = 0; i < num_colors; i++) {
313 putc(GETJSAMPLE(colormap[0][i]), outfile);
314 putc(GETJSAMPLE(colormap[0][i]), outfile);
315 putc(GETJSAMPLE(colormap[0][i]), outfile);
316 if (map_entry_size == 4)
317 putc(0, outfile);
318 }
319 }
320 } else {
321 /* If no colormap, must be grayscale data. Generate a linear "map". */
322 for (i = 0; i < 256; i++) {
323 putc(i, outfile);
324 putc(i, outfile);
325 putc(i, outfile);
326 if (map_entry_size == 4)
327 putc(0, outfile);
328 }
329 }
330 /* Pad colormap with zeros to ensure specified number of colormap entries */
331 if (i > map_colors)
332 ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);
333 for (; i < map_colors; i++) {
334 putc(0, outfile);
335 putc(0, outfile);
336 putc(0, outfile);
337 if (map_entry_size == 4)
338 putc(0, outfile);
339 }
340}
341
342
343METHODDEF(void)
344finish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
345{
346 bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;
347 register FILE * outfile = dest->pub.output_file;
348 JSAMPARRAY image_ptr;
349 register JSAMPROW data_ptr;
350 JDIMENSION row;
351 register JDIMENSION col;
352 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
353
354 /* Write the header and colormap */
355 if (dest->is_os2)
356 write_os2_header(cinfo, dest);
357 else
358 write_bmp_header(cinfo, dest);
359
360 /* Write the file body from our virtual array */
361 for (row = cinfo->output_height; row > 0; row--) {
362 if (progress != NULL) {
363 progress->pub.pass_counter = (long) (cinfo->output_height - row);
364 progress->pub.pass_limit = (long) cinfo->output_height;
365 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
366 }
367 image_ptr = (*cinfo->mem->access_virt_sarray)
368 ((j_common_ptr) cinfo, dest->whole_image, row-1, (JDIMENSION) 1, FALSE);
369 data_ptr = image_ptr[0];
370 for (col = dest->row_width; col > 0; col--) {
371 putc(GETJSAMPLE(*data_ptr), outfile);
372 data_ptr++;
373 }
374 }
375 if (progress != NULL)
376 progress->completed_extra_passes++;
377
378 /* Make sure we wrote the output file OK */
379 fflush(outfile);
380 if (ferror(outfile))
381 ERREXIT(cinfo, JERR_FILE_WRITE);
382}
383
384
385/*
386 * The module selection routine for BMP format output.
387 */
388
389GLOBAL(djpeg_dest_ptr)
390jinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2)
391{
392 bmp_dest_ptr dest;
393 JDIMENSION row_width;
394
395 /* Create module interface object, fill in method pointers */
396 dest = (bmp_dest_ptr)
397 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
398 SIZEOF(bmp_dest_struct));
399 dest->pub.start_output = start_output_bmp;
400 dest->pub.finish_output = finish_output_bmp;
401 dest->is_os2 = is_os2;
402
403 if (cinfo->out_color_space == JCS_GRAYSCALE) {
404 dest->pub.put_pixel_rows = put_gray_rows;
405 } else if (cinfo->out_color_space == JCS_RGB) {
406 if (cinfo->quantize_colors)
407 dest->pub.put_pixel_rows = put_gray_rows;
408 else
409 dest->pub.put_pixel_rows = put_pixel_rows;
410 } else {
411 ERREXIT(cinfo, JERR_BMP_COLORSPACE);
412 }
413
414 /* Calculate output image dimensions so we can allocate space */
415 jpeg_calc_output_dimensions(cinfo);
416
417 /* Determine width of rows in the BMP file (padded to 4-byte boundary). */
418 row_width = cinfo->output_width * cinfo->output_components;
419 dest->data_width = row_width;
420 while ((row_width & 3) != 0) row_width++;
421 dest->row_width = row_width;
422 dest->pad_bytes = (int) (row_width - dest->data_width);
423
424 /* Allocate space for inversion array, prepare for write pass */
425 dest->whole_image = (*cinfo->mem->request_virt_sarray)
426 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
427 row_width, cinfo->output_height, (JDIMENSION) 1);
428 dest->cur_output_row = 0;
429 if (cinfo->progress != NULL) {
430 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
431 progress->total_extra_passes++; /* count file input as separate pass */
432 }
433
434 /* Create decompressor output buffer. */
435 dest->pub.buffer = (*cinfo->mem->alloc_sarray)
436 ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);
437 dest->pub.buffer_height = 1;
438
439 return (djpeg_dest_ptr) dest;
440}
441
442#endif /* BMP_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrgif.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrgif.c
new file mode 100644
index 0000000..13f953b
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrgif.c
@@ -0,0 +1,399 @@
1/*
2 * wrgif.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to write output images in GIF format.
9 *
10 **************************************************************************
11 * NOTE: to avoid entanglements with Unisys' patent on LZW compression, *
12 * this code has been modified to output "uncompressed GIF" files. *
13 * There is no trace of the LZW algorithm in this file. *
14 **************************************************************************
15 *
16 * These routines may need modification for non-Unix environments or
17 * specialized applications. As they stand, they assume output to
18 * an ordinary stdio stream.
19 */
20
21/*
22 * This code is loosely based on ppmtogif from the PBMPLUS distribution
23 * of Feb. 1991. That file contains the following copyright notice:
24 * Based on GIFENCODE by David Rowley <mgardi@watdscu.waterloo.edu>.
25 * Lempel-Ziv compression based on "compress" by Spencer W. Thomas et al.
26 * Copyright (C) 1989 by Jef Poskanzer.
27 * Permission to use, copy, modify, and distribute this software and its
28 * documentation for any purpose and without fee is hereby granted, provided
29 * that the above copyright notice appear in all copies and that both that
30 * copyright notice and this permission notice appear in supporting
31 * documentation. This software is provided "as is" without express or
32 * implied warranty.
33 *
34 * We are also required to state that
35 * "The Graphics Interchange Format(c) is the Copyright property of
36 * CompuServe Incorporated. GIF(sm) is a Service Mark property of
37 * CompuServe Incorporated."
38 */
39
40#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
41
42#ifdef GIF_SUPPORTED
43
44
45/* Private version of data destination object */
46
47typedef struct {
48 struct djpeg_dest_struct pub; /* public fields */
49
50 j_decompress_ptr cinfo; /* back link saves passing separate parm */
51
52 /* State for packing variable-width codes into a bitstream */
53 int n_bits; /* current number of bits/code */
54 int maxcode; /* maximum code, given n_bits */
55 INT32 cur_accum; /* holds bits not yet output */
56 int cur_bits; /* # of bits in cur_accum */
57
58 /* State for GIF code assignment */
59 int ClearCode; /* clear code (doesn't change) */
60 int EOFCode; /* EOF code (ditto) */
61 int code_counter; /* counts output symbols */
62
63 /* GIF data packet construction buffer */
64 int bytesinpkt; /* # of bytes in current packet */
65 char packetbuf[256]; /* workspace for accumulating packet */
66
67} gif_dest_struct;
68
69typedef gif_dest_struct * gif_dest_ptr;
70
71/* Largest value that will fit in N bits */
72#define MAXCODE(n_bits) ((1 << (n_bits)) - 1)
73
74
75/*
76 * Routines to package finished data bytes into GIF data blocks.
77 * A data block consists of a count byte (1..255) and that many data bytes.
78 */
79
80LOCAL(void)
81flush_packet (gif_dest_ptr dinfo)
82/* flush any accumulated data */
83{
84 if (dinfo->bytesinpkt > 0) { /* never write zero-length packet */
85 dinfo->packetbuf[0] = (char) dinfo->bytesinpkt++;
86 if (JFWRITE(dinfo->pub.output_file, dinfo->packetbuf, dinfo->bytesinpkt)
87 != (size_t) dinfo->bytesinpkt)
88 ERREXIT(dinfo->cinfo, JERR_FILE_WRITE);
89 dinfo->bytesinpkt = 0;
90 }
91}
92
93
94/* Add a character to current packet; flush to disk if necessary */
95#define CHAR_OUT(dinfo,c) \
96 { (dinfo)->packetbuf[++(dinfo)->bytesinpkt] = (char) (c); \
97 if ((dinfo)->bytesinpkt >= 255) \
98 flush_packet(dinfo); \
99 }
100
101
102/* Routine to convert variable-width codes into a byte stream */
103
104LOCAL(void)
105output (gif_dest_ptr dinfo, int code)
106/* Emit a code of n_bits bits */
107/* Uses cur_accum and cur_bits to reblock into 8-bit bytes */
108{
109 dinfo->cur_accum |= ((INT32) code) << dinfo->cur_bits;
110 dinfo->cur_bits += dinfo->n_bits;
111
112 while (dinfo->cur_bits >= 8) {
113 CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);
114 dinfo->cur_accum >>= 8;
115 dinfo->cur_bits -= 8;
116 }
117}
118
119
120/* The pseudo-compression algorithm.
121 *
122 * In this module we simply output each pixel value as a separate symbol;
123 * thus, no compression occurs. In fact, there is expansion of one bit per
124 * pixel, because we use a symbol width one bit wider than the pixel width.
125 *
126 * GIF ordinarily uses variable-width symbols, and the decoder will expect
127 * to ratchet up the symbol width after a fixed number of symbols.
128 * To simplify the logic and keep the expansion penalty down, we emit a
129 * GIF Clear code to reset the decoder just before the width would ratchet up.
130 * Thus, all the symbols in the output file will have the same bit width.
131 * Note that emitting the Clear codes at the right times is a mere matter of
132 * counting output symbols and is in no way dependent on the LZW patent.
133 *
134 * With a small basic pixel width (low color count), Clear codes will be
135 * needed very frequently, causing the file to expand even more. So this
136 * simplistic approach wouldn't work too well on bilevel images, for example.
137 * But for output of JPEG conversions the pixel width will usually be 8 bits
138 * (129 to 256 colors), so the overhead added by Clear symbols is only about
139 * one symbol in every 256.
140 */
141
142LOCAL(void)
143compress_init (gif_dest_ptr dinfo, int i_bits)
144/* Initialize pseudo-compressor */
145{
146 /* init all the state variables */
147 dinfo->n_bits = i_bits;
148 dinfo->maxcode = MAXCODE(dinfo->n_bits);
149 dinfo->ClearCode = (1 << (i_bits - 1));
150 dinfo->EOFCode = dinfo->ClearCode + 1;
151 dinfo->code_counter = dinfo->ClearCode + 2;
152 /* init output buffering vars */
153 dinfo->bytesinpkt = 0;
154 dinfo->cur_accum = 0;
155 dinfo->cur_bits = 0;
156 /* GIF specifies an initial Clear code */
157 output(dinfo, dinfo->ClearCode);
158}
159
160
161LOCAL(void)
162compress_pixel (gif_dest_ptr dinfo, int c)
163/* Accept and "compress" one pixel value.
164 * The given value must be less than n_bits wide.
165 */
166{
167 /* Output the given pixel value as a symbol. */
168 output(dinfo, c);
169 /* Issue Clear codes often enough to keep the reader from ratcheting up
170 * its symbol size.
171 */
172 if (dinfo->code_counter < dinfo->maxcode) {
173 dinfo->code_counter++;
174 } else {
175 output(dinfo, dinfo->ClearCode);
176 dinfo->code_counter = dinfo->ClearCode + 2; /* reset the counter */
177 }
178}
179
180
181LOCAL(void)
182compress_term (gif_dest_ptr dinfo)
183/* Clean up at end */
184{
185 /* Send an EOF code */
186 output(dinfo, dinfo->EOFCode);
187 /* Flush the bit-packing buffer */
188 if (dinfo->cur_bits > 0) {
189 CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);
190 }
191 /* Flush the packet buffer */
192 flush_packet(dinfo);
193}
194
195
196/* GIF header construction */
197
198
199LOCAL(void)
200put_word (gif_dest_ptr dinfo, unsigned int w)
201/* Emit a 16-bit word, LSB first */
202{
203 putc(w & 0xFF, dinfo->pub.output_file);
204 putc((w >> 8) & 0xFF, dinfo->pub.output_file);
205}
206
207
208LOCAL(void)
209put_3bytes (gif_dest_ptr dinfo, int val)
210/* Emit 3 copies of same byte value --- handy subr for colormap construction */
211{
212 putc(val, dinfo->pub.output_file);
213 putc(val, dinfo->pub.output_file);
214 putc(val, dinfo->pub.output_file);
215}
216
217
218LOCAL(void)
219emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap)
220/* Output the GIF file header, including color map */
221/* If colormap==NULL, synthesize a gray-scale colormap */
222{
223 int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte;
224 int cshift = dinfo->cinfo->data_precision - 8;
225 int i;
226
227 if (num_colors > 256)
228 ERREXIT1(dinfo->cinfo, JERR_TOO_MANY_COLORS, num_colors);
229 /* Compute bits/pixel and related values */
230 BitsPerPixel = 1;
231 while (num_colors > (1 << BitsPerPixel))
232 BitsPerPixel++;
233 ColorMapSize = 1 << BitsPerPixel;
234 if (BitsPerPixel <= 1)
235 InitCodeSize = 2;
236 else
237 InitCodeSize = BitsPerPixel;
238 /*
239 * Write the GIF header.
240 * Note that we generate a plain GIF87 header for maximum compatibility.
241 */
242 putc('G', dinfo->pub.output_file);
243 putc('I', dinfo->pub.output_file);
244 putc('F', dinfo->pub.output_file);
245 putc('8', dinfo->pub.output_file);
246 putc('7', dinfo->pub.output_file);
247 putc('a', dinfo->pub.output_file);
248 /* Write the Logical Screen Descriptor */
249 put_word(dinfo, (unsigned int) dinfo->cinfo->output_width);
250 put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);
251 FlagByte = 0x80; /* Yes, there is a global color table */
252 FlagByte |= (BitsPerPixel-1) << 4; /* color resolution */
253 FlagByte |= (BitsPerPixel-1); /* size of global color table */
254 putc(FlagByte, dinfo->pub.output_file);
255 putc(0, dinfo->pub.output_file); /* Background color index */
256 putc(0, dinfo->pub.output_file); /* Reserved (aspect ratio in GIF89) */
257 /* Write the Global Color Map */
258 /* If the color map is more than 8 bits precision, */
259 /* we reduce it to 8 bits by shifting */
260 for (i=0; i < ColorMapSize; i++) {
261 if (i < num_colors) {
262 if (colormap != NULL) {
263 if (dinfo->cinfo->out_color_space == JCS_RGB) {
264 /* Normal case: RGB color map */
265 putc(GETJSAMPLE(colormap[0][i]) >> cshift, dinfo->pub.output_file);
266 putc(GETJSAMPLE(colormap[1][i]) >> cshift, dinfo->pub.output_file);
267 putc(GETJSAMPLE(colormap[2][i]) >> cshift, dinfo->pub.output_file);
268 } else {
269 /* Grayscale "color map": possible if quantizing grayscale image */
270 put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift);
271 }
272 } else {
273 /* Create a gray-scale map of num_colors values, range 0..255 */
274 put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1));
275 }
276 } else {
277 /* fill out the map to a power of 2 */
278 put_3bytes(dinfo, 0);
279 }
280 }
281 /* Write image separator and Image Descriptor */
282 putc(',', dinfo->pub.output_file); /* separator */
283 put_word(dinfo, 0); /* left/top offset */
284 put_word(dinfo, 0);
285 put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); /* image size */
286 put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);
287 /* flag byte: not interlaced, no local color map */
288 putc(0x00, dinfo->pub.output_file);
289 /* Write Initial Code Size byte */
290 putc(InitCodeSize, dinfo->pub.output_file);
291
292 /* Initialize for "compression" of image data */
293 compress_init(dinfo, InitCodeSize+1);
294}
295
296
297/*
298 * Startup: write the file header.
299 */
300
301METHODDEF(void)
302start_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
303{
304 gif_dest_ptr dest = (gif_dest_ptr) dinfo;
305
306 if (cinfo->quantize_colors)
307 emit_header(dest, cinfo->actual_number_of_colors, cinfo->colormap);
308 else
309 emit_header(dest, 256, (JSAMPARRAY) NULL);
310}
311
312
313/*
314 * Write some pixel data.
315 * In this module rows_supplied will always be 1.
316 */
317
318METHODDEF(void)
319put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
320 JDIMENSION rows_supplied)
321{
322 gif_dest_ptr dest = (gif_dest_ptr) dinfo;
323 register JSAMPROW ptr;
324 register JDIMENSION col;
325
326 ptr = dest->pub.buffer[0];
327 for (col = cinfo->output_width; col > 0; col--) {
328 compress_pixel(dest, GETJSAMPLE(*ptr++));
329 }
330}
331
332
333/*
334 * Finish up at the end of the file.
335 */
336
337METHODDEF(void)
338finish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
339{
340 gif_dest_ptr dest = (gif_dest_ptr) dinfo;
341
342 /* Flush "compression" mechanism */
343 compress_term(dest);
344 /* Write a zero-length data block to end the series */
345 putc(0, dest->pub.output_file);
346 /* Write the GIF terminator mark */
347 putc(';', dest->pub.output_file);
348 /* Make sure we wrote the output file OK */
349 fflush(dest->pub.output_file);
350 if (ferror(dest->pub.output_file))
351 ERREXIT(cinfo, JERR_FILE_WRITE);
352}
353
354
355/*
356 * The module selection routine for GIF format output.
357 */
358
359GLOBAL(djpeg_dest_ptr)
360jinit_write_gif (j_decompress_ptr cinfo)
361{
362 gif_dest_ptr dest;
363
364 /* Create module interface object, fill in method pointers */
365 dest = (gif_dest_ptr)
366 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
367 SIZEOF(gif_dest_struct));
368 dest->cinfo = cinfo; /* make back link for subroutines */
369 dest->pub.start_output = start_output_gif;
370 dest->pub.put_pixel_rows = put_pixel_rows;
371 dest->pub.finish_output = finish_output_gif;
372
373 if (cinfo->out_color_space != JCS_GRAYSCALE &&
374 cinfo->out_color_space != JCS_RGB)
375 ERREXIT(cinfo, JERR_GIF_COLORSPACE);
376
377 /* Force quantization if color or if > 8 bits input */
378 if (cinfo->out_color_space != JCS_GRAYSCALE || cinfo->data_precision > 8) {
379 /* Force quantization to at most 256 colors */
380 cinfo->quantize_colors = TRUE;
381 if (cinfo->desired_number_of_colors > 256)
382 cinfo->desired_number_of_colors = 256;
383 }
384
385 /* Calculate output image dimensions so we can allocate space */
386 jpeg_calc_output_dimensions(cinfo);
387
388 if (cinfo->output_components != 1) /* safety check: just one component? */
389 ERREXIT(cinfo, JERR_GIF_BUG);
390
391 /* Create decompressor output buffer. */
392 dest->pub.buffer = (*cinfo->mem->alloc_sarray)
393 ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1);
394 dest->pub.buffer_height = 1;
395
396 return (djpeg_dest_ptr) dest;
397}
398
399#endif /* GIF_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.1 b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.1
new file mode 100644
index 0000000..44dad35
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.1
@@ -0,0 +1,103 @@
1.TH WRJPGCOM 1 "15 June 1995"
2.SH NAME
3wrjpgcom \- insert text comments into a JPEG file
4.SH SYNOPSIS
5.B wrjpgcom
6[
7.B \-replace
8]
9[
10.BI \-comment " text"
11]
12[
13.BI \-cfile " name"
14]
15[
16.I filename
17]
18.LP
19.SH DESCRIPTION
20.LP
21.B wrjpgcom
22reads the named JPEG/JFIF file, or the standard input if no file is named,
23and generates a new JPEG/JFIF file on standard output. A comment block is
24added to the file.
25.PP
26The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file.
27Although the standard doesn't actually define what COM blocks are for, they
28are widely used to hold user-supplied text strings. This lets you add
29annotations, titles, index terms, etc to your JPEG files, and later retrieve
30them as text. COM blocks do not interfere with the image stored in the JPEG
31file. The maximum size of a COM block is 64K, but you can have as many of
32them as you like in one JPEG file.
33.PP
34.B wrjpgcom
35adds a COM block, containing text you provide, to a JPEG file.
36Ordinarily, the COM block is added after any existing COM blocks; but you
37can delete the old COM blocks if you wish.
38.SH OPTIONS
39Switch names may be abbreviated, and are not case sensitive.
40.TP
41.B \-replace
42Delete any existing COM blocks from the file.
43.TP
44.BI \-comment " text"
45Supply text for new COM block on command line.
46.TP
47.BI \-cfile " name"
48Read text for new COM block from named file.
49.PP
50If you have only one line of comment text to add, you can provide it on the
51command line with
52.BR \-comment .
53The comment text must be surrounded with quotes so that it is treated as a
54single argument. Longer comments can be read from a text file.
55.PP
56If you give neither
57.B \-comment
58nor
59.BR \-cfile ,
60then
61.B wrjpgcom
62will read the comment text from standard input. (In this case an input image
63file name MUST be supplied, so that the source JPEG file comes from somewhere
64else.) You can enter multiple lines, up to 64KB worth. Type an end-of-file
65indicator (usually control-D) to terminate the comment text entry.
66.PP
67.B wrjpgcom
68will not add a COM block if the provided comment string is empty. Therefore
69\fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file.
70.SH EXAMPLES
71.LP
72Add a short comment to in.jpg, producing out.jpg:
73.IP
74.B wrjpgcom \-c
75\fI"View of my back yard" in.jpg
76.B >
77.I out.jpg
78.PP
79Attach a long comment previously stored in comment.txt:
80.IP
81.B wrjpgcom
82.I in.jpg
83.B <
84.I comment.txt
85.B >
86.I out.jpg
87.PP
88or equivalently
89.IP
90.B wrjpgcom
91.B -cfile
92.I comment.txt
93.B <
94.I in.jpg
95.B >
96.I out.jpg
97.SH SEE ALSO
98.BR cjpeg (1),
99.BR djpeg (1),
100.BR jpegtran (1),
101.BR rdjpgcom (1)
102.SH AUTHOR
103Independent JPEG Group
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.c
new file mode 100644
index 0000000..7d10ee6
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrjpgcom.c
@@ -0,0 +1,583 @@
1/*
2 * wrjpgcom.c
3 *
4 * Copyright (C) 1994-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains a very simple stand-alone application that inserts
9 * user-supplied text as a COM (comment) marker in a JFIF file.
10 * This may be useful as an example of the minimum logic needed to parse
11 * JPEG markers.
12 */
13
14#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */
15#include "jinclude.h" /* get auto-config symbols, <stdio.h> */
16
17#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc() */
18extern void * malloc ();
19#endif
20#include <ctype.h> /* to declare isupper(), tolower() */
21#ifdef USE_SETMODE
22#include <fcntl.h> /* to declare setmode()'s parameter macros */
23/* If you have setmode() but not <io.h>, just delete this line: */
24#include <io.h> /* to declare setmode() */
25#endif
26
27#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
28#ifdef __MWERKS__
29#include <SIOUX.h> /* Metrowerks needs this */
30#include <console.h> /* ... and this */
31#endif
32#ifdef THINK_C
33#include <console.h> /* Think declares it here */
34#endif
35#endif
36
37#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
38#define READ_BINARY "r"
39#define WRITE_BINARY "w"
40#else
41#ifdef VMS /* VMS is very nonstandard */
42#define READ_BINARY "rb", "ctx=stm"
43#define WRITE_BINARY "wb", "ctx=stm"
44#else /* standard ANSI-compliant case */
45#define READ_BINARY "rb"
46#define WRITE_BINARY "wb"
47#endif
48#endif
49
50#ifndef EXIT_FAILURE /* define exit() codes if not provided */
51#define EXIT_FAILURE 1
52#endif
53#ifndef EXIT_SUCCESS
54#ifdef VMS
55#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
56#else
57#define EXIT_SUCCESS 0
58#endif
59#endif
60
61/* Reduce this value if your malloc() can't allocate blocks up to 64K.
62 * On DOS, compiling in large model is usually a better solution.
63 */
64
65#ifndef MAX_COM_LENGTH
66#define MAX_COM_LENGTH 65000L /* must be <= 65533 in any case */
67#endif
68
69
70/*
71 * These macros are used to read the input file and write the output file.
72 * To reuse this code in another application, you might need to change these.
73 */
74
75static FILE * infile; /* input JPEG file */
76
77/* Return next input byte, or EOF if no more */
78#define NEXTBYTE() getc(infile)
79
80static FILE * outfile; /* output JPEG file */
81
82/* Emit an output byte */
83#define PUTBYTE(x) putc((x), outfile)
84
85
86/* Error exit handler */
87#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE))
88
89
90/* Read one byte, testing for EOF */
91static int
92read_1_byte (void)
93{
94 int c;
95
96 c = NEXTBYTE();
97 if (c == EOF)
98 ERREXIT("Premature EOF in JPEG file");
99 return c;
100}
101
102/* Read 2 bytes, convert to unsigned int */
103/* All 2-byte quantities in JPEG markers are MSB first */
104static unsigned int
105read_2_bytes (void)
106{
107 int c1, c2;
108
109 c1 = NEXTBYTE();
110 if (c1 == EOF)
111 ERREXIT("Premature EOF in JPEG file");
112 c2 = NEXTBYTE();
113 if (c2 == EOF)
114 ERREXIT("Premature EOF in JPEG file");
115 return (((unsigned int) c1) << 8) + ((unsigned int) c2);
116}
117
118
119/* Routines to write data to output file */
120
121static void
122write_1_byte (int c)
123{
124 PUTBYTE(c);
125}
126
127static void
128write_2_bytes (unsigned int val)
129{
130 PUTBYTE((val >> 8) & 0xFF);
131 PUTBYTE(val & 0xFF);
132}
133
134static void
135write_marker (int marker)
136{
137 PUTBYTE(0xFF);
138 PUTBYTE(marker);
139}
140
141static void
142copy_rest_of_file (void)
143{
144 int c;
145
146 while ((c = NEXTBYTE()) != EOF)
147 PUTBYTE(c);
148}
149
150
151/*
152 * JPEG markers consist of one or more 0xFF bytes, followed by a marker
153 * code byte (which is not an FF). Here are the marker codes of interest
154 * in this program. (See jdmarker.c for a more complete list.)
155 */
156
157#define M_SOF0 0xC0 /* Start Of Frame N */
158#define M_SOF1 0xC1 /* N indicates which compression process */
159#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */
160#define M_SOF3 0xC3
161#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */
162#define M_SOF6 0xC6
163#define M_SOF7 0xC7
164#define M_SOF9 0xC9
165#define M_SOF10 0xCA
166#define M_SOF11 0xCB
167#define M_SOF13 0xCD
168#define M_SOF14 0xCE
169#define M_SOF15 0xCF
170#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */
171#define M_EOI 0xD9 /* End Of Image (end of datastream) */
172#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */
173#define M_COM 0xFE /* COMment */
174
175
176/*
177 * Find the next JPEG marker and return its marker code.
178 * We expect at least one FF byte, possibly more if the compressor used FFs
179 * to pad the file. (Padding FFs will NOT be replicated in the output file.)
180 * There could also be non-FF garbage between markers. The treatment of such
181 * garbage is unspecified; we choose to skip over it but emit a warning msg.
182 * NB: this routine must not be used after seeing SOS marker, since it will
183 * not deal correctly with FF/00 sequences in the compressed image data...
184 */
185
186static int
187next_marker (void)
188{
189 int c;
190 int discarded_bytes = 0;
191
192 /* Find 0xFF byte; count and skip any non-FFs. */
193 c = read_1_byte();
194 while (c != 0xFF) {
195 discarded_bytes++;
196 c = read_1_byte();
197 }
198 /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs
199 * are legal as pad bytes, so don't count them in discarded_bytes.
200 */
201 do {
202 c = read_1_byte();
203 } while (c == 0xFF);
204
205 if (discarded_bytes != 0) {
206 fprintf(stderr, "Warning: garbage data found in JPEG file\n");
207 }
208
209 return c;
210}
211
212
213/*
214 * Read the initial marker, which should be SOI.
215 * For a JFIF file, the first two bytes of the file should be literally
216 * 0xFF M_SOI. To be more general, we could use next_marker, but if the
217 * input file weren't actually JPEG at all, next_marker might read the whole
218 * file and then return a misleading error message...
219 */
220
221static int
222first_marker (void)
223{
224 int c1, c2;
225
226 c1 = NEXTBYTE();
227 c2 = NEXTBYTE();
228 if (c1 != 0xFF || c2 != M_SOI)
229 ERREXIT("Not a JPEG file");
230 return c2;
231}
232
233
234/*
235 * Most types of marker are followed by a variable-length parameter segment.
236 * This routine skips over the parameters for any marker we don't otherwise
237 * want to process.
238 * Note that we MUST skip the parameter segment explicitly in order not to
239 * be fooled by 0xFF bytes that might appear within the parameter segment;
240 * such bytes do NOT introduce new markers.
241 */
242
243static void
244copy_variable (void)
245/* Copy an unknown or uninteresting variable-length marker */
246{
247 unsigned int length;
248
249 /* Get the marker parameter length count */
250 length = read_2_bytes();
251 write_2_bytes(length);
252 /* Length includes itself, so must be at least 2 */
253 if (length < 2)
254 ERREXIT("Erroneous JPEG marker length");
255 length -= 2;
256 /* Skip over the remaining bytes */
257 while (length > 0) {
258 write_1_byte(read_1_byte());
259 length--;
260 }
261}
262
263static void
264skip_variable (void)
265/* Skip over an unknown or uninteresting variable-length marker */
266{
267 unsigned int length;
268
269 /* Get the marker parameter length count */
270 length = read_2_bytes();
271 /* Length includes itself, so must be at least 2 */
272 if (length < 2)
273 ERREXIT("Erroneous JPEG marker length");
274 length -= 2;
275 /* Skip over the remaining bytes */
276 while (length > 0) {
277 (void) read_1_byte();
278 length--;
279 }
280}
281
282
283/*
284 * Parse the marker stream until SOFn or EOI is seen;
285 * copy data to output, but discard COM markers unless keep_COM is true.
286 */
287
288static int
289scan_JPEG_header (int keep_COM)
290{
291 int marker;
292
293 /* Expect SOI at start of file */
294 if (first_marker() != M_SOI)
295 ERREXIT("Expected SOI marker first");
296 write_marker(M_SOI);
297
298 /* Scan miscellaneous markers until we reach SOFn. */
299 for (;;) {
300 marker = next_marker();
301 switch (marker) {
302 /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,
303 * treated as SOFn. C4 in particular is actually DHT.
304 */
305 case M_SOF0: /* Baseline */
306 case M_SOF1: /* Extended sequential, Huffman */
307 case M_SOF2: /* Progressive, Huffman */
308 case M_SOF3: /* Lossless, Huffman */
309 case M_SOF5: /* Differential sequential, Huffman */
310 case M_SOF6: /* Differential progressive, Huffman */
311 case M_SOF7: /* Differential lossless, Huffman */
312 case M_SOF9: /* Extended sequential, arithmetic */
313 case M_SOF10: /* Progressive, arithmetic */
314 case M_SOF11: /* Lossless, arithmetic */
315 case M_SOF13: /* Differential sequential, arithmetic */
316 case M_SOF14: /* Differential progressive, arithmetic */
317 case M_SOF15: /* Differential lossless, arithmetic */
318 return marker;
319
320 case M_SOS: /* should not see compressed data before SOF */
321 ERREXIT("SOS without prior SOFn");
322 break;
323
324 case M_EOI: /* in case it's a tables-only JPEG stream */
325 return marker;
326
327 case M_COM: /* Existing COM: conditionally discard */
328 if (keep_COM) {
329 write_marker(marker);
330 copy_variable();
331 } else {
332 skip_variable();
333 }
334 break;
335
336 default: /* Anything else just gets copied */
337 write_marker(marker);
338 copy_variable(); /* we assume it has a parameter count... */
339 break;
340 }
341 } /* end loop */
342}
343
344
345/* Command line parsing code */
346
347static const char * progname; /* program name for error messages */
348
349
350static void
351usage (void)
352/* complain about bad command line */
353{
354 fprintf(stderr, "wrjpgcom inserts a textual comment in a JPEG file.\n");
355 fprintf(stderr, "You can add to or replace any existing comment(s).\n");
356
357 fprintf(stderr, "Usage: %s [switches] ", progname);
358#ifdef TWO_FILE_COMMANDLINE
359 fprintf(stderr, "inputfile outputfile\n");
360#else
361 fprintf(stderr, "[inputfile]\n");
362#endif
363
364 fprintf(stderr, "Switches (names may be abbreviated):\n");
365 fprintf(stderr, " -replace Delete any existing comments\n");
366 fprintf(stderr, " -comment \"text\" Insert comment with given text\n");
367 fprintf(stderr, " -cfile name Read comment from named file\n");
368 fprintf(stderr, "Notice that you must put quotes around the comment text\n");
369 fprintf(stderr, "when you use -comment.\n");
370 fprintf(stderr, "If you do not give either -comment or -cfile on the command line,\n");
371 fprintf(stderr, "then the comment text is read from standard input.\n");
372 fprintf(stderr, "It can be multiple lines, up to %u characters total.\n",
373 (unsigned int) MAX_COM_LENGTH);
374#ifndef TWO_FILE_COMMANDLINE
375 fprintf(stderr, "You must specify an input JPEG file name when supplying\n");
376 fprintf(stderr, "comment text from standard input.\n");
377#endif
378
379 exit(EXIT_FAILURE);
380}
381
382
383static int
384keymatch (char * arg, const char * keyword, int minchars)
385/* Case-insensitive matching of (possibly abbreviated) keyword switches. */
386/* keyword is the constant keyword (must be lower case already), */
387/* minchars is length of minimum legal abbreviation. */
388{
389 register int ca, ck;
390 register int nmatched = 0;
391
392 while ((ca = *arg++) != '\0') {
393 if ((ck = *keyword++) == '\0')
394 return 0; /* arg longer than keyword, no good */
395 if (isupper(ca)) /* force arg to lcase (assume ck is already) */
396 ca = tolower(ca);
397 if (ca != ck)
398 return 0; /* no good */
399 nmatched++; /* count matched characters */
400 }
401 /* reached end of argument; fail if it's too short for unique abbrev */
402 if (nmatched < minchars)
403 return 0;
404 return 1; /* A-OK */
405}
406
407
408/*
409 * The main program.
410 */
411
412int
413main (int argc, char **argv)
414{
415 int argn;
416 char * arg;
417 int keep_COM = 1;
418 char * comment_arg = NULL;
419 FILE * comment_file = NULL;
420 unsigned int comment_length = 0;
421 int marker;
422
423 /* On Mac, fetch a command line. */
424#ifdef USE_CCOMMAND
425 argc = ccommand(&argv);
426#endif
427
428 progname = argv[0];
429 if (progname == NULL || progname[0] == 0)
430 progname = "wrjpgcom"; /* in case C library doesn't provide it */
431
432 /* Parse switches, if any */
433 for (argn = 1; argn < argc; argn++) {
434 arg = argv[argn];
435 if (arg[0] != '-')
436 break; /* not switch, must be file name */
437 arg++; /* advance over '-' */
438 if (keymatch(arg, "replace", 1)) {
439 keep_COM = 0;
440 } else if (keymatch(arg, "cfile", 2)) {
441 if (++argn >= argc) usage();
442 if ((comment_file = fopen(argv[argn], "r")) == NULL) {
443 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
444 exit(EXIT_FAILURE);
445 }
446 } else if (keymatch(arg, "comment", 1)) {
447 if (++argn >= argc) usage();
448 comment_arg = argv[argn];
449 /* If the comment text starts with '"', then we are probably running
450 * under MS-DOG and must parse out the quoted string ourselves. Sigh.
451 */
452 if (comment_arg[0] == '"') {
453 comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);
454 if (comment_arg == NULL)
455 ERREXIT("Insufficient memory");
456 strcpy(comment_arg, argv[argn]+1);
457 for (;;) {
458 comment_length = (unsigned int) strlen(comment_arg);
459 if (comment_length > 0 && comment_arg[comment_length-1] == '"') {
460 comment_arg[comment_length-1] = '\0'; /* zap terminating quote */
461 break;
462 }
463 if (++argn >= argc)
464 ERREXIT("Missing ending quote mark");
465 strcat(comment_arg, " ");
466 strcat(comment_arg, argv[argn]);
467 }
468 }
469 comment_length = (unsigned int) strlen(comment_arg);
470 } else
471 usage();
472 }
473
474 /* Cannot use both -comment and -cfile. */
475 if (comment_arg != NULL && comment_file != NULL)
476 usage();
477 /* If there is neither -comment nor -cfile, we will read the comment text
478 * from stdin; in this case there MUST be an input JPEG file name.
479 */
480 if (comment_arg == NULL && comment_file == NULL && argn >= argc)
481 usage();
482
483 /* Open the input file. */
484 if (argn < argc) {
485 if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {
486 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
487 exit(EXIT_FAILURE);
488 }
489 } else {
490 /* default input file is stdin */
491#ifdef USE_SETMODE /* need to hack file mode? */
492 setmode(fileno(stdin), O_BINARY);
493#endif
494#ifdef USE_FDOPEN /* need to re-open in binary mode? */
495 if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
496 fprintf(stderr, "%s: can't open stdin\n", progname);
497 exit(EXIT_FAILURE);
498 }
499#else
500 infile = stdin;
501#endif
502 }
503
504 /* Open the output file. */
505#ifdef TWO_FILE_COMMANDLINE
506 /* Must have explicit output file name */
507 if (argn != argc-2) {
508 fprintf(stderr, "%s: must name one input and one output file\n",
509 progname);
510 usage();
511 }
512 if ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) {
513 fprintf(stderr, "%s: can't open %s\n", progname, argv[argn+1]);
514 exit(EXIT_FAILURE);
515 }
516#else
517 /* Unix style: expect zero or one file name */
518 if (argn < argc-1) {
519 fprintf(stderr, "%s: only one input file\n", progname);
520 usage();
521 }
522 /* default output file is stdout */
523#ifdef USE_SETMODE /* need to hack file mode? */
524 setmode(fileno(stdout), O_BINARY);
525#endif
526#ifdef USE_FDOPEN /* need to re-open in binary mode? */
527 if ((outfile = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
528 fprintf(stderr, "%s: can't open stdout\n", progname);
529 exit(EXIT_FAILURE);
530 }
531#else
532 outfile = stdout;
533#endif
534#endif /* TWO_FILE_COMMANDLINE */
535
536 /* Collect comment text from comment_file or stdin, if necessary */
537 if (comment_arg == NULL) {
538 FILE * src_file;
539 int c;
540
541 comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);
542 if (comment_arg == NULL)
543 ERREXIT("Insufficient memory");
544 comment_length = 0;
545 src_file = (comment_file != NULL ? comment_file : stdin);
546 while ((c = getc(src_file)) != EOF) {
547 if (comment_length >= (unsigned int) MAX_COM_LENGTH) {
548 fprintf(stderr, "Comment text may not exceed %u bytes\n",
549 (unsigned int) MAX_COM_LENGTH);
550 exit(EXIT_FAILURE);
551 }
552 comment_arg[comment_length++] = (char) c;
553 }
554 if (comment_file != NULL)
555 fclose(comment_file);
556 }
557
558 /* Copy JPEG headers until SOFn marker;
559 * we will insert the new comment marker just before SOFn.
560 * This (a) causes the new comment to appear after, rather than before,
561 * existing comments; and (b) ensures that comments come after any JFIF
562 * or JFXX markers, as required by the JFIF specification.
563 */
564 marker = scan_JPEG_header(keep_COM);
565 /* Insert the new COM marker, but only if nonempty text has been supplied */
566 if (comment_length > 0) {
567 write_marker(M_COM);
568 write_2_bytes(comment_length + 2);
569 while (comment_length > 0) {
570 write_1_byte(*comment_arg++);
571 comment_length--;
572 }
573 }
574 /* Duplicate the remainder of the source file.
575 * Note that any COM markers occuring after SOF will not be touched.
576 */
577 write_marker(marker);
578 copy_rest_of_file();
579
580 /* All done. */
581 exit(EXIT_SUCCESS);
582 return 0; /* suppress no-return-value warnings */
583}
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrppm.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrppm.c
new file mode 100644
index 0000000..1e56d9c
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrppm.c
@@ -0,0 +1,269 @@
1/*
2 * wrppm.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * Modified 2009 by Guido Vollbeding.
6 * This file is part of the Independent JPEG Group's software.
7 * For conditions of distribution and use, see the accompanying README file.
8 *
9 * This file contains routines to write output images in PPM/PGM format.
10 * The extended 2-byte-per-sample raw PPM/PGM formats are supported.
11 * The PBMPLUS library is NOT required to compile this software
12 * (but it is highly useful as a set of PPM image manipulation programs).
13 *
14 * These routines may need modification for non-Unix environments or
15 * specialized applications. As they stand, they assume output to
16 * an ordinary stdio stream.
17 */
18
19#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
20
21#ifdef PPM_SUPPORTED
22
23
24/*
25 * For 12-bit JPEG data, we either downscale the values to 8 bits
26 * (to write standard byte-per-sample PPM/PGM files), or output
27 * nonstandard word-per-sample PPM/PGM files. Downscaling is done
28 * if PPM_NORAWWORD is defined (this can be done in the Makefile
29 * or in jconfig.h).
30 * (When the core library supports data precision reduction, a cleaner
31 * implementation will be to ask for that instead.)
32 */
33
34#if BITS_IN_JSAMPLE == 8
35#define PUTPPMSAMPLE(ptr,v) *ptr++ = (char) (v)
36#define BYTESPERSAMPLE 1
37#define PPM_MAXVAL 255
38#else
39#ifdef PPM_NORAWWORD
40#define PUTPPMSAMPLE(ptr,v) *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8))
41#define BYTESPERSAMPLE 1
42#define PPM_MAXVAL 255
43#else
44/* The word-per-sample format always puts the MSB first. */
45#define PUTPPMSAMPLE(ptr,v) \
46 { register int val_ = v; \
47 *ptr++ = (char) ((val_ >> 8) & 0xFF); \
48 *ptr++ = (char) (val_ & 0xFF); \
49 }
50#define BYTESPERSAMPLE 2
51#define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)
52#endif
53#endif
54
55
56/*
57 * When JSAMPLE is the same size as char, we can just fwrite() the
58 * decompressed data to the PPM or PGM file. On PCs, in order to make this
59 * work the output buffer must be allocated in near data space, because we are
60 * assuming small-data memory model wherein fwrite() can't reach far memory.
61 * If you need to process very wide images on a PC, you might have to compile
62 * in large-memory model, or else replace fwrite() with a putc() loop ---
63 * which will be much slower.
64 */
65
66
67/* Private version of data destination object */
68
69typedef struct {
70 struct djpeg_dest_struct pub; /* public fields */
71
72 /* Usually these two pointers point to the same place: */
73 char *iobuffer; /* fwrite's I/O buffer */
74 JSAMPROW pixrow; /* decompressor output buffer */
75 size_t buffer_width; /* width of I/O buffer */
76 JDIMENSION samples_per_row; /* JSAMPLEs per output row */
77} ppm_dest_struct;
78
79typedef ppm_dest_struct * ppm_dest_ptr;
80
81
82/*
83 * Write some pixel data.
84 * In this module rows_supplied will always be 1.
85 *
86 * put_pixel_rows handles the "normal" 8-bit case where the decompressor
87 * output buffer is physically the same as the fwrite buffer.
88 */
89
90METHODDEF(void)
91put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
92 JDIMENSION rows_supplied)
93{
94 ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
95
96 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
97}
98
99
100/*
101 * This code is used when we have to copy the data and apply a pixel
102 * format translation. Typically this only happens in 12-bit mode.
103 */
104
105METHODDEF(void)
106copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
107 JDIMENSION rows_supplied)
108{
109 ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
110 register char * bufferptr;
111 register JSAMPROW ptr;
112 register JDIMENSION col;
113
114 ptr = dest->pub.buffer[0];
115 bufferptr = dest->iobuffer;
116 for (col = dest->samples_per_row; col > 0; col--) {
117 PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++));
118 }
119 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
120}
121
122
123/*
124 * Write some pixel data when color quantization is in effect.
125 * We have to demap the color index values to straight data.
126 */
127
128METHODDEF(void)
129put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
130 JDIMENSION rows_supplied)
131{
132 ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
133 register char * bufferptr;
134 register int pixval;
135 register JSAMPROW ptr;
136 register JSAMPROW color_map0 = cinfo->colormap[0];
137 register JSAMPROW color_map1 = cinfo->colormap[1];
138 register JSAMPROW color_map2 = cinfo->colormap[2];
139 register JDIMENSION col;
140
141 ptr = dest->pub.buffer[0];
142 bufferptr = dest->iobuffer;
143 for (col = cinfo->output_width; col > 0; col--) {
144 pixval = GETJSAMPLE(*ptr++);
145 PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[pixval]));
146 PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map1[pixval]));
147 PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map2[pixval]));
148 }
149 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
150}
151
152
153METHODDEF(void)
154put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
155 JDIMENSION rows_supplied)
156{
157 ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
158 register char * bufferptr;
159 register JSAMPROW ptr;
160 register JSAMPROW color_map = cinfo->colormap[0];
161 register JDIMENSION col;
162
163 ptr = dest->pub.buffer[0];
164 bufferptr = dest->iobuffer;
165 for (col = cinfo->output_width; col > 0; col--) {
166 PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map[GETJSAMPLE(*ptr++)]));
167 }
168 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
169}
170
171
172/*
173 * Startup: write the file header.
174 */
175
176METHODDEF(void)
177start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
178{
179 ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
180
181 /* Emit file header */
182 switch (cinfo->out_color_space) {
183 case JCS_GRAYSCALE:
184 /* emit header for raw PGM format */
185 fprintf(dest->pub.output_file, "P5\n%ld %ld\n%d\n",
186 (long) cinfo->output_width, (long) cinfo->output_height,
187 PPM_MAXVAL);
188 break;
189 case JCS_RGB:
190 /* emit header for raw PPM format */
191 fprintf(dest->pub.output_file, "P6\n%ld %ld\n%d\n",
192 (long) cinfo->output_width, (long) cinfo->output_height,
193 PPM_MAXVAL);
194 break;
195 default:
196 ERREXIT(cinfo, JERR_PPM_COLORSPACE);
197 }
198}
199
200
201/*
202 * Finish up at the end of the file.
203 */
204
205METHODDEF(void)
206finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
207{
208 /* Make sure we wrote the output file OK */
209 fflush(dinfo->output_file);
210 if (ferror(dinfo->output_file))
211 ERREXIT(cinfo, JERR_FILE_WRITE);
212}
213
214
215/*
216 * The module selection routine for PPM format output.
217 */
218
219GLOBAL(djpeg_dest_ptr)
220jinit_write_ppm (j_decompress_ptr cinfo)
221{
222 ppm_dest_ptr dest;
223
224 /* Create module interface object, fill in method pointers */
225 dest = (ppm_dest_ptr)
226 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
227 SIZEOF(ppm_dest_struct));
228 dest->pub.start_output = start_output_ppm;
229 dest->pub.finish_output = finish_output_ppm;
230
231 /* Calculate output image dimensions so we can allocate space */
232 jpeg_calc_output_dimensions(cinfo);
233
234 /* Create physical I/O buffer. Note we make this near on a PC. */
235 dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;
236 dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF(char));
237 dest->iobuffer = (char *) (*cinfo->mem->alloc_small)
238 ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width);
239
240 if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 ||
241 SIZEOF(JSAMPLE) != SIZEOF(char)) {
242 /* When quantizing, we need an output buffer for colormap indexes
243 * that's separate from the physical I/O buffer. We also need a
244 * separate buffer if pixel format translation must take place.
245 */
246 dest->pub.buffer = (*cinfo->mem->alloc_sarray)
247 ((j_common_ptr) cinfo, JPOOL_IMAGE,
248 cinfo->output_width * cinfo->output_components, (JDIMENSION) 1);
249 dest->pub.buffer_height = 1;
250 if (! cinfo->quantize_colors)
251 dest->pub.put_pixel_rows = copy_pixel_rows;
252 else if (cinfo->out_color_space == JCS_GRAYSCALE)
253 dest->pub.put_pixel_rows = put_demapped_gray;
254 else
255 dest->pub.put_pixel_rows = put_demapped_rgb;
256 } else {
257 /* We will fwrite() directly from decompressor output buffer. */
258 /* Synthesize a JSAMPARRAY pointer structure */
259 /* Cast here implies near->far pointer conversion on PCs */
260 dest->pixrow = (JSAMPROW) dest->iobuffer;
261 dest->pub.buffer = & dest->pixrow;
262 dest->pub.buffer_height = 1;
263 dest->pub.put_pixel_rows = put_pixel_rows;
264 }
265
266 return (djpeg_dest_ptr) dest;
267}
268
269#endif /* PPM_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrrle.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrrle.c
new file mode 100644
index 0000000..7a00c0d
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrrle.c
@@ -0,0 +1,305 @@
1/*
2 * wrrle.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to write output images in RLE format.
9 * The Utah Raster Toolkit library is required (version 3.1 or later).
10 *
11 * These routines may need modification for non-Unix environments or
12 * specialized applications. As they stand, they assume output to
13 * an ordinary stdio stream.
14 *
15 * Based on code contributed by Mike Lijewski,
16 * with updates from Robert Hutchinson.
17 */
18
19#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
20
21#ifdef RLE_SUPPORTED
22
23/* rle.h is provided by the Utah Raster Toolkit. */
24
25#include <rle.h>
26
27/*
28 * We assume that JSAMPLE has the same representation as rle_pixel,
29 * to wit, "unsigned char". Hence we can't cope with 12- or 16-bit samples.
30 */
31
32#if BITS_IN_JSAMPLE != 8
33 Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
34#endif
35
36
37/*
38 * Since RLE stores scanlines bottom-to-top, we have to invert the image
39 * from JPEG's top-to-bottom order. To do this, we save the outgoing data
40 * in a virtual array during put_pixel_row calls, then actually emit the
41 * RLE file during finish_output.
42 */
43
44
45/*
46 * For now, if we emit an RLE color map then it is always 256 entries long,
47 * though not all of the entries need be used.
48 */
49
50#define CMAPBITS 8
51#define CMAPLENGTH (1<<(CMAPBITS))
52
53typedef struct {
54 struct djpeg_dest_struct pub; /* public fields */
55
56 jvirt_sarray_ptr image; /* virtual array to store the output image */
57 rle_map *colormap; /* RLE-style color map, or NULL if none */
58 rle_pixel **rle_row; /* To pass rows to rle_putrow() */
59
60} rle_dest_struct;
61
62typedef rle_dest_struct * rle_dest_ptr;
63
64/* Forward declarations */
65METHODDEF(void) rle_put_pixel_rows
66 JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
67 JDIMENSION rows_supplied));
68
69
70/*
71 * Write the file header.
72 *
73 * In this module it's easier to wait till finish_output to write anything.
74 */
75
76METHODDEF(void)
77start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
78{
79 rle_dest_ptr dest = (rle_dest_ptr) dinfo;
80 size_t cmapsize;
81 int i, ci;
82#ifdef PROGRESS_REPORT
83 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
84#endif
85
86 /*
87 * Make sure the image can be stored in RLE format.
88 *
89 * - RLE stores image dimensions as *signed* 16 bit integers. JPEG
90 * uses unsigned, so we have to check the width.
91 *
92 * - Colorspace is expected to be grayscale or RGB.
93 *
94 * - The number of channels (components) is expected to be 1 (grayscale/
95 * pseudocolor) or 3 (truecolor/directcolor).
96 * (could be 2 or 4 if using an alpha channel, but we aren't)
97 */
98
99 if (cinfo->output_width > 32767 || cinfo->output_height > 32767)
100 ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width,
101 cinfo->output_height);
102
103 if (cinfo->out_color_space != JCS_GRAYSCALE &&
104 cinfo->out_color_space != JCS_RGB)
105 ERREXIT(cinfo, JERR_RLE_COLORSPACE);
106
107 if (cinfo->output_components != 1 && cinfo->output_components != 3)
108 ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components);
109
110 /* Convert colormap, if any, to RLE format. */
111
112 dest->colormap = NULL;
113
114 if (cinfo->quantize_colors) {
115 /* Allocate storage for RLE-style cmap, zero any extra entries */
116 cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map);
117 dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)
118 ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);
119 MEMZERO(dest->colormap, cmapsize);
120
121 /* Save away data in RLE format --- note 8-bit left shift! */
122 /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */
123 for (ci = 0; ci < cinfo->out_color_components; ci++) {
124 for (i = 0; i < cinfo->actual_number_of_colors; i++) {
125 dest->colormap[ci * CMAPLENGTH + i] =
126 GETJSAMPLE(cinfo->colormap[ci][i]) << 8;
127 }
128 }
129 }
130
131 /* Set the output buffer to the first row */
132 dest->pub.buffer = (*cinfo->mem->access_virt_sarray)
133 ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE);
134 dest->pub.buffer_height = 1;
135
136 dest->pub.put_pixel_rows = rle_put_pixel_rows;
137
138#ifdef PROGRESS_REPORT
139 if (progress != NULL) {
140 progress->total_extra_passes++; /* count file writing as separate pass */
141 }
142#endif
143}
144
145
146/*
147 * Write some pixel data.
148 *
149 * This routine just saves the data away in a virtual array.
150 */
151
152METHODDEF(void)
153rle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
154 JDIMENSION rows_supplied)
155{
156 rle_dest_ptr dest = (rle_dest_ptr) dinfo;
157
158 if (cinfo->output_scanline < cinfo->output_height) {
159 dest->pub.buffer = (*cinfo->mem->access_virt_sarray)
160 ((j_common_ptr) cinfo, dest->image,
161 cinfo->output_scanline, (JDIMENSION) 1, TRUE);
162 }
163}
164
165/*
166 * Finish up at the end of the file.
167 *
168 * Here is where we really output the RLE file.
169 */
170
171METHODDEF(void)
172finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
173{
174 rle_dest_ptr dest = (rle_dest_ptr) dinfo;
175 rle_hdr header; /* Output file information */
176 rle_pixel **rle_row, *red, *green, *blue;
177 JSAMPROW output_row;
178 char cmapcomment[80];
179 int row, col;
180 int ci;
181#ifdef PROGRESS_REPORT
182 cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
183#endif
184
185 /* Initialize the header info */
186 header = *rle_hdr_init(NULL);
187 header.rle_file = dest->pub.output_file;
188 header.xmin = 0;
189 header.xmax = cinfo->output_width - 1;
190 header.ymin = 0;
191 header.ymax = cinfo->output_height - 1;
192 header.alpha = 0;
193 header.ncolors = cinfo->output_components;
194 for (ci = 0; ci < cinfo->output_components; ci++) {
195 RLE_SET_BIT(header, ci);
196 }
197 if (cinfo->quantize_colors) {
198 header.ncmap = cinfo->out_color_components;
199 header.cmaplen = CMAPBITS;
200 header.cmap = dest->colormap;
201 /* Add a comment to the output image with the true colormap length. */
202 sprintf(cmapcomment, "color_map_length=%d", cinfo->actual_number_of_colors);
203 rle_putcom(cmapcomment, &header);
204 }
205
206 /* Emit the RLE header and color map (if any) */
207 rle_put_setup(&header);
208
209 /* Now output the RLE data from our virtual array.
210 * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
211 * and (b) we are not on a machine where FAR pointers differ from regular.
212 */
213
214#ifdef PROGRESS_REPORT
215 if (progress != NULL) {
216 progress->pub.pass_limit = cinfo->output_height;
217 progress->pub.pass_counter = 0;
218 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
219 }
220#endif
221
222 if (cinfo->output_components == 1) {
223 for (row = cinfo->output_height-1; row >= 0; row--) {
224 rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
225 ((j_common_ptr) cinfo, dest->image,
226 (JDIMENSION) row, (JDIMENSION) 1, FALSE);
227 rle_putrow(rle_row, (int) cinfo->output_width, &header);
228#ifdef PROGRESS_REPORT
229 if (progress != NULL) {
230 progress->pub.pass_counter++;
231 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
232 }
233#endif
234 }
235 } else {
236 for (row = cinfo->output_height-1; row >= 0; row--) {
237 rle_row = (rle_pixel **) dest->rle_row;
238 output_row = * (*cinfo->mem->access_virt_sarray)
239 ((j_common_ptr) cinfo, dest->image,
240 (JDIMENSION) row, (JDIMENSION) 1, FALSE);
241 red = rle_row[0];
242 green = rle_row[1];
243 blue = rle_row[2];
244 for (col = cinfo->output_width; col > 0; col--) {
245 *red++ = GETJSAMPLE(*output_row++);
246 *green++ = GETJSAMPLE(*output_row++);
247 *blue++ = GETJSAMPLE(*output_row++);
248 }
249 rle_putrow(rle_row, (int) cinfo->output_width, &header);
250#ifdef PROGRESS_REPORT
251 if (progress != NULL) {
252 progress->pub.pass_counter++;
253 (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
254 }
255#endif
256 }
257 }
258
259#ifdef PROGRESS_REPORT
260 if (progress != NULL)
261 progress->completed_extra_passes++;
262#endif
263
264 /* Emit file trailer */
265 rle_puteof(&header);
266 fflush(dest->pub.output_file);
267 if (ferror(dest->pub.output_file))
268 ERREXIT(cinfo, JERR_FILE_WRITE);
269}
270
271
272/*
273 * The module selection routine for RLE format output.
274 */
275
276GLOBAL(djpeg_dest_ptr)
277jinit_write_rle (j_decompress_ptr cinfo)
278{
279 rle_dest_ptr dest;
280
281 /* Create module interface object, fill in method pointers */
282 dest = (rle_dest_ptr)
283 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
284 SIZEOF(rle_dest_struct));
285 dest->pub.start_output = start_output_rle;
286 dest->pub.finish_output = finish_output_rle;
287
288 /* Calculate output image dimensions so we can allocate space */
289 jpeg_calc_output_dimensions(cinfo);
290
291 /* Allocate a work array for output to the RLE library. */
292 dest->rle_row = (*cinfo->mem->alloc_sarray)
293 ((j_common_ptr) cinfo, JPOOL_IMAGE,
294 cinfo->output_width, (JDIMENSION) cinfo->output_components);
295
296 /* Allocate a virtual array to hold the image. */
297 dest->image = (*cinfo->mem->request_virt_sarray)
298 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
299 (JDIMENSION) (cinfo->output_width * cinfo->output_components),
300 cinfo->output_height, (JDIMENSION) 1);
301
302 return (djpeg_dest_ptr) dest;
303}
304
305#endif /* RLE_SUPPORTED */
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrtarga.c b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrtarga.c
new file mode 100644
index 0000000..6566273
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/wrtarga.c
@@ -0,0 +1,253 @@
1/*
2 * wrtarga.c
3 *
4 * Copyright (C) 1991-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains routines to write output images in Targa format.
9 *
10 * These routines may need modification for non-Unix environments or
11 * specialized applications. As they stand, they assume output to
12 * an ordinary stdio stream.
13 *
14 * Based on code contributed by Lee Daniel Crocker.
15 */
16
17#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
18
19#ifdef TARGA_SUPPORTED
20
21
22/*
23 * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.
24 * This is not yet implemented.
25 */
26
27#if BITS_IN_JSAMPLE != 8
28 Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
29#endif
30
31/*
32 * The output buffer needs to be writable by fwrite(). On PCs, we must
33 * allocate the buffer in near data space, because we are assuming small-data
34 * memory model, wherein fwrite() can't reach far memory. If you need to
35 * process very wide images on a PC, you might have to compile in large-memory
36 * model, or else replace fwrite() with a putc() loop --- which will be much
37 * slower.
38 */
39
40
41/* Private version of data destination object */
42
43typedef struct {
44 struct djpeg_dest_struct pub; /* public fields */
45
46 char *iobuffer; /* physical I/O buffer */
47 JDIMENSION buffer_width; /* width of one row */
48} tga_dest_struct;
49
50typedef tga_dest_struct * tga_dest_ptr;
51
52
53LOCAL(void)
54write_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors)
55/* Create and write a Targa header */
56{
57 char targaheader[18];
58
59 /* Set unused fields of header to 0 */
60 MEMZERO(targaheader, SIZEOF(targaheader));
61
62 if (num_colors > 0) {
63 targaheader[1] = 1; /* color map type 1 */
64 targaheader[5] = (char) (num_colors & 0xFF);
65 targaheader[6] = (char) (num_colors >> 8);
66 targaheader[7] = 24; /* 24 bits per cmap entry */
67 }
68
69 targaheader[12] = (char) (cinfo->output_width & 0xFF);
70 targaheader[13] = (char) (cinfo->output_width >> 8);
71 targaheader[14] = (char) (cinfo->output_height & 0xFF);
72 targaheader[15] = (char) (cinfo->output_height >> 8);
73 targaheader[17] = 0x20; /* Top-down, non-interlaced */
74
75 if (cinfo->out_color_space == JCS_GRAYSCALE) {
76 targaheader[2] = 3; /* image type = uncompressed gray-scale */
77 targaheader[16] = 8; /* bits per pixel */
78 } else { /* must be RGB */
79 if (num_colors > 0) {
80 targaheader[2] = 1; /* image type = colormapped RGB */
81 targaheader[16] = 8;
82 } else {
83 targaheader[2] = 2; /* image type = uncompressed RGB */
84 targaheader[16] = 24;
85 }
86 }
87
88 if (JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18)
89 ERREXIT(cinfo, JERR_FILE_WRITE);
90}
91
92
93/*
94 * Write some pixel data.
95 * In this module rows_supplied will always be 1.
96 */
97
98METHODDEF(void)
99put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
100 JDIMENSION rows_supplied)
101/* used for unquantized full-color output */
102{
103 tga_dest_ptr dest = (tga_dest_ptr) dinfo;
104 register JSAMPROW inptr;
105 register char * outptr;
106 register JDIMENSION col;
107
108 inptr = dest->pub.buffer[0];
109 outptr = dest->iobuffer;
110 for (col = cinfo->output_width; col > 0; col--) {
111 outptr[0] = (char) GETJSAMPLE(inptr[2]); /* RGB to BGR order */
112 outptr[1] = (char) GETJSAMPLE(inptr[1]);
113 outptr[2] = (char) GETJSAMPLE(inptr[0]);
114 inptr += 3, outptr += 3;
115 }
116 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
117}
118
119METHODDEF(void)
120put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
121 JDIMENSION rows_supplied)
122/* used for grayscale OR quantized color output */
123{
124 tga_dest_ptr dest = (tga_dest_ptr) dinfo;
125 register JSAMPROW inptr;
126 register char * outptr;
127 register JDIMENSION col;
128
129 inptr = dest->pub.buffer[0];
130 outptr = dest->iobuffer;
131 for (col = cinfo->output_width; col > 0; col--) {
132 *outptr++ = (char) GETJSAMPLE(*inptr++);
133 }
134 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
135}
136
137
138/*
139 * Write some demapped pixel data when color quantization is in effect.
140 * For Targa, this is only applied to grayscale data.
141 */
142
143METHODDEF(void)
144put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
145 JDIMENSION rows_supplied)
146{
147 tga_dest_ptr dest = (tga_dest_ptr) dinfo;
148 register JSAMPROW inptr;
149 register char * outptr;
150 register JSAMPROW color_map0 = cinfo->colormap[0];
151 register JDIMENSION col;
152
153 inptr = dest->pub.buffer[0];
154 outptr = dest->iobuffer;
155 for (col = cinfo->output_width; col > 0; col--) {
156 *outptr++ = (char) GETJSAMPLE(color_map0[GETJSAMPLE(*inptr++)]);
157 }
158 (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
159}
160
161
162/*
163 * Startup: write the file header.
164 */
165
166METHODDEF(void)
167start_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
168{
169 tga_dest_ptr dest = (tga_dest_ptr) dinfo;
170 int num_colors, i;
171 FILE *outfile;
172
173 if (cinfo->out_color_space == JCS_GRAYSCALE) {
174 /* Targa doesn't have a mapped grayscale format, so we will */
175 /* demap quantized gray output. Never emit a colormap. */
176 write_header(cinfo, dinfo, 0);
177 if (cinfo->quantize_colors)
178 dest->pub.put_pixel_rows = put_demapped_gray;
179 else
180 dest->pub.put_pixel_rows = put_gray_rows;
181 } else if (cinfo->out_color_space == JCS_RGB) {
182 if (cinfo->quantize_colors) {
183 /* We only support 8-bit colormap indexes, so only 256 colors */
184 num_colors = cinfo->actual_number_of_colors;
185 if (num_colors > 256)
186 ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors);
187 write_header(cinfo, dinfo, num_colors);
188 /* Write the colormap. Note Targa uses BGR byte order */
189 outfile = dest->pub.output_file;
190 for (i = 0; i < num_colors; i++) {
191 putc(GETJSAMPLE(cinfo->colormap[2][i]), outfile);
192 putc(GETJSAMPLE(cinfo->colormap[1][i]), outfile);
193 putc(GETJSAMPLE(cinfo->colormap[0][i]), outfile);
194 }
195 dest->pub.put_pixel_rows = put_gray_rows;
196 } else {
197 write_header(cinfo, dinfo, 0);
198 dest->pub.put_pixel_rows = put_pixel_rows;
199 }
200 } else {
201 ERREXIT(cinfo, JERR_TGA_COLORSPACE);
202 }
203}
204
205
206/*
207 * Finish up at the end of the file.
208 */
209
210METHODDEF(void)
211finish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
212{
213 /* Make sure we wrote the output file OK */
214 fflush(dinfo->output_file);
215 if (ferror(dinfo->output_file))
216 ERREXIT(cinfo, JERR_FILE_WRITE);
217}
218
219
220/*
221 * The module selection routine for Targa format output.
222 */
223
224GLOBAL(djpeg_dest_ptr)
225jinit_write_targa (j_decompress_ptr cinfo)
226{
227 tga_dest_ptr dest;
228
229 /* Create module interface object, fill in method pointers */
230 dest = (tga_dest_ptr)
231 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
232 SIZEOF(tga_dest_struct));
233 dest->pub.start_output = start_output_tga;
234 dest->pub.finish_output = finish_output_tga;
235
236 /* Calculate output image dimensions so we can allocate space */
237 jpeg_calc_output_dimensions(cinfo);
238
239 /* Create I/O buffer. Note we make this near on a PC. */
240 dest->buffer_width = cinfo->output_width * cinfo->output_components;
241 dest->iobuffer = (char *)
242 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
243 (size_t) (dest->buffer_width * SIZEOF(char)));
244
245 /* Create decompressor output buffer. */
246 dest->pub.buffer = (*cinfo->mem->alloc_sarray)
247 ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1);
248 dest->pub.buffer_height = 1;
249
250 return (djpeg_dest_ptr) dest;
251}
252
253#endif /* TARGA_SUPPORTED */