summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-04-27 18:40:28 +0200
committerKim Woelders <kim@woelders.dk>2021-04-30 10:03:49 +0200
commitc1ee164d6db491b0cd92986259ee76ef46fcb87c (patch)
tree2ff1ae4db10bca98dc402d61c7b55437ff064565
parent27ab891c56293ed34f592e628ef73ee34c24ef30 (diff)
autofoo: Move more to pkg-config
Facilitates testing alternative library versions.
-rw-r--r--configure.ac61
-rw-r--r--src/modules/loaders/Makefile.am23
2 files changed, 19 insertions, 65 deletions
diff --git a/configure.ac b/configure.ac
index ae7babe..957e802 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,13 +142,7 @@ AC_ARG_WITH([jpeg],
142AC_MSG_RESULT($jpeg_loader) 142AC_MSG_RESULT($jpeg_loader)
143 143
144if test "$jpeg_loader" != no ; then 144if test "$jpeg_loader" != no ; then
145 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no) 145 PKG_CHECK_MODULES(JPEG, libjpeg, [ jpeg_ok="yes" ], [ jpeg_ok="no" ])
146 if test "$jpeg_ok" = yes; then
147 AC_CHECK_HEADER([jpeglib.h], , jpeg_ok=no)
148 if test "$jpeg_ok" = yes; then
149 JPEGLIBS="-ljpeg"
150 fi
151 fi
152 if test "$jpeg_ok" = no ; then 146 if test "$jpeg_ok" = no ; then
153 if test "$jpeg_loader" = yes ; then 147 if test "$jpeg_loader" = yes ; then
154 AC_MSG_ERROR(JPEG support was requested but system does not support it) 148 AC_MSG_ERROR(JPEG support was requested but system does not support it)
@@ -160,7 +154,6 @@ else
160 jpeg_ok=no 154 jpeg_ok=no
161fi 155fi
162AM_CONDITIONAL(BUILD_JPEG_LOADER, test "$jpeg_ok" = yes) 156AM_CONDITIONAL(BUILD_JPEG_LOADER, test "$jpeg_ok" = yes)
163AC_SUBST(JPEGLIBS)
164 157
165 158
166AC_MSG_CHECKING(whether to enable png support) 159AC_MSG_CHECKING(whether to enable png support)
@@ -225,25 +218,7 @@ AC_ARG_WITH([tiff],
225AC_MSG_RESULT($tiff_loader) 218AC_MSG_RESULT($tiff_loader)
226 219
227if test "$tiff_loader" != no ; then 220if test "$tiff_loader" != no ; then
228 AC_CHECK_LIB(tiff, TIFFReadScanline, 221 PKG_CHECK_MODULES(TIFF, libtiff-4, [ tiff_ok="yes" ], [ tiff_ok="no" ])
229 tiff_libs="-ltiff"
230 tiff_ok=yes,
231 AC_CHECK_LIB(tiff, TIFFReadScanline,
232 tiff_libs="-ltiff -ljpeg -lz -lm"
233 tiff_ok=yes,
234 AC_CHECK_LIB(tiff34, TIFFReadScanline,
235 tiff_libs="-ltiff34 -ljpeg -lz -lm"
236 tiff_ok=yes,
237 tiff_ok=no,
238 -ljpeg -lz -lm),
239 -ljpeg -lz -lm),
240 )
241 if test "$tiff_ok" = yes; then
242 AC_CHECK_HEADER([tiffio.h], , tiff_ok=no)
243 if test "$tiff_ok" = yes; then
244 TIFFLIBS=$tiff_libs
245 fi
246 fi
247 if test "$tiff_ok" = no ; then 222 if test "$tiff_ok" = no ; then
248 if test "$tiff_loader" = yes ; then 223 if test "$tiff_loader" = yes ; then
249 AC_MSG_ERROR(TIFF support was requested but system does not support it) 224 AC_MSG_ERROR(TIFF support was requested but system does not support it)
@@ -255,7 +230,6 @@ else
255 tiff_ok=no 230 tiff_ok=no
256fi 231fi
257AM_CONDITIONAL(BUILD_TIFF_LOADER, test "$tiff_ok" = yes) 232AM_CONDITIONAL(BUILD_TIFF_LOADER, test "$tiff_ok" = yes)
258AC_SUBST(TIFFLIBS)
259 233
260 234
261AC_MSG_CHECKING(whether to enable gif support) 235AC_MSG_CHECKING(whether to enable gif support)
@@ -332,13 +306,7 @@ AC_ARG_WITH([zlib],
332AC_MSG_RESULT($zlib_loader) 306AC_MSG_RESULT($zlib_loader)
333 307
334if test "$zlib_loader" != no ; then 308if test "$zlib_loader" != no ; then
335 AC_CHECK_LIB(z, uncompress, zlib_ok=yes, zlib_ok=no) 309 PKG_CHECK_MODULES(ZLIB, zlib, [ zlib_ok="yes" ], [ zlib_ok="no" ])
336 if test "$zlib_ok" = yes; then
337 AC_CHECK_HEADER([zlib.h], , zlib_ok=no)
338 if test "$zlib_ok" = yes; then
339 ZLIBLIBS="-lz"
340 fi
341 fi
342 if test "$zlib_ok" = no ; then 310 if test "$zlib_ok" = no ; then
343 if test "$zlib_loader" = yes ; then 311 if test "$zlib_loader" = yes ; then
344 AC_MSG_ERROR(ZLIB support was requested but system does not support it) 312 AC_MSG_ERROR(ZLIB support was requested but system does not support it)
@@ -350,7 +318,6 @@ else
350 zlib_ok=no 318 zlib_ok=no
351fi 319fi
352AM_CONDITIONAL(BUILD_ZLIB_LOADER, test "$zlib_ok" = yes) 320AM_CONDITIONAL(BUILD_ZLIB_LOADER, test "$zlib_ok" = yes)
353AC_SUBST(ZLIBLIBS)
354 321
355 322
356AC_MSG_CHECKING(whether to enable bzip2 support) 323AC_MSG_CHECKING(whether to enable bzip2 support)
@@ -368,13 +335,7 @@ AC_ARG_WITH([bzip2],
368AC_MSG_RESULT($bz2_loader) 335AC_MSG_RESULT($bz2_loader)
369 336
370if test "$bz2_loader" != no ; then 337if test "$bz2_loader" != no ; then
371 AC_CHECK_LIB(bz2, BZ2_bzRead, bz2_ok=yes, bz2_ok=no) 338 PKG_CHECK_MODULES(BZ2, bzip2, [ bz2_ok="yes" ], [ bz2_ok="no" ])
372 if test "$bz2_ok" = yes; then
373 AC_CHECK_HEADER([bzlib.h], , bz2_ok=no)
374 if test "$bz2_ok" = yes; then
375 BZ2LIBS="-lbz2"
376 fi
377 fi
378 if test "$bz2_ok" = no ; then 339 if test "$bz2_ok" = no ; then
379 if test "$bz2_loader" = yes ; then 340 if test "$bz2_loader" = yes ; then
380 AC_MSG_ERROR(BZIP2 support was requested but system does not support it) 341 AC_MSG_ERROR(BZIP2 support was requested but system does not support it)
@@ -386,7 +347,6 @@ else
386 bz2_ok=no 347 bz2_ok=no
387fi 348fi
388AM_CONDITIONAL(BUILD_BZ2_LOADER, test "$bz2_ok" = yes) 349AM_CONDITIONAL(BUILD_BZ2_LOADER, test "$bz2_ok" = yes)
389AC_SUBST(BZ2LIBS)
390 350
391 351
392AC_MSG_CHECKING(whether to enable id3 support) 352AC_MSG_CHECKING(whether to enable id3 support)
@@ -404,17 +364,7 @@ AC_ARG_WITH([id3],
404AC_MSG_RESULT($id3_loader) 364AC_MSG_RESULT($id3_loader)
405 365
406if test "$id3_loader" != no ; then 366if test "$id3_loader" != no ; then
407 AC_CHECK_LIB(id3tag, id3_file_open, 367 PKG_CHECK_MODULES(ID3, id3tag, [ id3_ok="yes" ], [ id3_ok="no" ])
408 id3_libs="-lz -lid3tag"
409 id3_ok=yes,
410 id3_ok=no,
411 -lz)
412 if test "$id3_ok" = yes; then
413 AC_CHECK_HEADER([id3tag.h], , id3_ok=no)
414 if test "$id3_ok" = yes; then
415 ID3LIBS=$id3_libs
416 fi
417 fi
418 if test "$id3_ok" = no ; then 368 if test "$id3_ok" = no ; then
419 if test "$id3_loader" = yes ; then 369 if test "$id3_loader" = yes ; then
420 AC_MSG_ERROR(ID3 support was requested but system does not support it) 370 AC_MSG_ERROR(ID3 support was requested but system does not support it)
@@ -426,7 +376,6 @@ else
426 id3_ok=no 376 id3_ok=no
427fi 377fi
428AM_CONDITIONAL(BUILD_ID3_LOADER, test "$id3_ok" = yes) 378AM_CONDITIONAL(BUILD_ID3_LOADER, test "$id3_ok" = yes)
429AC_SUBST(ID3LIBS)
430 379
431 380
432EC_C_WARNINGS() 381EC_C_WARNINGS()
diff --git a/src/modules/loaders/Makefile.am b/src/modules/loaders/Makefile.am
index ca8c084..921f0ad 100644
--- a/src/modules/loaders/Makefile.am
+++ b/src/modules/loaders/Makefile.am
@@ -62,8 +62,9 @@ bmp_la_LIBADD = $(top_builddir)/src/lib/libImlib2.la
62bmp_la_LIBTOOLFLAGS = --tag=disable-static 62bmp_la_LIBTOOLFLAGS = --tag=disable-static
63 63
64bz2_la_SOURCES = loader_bz2.c 64bz2_la_SOURCES = loader_bz2.c
65bz2_la_CPPFLAGS = $(BZ2_CFLAGS) $(AM_CPPFLAGS)
65bz2_la_LDFLAGS = -module -avoid-version 66bz2_la_LDFLAGS = -module -avoid-version
66bz2_la_LIBADD = @BZ2LIBS@ $(top_builddir)/src/lib/libImlib2.la 67bz2_la_LIBADD = $(BZ2_LIBS) $(top_builddir)/src/lib/libImlib2.la
67bz2_la_LIBTOOLFLAGS = --tag=disable-static 68bz2_la_LIBTOOLFLAGS = --tag=disable-static
68 69
69ff_la_SOURCES = loader_ff.c 70ff_la_SOURCES = loader_ff.c
@@ -82,13 +83,15 @@ ico_la_LIBADD = $(top_builddir)/src/lib/libImlib2.la
82ico_la_LIBTOOLFLAGS = --tag=disable-static 83ico_la_LIBTOOLFLAGS = --tag=disable-static
83 84
84id3_la_SOURCES = loader_id3.c 85id3_la_SOURCES = loader_id3.c
86id3_la_CPPFLAGS = $(ID3_CFLAGS) $(AM_CPPFLAGS)
85id3_la_LDFLAGS = -module -avoid-version 87id3_la_LDFLAGS = -module -avoid-version
86id3_la_LIBADD = @ID3LIBS@ $(top_builddir)/src/lib/libImlib2.la 88id3_la_LIBADD = $(ID3_LIBS) $(top_builddir)/src/lib/libImlib2.la
87id3_la_LIBTOOLFLAGS = --tag=disable-static 89id3_la_LIBTOOLFLAGS = --tag=disable-static
88 90
89jpeg_la_SOURCES = loader_jpeg.c 91jpeg_la_SOURCES = loader_jpeg.c
92jpeg_la_CPPFLAGS = $(JPEG_CFLAGS) $(AM_CPPFLAGS)
90jpeg_la_LDFLAGS = -module -avoid-version 93jpeg_la_LDFLAGS = -module -avoid-version
91jpeg_la_LIBADD = @JPEGLIBS@ $(top_builddir)/src/lib/libImlib2.la 94jpeg_la_LIBADD = $(JPEG_LIBS) $(top_builddir)/src/lib/libImlib2.la
92jpeg_la_LIBTOOLFLAGS = --tag=disable-static 95jpeg_la_LIBTOOLFLAGS = --tag=disable-static
93 96
94lbm_la_SOURCES = loader_lbm.c 97lbm_la_SOURCES = loader_lbm.c
@@ -97,9 +100,9 @@ lbm_la_LIBADD = $(top_builddir)/src/lib/libImlib2.la
97lbm_la_LIBTOOLFLAGS = --tag=disable-static 100lbm_la_LIBTOOLFLAGS = --tag=disable-static
98 101
99png_la_SOURCES = loader_png.c 102png_la_SOURCES = loader_png.c
100png_la_CPPFLAGS = @PNG_CFLAGS@ $(AM_CPPFLAGS) 103png_la_CPPFLAGS = $(PNG_CFLAGS) $(AM_CPPFLAGS)
101png_la_LDFLAGS = -module -avoid-version 104png_la_LDFLAGS = -module -avoid-version
102png_la_LIBADD = @PNG_LIBS@ $(top_builddir)/src/lib/libImlib2.la 105png_la_LIBADD = $(PNG_LIBS) $(top_builddir)/src/lib/libImlib2.la
103png_la_LIBTOOLFLAGS = --tag=disable-static 106png_la_LIBTOOLFLAGS = --tag=disable-static
104 107
105pnm_la_SOURCES = loader_pnm.c 108pnm_la_SOURCES = loader_pnm.c
@@ -113,14 +116,15 @@ tga_la_LIBADD = $(top_builddir)/src/lib/libImlib2.la
113tga_la_LIBTOOLFLAGS = --tag=disable-static 116tga_la_LIBTOOLFLAGS = --tag=disable-static
114 117
115tiff_la_SOURCES = loader_tiff.c 118tiff_la_SOURCES = loader_tiff.c
119tiff_la_CPPFLAGS = $(TIFF_CFLAGS) $(AM_CPPFLAGS)
116tiff_la_LDFLAGS = -module -avoid-version 120tiff_la_LDFLAGS = -module -avoid-version
117tiff_la_LIBADD = @TIFFLIBS@ $(top_builddir)/src/lib/libImlib2.la 121tiff_la_LIBADD = $(TIFF_LIBS) $(top_builddir)/src/lib/libImlib2.la
118tiff_la_LIBTOOLFLAGS = --tag=disable-static 122tiff_la_LIBTOOLFLAGS = --tag=disable-static
119 123
120webp_la_SOURCES = loader_webp.c 124webp_la_SOURCES = loader_webp.c
121webp_la_CPPFLAGS = @WEBP_CFLAGS@ $(AM_CPPFLAGS) 125webp_la_CPPFLAGS = $(WEBP_CFLAGS) $(AM_CPPFLAGS)
122webp_la_LDFLAGS = -module -avoid-version 126webp_la_LDFLAGS = -module -avoid-version
123webp_la_LIBADD = @WEBP_LIBS@ $(top_builddir)/src/lib/libImlib2.la 127webp_la_LIBADD = $(WEBP_LIBS) $(top_builddir)/src/lib/libImlib2.la
124webp_la_LIBTOOLFLAGS = --tag=disable-static 128webp_la_LIBTOOLFLAGS = --tag=disable-static
125 129
126xbm_la_SOURCES = loader_xbm.c 130xbm_la_SOURCES = loader_xbm.c
@@ -134,6 +138,7 @@ xpm_la_LIBADD = $(top_builddir)/src/lib/libImlib2.la
134xpm_la_LIBTOOLFLAGS = --tag=disable-static 138xpm_la_LIBTOOLFLAGS = --tag=disable-static
135 139
136zlib_la_SOURCES = loader_zlib.c 140zlib_la_SOURCES = loader_zlib.c
141zlib_la_CPPFLAGS = $(ZLIB_CFLAGS) $(AM_CPPFLAGS)
137zlib_la_LDFLAGS = -module -avoid-version 142zlib_la_LDFLAGS = -module -avoid-version
138zlib_la_LIBADD = @ZLIBLIBS@ $(top_builddir)/src/lib/libImlib2.la 143zlib_la_LIBADD = $(ZLIB_LIBS) $(top_builddir)/src/lib/libImlib2.la
139zlib_la_LIBTOOLFLAGS = --tag=disable-static 144zlib_la_LIBTOOLFLAGS = --tag=disable-static