[poppler] cmake and static binaries

Adrian Johnson ajohnson at redneon.com
Sun Sep 10 06:00:46 UTC 2017


On 10/09/17 06:27, William Bader wrote:
>> It's not a direct dependency of poppler
> 
> 
> Thanks for the draw_lib_dependencies command.
> 
> It shows that libjbig is a dependency of libtiff. https://imgur.com/a/8WYfY
> 
> 
> I did normal dynamic builds with no options 'configure;make' in one area
> and 'cmake .;make' in another area.
> 
> ldd shows libjbig as a dependency of the autotools libpoppler.so but not
> the cmake libpoppler.so
> 
> If it only happens to me, it isn't worth looking at, but if it happens
> to anyone else, it could be a difference between the default options in
> autotools and cmake.

pkg-config has a --static option to list libraries required for a static
build.

$ pkg-config --libs libtiff-4
-ltiff

$ pkg-config --static --libs libtiff-4
-ltiff -llzma -ljbig -ljpeg -lz -lm

You can try grepping the CMakeCache.txt. eg

$ grep -i cairo CMakeCache.txt  | grep -i static

shows a variable with static link flags

_pc_cairo_STATIC_LDFLAGS:INTERNAL=-lcairo;-lz;-lgobject-2.0;-lffi;-lglib-2.0;-pthread;-lpcre;-pthread;-lpixman-1;-lfontconfig;-lexpat;-lfreetype;-lexpat;-lfreetype;-lz;-lpng16;-lm;-lz;-lm;-lpng16;-lm;-lz;-lm;-lxcb-shm;-lxcb-render;-lXrender;-lXext;-lX11;-lpthread;-lxcb;-lXau;-lXdmcp

but

$ grep -i tiff CMakeCache.txt  | grep -i static

does not show any static link flags. For some reason cmake is not
finding the libtiff static link flags.

> 
> Since libjbig is a dependency of libtiff and not directly of libpoppler,
> the difference might be what libpoppler uses in libtiff.
> 
> The config.h files set different options.
> 
> 
> $ diff <(grep define auto/poppler-0.59.0/config.h | sort) <(grep define
> cmake/poppler-0.59.0/config.h | sort)
> 1,3d0
> < #  define WORDS_BIGENDIAN 1
> < # define _DARWIN_USE_64_BIT_INODE 1
> < # if defined __BIG_ENDIAN__
> 21a19
>> #define HAVE_LIBZ 1
> 30d27
> < #define HAVE_PTHREAD_PRIO_INHERIT 1
> 36a34
>> #define HAVE_SYS_DIR_H 1
> 40d37
> < #define HAVE_TIFFIO_H 1
> 43d39
> < #define HAVE_ZLIB_H 1
> 45d40
> < #define LT_OBJDIR ".libs/"
> 56d50
> < #define POPPLER_VERSION "0.59.0"
> 60d53
> < #define USE_OPENJPEG1 1
> 63,64c56,57
> < #define WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG 1
> < #if defined AC_APPLE_UNIVERSAL_BUILD
> ---
>> #define snprintf _snprintf
>> #if defined(_MSC_VER) && _MSC_VER < 1900
> 68a62
>> /* MS defined snprintf as deprecated but then added it in Visual
> Studio 2015. */
> 
> poppler-config.h is different also.
> 
> 
> $ diff <(grep define auto/poppler-0.59.0/poppler/poppler-config.h | sort
> -u) <(grep define cmake/poppler-0.59.0/poppler/poppler-config.h | sort -u)
> 4a5
>> #define ENABLE_ZLIB 1
> 9a11
>> #define HAVE_SYS_DIR_H 1
> 
> 
> Regards, William
> 
> 
> 
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/poppler
> 



More information about the poppler mailing list