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

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

Finally, committing the version of the code that runs the static compilation of xpdf-tools to completion. Still have the issue that pdftohtml and possibly some other binaries don't run (bash says it can't find the file when I try to execute pdftohtml), but pdftotext at least runs to print the usage, though I have yet to test that out on an actual PDF. Committing this version since it at least completes the process of building xpdf-tools statically. The CMakeLists.txt file introduced in this commit (and now contained in the current update to gs-xpdf-4.00.tar.gz) contains all the modifications made to the original CMakeLists.txt (the one in xpdf-4.00.tar.gz).

  • Property svn:executable set to *
File size: 4.0 KB
RevLine 
[32227]1#!/bin/bash
2
3# only going to make xpdf-tools, not xpdf-reader. So not making all of xpdf
[32233]4package=gs-xpdf
[32227]5version=-4.00
6
7progname=$0
8
9source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
10
[32228]11# GEXT XDFTOOLS INSTALLED location is this GEXT's GSDLOS subdir
[32227]12prefix=$GEXTXPDFTOOLS_INSTALLED
13
[32230]14# Use C/CPP/CXX FLAGS and LDFLAGS for further setting up
[32228]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"
[32227]20
21
22opt_run_untar $force_untar $auto_untar $package $version
23
24# Whether force_config is set for this package depends on CMake test
25# to see if 'release' directory has been created or not
26if [ $auto_config = "1" ] ; then
27 if [ ! -d $package$version/release ] ; then
28 force_config=1
29 fi
30fi
31
32echo "Using cmake: "
33echo `which cmake`
34
[32230]35# The xpdf-tools src code's INSTALL instructions say we need to create a 'build' dir,
36# cd into there and then run cmake from there, providing the xpdf-tools src dir
37# However, doing so breaks the way cascade-lib.bash runs a CMake compile sequence.
38# cascade-lib.bash wants a 'release' directory, so do it the cascade-make way as
39# that works.
[32228]40# TO AVOID building xpdf(reader), turn off finding Qt libs with the cmake flags below
[32227]41if [ $force_config = "1" ] ; then
42 echo "[pushd $package$version]"
43 ( cd $package$version ; \
44 if [ ! -d release ] ; then \
45 echo "Creating 'release' directory" ; \
46 mkdir release ; \
47 fi ; \
48 cd release ; \
49
[32230]50 # see xpdf-tools src code's INSTALL file for these options
[32227]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 \
[32233]56 -DZLIB_LIBRARY=$prefix/lib/libz.a \
57 -DPNG_LIBRARY=$prefix/lib/libpng15.a \
[32232]58 -DFREETYPE_DIR=$prefix \
[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" \
64 $GEXT_XPDFTOOLS/packages/$package$version
65 fi ; \
66 PKG_CONFIG_PATH=$prefix/lib/pkgconfig:${PKG_CONFIG_PATH}; \
67 export PKG_CONFIG_PATH; \
68 )
69 if [ $? != 0 ] ; then
70 echo " Error encountered running *configure* stage of $progname"
71 exit 1
72 fi
73 echo "[popd]"
74 opt_run_cmake $compile $package $version "release"
75 opt_run_cmake $install $package $version "release" "install"
76else
77 if [ $auto_config = "1" ] ; then
78 echo "Found top-level for ${progname%.*} => no need to run configure/initialize CMake"
79 fi
80fi
[32228]81
[32230]82# If compiling statically, need these above in place of the references to .so files
83# -DZLIB_LIBRARY=$prefix/lib/libz.a \
84# -DPNG_LIBRARY=$prefix/lib/libpng15.a \
85# -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \
86
87
88## When -DFREETYPE_DIR is used in place of -DFREETYPE_LIBRARY above, it makes
89## xpdf-tools compilation find the "libfreetype.so" (no versioning at end) in
90## our gs ext.
91## But -DZLIB_DIR and -DPNG_DIR are ignored because they go unrecognised, whereas
92## -DZLIB_LIBRARY and -DPNG_LIBRARY are recognised by XpdfTools' CMake files.
93## -DZLIB_LIBRARY and -DPNG_LIBRARY require full paths. So the first 2 lines of the
94## following won't work:
[32228]95# -DZLIB_DIR=$prefix \
96# -DPNG_DIR=$prefix \
97# -DFREETYPE_DIR=$prefix \
98
[32230]99## When specified in the following way, all 3 lines are recognised (freetype, zlib,
100## png). The 3rd line can alternatively still use "-DFREETYPE_DIR=$prefix"
[32228]101# -DZLIB_LIBRARY=$prefix/lib/libz.so.1.2.7 \
102# -DPNG_LIBRARY=$prefix/lib/libpng15.so.15.30.0 \
103# -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.so.6.3.20 \
104
105
106# If compilation was successful, then we don't need cmake binaries anymore when
107# packaging up xpdf-tools
Note: See TracBrowser for help on using the repository browser.