Show
Ignore:
Timestamp:
29.06.2018 21:59:19 (15 months ago)
Author:
ak19
Message:

Tried to compile xpdf-tools up statically with CMake, but still not successful. For now committing modifications necessary (including the new additional packages) for compiling xpdf-tools agains dynamically linked libs of libpng and zlib and freetype. Although these 3 packages have been introduced and are successfully compiled up (and I can even get the CMake configure stage of xpdf-tools to 'see' them), the xpdftools binaries upon successful compilation are shown by ldd to still refer to system versions of zlib, libpng and freetype. Some modifications to a single file in the xpdftools src package were necessary to get things to compile again with these changes, so recommitting the xpdftools src package with modications using the usual gs- prefix and a readme.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/XPDFTOOLS.sh

    r32227 r32228  
    22 
    33# only going to make xpdf-tools, not xpdf-reader. So not making all of xpdf 
    4 package=xpdf 
     4package=gs-xpdf 
    55version=-4.00 
    66 
     
    99source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $* 
    1010 
     11# GEXT XDFTOOLS INSTALLED location is this GEXT's GSDLOS subdir 
    1112prefix=$GEXTXPDFTOOLS_INSTALLED 
    1213 
    13 #export CFLAGS="$CFLAGS -I$GEXTAUDIODB_INSTALLED/include" 
    14 #export CPPFLAGS="$CPPFLAGS -I$GEXTAUDIODB_INSTALLED/include" 
    15 #export CXXFLAGS="$CXXFLAGS -I$GEXTAUDIODB_INSTALLED/include" 
    16 #export LDFLAGS="$LDFLAGS -L$GEXTAUDIODB_INSTALLED/lib" 
     14# Use C/CPP/CXX FLAGS and LDFLAGS for setting up 
     15# libpng and libz for compiling xpdftools 
     16export CFLAGS="$CFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15" 
     17export CPPFLAGS="$CPPFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15" 
     18export CXXFLAGS="$CXXFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15" 
     19export LDFLAGS="$LDFLAGS -L$GEXTXPDFTOOLS_INSTALLED/lib" 
    1720 
    1821#echo GSDLOS = $GSDLOS 
     
    3235##exit 0 
    3336 
    34 ##if type -p pdftohtml; then 
    35 ##  echo "found xpdf-tools in PATH" 
    36 ##  _XPDFTOOLS=pdftohtml 
    37 ##elif [[ -x "$GEXTXPDFTOOLS_INSTALLED/linux/bin/pdftohtml" ]]; then 
    38 if [[ -x "$GEXTXPDFTOOLS_INSTALLED/bin/pdftohtml" ]]; then 
    39   echo "found pdftohtml in $GEXTXPDFTOOLS_INSTALLED/bin" 
    40   _XPDFTOOLS="$GEXTXPDFTOOLS_INSTALLED/bin" 
    41 fi 
    42  
    43 # IGNORE: See xpdf-tools src' INSTALL instructions: need to create a build dir 
     37# IGNORE: See xpdf-tools src' INSTALL instructions: need to create a 'build' dir 
    4438# cd there and then run cmake from there, providing the xpdf-tools src dir 
    45 # Actually, doing the above breaks the way cascade-lib.bash does it. It wants 
    46 # a 'release' directory, so do it the cascade-make way. 
     39# ACTUALLY: doing the above breaks the way cascade-lib.bash does it. It wants 
     40# a 'release' directory, so do it the cascade-make way as that works. 
     41# TO AVOID building xpdf(reader), turn off finding Qt libs with the cmake flags below 
    4742if [ $force_config = "1" ] ; then 
    4843  echo "[pushd $package$version]" 
     
    5954    cmake -DCMAKE_BUILD_TYPE=Release \ 
    6055        -DCMAKE_INSTALL_PREFIX=$prefix \ 
     56        -DZLIB_LIBRARY=$prefix/lib/libz.a \ 
     57        -DPNG_LIBRARY=$prefix/lib/libpng15.a \ 
     58        -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \ 
    6159        -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 \ 
    6260        -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 \ 
     
    6462        -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ 
    6563        -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" \ 
     64        -DPNG_LINK_FLAGS="-lpng15" \ 
    6665        $GEXT_XPDFTOOLS/packages/$package$version 
    6766    fi ; \ 
     
    8180  fi 
    8281fi 
     82 
     83## The -DFREETYPE_DIR to be used in place of -DFREETYPE_LIBRARY above 
     84## this will help it find the "libfreetype.so" (no versioning at end) in our gs ext 
     85## But -DZLIB_DIR and -DPNG_DIR are ignored and unrecognised, whereas 
     86## -DZLIB_LIBRARY and -DPNG_LIBRARY are recognised & supposedly used when compiling 
     87## but weren't really used as seen when running ldd on the xpdf-tools binaries: 
     88#       -DZLIB_DIR=$prefix \ 
     89#       -DPNG_DIR=$prefix \ 
     90#       -DFREETYPE_DIR=$prefix \ 
     91 
     92## When specified this way, all 3 lines are recognised (freetype, zlib, png) 
     93## but weren't really used as seen when running ldd on the xpdf-tools binaries: 
     94#       -DZLIB_LIBRARY=$prefix/lib/libz.so.1.2.7 \ 
     95#       -DPNG_LIBRARY=$prefix/lib/libpng15.so.15.30.0 \ 
     96#       -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.so.6.3.20 \ 
     97 
     98 
     99# If compilation was successful, then we don't need cmake binaries anymore when 
     100# packaging up xpdf-tools