freebsd-ports/graphics/apngdis/files/patch-Makefile
Danilo Egea Gondolfo 6be5098af1 - Update to 2.8
2015-03-31 02:30:05 +00:00

24 lines
618 B
Text

--- Makefile.orig
+++ Makefile
@@ -1,11 +1,16 @@
PACKAGE = apngdis
-CC = gcc
-CFLAGS = -Wall -pedantic
-CFLAGS_OPT = -O2
-LIBS = -lstdc++ -lm -lpng -lz
+CXX ?= c++
+CXXFLAGS += -Wall -pedantic
+CPPFLAGS += $(shell libpng-config --cflags)
+ifeq ($(strip $(STATIC)),)
+LIBS = $(shell libpng-config --ldflags)
+else
+LIBS = $(shell libpng-config --static --ldflags)
+LDFLAGS += -static
+endif
all :
- $(CC) $(CFLAGS) $(CFLAGS_OPT) -o $(PACKAGE) $(PACKAGE).cpp -s $(LIBS)
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(PACKAGE) $(PACKAGE).cpp -s $(LIBS) $(LDFLAGS)
.PHONY : clean