44#
55# Copyright (c) 1994, Regents of the University of California
66#
7- # $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.26 2005/03/14 17:27:50 momjian Exp $
7+ # $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.27 2005/12/06 05:26:21 tgl Exp $
88#
99# -------------------------------------------------------------------------
1010
@@ -17,28 +17,30 @@ SO_MAJOR_VERSION= 2
1717SO_MINOR_VERSION = 1
1818DLTYPE = library
1919
20- override CPPFLAGS := -I$(top_srcdir ) /src/interfaces/ecpg/include\
21- -I$(top_srcdir ) /src/include/utils -I$(libpq_srcdir ) $(CPPFLAGS ) \
22- $(PTHREAD_CFLAGS ) -DFRONTEND
20+ override CPPFLAGS := -DFRONTEND - I$(top_srcdir ) /src/interfaces/ecpg/include\
21+ -I$(top_srcdir ) /src/include/utils -I$(libpq_srcdir ) $(CPPFLAGS )
22+ override CFLAGS += $(PTHREAD_CFLAGS )
2323
24- # Need torecomple any libpgport object files
25- LIBS :=$(patsubst -lpgport, ,$(LIBS ) )
24+ # Need torecompile any libpgport object files
25+ LIBS :=$(filter-out -lpgport,$(LIBS ) )
2626
2727SHLIB_LINK += -lm
2828
2929OBJS = numeric.o datetime.o common.o dt_common.o timestamp.o interval.o\
3030pgstrcasecmp.o\
31- $(filter rint.o,$(LIBOBJS ) )
31+ $(filter rint.o snprintf.o ,$(LIBOBJS ) )
3232
3333all : all-lib
3434
3535# Shared library stuff
3636include $(top_srcdir ) /src/Makefile.shlib
3737
38- rint.c :% .c :$(top_srcdir ) /src/port/% .c
39- rm -f$@ && $(LN_S ) $< .
38+ # We use some port modules verbatim, but since we need to
39+ # compile with appropriate options to build a shared lib, we can't
40+ # necessarily use the same object files as the backend uses. Instead,
41+ # symlink the source files in here and build our own object file.
4042
41- pgstrcasecmp.c : % .c: $(top_srcdir ) /src/port/% .c
43+ pgstrcasecmp.c rint .csnprintf.c : % : $(top_srcdir ) /src/port/%
4244rm -f$@ && $(LN_S ) $< .
4345
4446install : all installdirs install-lib
@@ -49,7 +51,7 @@ installdirs:
4951uninstall : uninstall-lib
5052
5153clean distclean maintainer-clean : clean-lib
52- rm -f$(OBJS ) rint.cpgstrcasecmp .c
54+ rm -f$(OBJS ) pgstrcasecmp.c rint.csnprintf .c
5355
5456depend dep :
5557$(CC ) -MM$(CFLAGS ) * .c> depend