Mercurial > hg > forks > libbpg
changeset 2:bb21eb1cd483
Use pkg-config.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Dec 2016 10:17:53 +0200 |
parents | c04221f4d596 |
children | ffcd1967fb5c |
files | Makefile |
diffstat | 1 files changed, 15 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Wed Nov 16 11:17:33 2016 +0200 +++ b/Makefile Wed Dec 07 10:17:53 2016 +0200 @@ -9,6 +9,7 @@ # Enable the JCTVC code (best quality but slow) for the encoder #USE_JCTVC=y # Compile bpgview (SDL and SDL_image libraries needed) + USE_BPGVIEW=y # Enable it to use bit depths > 12 (need more tests to validate encoder) #USE_JCTVC_HIGH_BIT_DEPTH=y @@ -38,9 +39,18 @@ PWD:=$(shell pwd) +LIBSDL_CFLAGS:=$(shell pkg-config --cflags sdl) +LIBSDL_LDFLAGS:=$(shell pkg-config --libs sdl) -lSDL_image + +LIBPNG_CFLAGS:=$(shell pkg-config --cflags libpng) +LIBPNG_LDFLAGS:=$(shell pkg-config --libs libpng) + +LIBJPEG_CFLAGS:=$(shell pkg-config --cflags libjpeg) +LIBJPEG_LDFLAGS:=$(shell pkg-config --libs libjpeg) + CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -CFLAGS+=-I. +CFLAGS+=-I. $(LIBSDL_CFLAGS) $(LIBPNG_CFLAGS) $(LIBJPEG_CFLAGS) CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\" ifdef USE_JCTVC_HIGH_BIT_DEPTH CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT @@ -177,11 +187,11 @@ else LIBS:=-lrt endif # !CONFIG_APPLE + LIBS+=-lm -lpthread - -BPGDEC_LIBS:=-lpng $(LIBS) -BPGENC_LIBS+=-lpng -ljpeg $(LIBS) -BPGVIEW_LIBS:=-lSDL_image -lSDL $(LIBS) +BPGDEC_LIBS:=$(LIBPNG_LDFLAGS) $(LIBS) +BPGENC_LIBS+=$(LIBPNG_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBS) +BPGVIEW_LIBS:=$(LIBSDL_LDFLAGS) $(LIBS) endif #!CONFIG_WIN32