1 | #!/bin/bash
|
---|
2 |
|
---|
3 | package=jpeg
|
---|
4 | #version=-6b
|
---|
5 | # version 9c is from 2018, see www.ijg.org. Version 6b is from 2008
|
---|
6 | version=-9c
|
---|
7 |
|
---|
8 | # renamed the downloaded jpegsrc.v9c.tar.gz to jpeg$version.tar.gz
|
---|
9 | # similarly for the earlier 6b version.
|
---|
10 |
|
---|
11 | progname=$0
|
---|
12 |
|
---|
13 | (cd .. ; \
|
---|
14 | source setup.bash silent; )
|
---|
15 |
|
---|
16 | # This syntax is from the realistic books extension:
|
---|
17 | #source $GEXT_XPDFTOOLS/cascade-make/lib/cascade-lib.bash
|
---|
18 | source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
|
---|
19 |
|
---|
20 | prefix=$GEXTXPDFTOOLS_INSTALLED
|
---|
21 |
|
---|
22 | # Unpack the libjpeg tarball
|
---|
23 | opt_run_untar $force_untar $auto_untar $package $version
|
---|
24 |
|
---|
25 | # Patch the unpacked tarball with our fixed up config.sub to get --enable-static to work
|
---|
26 | # GS: added x86_64-* to config.sub's $basic_machine list,
|
---|
27 | # since configuring produced the following error without it
|
---|
28 | # checking host system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
|
---|
29 | # in which case running make on the libjpeg package then failed with the error:
|
---|
30 | # ./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
|
---|
31 | # make: ./libtool: Command not found
|
---|
32 | # make: *** [jcapimin.lo] Error 127
|
---|
33 | # Error encountered running *make * stage of ./CASCADE-MAKE/LIBJPEG.sh
|
---|
34 | # The solution is taken from https://sourceforge.net/p/libjpeg/bugs/12/
|
---|
35 | ##if [[ -d "$package$version" && -f "gs-libjpeg-config.sub" ]]; then
|
---|
36 | ## echo "*******************************************************************"
|
---|
37 | ## echo "Using our custom gs-libjpeg-config.sub instead of the one included in $package$version"
|
---|
38 | ## echo "Copying across gs-libjpeg-config.sub as $package$version/config.sub"
|
---|
39 | ## echo "*******************************************************************"
|
---|
40 | ## echo `pwd`
|
---|
41 | ## cp "gs-libjpeg-config.sub" "$package$version/config.sub"
|
---|
42 | ##fi
|
---|
43 |
|
---|
44 | # This also seems to make only the static libjpeg.a
|
---|
45 | #opt_run_configure $force_config $auto_config $package $version "$prefix"
|
---|
46 | # Similarly, despite turning on --enable-shared as well as explained at
|
---|
47 | # http://www.linuxfromscratch.org/blfs/view/6.3/general/libjpeg.html
|
---|
48 | # only the libjpeg.a is produced with this command
|
---|
49 | opt_run_configure $force_config $auto_config $package $version "$prefix" --disable-shared
|
---|
50 | #opt_run_configure $force_config $auto_config $package $version "$prefix" \
|
---|
51 | # --enable-static --enable-shared
|
---|
52 | # --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-static --enable-shared
|
---|
53 | # The following didn't fix the configuration and subsequent libtool error described above
|
---|
54 | # and with or without it, there's still reference to host=x86_64-unknown(-unknown)-linux-gnu in configure output:
|
---|
55 | # --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-shared --enable-static
|
---|
56 |
|
---|
57 | opt_run_make $compile $package $version
|
---|
58 | #opt_run_make $install $package $version "install-lib"
|
---|
59 | # Contrary to the install.txt in version jpeg version 9c, install-lib is an unrecognised make command
|
---|
60 | # I found there was an install-libLTLIBRARIES target in the Makefile, however. And that seems to at least copy over libjpeg.a
|
---|
61 | opt_run_make $install $package $version "install-libLTLIBRARIES"
|
---|
62 | opt_run_make $clean $package $version "clean"
|
---|
63 | opt_run_make $distclean $package $version "distclean"
|
---|
64 |
|
---|
65 | opt_run_tarclean $tarclean $package $version
|
---|
66 |
|
---|
67 | # according to jpeg version 9c's install.txt, these 4 header files need to be copied into the include folder (besides installing libjpeg.a)
|
---|
68 | # if building something against the libjpeg library, as we do with xpdf-tools
|
---|
69 | cp $package$version/jpeglib.h $package$version/jerror.h $package$version/jconfig.h $package$version/jmorecfg.h $GEXTXPDFTOOLS_INSTALLED/include/.
|
---|
70 |
|
---|