[32227] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | # only going to make xpdf-tools, not xpdf-reader. So not making all of xpdf
|
---|
[32228] | 4 | package=gs-xpdf
|
---|
[32227] | 5 | version=-4.00
|
---|
| 6 |
|
---|
| 7 | progname=$0
|
---|
| 8 |
|
---|
| 9 | source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
|
---|
| 10 |
|
---|
[32228] | 11 | # GEXT XDFTOOLS INSTALLED location is this GEXT's GSDLOS subdir
|
---|
[32227] | 12 | prefix=$GEXTXPDFTOOLS_INSTALLED
|
---|
| 13 |
|
---|
[32228] | 14 | # Use C/CPP/CXX FLAGS and LDFLAGS for setting up
|
---|
| 15 | # libpng and libz for compiling xpdftools
|
---|
| 16 | export CFLAGS="$CFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15"
|
---|
| 17 | export CPPFLAGS="$CPPFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15"
|
---|
| 18 | export CXXFLAGS="$CXXFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15"
|
---|
| 19 | export LDFLAGS="$LDFLAGS -L$GEXTXPDFTOOLS_INSTALLED/lib"
|
---|
[32227] | 20 |
|
---|
| 21 | #echo GSDLOS = $GSDLOS
|
---|
| 22 |
|
---|
| 23 | opt_run_untar $force_untar $auto_untar $package $version
|
---|
| 24 |
|
---|
| 25 | # Whether force_config is set for this package depends on CMake test
|
---|
| 26 | # to see if 'release' directory has been created or not
|
---|
| 27 | if [ $auto_config = "1" ] ; then
|
---|
| 28 | if [ ! -d $package$version/release ] ; then
|
---|
| 29 | force_config=1
|
---|
| 30 | fi
|
---|
| 31 | fi
|
---|
| 32 |
|
---|
| 33 | echo "Using cmake: "
|
---|
| 34 | echo `which cmake`
|
---|
| 35 | ##exit 0
|
---|
| 36 |
|
---|
[32228] | 37 | # IGNORE: See xpdf-tools src' INSTALL instructions: need to create a 'build' dir
|
---|
[32227] | 38 | # cd there and then run cmake from there, providing the xpdf-tools src dir
|
---|
[32228] | 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
|
---|
[32227] | 42 | if [ $force_config = "1" ] ; then
|
---|
| 43 | echo "[pushd $package$version]"
|
---|
| 44 | ( cd $package$version ; \
|
---|
| 45 | if [ ! -d release ] ; then \
|
---|
| 46 | echo "Creating 'release' directory" ; \
|
---|
| 47 | mkdir release ; \
|
---|
| 48 | fi ; \
|
---|
| 49 | cd release ; \
|
---|
| 50 |
|
---|
| 51 | if [ ! -f Makefile ] ; then \
|
---|
| 52 | #cmake -D CMAKE_BUILD_TYPE=RELEASE \
|
---|
| 53 | # -D CMAKE_INSTALL_PREFIX=$prefix ..;
|
---|
| 54 | cmake -DCMAKE_BUILD_TYPE=Release \
|
---|
| 55 | -DCMAKE_INSTALL_PREFIX=$prefix \
|
---|
[32228] | 56 | -DZLIB_LIBRARY=$prefix/lib/libz.a \
|
---|
| 57 | -DPNG_LIBRARY=$prefix/lib/libpng15.a \
|
---|
| 58 | -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \
|
---|
[32227] | 59 | -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 \
|
---|
| 60 | -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 \
|
---|
| 61 | -DCMAKE_C_FLAGS="$CFLAGS" \
|
---|
| 62 | -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
|
---|
| 63 | -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" \
|
---|
[32228] | 64 | -DPNG_LINK_FLAGS="-lpng15" \
|
---|
[32227] | 65 | $GEXT_XPDFTOOLS/packages/$package$version
|
---|
| 66 | fi ; \
|
---|
| 67 | PKG_CONFIG_PATH=$prefix/lib/pkgconfig:${PKG_CONFIG_PATH}; \
|
---|
| 68 | export PKG_CONFIG_PATH; \
|
---|
| 69 | )
|
---|
| 70 | if [ $? != 0 ] ; then
|
---|
| 71 | echo " Error encountered running *configure* stage of $progname"
|
---|
| 72 | exit 1
|
---|
| 73 | fi
|
---|
| 74 | echo "[popd]"
|
---|
| 75 | opt_run_cmake $compile $package $version "release"
|
---|
| 76 | opt_run_cmake $install $package $version "release" "install"
|
---|
| 77 | else
|
---|
| 78 | if [ $auto_config = "1" ] ; then
|
---|
| 79 | echo "Found top-level for ${progname%.*} => no need to run configure/initialize CMake"
|
---|
| 80 | fi
|
---|
| 81 | fi
|
---|
[32228] | 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
|
---|