$NetBSD: patch-ac,v 1.1 2003/07/10 08:03:58 jtb Exp $

--- Makefile.in.orig
+++ Makefile.in
@@ -48,7 +48,7 @@
 AWK = @AWK@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @SHLIB_CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -77,6 +77,7 @@
 LIB_SPECS = @LIB_SPECS@
 LTLIBOBJS = @LTLIBOBJS@
 M4 = @M4@
+RM ?= rm -f
 
 # Man page
 M4_DEFS = @M4_DEFS@ @DEFS@
@@ -748,7 +749,7 @@
 
 lib/tcl/xcircuit${SHDLIB_EXT}: xcwrap.o ${xcircuit_OBJECTS}
 	$(RM) lib/xcircuit${SHDLIB_EXT}
-	$(CC) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o ${xcircuit_OBJECTS} \
+	$(CC) ${CFLAGS} -o $@ ${LDDL_FLAGS} ${LDFLAGS} xcwrap.o ${xcircuit_OBJECTS} \
 		${X_LIBS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS}
 
 tcl:	lib/tcl/xcircuit${SHDLIB_EXT}