blob: 131f8024cddcceeecb8e5e5886436dc3cc58b066 [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
DRC21d66832010-02-12 04:34:41 +00003libturbojpeg_la_LDFLAGS = -avoid-version -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
DRC39ea5622010-10-12 01:55:31 +0000123DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
124 structure.txt coderules.txt filelist.txt jconfig.txt change.log \
DRC9f5320f2011-05-24 17:14:43 +0000125 README-turbo.txt rdrle.c wrrle.c BUILDING.txt ChangeLog.txt
DRC0a945a12010-02-15 11:04:51 +0000126
DRC750e0782011-05-10 21:05:49 +0000127
DRC7ccb0072012-01-31 10:49:23 +0000128EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
DRCa006fba2011-10-27 23:25:28 +0000129 sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
130 jccolext.c jdcolext.c jdmrgext.c
DRC0a945a12010-02-15 11:04:51 +0000131
132dist-hook:
133 rm -rf `find $(distdir) -name .svn`
134
135
DRC66f97e62010-11-23 05:49:54 +0000136test: testclean all
DRCf2602ce2011-04-01 00:20:33 +0000137if WITH_JAVA
138 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
139 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi
140 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv
141 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi
142endif
DRC3185cb92011-05-25 03:52:22 +0000143 ./tjunittest
144 ./tjunittest -alloc
145 ./tjunittest -yuv
DRC7ab03642012-01-31 05:47:07 +0000146 ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm
147 cmp $(srcdir)/testimages/testimgint.jpg testoutint.jpg
148 ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm
149 cmp $(srcdir)/testimages/testimgfst.jpg testoutfst.jpg
150 ./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm
151 cmp $(srcdir)/testimages/testimgfst100.jpg testoutfst100.jpg
152 ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm
DRC321e0682011-05-03 08:47:43 +0000153if WITH_SSE_FLOAT_DCT
DRC7ab03642012-01-31 05:47:07 +0000154 cmp $(srcdir)/testimages/testimgflt.jpg testoutflt.jpg
DRC83f21442010-06-10 18:52:41 +0000155else
DRC7ab03642012-01-31 05:47:07 +0000156 cmp $(srcdir)/testimages/testimgflt-nosimd.jpg testoutflt.jpg
DRC66f97e62010-11-23 05:49:54 +0000157endif
DRC7ab03642012-01-31 05:47:07 +0000158 ./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm
159 cmp $(srcdir)/testimages/testimggray.jpg testoutgray.jpg
160 ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg
161 cmp $(srcdir)/testimages/testimgint.ppm testoutint.ppm
162 ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg
163 cmp $(srcdir)/testimages/testimgfst.ppm testoutfst.ppm
164 ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg
DRC321e0682011-05-03 08:47:43 +0000165if WITH_SSE_FLOAT_DCT
DRC7ab03642012-01-31 05:47:07 +0000166 cmp $(srcdir)/testimages/testimgflt.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000167else
DRC7ab03642012-01-31 05:47:07 +0000168 cmp $(srcdir)/testimages/testorig.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000169endif
DRC3a5e3622012-01-31 10:43:56 +0000170 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 \
171 scalearg=`echo $$scale | sed s@_@/@g`; \
172 ./djpeg -dct int -nosmooth -scale $$scalearg -ppm -outfile testoutint$$scale.ppm $(srcdir)/testimages/testorig.jpg; \
173 cmp $(srcdir)/testimages/testimgint$$scale.ppm testoutint$$scale.ppm; \
174 done
DRC7ab03642012-01-31 05:47:07 +0000175 ./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg
176 cmp $(srcdir)/testimages/testimgfst1_2.ppm testoutfst1_2.ppm
DRC7ab03642012-01-31 05:47:07 +0000177 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg
178 cmp $(srcdir)/testimages/testimg.bmp testout.bmp
DRCe3720042010-11-23 06:50:14 +0000179if WITH_ARITH_ENC
DRC7ab03642012-01-31 05:47:07 +0000180 ./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm
181 cmp $(srcdir)/testimages/testimgari.jpg testoutari.jpg
182 ./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg
183 cmp $(srcdir)/testimages/testimgari.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000184endif
185if WITH_ARITH_DEC
DRC7ab03642012-01-31 05:47:07 +0000186 ./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg
187 cmp $(srcdir)/testimages/testimgari.ppm testoutari.ppm
188 ./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg
189 cmp $(srcdir)/testimages/testimgint.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000190endif
DRC7ab03642012-01-31 05:47:07 +0000191 ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm
192 cmp $(srcdir)/testimages/testimgp.jpg testoutp.jpg
DRC83f21442010-06-10 18:52:41 +0000193 ./jpegtran -outfile testoutt.jpg testoutp.jpg
DRC7ab03642012-01-31 05:47:07 +0000194 cmp $(srcdir)/testimages/testimgint.jpg testoutt.jpg
195 ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg
196 cmp $(srcdir)/testimages/testimgcrop.jpg testoutcrop.jpg
DRC83f21442010-06-10 18:52:41 +0000197
DRC83f21442010-06-10 18:52:41 +0000198
DRC34d59e72010-02-12 06:27:34 +0000199testclean:
DRC7b991722010-06-10 19:44:56 +0000200 rm -f testout*
DRCf2602ce2011-04-01 00:20:33 +0000201 rm -f *_GRAY_*.bmp
202 rm -f *_GRAY_*.png
203 rm -f *_GRAY_*.ppm
204 rm -f *_GRAY_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000205 rm -f *_GRAY.yuv
DRCf2602ce2011-04-01 00:20:33 +0000206 rm -f *_420_*.bmp
207 rm -f *_420_*.png
208 rm -f *_420_*.ppm
209 rm -f *_420_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000210 rm -f *_420.yuv
DRCf2602ce2011-04-01 00:20:33 +0000211 rm -f *_422_*.bmp
212 rm -f *_422_*.png
213 rm -f *_422_*.ppm
214 rm -f *_422_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000215 rm -f *_422.yuv
DRCf2602ce2011-04-01 00:20:33 +0000216 rm -f *_444_*.bmp
217 rm -f *_444_*.png
218 rm -f *_444_*.ppm
219 rm -f *_444_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000220 rm -f *_444.yuv
DRCf2602ce2011-04-01 00:20:33 +0000221 rm -f *_440_*.bmp
222 rm -f *_440_*.png
223 rm -f *_440_*.ppm
224 rm -f *_440_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000225 rm -f *_440.yuv
DRC079b4342010-02-15 11:32:23 +0000226
DRCcb6157b2012-01-31 11:38:13 +0000227
228tjtest:
229 sh ./tjbenchtest
230if WITH_JAVA
231 sh ./tjexampletest
232endif
233
234
DRCd1c281a2010-11-17 22:44:40 +0000235if X86_64
236
237install-exec-hook:
238 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
239 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
240 cd $(DESTDIR)/${prefix}; \
241 if [ -d lib -a ! -d lib64 -a ! -h lib64 ]; then \
242 $(LN_S) lib lib64; \
243 fi \
244 fi
245
246else
247
248install-exec-hook:
249 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
250 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
251 cd $(DESTDIR)/${prefix}; \
252 if [ -d lib -a ! -d lib32 -a ! -h lib32 ]; then \
253 $(LN_S) lib lib32; \
254 fi \
255 fi
256
257endif
258
DRC079b4342010-02-15 11:32:23 +0000259rpm: all
DRC1f80a102010-10-18 00:15:31 +0000260 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
261 mkdir -p $$TMPDIR/RPMS; \
262 ln -fs `pwd` $$TMPDIR/BUILD; \
DRCb94f2de2011-03-22 09:31:25 +0000263 rm -f ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000264 rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
265 --define "_topdir $$TMPDIR" --define "_srcdir ${srcdir}" \
DRCb94f2de2011-03-22 09:31:25 +0000266 --target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
267 cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
268 ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000269 rm -rf $$TMPDIR
DRC079b4342010-02-15 11:32:23 +0000270
DRCf26914b2010-02-15 11:36:46 +0000271srpm: dist-gzip
DRC1f80a102010-10-18 00:15:31 +0000272 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
273 mkdir -p $$TMPDIR/RPMS; \
274 mkdir -p $$TMPDIR/SRPMS; \
275 mkdir -p $$TMPDIR/BUILD; \
276 mkdir -p $$TMPDIR/SOURCES; \
277 mkdir -p $$TMPDIR/SPECS; \
DRCb94f2de2011-03-22 09:31:25 +0000278 rm -f ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000279 cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
DRCb94f2de2011-03-22 09:31:25 +0000280 cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
DRC1f80a102010-10-18 00:15:31 +0000281 | sed s@%{_srcdir}/@@g | sed s/#--\>//g \
DRCb94f2de2011-03-22 09:31:25 +0000282 > $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRC1f80a102010-10-18 00:15:31 +0000283 rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRCb94f2de2011-03-22 09:31:25 +0000284 cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm \
285 ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000286 rm -rf $$TMPDIR
DRC52a19f22010-02-15 12:06:27 +0000287
288deb: all
DRCb94f2de2011-03-22 09:31:25 +0000289 sh pkgscripts/makedpkg
DRC6533b6e2010-02-15 14:57:18 +0000290
DRC315123f2010-02-15 16:14:26 +0000291if X86_64
292
293udmg: all
DRCb94f2de2011-03-22 09:31:25 +0000294 sh pkgscripts/makemacpkg universal ${BUILDDIR32}
DRC315123f2010-02-15 16:14:26 +0000295
296endif
297
DRC6533b6e2010-02-15 14:57:18 +0000298dmg: all
DRCb94f2de2011-03-22 09:31:25 +0000299 sh pkgscripts/makemacpkg
DRCb9b1ca32010-02-17 02:24:02 +0000300
301if X86_64
302
DRC0f53df82010-10-21 19:47:06 +0000303csunpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000304 sh pkgscripts/makesunpkg combined ${BUILDDIR32}
DRCb9b1ca32010-02-17 02:24:02 +0000305
DRC3dc1bc22010-05-10 22:18:10 +0000306endif
DRCae79fdb2010-06-09 20:16:04 +0000307
DRC0f53df82010-10-21 19:47:06 +0000308sunpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000309 sh pkgscripts/makesunpkg
DRC0f53df82010-10-21 19:47:06 +0000310
DRCae79fdb2010-06-09 20:16:04 +0000311cygwinpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000312 sh pkgscripts/makecygwinpkg