1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # only going to make xpdf-tools, not xpdf-reader. So not making all of xpdf
|
---|
4 | package=xpdf
|
---|
5 | version=-4.00
|
---|
6 |
|
---|
7 | progname=$0
|
---|
8 |
|
---|
9 | source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
|
---|
10 |
|
---|
11 | prefix=$GEXTXPDFTOOLS_INSTALLED
|
---|
12 |
|
---|
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"
|
---|
17 |
|
---|
18 | #echo GSDLOS = $GSDLOS
|
---|
19 |
|
---|
20 | opt_run_untar $force_untar $auto_untar $package $version
|
---|
21 |
|
---|
22 | # Whether force_config is set for this package depends on CMake test
|
---|
23 | # to see if 'release' directory has been created or not
|
---|
24 | if [ $auto_config = "1" ] ; then
|
---|
25 | if [ ! -d $package$version/release ] ; then
|
---|
26 | force_config=1
|
---|
27 | fi
|
---|
28 | fi
|
---|
29 |
|
---|
30 | echo "Using cmake: "
|
---|
31 | echo `which cmake`
|
---|
32 | ##exit 0
|
---|
33 |
|
---|
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
|
---|
44 | # 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.
|
---|
47 | if [ $force_config = "1" ] ; then
|
---|
48 | echo "[pushd $package$version]"
|
---|
49 | ( cd $package$version ; \
|
---|
50 | if [ ! -d release ] ; then \
|
---|
51 | echo "Creating 'release' directory" ; \
|
---|
52 | mkdir release ; \
|
---|
53 | fi ; \
|
---|
54 | cd release ; \
|
---|
55 |
|
---|
56 | if [ ! -f Makefile ] ; then \
|
---|
57 | #cmake -D CMAKE_BUILD_TYPE=RELEASE \
|
---|
58 | # -D CMAKE_INSTALL_PREFIX=$prefix ..;
|
---|
59 | cmake -DCMAKE_BUILD_TYPE=Release \
|
---|
60 | -DCMAKE_INSTALL_PREFIX=$prefix \
|
---|
61 | -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 \
|
---|
62 | -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 \
|
---|
63 | -DCMAKE_C_FLAGS="$CFLAGS" \
|
---|
64 | -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
|
---|
65 | -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" \
|
---|
66 | $GEXT_XPDFTOOLS/packages/$package$version
|
---|
67 | fi ; \
|
---|
68 | PKG_CONFIG_PATH=$prefix/lib/pkgconfig:${PKG_CONFIG_PATH}; \
|
---|
69 | export PKG_CONFIG_PATH; \
|
---|
70 | )
|
---|
71 | if [ $? != 0 ] ; then
|
---|
72 | echo " Error encountered running *configure* stage of $progname"
|
---|
73 | exit 1
|
---|
74 | fi
|
---|
75 | echo "[popd]"
|
---|
76 | opt_run_cmake $compile $package $version "release"
|
---|
77 | opt_run_cmake $install $package $version "release" "install"
|
---|
78 | else
|
---|
79 | if [ $auto_config = "1" ] ; then
|
---|
80 | echo "Found top-level for ${progname%.*} => no need to run configure/initialize CMake"
|
---|
81 | fi
|
---|
82 | fi
|
---|