source: gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/XPDFTOOLS.sh@ 32228

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

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.

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1#!/bin/bash
2
3# only going to make xpdf-tools, not xpdf-reader. So not making all of xpdf
4package=gs-xpdf
5version=-4.00
6
7progname=$0
8
9source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
10
11# GEXT XDFTOOLS INSTALLED location is this GEXT's GSDLOS subdir
12prefix=$GEXTXPDFTOOLS_INSTALLED
13
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"
20
21#echo GSDLOS = $GSDLOS
22
23opt_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
27if [ $auto_config = "1" ] ; then
28 if [ ! -d $package$version/release ] ; then
29 force_config=1
30 fi
31fi
32
33echo "Using cmake: "
34echo `which cmake`
35##exit 0
36
37# IGNORE: See xpdf-tools src' INSTALL instructions: need to create a 'build' dir
38# cd there and then run cmake from there, providing the xpdf-tools src dir
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
42if [ $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 \
56 -DZLIB_LIBRARY=$prefix/lib/libz.a \
57 -DPNG_LIBRARY=$prefix/lib/libpng15.a \
58 -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \
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" \
64 -DPNG_LINK_FLAGS="-lpng15" \
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"
77else
78 if [ $auto_config = "1" ] ; then
79 echo "Found top-level for ${progname%.*} => no need to run configure/initialize CMake"
80 fi
81fi
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
Note: See TracBrowser for help on using the repository browser.