ecpg/pgtypeslib seems to need snprintf.c pulled in, too.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Dec 2005 05:26:30 +0000 (05:26 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Dec 2005 05:26:30 +0000 (05:26 +0000)
src/interfaces/ecpg/pgtypeslib/Makefile

index 03b02e6e1c662aa02e82f654e7796c615f9d5ac7..42a3dae0bb9f6f52d6d04242e3b6eddd38134383 100644 (file)
@@ -17,28 +17,30 @@ SO_MAJOR_VERSION= 2
 SO_MINOR_VERSION= 1
 DLTYPE= library
 
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include \
-       -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) \
-       $(PTHREAD_CFLAGS) -DFRONTEND
+override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
+       -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS)
+override CFLAGS += $(PTHREAD_CFLAGS)
 
-# Need to recomple any libpgport object files
-LIBS := $(patsubst -lpgport,, $(LIBS))
+# Need to recompile any libpgport object files
+LIBS := $(filter-out -lpgport, $(LIBS))
 
 SHLIB_LINK += -lm
 
 OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
        pgstrcasecmp.o \
-       $(filter rint.o, $(LIBOBJS))
+       $(filter rint.o snprintf.o, $(LIBOBJS))
 
 all: all-lib
 
 # Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib
 
-rint.c: %.c : $(top_srcdir)/src/port/%.c
-       rm -f $@ && $(LN_S) $< .
+# We use some port modules verbatim, but since we need to
+# compile with appropriate options to build a shared lib, we can't
+# necessarily use the same object files as the backend uses. Instead,
+# symlink the source files in here and build our own object file.
 
-pgstrcasecmp.c: %.c : $(top_srcdir)/src/port/%.c
+pgstrcasecmp.c rint.c snprintf.c: % : $(top_srcdir)/src/port/%
        rm -f $@ && $(LN_S) $< .
 
 install: all installdirs install-lib
@@ -49,7 +51,7 @@ installdirs:
 uninstall: uninstall-lib
 
 clean distclean maintainer-clean: clean-lib
-       rm -f $(OBJS) rint.c pgstrcasecmp.c
+       rm -f $(OBJS) pgstrcasecmp.c rint.c snprintf.c
 
 depend dep:
        $(CC) -MM $(CFLAGS) *.c >depend