source: gs2-extensions/xpdf-tools/trunk/src/packages/GS-README.txt@ 32246

Last change on this file since 32246 was 32229, checked in by ak19, 6 years ago

Forgot to commit the README last time: the GS-README.txt belongs with with revision 32228.

File size: 2.9 KB
Line 
1-------------------------------------------------------------------
2Modfications to xpdf-4.00.tar.gz to produce gs-xpdf-4.00.tar.gz
3-------------------------------------------------------------------
4In order to successfully compile xpdf-tools-4.00 against *dynamically* linked libraries for zlib (and libpng), needed to modify the CMakeLists.txt. The changes.
5
6 if (PNG_FOUND)
7 include_directories("${PNG_INCLUDE_DIRS}")
8 add_definitions("${PNG_DEFINITIONS}")
9 endif ()
10 #--------- NEW
11 # https://stackoverflow.com/questions/36126333/mingw-cmake-undefined-reference-to-zlib
12 if (ZLIB_FOUND)
13 include_directories("${ZLIB_INCLUDE_DIRS}")
14 add_definitions("${ZLIB_DEFINITIONS}")
15 endif ()
16 #--------- ENDNEW
17 if (HAVE_LCMS)
18 ...
19
20
21Note that the xpdftools binaries produced in this fashion are still linked to the system zlib and libpng rather than the ones we're compiling up as part of the GEXT XPDFTOOLS extension. But just to get the compilation to succeed with the references to our local library in XPDFTOOLS.sh below (a step toward getting the statically linked xpdftools binaries to compile), we needed the above changes.
22
23 cmake -DCMAKE_BUILD_TYPE=Release \
24 -DCMAKE_INSTALL_PREFIX=$prefix \
25 -DZLIB_LIBRARY=$prefix/lib/libz.a \ <========
26 -DPNG_LIBRARY=$prefix/lib/libpng15.a \ <========
27 -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \ <========
28 -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 \
29 -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 \
30 -DCMAKE_C_FLAGS="$CFLAGS" \
31 -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
32 -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" \
33 -DPNG_LINK_FLAGS="-lpng15" \
34 $GEXT_XPDFTOOLS/packages/$package$version
35
36
37-------------------------------------------------------------------
38Redundant CMakeLists.txt files
39-------------------------------------------------------------------
40I've also committed work in progress versions of CMakeLists.txt
41- CMakeLists.txt.orig: the original version of this file in the unmodified xpdf-4.00.tar.gz
42- CMakeLists.txt.static1_notworking: Sets up CMake settings for static compilation. Which then required some further changes to stop compilation from complaining about undefined references to thread mutex or something. (-lpthread/pthread library was necessary, but needed to set this the CMake way). Not a working version.
43- CMakeLists.txt.static2_notworking: more changes in an attempt to bypass the errors about undefined references to png (and 'inflate' of zlib). Still not working. It's this version that briefly attempted to use the override to PNG_LINK_FLAGS I am setting in XPDFTOOLS.sh (the line containing: -DPNG_LINK_FLAGS="-lpng15" \). Not sure why it never got set.
44- CMakeLists.txt: the version of this file first committed with the modified gs-xpdf-4.00.tar.gz. For getting xpdf-tools to compile with dynamic linking and with the current setup of XPDFTOOLS.sh
45
46There are comments in the modified CMakeLists.txt file above to provide URLs explaining why I made various changes.
47
Note: See TracBrowser for help on using the repository browser.