blob: 838c6262a6cd949255cd919439bfc97251290e49 [file] [log] [blame]
DRC1bf1a142010-02-11 06:39:32 +00001lib_LTLIBRARIES = libjpeg.la libturbojpeg.la
DRC1f80a102010-10-18 00:15:31 +00002libjpeg_la_LDFLAGS = -version-info ${SO_MAJOR_VERSION}:${SO_MINOR_VERSION} -no-undefined
DRCfd407772012-03-23 03:24:39 +00003libturbojpeg_la_LDFLAGS = -version-info 0:0 -no-undefined
DRC0a945a12010-02-15 11:04:51 +00004include_HEADERS = jerror.h jmorecfg.h jpeglib.h turbojpeg.h
5nodist_include_HEADERS = jconfig.h
DRC0c0f3042010-01-28 05:34:53 +00006
Adam Tkacda5a1fe2008-10-22 11:19:25 +00007HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
DRC1f80a102010-10-18 00:15:31 +00008 jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +00009
DRCe3720042010-11-23 06:50:14 +000010libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
11 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
12 jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
13 jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
14 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
15 jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
16 jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
17 jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
18
19if WITH_ARITH
20
21libjpeg_la_SOURCES += jaricom.c
22
23endif
24
25if WITH_ARITH_ENC
26
27libjpeg_la_SOURCES += jcarith.c
28
29endif
30
31if WITH_ARITH_DEC
32
33libjpeg_la_SOURCES += jdarith.c
34
35endif
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000036
DRC418dbdf2011-05-26 10:45:06 +000037libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpeg.c turbojpeg.h \
DRC9b28def2011-05-21 14:37:15 +000038 transupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c
DRCf8e00552011-02-04 11:06:36 +000039
DRCdffd53d2011-04-01 00:37:20 +000040SUBDIRS = java
41
DRCf2602ce2011-04-01 00:20:33 +000042if WITH_JAVA
DRCf8e00552011-02-04 11:06:36 +000043
44libturbojpeg_la_SOURCES += turbojpeg-jni.c
DRCe08c05f2011-03-31 08:03:26 +000045libturbojpeg_la_CFLAGS = ${JNI_CFLAGS}
DRCf8e00552011-02-04 11:06:36 +000046TJMAPFILE = turbojpeg-mapfile.jni
47
48else
49
50TJMAPFILE = turbojpeg-mapfile
51
52endif
53
54libturbojpeg_la_SOURCES += $(TJMAPFILE)
DRC6f8c6682010-02-16 05:03:51 +000055
56if VERSION_SCRIPT
57
DRC9fa95592011-02-25 00:23:44 +000058libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)
DRC8515d3d2010-10-19 06:38:57 +000059libjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map
DRC6f8c6682010-02-16 05:03:51 +000060
61endif
DRC1bf1a142010-02-11 06:39:32 +000062
DRC60cddeb2010-02-12 05:37:07 +000063if WITH_SIMD
64
DRCf2602ce2011-04-01 00:20:33 +000065SUBDIRS += simd
Pierre Ossman3a65ef42009-03-16 13:34:18 +000066libjpeg_la_LIBADD = simd/libsimd.la
DRC1bf1a142010-02-11 06:39:32 +000067libturbojpeg_la_LIBADD = simd/libsimd.la
Pierre Ossman2ae181c2009-03-09 13:21:27 +000068
DRC60cddeb2010-02-12 05:37:07 +000069else
70
71libjpeg_la_SOURCES += jsimd_none.c
72
73endif
74
DRC3185cb92011-05-25 03:52:22 +000075bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom tjbench
DRCb76c8402011-12-19 15:01:55 +000076noinst_PROGRAMS = tjunittest jcstest
DRC2e7b76b2009-04-03 12:04:24 +000077
DRC3185cb92011-05-25 03:52:22 +000078tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \
DRC18821f82011-05-24 17:07:51 +000079 wrbmp.c wrppm.c
DRC2e7b76b2009-04-03 12:04:24 +000080
DRC3185cb92011-05-25 03:52:22 +000081tjbench_LDADD = libturbojpeg.la libjpeg.la -lm
DRC2e7b76b2009-04-03 12:04:24 +000082
DRC3185cb92011-05-25 03:52:22 +000083tjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED
DRCbe49b8c2011-05-24 13:41:27 +000084
DRC3185cb92011-05-25 03:52:22 +000085tjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c
DRC2e7b76b2009-04-03 12:04:24 +000086
DRC3185cb92011-05-25 03:52:22 +000087tjunittest_LDADD = libturbojpeg.la
DRC73de9822009-06-25 20:41:17 +000088
89cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
90 rdppm.c rdswitch.c rdtarga.c
91
DRC971d8512010-02-13 22:55:05 +000092cjpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000093
94cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
95 -DTARGA_SUPPORTED
96
97djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
98 wrbmp.c wrgif.c wrppm.c wrtarga.c
99
DRC971d8512010-02-13 22:55:05 +0000100djpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +0000101
102djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
103 -DTARGA_SUPPORTED
DRC60fa0602010-02-12 06:01:49 +0000104
DRC0a945a12010-02-15 11:04:51 +0000105jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
DRC60fa0602010-02-12 06:01:49 +0000106
DRC971d8512010-02-13 22:55:05 +0000107jpegtran_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000108
DRC0a945a12010-02-15 11:04:51 +0000109rdjpgcom_SOURCES = rdjpgcom.c
DRC60fa0602010-02-12 06:01:49 +0000110
DRC971d8512010-02-13 22:55:05 +0000111rdjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000112
113wrjpgcom_SOURCES = wrjpgcom.c
114
DRC971d8512010-02-13 22:55:05 +0000115wrjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000116
DRCb76c8402011-12-19 15:01:55 +0000117jcstest_SOURCES = jcstest.c
118
119jcstest_LDADD = libjpeg.la
DRC0a945a12010-02-15 11:04:51 +0000120
DRCcbda81a2010-06-05 01:12:35 +0000121dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DRC0a945a12010-02-15 11:04:51 +0000122
DRCa1647c82012-02-10 00:39:05 +0000123DOCS= install.txt coderules.txt filelist.txt jconfig.txt change.log \
124 rdrle.c wrrle.c BUILDING.txt ChangeLog.txt
125
126docdir = $(datadir)/doc
DRC01bf9d92012-02-10 01:52:31 +0000127dist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \
DRCa1647c82012-02-10 00:39:05 +0000128 wizard.txt
129
130exampledir = $(datadir)/doc
DRC01bf9d92012-02-10 01:52:31 +0000131dist_example_DATA = example.c
DRC0a945a12010-02-15 11:04:51 +0000132
DRC750e0782011-05-10 21:05:49 +0000133
DRC7ccb0072012-01-31 10:49:23 +0000134EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
DRCa006fba2011-10-27 23:25:28 +0000135 sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
136 jccolext.c jdcolext.c jdmrgext.c
DRC0a945a12010-02-15 11:04:51 +0000137
138dist-hook:
139 rm -rf `find $(distdir) -name .svn`
140
141
DRC66f97e62010-11-23 05:49:54 +0000142test: testclean all
DRCf2602ce2011-04-01 00:20:33 +0000143if WITH_JAVA
144 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
145 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi
146 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv
147 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi
148endif
DRC3185cb92011-05-25 03:52:22 +0000149 ./tjunittest
150 ./tjunittest -alloc
151 ./tjunittest -yuv
DRC7ab03642012-01-31 05:47:07 +0000152 ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm
153 cmp $(srcdir)/testimages/testimgint.jpg testoutint.jpg
154 ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm
155 cmp $(srcdir)/testimages/testimgfst.jpg testoutfst.jpg
156 ./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm
157 cmp $(srcdir)/testimages/testimgfst100.jpg testoutfst100.jpg
158 ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm
DRC321e0682011-05-03 08:47:43 +0000159if WITH_SSE_FLOAT_DCT
DRC7ab03642012-01-31 05:47:07 +0000160 cmp $(srcdir)/testimages/testimgflt.jpg testoutflt.jpg
DRC83f21442010-06-10 18:52:41 +0000161else
DRC7ab03642012-01-31 05:47:07 +0000162 cmp $(srcdir)/testimages/testimgflt-nosimd.jpg testoutflt.jpg
DRC66f97e62010-11-23 05:49:54 +0000163endif
DRC7ab03642012-01-31 05:47:07 +0000164 ./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm
165 cmp $(srcdir)/testimages/testimggray.jpg testoutgray.jpg
166 ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg
167 cmp $(srcdir)/testimages/testimgint.ppm testoutint.ppm
168 ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg
169 cmp $(srcdir)/testimages/testimgfst.ppm testoutfst.ppm
170 ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg
DRC321e0682011-05-03 08:47:43 +0000171if WITH_SSE_FLOAT_DCT
DRC7ab03642012-01-31 05:47:07 +0000172 cmp $(srcdir)/testimages/testimgflt.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000173else
DRC7ab03642012-01-31 05:47:07 +0000174 cmp $(srcdir)/testimages/testorig.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000175endif
DRC3a5e3622012-01-31 10:43:56 +0000176 for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do \
177 scalearg=`echo $$scale | sed s@_@/@g`; \
178 ./djpeg -dct int -nosmooth -scale $$scalearg -ppm -outfile testoutint$$scale.ppm $(srcdir)/testimages/testorig.jpg; \
179 cmp $(srcdir)/testimages/testimgint$$scale.ppm testoutint$$scale.ppm; \
180 done
DRC7ab03642012-01-31 05:47:07 +0000181 ./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg
182 cmp $(srcdir)/testimages/testimgfst1_2.ppm testoutfst1_2.ppm
DRC7ab03642012-01-31 05:47:07 +0000183 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg
184 cmp $(srcdir)/testimages/testimg.bmp testout.bmp
DRCe3720042010-11-23 06:50:14 +0000185if WITH_ARITH_ENC
DRC7ab03642012-01-31 05:47:07 +0000186 ./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm
187 cmp $(srcdir)/testimages/testimgari.jpg testoutari.jpg
188 ./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg
189 cmp $(srcdir)/testimages/testimgari.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000190endif
191if WITH_ARITH_DEC
DRC7ab03642012-01-31 05:47:07 +0000192 ./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg
193 cmp $(srcdir)/testimages/testimgari.ppm testoutari.ppm
194 ./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg
195 cmp $(srcdir)/testimages/testimgint.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000196endif
DRC7ab03642012-01-31 05:47:07 +0000197 ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm
198 cmp $(srcdir)/testimages/testimgp.jpg testoutp.jpg
DRC83f21442010-06-10 18:52:41 +0000199 ./jpegtran -outfile testoutt.jpg testoutp.jpg
DRC7ab03642012-01-31 05:47:07 +0000200 cmp $(srcdir)/testimages/testimgint.jpg testoutt.jpg
201 ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg
202 cmp $(srcdir)/testimages/testimgcrop.jpg testoutcrop.jpg
DRC83f21442010-06-10 18:52:41 +0000203
DRC83f21442010-06-10 18:52:41 +0000204
DRC34d59e72010-02-12 06:27:34 +0000205testclean:
DRC7b991722010-06-10 19:44:56 +0000206 rm -f testout*
DRCf2602ce2011-04-01 00:20:33 +0000207 rm -f *_GRAY_*.bmp
208 rm -f *_GRAY_*.png
209 rm -f *_GRAY_*.ppm
210 rm -f *_GRAY_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000211 rm -f *_GRAY.yuv
DRCf2602ce2011-04-01 00:20:33 +0000212 rm -f *_420_*.bmp
213 rm -f *_420_*.png
214 rm -f *_420_*.ppm
215 rm -f *_420_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000216 rm -f *_420.yuv
DRCf2602ce2011-04-01 00:20:33 +0000217 rm -f *_422_*.bmp
218 rm -f *_422_*.png
219 rm -f *_422_*.ppm
220 rm -f *_422_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000221 rm -f *_422.yuv
DRCf2602ce2011-04-01 00:20:33 +0000222 rm -f *_444_*.bmp
223 rm -f *_444_*.png
224 rm -f *_444_*.ppm
225 rm -f *_444_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000226 rm -f *_444.yuv
DRCf2602ce2011-04-01 00:20:33 +0000227 rm -f *_440_*.bmp
228 rm -f *_440_*.png
229 rm -f *_440_*.ppm
230 rm -f *_440_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000231 rm -f *_440.yuv
DRC079b4342010-02-15 11:32:23 +0000232
DRCcb6157b2012-01-31 11:38:13 +0000233
234tjtest:
235 sh ./tjbenchtest
236if WITH_JAVA
DRCfac3bea2012-09-24 02:27:55 +0000237 sh ./tjbenchtest.java
DRCcb6157b2012-01-31 11:38:13 +0000238endif
239
240
DRCd1c281a2010-11-17 22:44:40 +0000241if X86_64
242
243install-exec-hook:
244 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
245 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
246 cd $(DESTDIR)/${prefix}; \
247 if [ -d lib -a ! -d lib64 -a ! -h lib64 ]; then \
248 $(LN_S) lib lib64; \
249 fi \
250 fi
251
252else
253
254install-exec-hook:
255 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
256 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
257 cd $(DESTDIR)/${prefix}; \
258 if [ -d lib -a ! -d lib32 -a ! -h lib32 ]; then \
259 $(LN_S) lib lib32; \
260 fi \
261 fi
262
263endif
264
DRC079b4342010-02-15 11:32:23 +0000265rpm: all
DRC1f80a102010-10-18 00:15:31 +0000266 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
267 mkdir -p $$TMPDIR/RPMS; \
268 ln -fs `pwd` $$TMPDIR/BUILD; \
DRCb94f2de2011-03-22 09:31:25 +0000269 rm -f ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000270 rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
DRC57bd84f2012-02-10 01:40:29 +0000271 --define "_topdir $$TMPDIR" \
DRCb94f2de2011-03-22 09:31:25 +0000272 --target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
273 cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
274 ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000275 rm -rf $$TMPDIR
DRC079b4342010-02-15 11:32:23 +0000276
DRCf26914b2010-02-15 11:36:46 +0000277srpm: dist-gzip
DRC1f80a102010-10-18 00:15:31 +0000278 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
279 mkdir -p $$TMPDIR/RPMS; \
280 mkdir -p $$TMPDIR/SRPMS; \
281 mkdir -p $$TMPDIR/BUILD; \
282 mkdir -p $$TMPDIR/SOURCES; \
283 mkdir -p $$TMPDIR/SPECS; \
DRCb94f2de2011-03-22 09:31:25 +0000284 rm -f ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000285 cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
DRCb94f2de2011-03-22 09:31:25 +0000286 cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
DRC57bd84f2012-02-10 01:40:29 +0000287 | sed s/#--\>//g \
DRCb94f2de2011-03-22 09:31:25 +0000288 > $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRC1f80a102010-10-18 00:15:31 +0000289 rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRCb94f2de2011-03-22 09:31:25 +0000290 cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm \
291 ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000292 rm -rf $$TMPDIR
DRC52a19f22010-02-15 12:06:27 +0000293
294deb: all
DRCb94f2de2011-03-22 09:31:25 +0000295 sh pkgscripts/makedpkg
DRC6533b6e2010-02-15 14:57:18 +0000296
DRC315123f2010-02-15 16:14:26 +0000297if X86_64
298
299udmg: all
DRC7c6ae032012-03-23 00:51:56 +0000300 sh pkgscripts/makemacpkg -build32 ${BUILDDIR32}
DRC315123f2010-02-15 16:14:26 +0000301
DRC1fbae842012-02-09 09:23:30 +0000302iosdmg: all
DRC7c6ae032012-03-23 00:51:56 +0000303 sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7}
DRC166c5ec2012-02-10 01:07:59 +0000304
305else
306
307iosdmg: all
DRC7c6ae032012-03-23 00:51:56 +0000308 sh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7}
DRC1fbae842012-02-09 09:23:30 +0000309
DRC315123f2010-02-15 16:14:26 +0000310endif
311
DRC6533b6e2010-02-15 14:57:18 +0000312dmg: all
DRCb94f2de2011-03-22 09:31:25 +0000313 sh pkgscripts/makemacpkg
DRCb9b1ca32010-02-17 02:24:02 +0000314
DRCae79fdb2010-06-09 20:16:04 +0000315cygwinpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000316 sh pkgscripts/makecygwinpkg