openjpeg: Win32-compatible OpenJPEG-2.0 detection

OpenJPEG 2.0 API uses stdcall on W32 by default. This prevents normal
autoconf library macros from finding its functions.
A more compatible check is to acutally link a program that includes a
real header.

https://bugzilla.gnome.org/show_bug.cgi?id=733487
This commit is contained in:
Руслан Ижбулатов 2014-05-06 09:28:14 +00:00 committed by Sebastian Dröge
parent c42595cc69
commit 3ac444d2b7

View file

@ -2553,7 +2553,18 @@ translit(dnm, m, l) AM_CONDITIONAL(USE_OPENJPEG, true)
AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [ AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
HAVE_OPENJPEG="no" HAVE_OPENJPEG="no"
AG_GST_CHECK_LIBHEADER(OPENJPEG, openjp2, opj_version, ,openjpeg-2.0/openjpeg.h, OPENJPEG_LIBS="-lopenjp2") save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
OPENJPEG_LIBS="-lopenjp2"
LIBS="$LIBS $OPENJPEG_LIBS"
CFLAGS="$CFLAGS $OPENJPEG_CFLAGS"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include <openjpeg-2.0/openjpeg.h>],
[return (int) *opj_version ();])
], [HAVE_OPENJPEG=yes], [HAVE_OPENJPEG=no])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
if test x"$HAVE_OPENJPEG" = x"no"; then if test x"$HAVE_OPENJPEG" = x"no"; then
PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1, PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1,
HAVE_OPENJPEG="yes", HAVE_OPENJPEG="yes",