Porting libtiff library

Irvanda Kurniadi irvanda.k at gmail.com
Fri Dec 13 03:36:49 CET 2013


Hi hackers,

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

libjpeg/Makefile:
PKGDIR        = .
L4DIR        ?= $(PKGDIR)/../..

include $(L4DIR)/mk/subdir.mk

*I think this Makefile only for generate the other Makefile in
sub-directory. *

libjpeg/lib/Makefile:
PKGDIR    ?= ..
L4DIR    ?= $(PKGDIR)/../..

TARGET = include build

include $(L4DIR)/mk/subdir.mk

*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?*

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?*

*From this understanding I tried to port libtiff with the same way:*
libtiff: Control lib Makefile
  lib: build contrib include Makefile
      build: Makefile tiffconf.h
      contrib: the source file of tiff-4.0.3
      include: Makefile

libtiff/Control:
provides: libtiff
requires: zlib libc l4re_c libjpeg

libtiff/Makefile:
PKGDIR        = .
L4DIR        ?= $(PKGDIR)/../..

include $(L4DIR)/mk/subdir.mk

libtiff/lib/Makefile:
PKGDIR    ?= ..
L4DIR    ?= $(PKGDIR)/../..

TARGET = include build

include $(L4DIR)/mk/subdir.mk

libtiff/lib/include/Makefile:
PKGDIR =     ../..
L4DIR ?=     $(PKGDIR)/../..

CONTRIB_HEADERS = y
INCSRC_DIR      = $(PKGDIR_ABS)/lib/contrib/libtiff
TARGET        = tif_config.h \
          $(PKGDIR_ABS)/lib/build/tiffconf.h

include $(L4DIR)/mk/include.mk

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

libtiff/lib/build/Makefile:
PKGDIR          ?= ../..
L4DIR           ?= $(PKGDIR)/../..

TARGET          = libtiff.a libtiff.so
REQUIRES_LIBS      = libjpeg
SYSTEMS         = $(SYSTEMS_PLAIN)
LIBS            = $(GCCLIB)
CONTRIB_INCDIR  = libtiff

SRC_C           = tif_aux.c tif_close.c tif_codec.c tif_color.c \
tif_compress.c tif_dir.c tif_dirinfo.c tif_dirread.c tif_dirwrite.c \
tif_dumpmode.c tif_error.c tif_extension.c tif_fax3.c tif_fax3sm.c \
tif_flush.c tif_getimage.c tif_jbig.c tif_jpeg_12.c tif_jpeg.c \
tif_luv.c tif_lzma.c tif_lzw.c tif_next.c tif_ojpeg.c tif_open.c \
tif_packbits.c tif_pixarlog.c tif_predict.c tif_print.c tif_read.c \
tif_read.c tif_strip.c tif_swab.c tif_thunder.c tif_tile.c tif_unix.c \
tif_version.c tif_warning.c tif_win32.c tif_write.c tif_zip.c

vpath %.c $(SRC_DIR)/../contrib/libtiff

include $(L4DIR)/mk/lib.mk

# prevent warnings
CFLAGS := $(filter-out -Wextra -Wall,$(CFLAGS))

*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

Regards,
Irvanda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20131213/7d42ca69/attachment.html>


More information about the l4-hackers mailing list