2020.11.10 09:40 "[Tiff] Compiling Libtiff with JBIG support", by Peter Chan

2020.11.10 09:40 "[Tiff] Compiling Libtiff with JBIG support", by Peter Chan

Hi,

I have been trying to compile Libtiff v4.1.0 with JBIG support, jbigkit v2.1 for macOS 10.14 but failed in the end. It seems the configure tool is not able to configure the jbig directory correctly.

Below is the steps, configuring and compile under shell. Am I doing this correctly?

$ cd ~/Project-Lib
$ tar xzvf tiff-4.1.0.tar.gz

$ tar xzvf jbigkit-2.1.tar.gz
$ cd jbigkit-2.1
$ make

$ cp -r libjbig ~/Project-Lib/tiff-4.1.0/
$ cd ../tiff-4.1.0
$ ./configure --with-jbig-include-dir=./libjbig/ --with-jbig-lib-dir=./libjbig/

/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -W -L./libjbig/ -o libport.la dummy.lo -ljbig -lz
../libtool: line 7486: cd: ./libjbig/: No such file or directory
libtool: error: cannot determine absolute directory name of './libjbig/'
make[1]: *** [libport.la] Error 1
make: *** [all-recursive] Error 1

#### Have to edit config.status file to continue
$ edit config.status
#### Need to change from

S["CPPFLAGS"]="-I./libjbig/ "
S["LDFLAGS"]="-L./libjbig/ "

To

S["CPPFLAGS"]="-I../libjbig/ "
S["LDFLAGS"]="-L../libjbig/ "

$ make
#### Compile fail

/bin/sh ../../libtool --tag=CC --mode=link gcc -g -O2 -Wall -W -L../libjbig/ -o addtiffo addtiffo.o tif_overview.o tif_ovrcache.o ../../libtiff/libtiff.la -ljbig -lz
../../libtool: line 7486: cd: ../libjbig/: No such file or directory
libtool: error: cannot determine absolute directory name of '../libjbig/'
make[2]: *** [addtiffo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

#### Have to edit libtool file to continue

$ edit libtool

#### Goto line 7486

#### Need to change from
      absdir=`cd "$dir" && pwd`
To
      absdir=`cd "../$dir" && pwd`

$ make
libtool: link: gcc -g -O2 -Wall -W -o .libs/addtiffo addtiffo.o tif_overview.o tif_ovrcache.o -L../libjbig/ ../../libtiff/.libs/libtiff.dylib -ljbig -lz
ld: warning: directory not found for option '-L../libjbig/'
ld: library not found for -ljbig
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [addtiffo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

#### Manage to compile up to libtiff.a and various *.dylib are generated but it stop here. ####
#### That's my best effort. Don't know how to continue from here. ####

Thanks.

Peter