diff --git a/configure.ac b/configure.ac index 624e633ee8e..0ee32daac7b 100644 --- a/configure.ac +++ b/configure.ac @@ -785,7 +785,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" LIBPGCOMMON_CFLAGS="-I${POSTGIS_SRCDIR}/libpgcommon" LIBPGCOMMON_LDFLAGS="${POSTGIS_SRCDIR}/libpgcommon/libpgcommon.a" diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in index f806152cdc4..3d4ecc270e4 100644 --- a/doc/html/image_src/Makefile.in +++ b/doc/html/image_src/Makefile.in @@ -149,12 +149,12 @@ $(IMAGES_RESIZED): ../images/%.png: %.wkt generator styles.conf convert $@ -resize 100x100 $@ # Build the main executable -generator: ../../../liblwgeom/liblwgeom.a $(OBJS) - $(CC) -o $@ $(OBJS) ../../../liblwgeom/liblwgeom.a -lm $(CUNIT_LDFLAGS) +generator: ../../../liblwgeom/.libs/liblwgeom.a $(OBJS) + $(CC) -o $@ $(OBJS) ../../../liblwgeom/.libs/liblwgeom.a -lm $(CUNIT_LDFLAGS) # Build liblwgeom -../../../liblwgeom/liblwgeom.a: - make -C ../../../liblwgeom liblwgeom.a +../../../liblwgeom/.libs/liblwgeom.a: + make -C ../../../liblwgeom liblwgeom.la # Clean target clean: diff --git a/liblwgeom/Makefile.in b/liblwgeom/Makefile.in index 7be9edfaf82..cc20bbc8e6c 100644 --- a/liblwgeom/Makefile.in +++ b/liblwgeom/Makefile.in @@ -21,8 +21,8 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ INSTALL = $(SHELL) ../install-sh +LIBTOOL = @LIBTOOL@ -SONAME = liblwgeom.so.@POSTGIS_MAJOR_VERSION@ SOVER = @POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@.@POSTGIS_MICRO_VERSION@ @@ -84,7 +84,9 @@ SA_OBJS = \ NM_OBJS = \ lwspheroid.o -OBJS = $(SA_OBJS) $(NM_OBJS) +LT_SA_OBJS = $(SA_OBJS:.o=.lo) +LT_NM_OBJS = $(NM_OBJS:.o=.lo) +LT_OBJS = $(LT_SA_OBJS) $(LT_NM_OBJS) SA_HEADERS = \ liblwgeom.h \ @@ -92,25 +94,23 @@ SA_HEADERS = \ libtgeom.h \ lwgeom_geos.h -all: liblwgeom.a +all: liblwgeom.la # nothing to install or uninstall install uninstall: -install-liblwgeom: liblwgeom.so liblwgeom.a - $(INSTALL) liblwgeom.so $(DESTDIR)$(libdir)/liblwgeom.so.$(SOVER) - $(INSTALL) liblwgeom.a $(DESTDIR)$(libdir)/liblwgeom.a - @echo "Remember to run ldconfig" +install-liblwgeom: liblwgeom.la + $(LIBTOOL) --mode=install $(INSTALL) liblwgeom.la $(libdir)/liblwgeom.la + $(LIBTOOL) --mode=finish $(libdir) uninstall-liblwgeom: - rm -f $(DESTDIR)$(libdir)/liblwgeom.so.$(SOVER) - rm -f $(DESTDIR)$(libdir)/liblwgeom.a + $(LIBTOOL) --mode=uninstall rm -f $(libdir)/liblwgeom.la -liblwgeom.a: $(SA_OBJS) $(NM_OBJS) $(SA_HEADERS) - ar rs liblwgeom.a $(SA_OBJS) $(NM_OBJS) +#liblwgeom.a: $(SA_OBJS) $(NM_OBJS) $(SA_HEADERS) +#ar rs liblwgeom.a $(SA_OBJS) $(NM_OBJS) -liblwgeom.so: $(OBJS) $(SA_HEADERS) - $(CC) -shared -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LDFLAGS) +liblwgeom.la: $(LT_OBJS) $(SA_HEADERS) + $(LIBTOOL) --tag=CC --mode=link $(CC) -rpath $(libdir) $(LT_OBJS) -release $(SOVER) $(LDFLAGS) -o $@ maintainer-clean: clean rm -f lwin_wkt_lex.c @@ -119,28 +119,26 @@ maintainer-clean: clean clean: $(MAKE) -C cunit clean - rm -f $(OBJS) - rm -f liblwgeom.a - rm -f liblwgeom.so + 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 .o files -$(SA_OBJS): %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< +# Command to build each of the .lo files +$(LT_SA_OBJS): %.lo: %.c + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $< -# Command to build each of the .o files -$(NM_OBJS): %.o: %.c - $(CC) $(CFLAGS) $(NUMERICFLAGS) -c -o $@ $< +$(LT_NM_OBJS): %.lo: %.c + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(NUMERICFLAGS) -c -o $@ $< # Generate WKT parser from Flex/Yacc inputs lwin_wkt_parse.c: lwin_wkt_parse.y $(YACC) -o'$@' -d $^ - # $(YACC) --debug --verbose -o'$@' -d $< # $(YACC) -o'$@' -d $^ diff --git a/liblwgeom/cunit/Makefile.in b/liblwgeom/cunit/Makefile.in index 31083fff471..578cec606fa 100644 --- a/liblwgeom/cunit/Makefile.in +++ b/liblwgeom/cunit/Makefile.in @@ -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 diff --git a/loader/Makefile.in b/loader/Makefile.in index c00a55b25e3..04aec753649 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -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@ diff --git a/loader/cunit/Makefile.in b/loader/cunit/Makefile.in index 6ca57be42cb..f116fdaff87 100644 --- a/loader/cunit/Makefile.in +++ b/loader/cunit/Makefile.in @@ -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@ diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 6e3934e07e6..81c5994d983 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -68,7 +68,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 -I../libpgcommon -SHLIB_LINK = ../libpgcommon/libpgcommon.a ../liblwgeom/liblwgeom.a @SHLIB_LINK@ +SHLIB_LINK = ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a @SHLIB_LINK@ # Extra files to remove during 'make clean' EXTRA_CLEAN=$(SQL_OBJS) @@ -101,7 +101,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 ../libpgcommon/libpgcommon.a +$(PG_OBJS): ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a # Borrow the $libdir substitution from PGXS but customise by adding the version number %.sql: %.sql.in