Permalink
Browse files

improve pdfium linking

  • Loading branch information...
jcupitt committed Dec 12, 2018
1 parent b4afd75 commit 596794c05acc44247497d3ded0244dbf46d8c248
Showing with 4 additions and 7 deletions.
  1. +2 −1 configure.ac
  2. +2 −6 m4/pdfium.m4
@@ -881,6 +881,7 @@ if test x"$with_pdfium" != x"no"; then
AC_MSG_WARN([PDFium found, disabling poppler])
with_poppler=no
fi
EXTRA_LIBS_USED="$EXTRA_LIBS_USED $PDFIUM_LIBS"
with_pdfium=yes
],[
with_pdfium=no
@@ -1179,7 +1180,7 @@ if test x"$with_jpeg" != x"no"; then
],
[FIND_JPEG(
[with_jpeg="yes (found by search)"
EXTRA_LIBS_USED="$EXTRA_LIBS_USED -ljpeg"
EXTRA_LIBS_USED="$EXTRA_LIBS_USED -ljpeg"
],
[AC_MSG_WARN([libjpeg not found; disabling JPEG support])
with_jpeg=no
@@ -62,7 +62,7 @@ if test "$PDFIUM_LIBS" = ""; then

AC_TRY_LINK([#include <fpdfview.h>],
[FPDF_DOCUMENT doc; doc = FPDF_LoadDocument("", "")],
[PDFIUM_LIBS="-L${prefix}/lib -lpdfium -lc++ -licuuc"],
[PDFIUM_LIBS="${prefix}/lib"],
[PDFIUM_LIBS=no])

LIBS="$pdfium_save_LIBS"
@@ -91,11 +91,7 @@ AC_MSG_RESULT([libraries $pdfium_libraries_result, headers $pdfium_includes_resu

if test x"$PDFIUM_LIBS" != x"no"; then
dir="$PDFIUM_LIBS"
PDFIUM_LIBS=""
for i in $pdfium_objects; do
PDFIUM_LIBS="$PDFIUM_LIBS $prefix/lib/pdfium-obj/$i"
done
PDFIUM_LIBS="$PDFIUM_LIBS -L$dir -lm -lpthread"
PDFIUM_LIBS="-L$dir -lpdfium -lc++ -licuuc"
fi

AC_SUBST(PDFIUM_LIBS)

0 comments on commit 596794c

Please sign in to comment.