OSDN Git Service

Also created export list for pgytpeslib and compatlib.
authorMichael Meskes <meskes@postgresql.org>
Wed, 3 Oct 2007 13:20:19 +0000 (13:20 +0000)
committerMichael Meskes <meskes@postgresql.org>
Wed, 3 Oct 2007 13:20:19 +0000 (13:20 +0000)
Set pgtypes library version to 3.0.
Set compat library version to 3.0.

src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/compatlib/Makefile
src/interfaces/ecpg/compatlib/exports.txt [new file with mode: 0644]
src/interfaces/ecpg/compatlib/informix.c
src/interfaces/ecpg/pgtypeslib/Makefile
src/interfaces/ecpg/pgtypeslib/exports.txt [new file with mode: 0644]

index e6eab07..3be4f39 100644 (file)
@@ -2259,5 +2259,8 @@ Wed, 03 Oct 2007 10:48:39 +0200
        - Cleaned up ecpglib and renamed functions that do not need to be
          exported.
        - Created export list for ecpglib.
+       - Also created export list for pgytpeslib and compatlib.
+       - Set pgtypes library version to 3.0.
+       - Set compat library version to 3.0.
        - Set ecpg library version to 6.0.
        - Set ecpg version to 4.4.
index c4e68ab..67f7afe 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.27 2007/01/20 17:16:17 petere Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.28 2007/10/03 13:20:19 meskes Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -13,8 +13,8 @@ top_builddir = ../../../..
 include $(top_builddir)/src/Makefile.global
 
 NAME= ecpg_compat
-SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 3
+SO_MAJOR_VERSION= 3
+SO_MINOR_VERSION= 0
 DLTYPE= library
 
 override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
@@ -23,13 +23,62 @@ override CFLAGS += $(PTHREAD_CFLAGS)
 SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) -lm \
        $(PTHREAD_LIBS)
 
-OBJS= informix.o
+OBJS= informix.o $(filter snprintf.o, $(LIBOBJS))
+
+ifneq ($(PORTNAME), win32)
+DLL_DEFFILE=libecpg_compatdll.def
+endif
 
 all: all-lib
 
 # Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib
 
+# We need several not-quite-identical variants of .DEF files to build libecpg
+# DLLs for Windows.  These are made from the single source file exports.txt.
+# Since we can't assume that Windows boxes will have sed, the .DEF files are
+# always built and included in distribution tarballs.
+
+.PHONY: def-files
+def-files: $(srcdir)/libecpg_compat.def $(srcdir)/blibecpg_compatdll.def
+$(srcdir)/libecpg_compat.def: exports.txt
+       echo '; DEF file for MS VC++' > $@
+       echo 'LIBRARY LIBECPG_COMPAT' >> $@
+       echo 'EXPORTS' >> $@
+       sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    \1@ \2/' < $< >> $@
+
+$(srcdir)/blibecpg_compatdll.def: exports.txt
+       echo '; DEF file for Borland C++ Builder' > $@
+       echo 'LIBRARY BLIBECPG_COMPAT' >> $@
+       echo 'EXPORTS' >> $@
+       sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    _\1@ \2/' < $< >> $@
+       echo '' >> $@
+       echo '; Aliases for MS compatible names' >> $@
+       sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    \1= _\1/' < $< | sed 's/ *$$//' >> $@
+
+# Where possible, restrict the symbols exported by the library to just the
+# official list, so as to avoid unintentional ABI changes.
+
+ifeq ($(PORTNAME), darwin)
+$(shlib): exports.list
+
+exports.list: exports.txt
+       $(AWK) '/^[^#]/ {printf "_%s\n",$$1}' $< >$@
+
+exported_symbols_list = -exported_symbols_list exports.list
+endif
+
+ifeq ($(PORTNAME), linux)
+$(shlib): exports.list
+
+exports.list: exports.txt
+       echo '{ global:' >$@
+       $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
+       echo ' local: *; };' >>$@
+
+exported_symbols_list = -Wl,--version-script=exports.list
+endif
+
 install: all installdirs install-lib
 
 installdirs:
@@ -38,4 +87,4 @@ installdirs:
 uninstall: uninstall-lib
 
 clean distclean maintainer-clean: clean-lib
-       rm -f $(OBJS)
+       rm -f $(OBJS) snprintf.c
diff --git a/src/interfaces/ecpg/compatlib/exports.txt b/src/interfaces/ecpg/compatlib/exports.txt
new file mode 100644 (file)
index 0000000..66686ca
--- /dev/null
@@ -0,0 +1,42 @@
+# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/exports.txt,v 1.1 2007/10/03 13:20:19 meskes Exp $
+# Functions to be exported by ecpg_compatlib DLL
+ECPG_informix_get_var  1
+ECPG_informix_set_var  2
+decadd                 3
+deccmp                 4
+deccopy                        5
+deccvasc               6
+deccvdbl               7
+deccvint               8
+deccvlong              9
+decdiv                 10
+decmul                 11
+decsub                 12
+dectoasc               13
+dectodbl               14
+dectoint               15
+dectolong              16
+dtcurrent              17
+dtcvasc                        18
+dtcvfmtasc             19
+dtsub                  20
+dttoasc                        21
+dttofmtasc             22
+intoasc                        23
+rdatestr               24
+rdayofweek             25
+rdefmtdate             26
+rfmtdate               27
+rfmtlong               28
+rgetmsg                        29
+risnull                        30
+rjulmdy                        31
+rmdyjul                        32
+rsetnull               33
+rstrdate               34
+rtoday                 35
+rtypalign              36
+rtypmsize              37
+rtypwidth              38
+rupshift               39
+
index 807277e..7f2e661 100644 (file)
@@ -1,14 +1,11 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.51 2007/10/03 12:34:29 mha Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.52 2007/10/03 13:20:19 meskes Exp $ */
 
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
 #include <math.h>
 #include <ctype.h>
 #include <limits.h>
 
 #define POSTGRES_ECPG_INTERNAL
-#include <postgres_fe.h>
+#include "postgres_fe.h"
 #include <ecpgtype.h>
 #include <ecpg_informix.h>
 #include <pgtypes_error.h>
index c02291d..f375c19 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.33 2007/09/27 19:53:44 tgl Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.34 2007/10/03 13:20:19 meskes Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -13,8 +13,8 @@ top_builddir = ../../../..
 include $(top_builddir)/src/Makefile.global
 
 NAME= pgtypes
-SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 3
+SO_MAJOR_VERSION= 3
+SO_MINOR_VERSION= 0
 DLTYPE= library
 
 override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
@@ -30,11 +30,60 @@ OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
        pgstrcasecmp.o \
        $(filter rint.o snprintf.o, $(LIBOBJS))
 
+ifneq ($(PORTNAME), win32)
+DLL_DEFFILE=libpgtypesdll.def
+endif
+
 all: all-lib
 
 # Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib
 
+# We need several not-quite-identical variants of .DEF files to build libecpg
+# DLLs for Windows.  These are made from the single source file exports.txt.
+# Since we can't assume that Windows boxes will have sed, the .DEF files are
+# always built and included in distribution tarballs.
+
+.PHONY: def-files
+def-files: $(srcdir)/libpgtypes.def $(srcdir)/blibpgtypesdll.def
+$(srcdir)/libpgtypes.def: exports.txt
+       echo '; DEF file for MS VC++' > $@
+       echo 'LIBRARY LIBPGTYPES' >> $@
+       echo 'EXPORTS' >> $@
+       sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    \1@ \2/' < $< >> $@
+
+$(srcdir)/blibpgtypesdll.def: exports.txt
+       echo '; DEF file for Borland C++ Builder' > $@
+       echo 'LIBRARY BLIBPGTYPES' >> $@
+       echo 'EXPORTS' >> $@
+       sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    _\1@ \2/' < $< >> $@
+       echo '' >> $@
+       echo '; Aliases for MS compatible names' >> $@
+       sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    \1= _\1/' < $< | sed 's/ *$$//' >> $@
+
+# Where possible, restrict the symbols exported by the library to just the
+# official list, so as to avoid unintentional ABI changes.
+
+ifeq ($(PORTNAME), darwin)
+$(shlib): exports.list
+
+exports.list: exports.txt
+       $(AWK) '/^[^#]/ {printf "_%s\n",$$1}' $< >$@
+
+exported_symbols_list = -exported_symbols_list exports.list
+endif
+
+ifeq ($(PORTNAME), linux)
+$(shlib): exports.list
+
+exports.list: exports.txt
+       echo '{ global:' >$@
+       $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
+       echo ' local: *; };' >>$@
+
+exported_symbols_list = -Wl,--version-script=exports.list
+endif
+
 # 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,
@@ -51,4 +100,4 @@ installdirs:
 uninstall: uninstall-lib
 
 clean distclean maintainer-clean: clean-lib
-       rm -f $(OBJS) pgstrcasecmp.c rint.c snprintf.c
+       rm -f $(OBJS) pgstrcasecmp.c rint.c snprintf.c exports.list
diff --git a/src/interfaces/ecpg/pgtypeslib/exports.txt b/src/interfaces/ecpg/pgtypeslib/exports.txt
new file mode 100644 (file)
index 0000000..46e7e4a
--- /dev/null
@@ -0,0 +1,48 @@
+# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/exports.txt,v 1.1 2007/10/03 13:20:19 meskes Exp $
+# Functions to be exported by pgtypeslib DLL
+PGTYPESdate_dayofweek          1
+PGTYPESdate_defmt_asc          2
+PGTYPESdate_fmt_asc            3
+PGTYPESdate_free               4
+PGTYPESdate_from_asc           5
+PGTYPESdate_from_timestamp     6
+PGTYPESdate_julmdy             7
+PGTYPESdate_mdyjul             8
+PGTYPESdate_new                        9
+PGTYPESdate_to_asc             10
+PGTYPESdate_today              11
+PGTYPESdecimal_free            12
+PGTYPESdecimal_new             13
+PGTYPESinterval_copy           14
+PGTYPESinterval_free           15
+PGTYPESinterval_from_asc       16
+PGTYPESinterval_new            17
+PGTYPESinterval_to_asc         18
+PGTYPESnumeric_add             19
+PGTYPESnumeric_cmp             20
+PGTYPESnumeric_copy            21
+PGTYPESnumeric_div             22
+PGTYPESnumeric_free            23
+PGTYPESnumeric_from_asc                24
+PGTYPESnumeric_from_decimal    25
+PGTYPESnumeric_from_double     26
+PGTYPESnumeric_from_int                27
+PGTYPESnumeric_from_long       28
+PGTYPESnumeric_mul             29
+PGTYPESnumeric_new             30
+PGTYPESnumeric_sub             31
+PGTYPESnumeric_to_asc          32
+PGTYPESnumeric_to_decimal      33
+PGTYPESnumeric_to_double       34
+PGTYPESnumeric_to_int          35
+PGTYPESnumeric_to_long         36
+PGTYPEStimestamp_add_interval  37
+PGTYPEStimestamp_current       38
+PGTYPEStimestamp_defmt_asc     39
+PGTYPEStimestamp_defmt_scan    40
+PGTYPEStimestamp_fmt_asc       41
+PGTYPEStimestamp_from_asc      42
+PGTYPEStimestamp_sub           43
+PGTYPEStimestamp_sub_interval  44
+PGTYPEStimestamp_to_asc                45
+