pngloss: patch Makefile to respect CFLAGS & LDFLAGS

- set C compiler standard to C99

See: https://trac.macports.org/ticket/70456
This commit is contained in:
Herby Gillot
2024-08-25 23:27:38 -04:00
parent db29ecf41a
commit 3f6f65ad24
2 changed files with 33 additions and 6 deletions
+6 -6
View File
@@ -6,7 +6,7 @@ PortGroup makefile 1.0
github.setup foobaz pngloss 1.0 v
github.tarball_from archive
revision 0
revision 1
description Lossy compression of PNG images
@@ -30,10 +30,10 @@ checksums rmd160 e87c09329c8eeb702e05381368e1c59b8eb29d55 \
sha256 24c5c3d176b299a3787fb019f668808ff54a75f236fb5e65ad87ecf499e26f77 \
size 3108037
depends_build-append \
port:autoconf \
port:automake \
port:libtool \
port:pkgconfig
patchfiles-append patch-Makefile.diff
depends_lib-append port:libpng
build.target ${name}
compiler.c_standard 1999
@@ -0,0 +1,27 @@
--- ./Makefile 2024-08-25 23:22:11
+++ ./Makefile 2024-08-25 23:23:26
@@ -1,9 +1,12 @@
-include config.mk
+PREFIX ?= /opt/local
+
CC ?= /usr/bin/cc
-CFLAGS = -O3 -Wall -Wextra -I/usr/local/include
-LDFLAGS = -L/usr/local/lib -lpng
-VERSION = 1.0
+CFLAGS ?= -O3 -Wall -Wextra -I$(PREFIX)/include
+LDFLAGS ?= -L$(PREFIX)/lib
+DEFAULT_LDFLAGS = -lpng
+VERSION ?= 1.0
BIN ?= pngloss
DESTDIR ?= /usr/local
@@ -19,7 +22,7 @@
all: $(BIN)
$(BIN): $(OBJS)
- $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) -o $@
+ $(CC) $(OBJS) $(CFLAGS) $(DEFAULT_LDFLAGS) $(LDFLAGS) -o $@
dist: $(TARFILE)