$NetBSD: patch-ab,v 1.2 2010/03/05 14:55:21 gdt Exp $

--- liblwgeom/Makefile.in.orig	2010-01-29 21:24:24.000000000 +0000
+++ liblwgeom/Makefile.in
@@ -60,10 +60,12 @@ SA_HEADERS = \
 	liblwgeom.h \
 	lwalgorithm.h
 
-all: liblwgeom.a
+all: liblwgeom.la
 
-liblwgeom.a: $(SA_OBJS) $(NM_OBJS) $(SA_HEADERS) 
-	ar rs liblwgeom.a $(SA_OBJS) $(NM_OBJS) 	
+liblwgeom.la: $(SA_OBJS) $(NM_OBJS) $(SA_HEADERS) 
+	${LIBTOOL} --mode=link ${CC} -o liblwgeom.la \
+		${SA_OBJS:.o=.lo} ${NM_OBJS:.o=.lo} -rpath ${PREFIX}/lib \
+		-version-info @POSTGIS_MAJOR_VERSION@:@POSTGIS_MINOR_VERSION@
 
 clean:
 	rm -f $(SA_OBJS) 
@@ -75,11 +77,11 @@ check: liblwgeom.a
 
 # Command to build each of the .o files
 $(SA_OBJS): %.o: %.c 
-	$(CC) $(CFLAGS) -c -o $@ $<
+	${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
 
 # Command to build each of the .o files
 $(NM_OBJS): %.o: %.c 
-	$(CC) $(CFLAGS) $(NUMERICFLAGS) -c -o $@ $<
+	${LIBTOOL} --mode=compile $(CC) $(CFLAGS) $(NUMERICFLAGS) -c -o $@ $<
 
 
 # Commands to generate the lexer and parser from input files
