$NetBSD: patch-unix_Makefile.gtk,v 1.4 2021/07/24 14:54:08 ryoon Exp $ Allow adding CFLAGS from the pkgsrc environment. Use pkgsrc infrastructure for deciding on whether to link against libdl or not. pow(3) requires libm. --- unix/Makefile.gtk.orig 2021-07-10 09:47:57.000000000 +0000 +++ unix/Makefile.gtk @@ -104,14 +104,14 @@ GTK_CONFIG = sh -c 'pkg-config gtk+-3.0 unexport CFLAGS # work around a weird issue with krb5-config -CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g -I.././ -I../charset/ -I../windows/ \ +CFLAGS += -O2 -Wall -std=gnu99 -Wvla -g -I.././ -I../charset/ -I../windows/ \ -I../unix/ $(shell $(GTK_CONFIG) --cflags) -D _FILE_OFFSET_BITS=64 XLDFLAGS = $(LDFLAGS) $(shell $(GTK_CONFIG) --libs) -ULDFLAGS = $(LDFLAGS) +ULDFLAGS = $(LDFLAGS) -lm ifeq (,$(findstring NO_GSSAPI,$(COMPAT))) ifeq (,$(findstring STATIC_GSSAPI,$(COMPAT))) -XLDFLAGS+= -ldl -ULDFLAGS+= -ldl +XLDFLAGS+= ${DL_LIBS} +ULDFLAGS+= ${DL_LIBS} else CFLAGS+= -DNO_LIBDL $(shell $(KRB5CONFIG) --cflags gssapi) XLDFLAGS+= $(shell $(KRB5CONFIG) --libs gssapi) @@ -121,7 +121,7 @@ endif INSTALL=install INSTALL_PROGRAM=$(INSTALL) INSTALL_DATA=$(INSTALL) -prefix=/usr/local +prefix=${PREFIX} exec_prefix=$(prefix) bindir=$(exec_prefix)/bin mandir=$(prefix)/man