Porting libtiff library

Adam Lackorzynski adam at os.inf.tu-dresden.de
Sun Dec 15 16:48:29 CET 2013


Hi,

On Fri Dec 13, 2013 at 11:36:49 +0900, Irvanda Kurniadi wrote:
> I'm trying to port libtiff by following the structure of libjpeg, but I
> couldn't fix the error in porting libtiff. This is the tree of libjpeg:
> libjpeg: Control Makefile Lib
>   Lib: build contrib include Makefile
>       build: jconfig.h Makefile
>       contrib: the source file of jpeg-9 library
>       include: Makefile
> 
> *What is the function of Control file?*
> libjpeg/Control:
> provides: libjpeg
> requires: libc

It lists packages that must be there to be able to build this packages,
and it states what this package offers to other packages.

> 
> libjpeg/Makefile:
> PKGDIR        = .
> L4DIR        ?= $(PKGDIR)/../..
> 
> include $(L4DIR)/mk/subdir.mk
> 
> *I think this Makefile only for generate the other Makefile in
> sub-directory. *

Indeed.

> *This Makefile also only for generating the other Makefile in targeted
> directories.*
> 
> libjpeg/lib/include/Makefile:
> PKGDIR    = ../..
> L4DIR    ?= $(PKGDIR)/../..
> 
> CONTRIB_HEADERS = y
> INCSRC_DIR      = $(PKGDIR_ABS)/lib/contrib
> TARGET          = jpeglib.h jmorecfg.h jerror.h \
>                   $(PKGDIR_ABS)/lib/build/jconfig.h
> 
> include $(L4DIR)/mk/include.mk
> 
> *What is the function of this Makefile in include directory?*

It defines the include files to be installed globally and which then can
be used by other programs and libraries.

> libjpeg/lib/build/Makefile:
> PKGDIR          ?= ../..
> L4DIR           ?= $(PKGDIR)/../..
> 
> TARGET          = libjpeg.a libjpeg.so
> SYSTEMS         = $(SYSTEMS_PLAIN)
> LIBS            = $(GCCLIB)
> CONTRIB_INCDIR  = libjpeg
> 
> SRC_C           = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c
> jccolor.c jcdctmgr.c jchuff.c \
>         jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
>         jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
>         jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
>         jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c \
>         jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
>         jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
>         jquant2.c jutils.c jmemmgr.c jmemnobs.c jdarith.c
> 
> vpath %.c $(SRC_DIR)/../contrib
> 
> include $(L4DIR)/mk/lib.mk
> 
> # prevent warnings
> CFLAGS := $(filter-out -Wextra -Wall,$(CFLAGS))
> 
> *I think this Makefile is used for compiling all c file in source lib. Is
> it true that this jconfig.h is obtained by manual configure?*

It is indeed used for compiling the C files. And yes, jconfig.h is a
fixed configuration.

> *I got the tiffconf.h after manual ./configure, then I put the tiffconf.h
> in build directory.*

Ok.

> *After I compiled the pkg, then I got this error message:*
> In file included from
> ~/l4linux_test/obj/l4/x86/include/contrib/libjpeg/jpeglib.h:27:0, from
> ~/l4linux_test/src/l4/pkg/libtiff/lib/contrib/libtiff/tif_jpeg.c:88:
> ~/l4linux_test/obj/l4/x86/include/contrib/libjpeg/jmorecfg.h:263:16: error:
> expected identifier before numeric constant
> 
> ...
> make[8]: *** [tif_jpeg.o] Error 1
> 
> please help me to find out this problem, thanks

It's an incompatibility between jpegv9 and libtiff which is said to be
fixed in jpegv9a (not yet released), thus I'd recommend taking
(temporarily) over the changes to the definition of TRUE and FALSE from
jpegv9a's version of jmorecfg.h.



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list