1 | #!/bin/bash
|
---|
2 |
|
---|
3 | package=jpeg
|
---|
4 | version=-6b
|
---|
5 |
|
---|
6 | progname=$0
|
---|
7 |
|
---|
8 | (cd .. ; \
|
---|
9 | source setup.bash silent; )
|
---|
10 |
|
---|
11 | # This syntax is from the realistic books extension:
|
---|
12 | #source $GEXT_XPDFTOOLS/cascade-make/lib/cascade-lib.bash
|
---|
13 | source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
|
---|
14 |
|
---|
15 | prefix=$GEXTXPDFTOOLS_INSTALLED
|
---|
16 |
|
---|
17 | # Unpack the libjpeg tarball
|
---|
18 | opt_run_untar $force_untar $auto_untar $package $version
|
---|
19 |
|
---|
20 | # Patch the unpacked tarball with our fixed up config.sub to get --enable-static to work
|
---|
21 | # GS: added x86_64-* to config.sub's $basic_machine list,
|
---|
22 | # since configuring produced the following error without it
|
---|
23 | # checking host system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
|
---|
24 | # in which case running make on the libjpeg package then failed with the error:
|
---|
25 | # ./libtool --mode=compile gcc -I/home/greenstone/gs3-svn-26Mar2018/gs2build/ext/xpdf-tools/linux/include -fPIC -I/home/greenstone/gs3-svn-26Mar2018/gs2build/ext/xpdf-tools/linux/include -I. -c ./jcapimin.c
|
---|
26 | # make: ./libtool: Command not found
|
---|
27 | # make: *** [jcapimin.lo] Error 127
|
---|
28 | # Error encountered running *make * stage of ./CASCADE-MAKE/LIBJPEG.sh
|
---|
29 | # The solution is taken from https://sourceforge.net/p/libjpeg/bugs/12/
|
---|
30 | if [[ -d "$package$version" && -f "gs-libjpeg-config.sub" ]]; then
|
---|
31 | echo "*******************************************************************"
|
---|
32 | echo "Using our custom gs-libjpeg-config.sub instead of the one included in $package$version"
|
---|
33 | echo "Copying across gs-libjpeg-config.sub as $package$version/config.sub"
|
---|
34 | echo "*******************************************************************"
|
---|
35 | echo `pwd`
|
---|
36 | cp "gs-libjpeg-config.sub" "$package$version/config.sub"
|
---|
37 | fi
|
---|
38 |
|
---|
39 | # This also seems to make only the static libjpeg.a
|
---|
40 | #opt_run_configure $force_config $auto_config $package $version "$prefix"
|
---|
41 | # Similarly, despite turning on --enable-shared as well as explained at
|
---|
42 | # http://www.linuxfromscratch.org/blfs/view/6.3/general/libjpeg.html
|
---|
43 | # only the libjpeg.a is produced with this command
|
---|
44 | opt_run_configure $force_config $auto_config $package $version "$prefix" \
|
---|
45 | --enable-static --enable-shared
|
---|
46 | # The following didn't fix the configuration and subsequent libtool error described above
|
---|
47 | # and with or without it, there's still reference to host=x86_64-unknown(-unknown)-linux-gnu in configure output:
|
---|
48 | # --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-shared --enable-static
|
---|
49 |
|
---|
50 | opt_run_make $compile $package $version
|
---|
51 | opt_run_make $install $package $version "install-lib"
|
---|
52 | opt_run_make $clean $package $version "clean"
|
---|
53 | opt_run_make $distclean $package $version "distclean"
|
---|
54 |
|
---|
55 | opt_run_tarclean $tarclean $package $version
|
---|
56 |
|
---|