From 5a1afb00567aeacca9ead58f5383c3f502317a69 Mon Sep 17 00:00:00 2001 From: yzrh Date: Thu, 29 Dec 2022 16:32:49 +0000 Subject: Link against libc for iconv, find openjpeg header with pkgconf. Signed-off-by: yzrh --- README.md | 12 ++++++------ src/Makefile | 7 ++++++- src/jp2.c | 4 ---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4e36fbd..1fdcf6c 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ any failures with a sample that can reproduce the behaviour. Dependency ---------- -1. OpenSSL -2. libiconv -3. zlib -4. jbig2dec -5. libjpeg-turbo -6. openjpeg +1. libcrypto (OpenSSL) +2. zlib +3. jbig2dec +4. libjpeg-turbo +5. openjpeg +6. pkgconf Usage ===== diff --git a/src/Makefile b/src/Makefile index 065a8a5..5442ff0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,11 +16,16 @@ obj = ${src:.c=.o} PREFIX = /usr/local CFLAGS = -O2 -pipe -flto -Wall -Wextra -LDFLAGS = -Wl,-O2 -lcrypto -liconv -lz -ljbig2dec -ljpeg -lopenjp2 -Wl,--as-needed +LDFLAGS = -Wl,-O2 -lcrypto -lz -ljbig2dec -ljpeg -lopenjp2 -Wl,--as-needed CFLAGS += -I/usr/local/include LDFLAGS += -L/usr/local/lib +OPENJPEG_CFLAGS != pkgconf --cflags libopenjp2 + +CFLAGS += ${OPENJPEG_CFLAGS} +CFLAGS += -DLIBICONV_PLUG + all: ${obj} ${inc} ${CC} ${LDFLAGS} -o melon ${obj} diff --git a/src/jp2.c b/src/jp2.c index 9420b48..a9d4429 100644 --- a/src/jp2.c +++ b/src/jp2.c @@ -6,11 +6,7 @@ #include -#ifdef __linux__ #include -#else -#include -#endif typedef struct _stream_user_data { OPJ_SIZE_T pos; -- cgit v1.2.3