Changeset 32228 for gs2-extensions


Ignore:
Timestamp:
2018-06-29T21:59:19+12:00 (6 years 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.

Location:
gs2-extensions/xpdf-tools/trunk/src
Files:
13 added
1 deleted
4 edited

Legend:

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

    r32227 r32228  
    33source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS .. $*
    44
    5 #PACKAGES="CMAKE"
    6 PACKAGES="CMAKE XPDFTOOLS"
     5PACKAGES="CMAKE LIBZ LIBPNG FREETYPE XPDFTOOLS"
    76
    87for d in $PACKAGES ; do
  • gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/CMAKE.sh

    r32227 r32228  
    3232
    3333# Only compile if necessary - we don't edit these source files.
    34 if type -p cmake; then
    35   echo "found cmake in PATH"
    36   _CMAKE=cmake
    37 elif [[ -x "$GEXTXPDFTOOLS_INSTALLED/linux/bin/cmake" ]]; then
    38 ##if [[ -x "$GEXTXPDFTOOLS_INSTALLED/linux/bin/cmake" ]]; then
     34#if type -p cmake; then
     35#  echo "found cmake in PATH"
     36#  _CMAKE=cmake
     37#elif [[ -x "$GEXTXPDFTOOLS_INSTALLED/linux/bin/cmake" ]]; then
     38# NO. Rather, only compile up OUR cmake if we haven't already got OUR cmake
     39# But don't use any system cmake: xpdf-tools is dependent on cmake version (>= 2.8.8)
     40if [[ -x "$GEXTXPDFTOOLS_INSTALLED/linux/bin/cmake" ]]; then
    3941  echo "found cmake in $GEXTXPDFTOOLS_INSTALLED/linux/bin"
    4042  _CMAKE="$GEXTXPDFTOOLS_INSTALLED/linux/bin/cmake"
  • 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
  • gs2-extensions/xpdf-tools/trunk/src/setup.bash

    r32227 r32228  
    1 # GEXTPARALLELBUILDING
     1# GEXT: XPDFTOOLS
    22
    33extdesc="the Xpdf-Tools Extension"
     
    5858    export GSDLEXTS=$GSDLEXTS:$extdir
    5959  fi
    60 
    61   echo "+Your environment is now setup for $extdesc in Greenstone"
     60  if [ "x$1" != "xsilent" ] ; then
     61      echo "+Your environment is now setup for $extdesc in Greenstone"
     62  fi
    6263else
    63   echo "+Your environment is already setup for $extdesc in Greenstone"
     64    if [ "x$1" != "xsilent" ] ; then
     65    echo "+Your environment is already setup for $extdesc in Greenstone"
     66    fi
    6467fi
    6568
    66 
     69# From http://trac.greenstone.org/browser/other-projects/trunk/realistic-books/setup.bash
     70if [ -e devel.sh ] ; then
     71    source devel.sh $*
     72fi
Note: See TracChangeset for help on using the changeset viewer.