$NetBSD: patch-Makefile,v 1.1 2022/03/27 10:26:53 nia Exp $ Make fewer assumptions. Avoid calling the linker directly, instead call it through CC. Honor LDFLAGS and allow the cwrappers to apply things like RELRO. --- Makefile.orig 2022-03-27 10:22:44.010550233 +0000 +++ Makefile @@ -1,14 +1,12 @@ # Change this if you have this stuff somewhere else. -TCLINC = /usr/local/lib/tcl8.0 -TKINC = /usr/local/lib/tk8.0 -X11INC = /usr/X11/include +TCLINC = ${LOCALBASE}/include +TKINC = ${LOCALBASE}/include +X11INC = ${X11BASE}/include -CFLAGS = -D__FreeBSD__ -Wall -fPIC -O3 -I$(TCLINC) -I$(TKINC) -I$(X11INC) - -CC = gcc +CFLAGS += -D__FreeBSD__ -Wall -fPIC -I$(TCLINC) -I$(TKINC) -I$(X11INC) all: ext.so ext.so: ext.o - ld -Bshareable -o ext.so ext.o + $(CC) $(LDFLAGS) -shared -o ext.so ext.o