poppler: build against libjpeg
Albert Astals Cid points out that --disable-libjpeg causes poppler to use internal JPEG code instead, which is not actively maintained. Add LIBJPEG_CFLAGS / LIBJPEG_LIBS to config_host.mk and patch poppler to respect LIBJPEG_LIBS. Change-Id: Id19a62a9bd9dc41fee5e8e43e2798e515aacc299 Reviewed-on: https://gerrit.libreoffice.org/30496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
parent
092261ffd4
commit
eea709f67d
@ -425,32 +425,37 @@ endif # SYSTEM_ZLIB
|
||||
ifneq ($(SYSTEM_JPEG),)
|
||||
|
||||
define gb_LinkTarget__use_jpeg
|
||||
$(call gb_LinkTarget_add_libs,$(1),-ljpeg)
|
||||
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
|
||||
$(call gb_LinkTarget_set_ldflags,$(1),\
|
||||
$$(filter-out -L/usr/lib/jvm%,$$(T_LDFLAGS)) \
|
||||
)
|
||||
|
||||
endef
|
||||
|
||||
gb_ExternalProject__use_jpeg :=
|
||||
|
||||
else ifneq ($(filter JPEG_TURBO,$(BUILD_TYPE)),)
|
||||
|
||||
define gb_LinkTarget__use_jpeg
|
||||
$(call gb_LinkTarget_set_include,$(1),\
|
||||
-I$(call gb_UnpackedTarball_get_dir,jpeg-turbo) \
|
||||
$(LIBJPEG_CFLAGS) \
|
||||
$$(INCLUDE) \
|
||||
)
|
||||
$(call gb_LinkTarget_add_libs,$(1),\
|
||||
$(call gb_UnpackedTarball_get_dir,jpeg-turbo)/.libs/libjpeg$(gb_StaticLibrary_PLAINEXT) \
|
||||
)
|
||||
$(call gb_LinkTarget_add_libs,$(1),$(LIBJPEG_LIBS))
|
||||
$(call gb_LinkTarget_use_external_project,$(1),jpeg-turbo,full)
|
||||
|
||||
endef
|
||||
|
||||
define gb_ExternalProject__use_jpeg
|
||||
$(call gb_ExternalProject_use_external_project,$(1),jpeg-turbo)
|
||||
|
||||
endef
|
||||
|
||||
else # !SYSTEM_JPEG
|
||||
|
||||
define gb_LinkTarget__use_jpeg
|
||||
$(call gb_LinkTarget_set_include,$(1),\
|
||||
-I$(call gb_UnpackedTarball_get_dir,jpeg) \
|
||||
$(LIBJPEG_CFLAGS) \
|
||||
$$(INCLUDE) \
|
||||
)
|
||||
|
||||
@ -458,6 +463,11 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\
|
||||
jpeg \
|
||||
)
|
||||
|
||||
define gb_ExternalProject__use_jpeg
|
||||
$(call gb_ExternalProject_use_static_libraries,$(1),jpeg)
|
||||
|
||||
endef
|
||||
|
||||
endef
|
||||
|
||||
endif # SYSTEM_JPEG
|
||||
@ -2752,6 +2762,7 @@ endef
|
||||
else # !SYSTEM_POPPLER
|
||||
|
||||
define gb_LinkTarget__use_poppler
|
||||
$(call gb_LinkTarget_use_external,$(1),jpeg)
|
||||
$(call gb_LinkTarget_use_external_project,$(1),poppler,full)
|
||||
|
||||
$(call gb_LinkTarget_set_include,$(1),\
|
||||
|
@ -320,6 +320,8 @@ export LIBFONTS_JAR=@LIBFONTS_JAR@
|
||||
export LIBFORMULA_JAR=@LIBFORMULA_JAR@
|
||||
export LIBGCRYPT_CFLAGS=@LIBGCRYPT_CFLAGS@
|
||||
export LIBGCRYPT_LIBS=@LIBGCRYPT_LIBS@
|
||||
export LIBJPEG_CFLAGS=$(gb_SPACE)@LIBJPEG_CFLAGS@
|
||||
export LIBJPEG_LIBS=$(gb_SPACE)@LIBJPEG_LIBS@
|
||||
export LIBLANGTAG_CFLAGS=$(gb_SPACE)@LIBLANGTAG_CFLAGS@
|
||||
export LIBLANGTAG_LIBS=$(gb_SPACE)@LIBLANGTAG_LIBS@
|
||||
export LIBLAYOUT_JAR=@LIBLAYOUT_JAR@
|
||||
|
12
configure.ac
12
configure.ac
@ -7716,10 +7716,10 @@ fi
|
||||
if test "$with_system_jpeg" = "yes"; then
|
||||
AC_MSG_RESULT([external])
|
||||
SYSTEM_JPEG=TRUE
|
||||
AC_CHECK_HEADER(jpeglib.h, [],
|
||||
AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
|
||||
[AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
|
||||
AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
|
||||
[AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
|
||||
AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
|
||||
[AC_MSG_ERROR(jpeg library not found or fuctional)], [])
|
||||
libo_MINGW_CHECK_DLL([libjpeg])
|
||||
else
|
||||
SYSTEM_JPEG=
|
||||
@ -7768,12 +7768,18 @@ Alternatively, you can install the 'new' nasm where ever you want and make sure
|
||||
_EOS
|
||||
AC_MSG_ERROR([no nasm (Netwide Assembler) found])
|
||||
fi
|
||||
LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/jpeg-turbo"
|
||||
LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/jpeg-turbo/.libs/libjpeg.lib"
|
||||
else
|
||||
AC_MSG_RESULT([internal, jpeg])
|
||||
BUILD_TYPE="$BUILD_TYPE JPEG"
|
||||
LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/jpeg"
|
||||
LIBJPEG_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -ljpeg"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(NASM)
|
||||
AC_SUBST(LIBJPEG_CFLAGS)
|
||||
AC_SUBST(LIBJPEG_LIBS)
|
||||
AC_SUBST(SYSTEM_JPEG)
|
||||
|
||||
dnl ===================================================================
|
||||
|
2
external/poppler/ExternalProject_poppler.mk
vendored
2
external/poppler/ExternalProject_poppler.mk
vendored
@ -26,7 +26,7 @@ $(call gb_ExternalProject_get_state_target,poppler,build) :
|
||||
--disable-poppler-cpp \
|
||||
--disable-libopenjpeg \
|
||||
--disable-libtiff \
|
||||
--disable-libjpeg \
|
||||
--enable-libjpeg \
|
||||
--disable-libpng \
|
||||
--disable-zlib \
|
||||
--disable-libcurl \
|
||||
|
1
external/poppler/UnpackedTarball_poppler.mk
vendored
1
external/poppler/UnpackedTarball_poppler.mk
vendored
@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
|
||||
external/poppler/poppler-vs2013.patch.1 \
|
||||
external/poppler/poppler-0.46.0-std-max.patch.1 \
|
||||
external/poppler/ubsan.patch.0 \
|
||||
external/poppler/poppler-libjpeg.patch.1 \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
23
external/poppler/poppler-libjpeg.patch.1
vendored
Normal file
23
external/poppler/poppler-libjpeg.patch.1
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
do not override user supplied LIBJPEG_LIBS so we can use the one in WORKDIR
|
||||
|
||||
--- poppler/configure.orig 2016-11-02 13:58:32.530617038 +0100
|
||||
+++ poppler/configure 2016-11-02 13:58:06.233617689 +0100
|
||||
@@ -21377,8 +21377,9 @@
|
||||
ac_save_USER_INCLUDES="$USER_INCLUDES"
|
||||
ac_save_USER_LDFLAGS="$USER_LDFLAGS"
|
||||
USER_INCLUDES="$USER_INCLUDES $LIBJPEG_CFLAGS"
|
||||
- USER_LDFLAGS="$USER_LDFLAGS $LIBJPEG_CFLAGS"
|
||||
+ USER_LDFLAGS="$USER_LDFLAGS $LIBJPEG_LIBS"
|
||||
|
||||
+if test -z "$LIBJPEG_LIBS"; then
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjpeg6b" >&5
|
||||
$as_echo_n "checking for libjpeg6b... " >&6; }
|
||||
@@ -21489,6 +21490,7 @@
|
||||
|
||||
|
||||
fi
|
||||
+fi
|
||||
|
||||
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
Loading…
x
Reference in New Issue
Block a user