]> granicus.if.org Git - postgis/commitdiff
Use libtool to build liblwgeom. Still only static. [RT-SIGTA]
authorSandro Santilli <strk@keybit.net>
Sat, 6 Aug 2011 15:12:32 +0000 (15:12 +0000)
committerSandro Santilli <strk@keybit.net>
Sat, 6 Aug 2011 15:12:32 +0000 (15:12 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7699 b70326c6-7e19-0410-871a-916f4a2858ee

.gitignore
configure.ac
liblwgeom/Makefile.in
liblwgeom/cunit/Makefile.in
loader/Makefile.in
loader/cunit/Makefile.in
postgis/Makefile.in

index 2e282bc5628f3e85a80e9b648e1f6ced86d6ec55..a4c85cfcf458eba624e754f6fe973746f8e19d4c 100644 (file)
@@ -1,4 +1,7 @@
 *.a
+*.la
+.libs
+*.lo
 aclocal.m4
 autom4te.cache/
 config.guess
index 9a679c6b364c3636ede957238f9d2150bbd1f81b..8ec37efad1838562910bbda279d5f3b50d23bc37 100644 (file)
@@ -777,7 +777,7 @@ if test "x$RASTER" = "xraster"; then dnl # {
     dnl ================================================
     POSTGIS_SRCDIR=`$PWDREGRESS`
     LIBLWGEOM_CFLAGS="-I${POSTGIS_SRCDIR}/liblwgeom"
-    LIBLWGEOM_LDFLAGS="${POSTGIS_SRCDIR}/liblwgeom/liblwgeom.a"
+    LIBLWGEOM_LDFLAGS="${POSTGIS_SRCDIR}/liblwgeom/.libs/liblwgeom.a"
 
     AC_SUBST([POSTGIS_SRCDIR])
     AC_SUBST([LIBLWGEOM_CFLAGS])
index bd3eef91a2f82c68a8b653557e0fc74e78ded7e1..f003938eca2b90f63aa87876cadd029b2a899ec7 100644 (file)
@@ -14,6 +14,9 @@ CC = @CC@
 CFLAGS = @CFLAGS@ @PICFLAGS@ @WARNFLAGS@ @GEOS_CPPFLAGS@
 LDFLAGS = @GEOS_LDFLAGS@ -lgeos_c
 NUMERICFLAGS = @NUMERICFLAGS@
+top_builddir = @top_builddir@
+LIBTOOL = @LIBTOOL@
+
 
 YACC=@YACC@
 LEX=@LEX@
@@ -80,11 +83,16 @@ SA_HEADERS = \
        libtgeom.h \
        lwgeom_geos.h
 
-all: liblwgeom.a
+LT_OBJS = $(SA_OBJS:.o=.lo) $(NM_OBJS:.o=.lo)
+
+all: liblwgeom.la
 
 # nothing to install or uninstall
 install uninstall:
 
+liblwgeom.la: $(LT_OBJS) $(SA_HEADERS)
+       $(LIBTOOL) --mode=link $(CC) -o liblwgeom.la $(LT_OBJS) 
+
 liblwgeom.a: $(SA_OBJS) $(NM_OBJS) $(SA_HEADERS)
        ar rs liblwgeom.a $(SA_OBJS) $(NM_OBJS) 
 
@@ -98,13 +106,20 @@ clean:
        rm -f $(SA_OBJS) 
        rm -f $(NM_OBJS) 
        rm -f liblwgeom.a 
+       rm -f $(LT_OBJS) 
+       rm -f liblwgeom.la 
+       rm -rf .libs
 
 # Nothing specific in distclean (will be done by clean)
 distclean:
 
-check: liblwgeom.a
+check: liblwgeom.la
        make -C cunit check
 
+# Command to build each of the .lo files
+$(LT_OBJS): %.lo: %.c 
+       $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
+
 # Command to build each of the .o files
 $(SA_OBJS): %.o: %.c 
        $(CC) $(CFLAGS) -c -o $@ $<
index 990601952f9585f3cbf94301b66f47a62e3efc05..9f9e132cd721eeca63953c7eebfc2babcd4232ca 100644 (file)
@@ -56,8 +56,8 @@ check: cu_tester
 endif
 
 # Build the main unit test executable
-cu_tester: ../liblwgeom.a $(OBJS)
-       $(CC) -o $@ $(OBJS) ../liblwgeom.a -lm $(CUNIT_LDFLAGS) $(LDFLAGS)
+cu_tester: ../.libs/liblwgeom.a $(OBJS)
+       $(CC) -o $@ $(OBJS) ../.libs/liblwgeom.a -lm $(CUNIT_LDFLAGS) $(LDFLAGS)
 
 # Command to build each of the .o files
 $(OBJS): %.o: %.c
index 643710d17a549ebeb01ea07a4f96640e1e7de80d..a31b59534ae85c5fc7bb5fb52047c71f5fc6a836 100644 (file)
@@ -39,7 +39,7 @@ ICONV_LDFLAGS=@ICONV_LDFLAGS@
 ICONV_CFLAGS=@ICONV_CFLAGS@
 
 # liblwgeom
-LIBLWGEOM=../liblwgeom/liblwgeom.a
+LIBLWGEOM=../liblwgeom/.libs/liblwgeom.a
 
 # GTK includes and libraries
 GTK_CFLAGS = @GTK_CFLAGS@ @IGE_MAC_CFLAGS@
index 6ca57be42cbc6f9428afc0b4d5d3ea17f7f82789..f116fdaff8764e4f6046081a9e435a10aa7a9b74 100644 (file)
@@ -26,7 +26,7 @@ PGSQL_FE_CPPFLAGS=@PGSQL_FE_CPPFLAGS@
 PGSQL_FE_LDFLAGS=@PGSQL_FE_LDFLAGS@
 
 # liblwgeom
-LIBLWGEOM=../../liblwgeom/liblwgeom.a
+LIBLWGEOM=../../liblwgeom/.libs/liblwgeom.a
 
 # iconv flags
 ICONV_LDFLAGS=@ICONV_LDFLAGS@
index 542cddff08a1f24c82400656041d6782e1bc933d..d1ac6b32e43e95de7edc9810e452d129bf0679cb 100644 (file)
@@ -74,7 +74,7 @@ OBJS=$(PG_OBJS)
 # older version of PostGIS, rather than with the static liblwgeom.a 
 # supplied with newer versions of PostGIS
 PG_CPPFLAGS+=@CPPFLAGS@ -I../liblwgeom
-SHLIB_LINK+=@SHLIB_LINK@ ../liblwgeom/liblwgeom.a
+SHLIB_LINK+=@SHLIB_LINK@ ../liblwgeom/.libs/liblwgeom.a
 
 # Extra files to remove during 'make clean'
 EXTRA_CLEAN=$(SQL_OBJS)
@@ -107,7 +107,7 @@ endif
 
 # Make all PostGIS objects depend upon liblwgeom, so that if an underlying
 # change is made, a PostGIS rebuild is triggered.
-$(PG_OBJS): ../liblwgeom/liblwgeom.a 
+$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a 
 
 # Borrow the $libdir substitution from PGXS but customise by adding the version number
 %.sql: %.sql.in