Squashed commit of the following:
authorSteve Singer <ssinger@ca.afilias.info>
Thu, 6 Jun 2013 14:47:01 +0000 (10:47 -0400)
committerSteve Singer <ssinger@ca.afilias.info>
Thu, 6 Jun 2013 14:47:01 +0000 (10:47 -0400)
commit 0d1c7738dc21f2c9e398b790d101f0024dab0a54
Author: Steve Singer <ssinger@ca.afilias.info>
Date:   Thu Jun 6 10:45:34 2013 -0400

    win32 makefile fixes for the PGVER variable

commit 9f2eed91d129304a0e67534c977394cce04492cf
Merge: c9a4687 86eac22
Author: Steve Singer <ssinger@ca.afilias.info>
Date:   Thu Jun 6 09:42:31 2013 -0400

    Merge remote-tracking branch 'origin/master' into pgcommon_22

commit c9a4687f8fa28cf93a417c0b0597b8c6bf65cea7
Author: Steve Singer <ssinger@ca.afilias.info>
Date:   Sun Jun 2 21:39:23 2013 -0400

    Link with pgcommon on win32 when building with PG 9.3+

commit abd5addee71a2fa55a634673730c2d1d18dfe8e9
Author: Steve Singer <ssinger@ca.afilias.info>
Date:   Sun Jun 2 21:31:37 2013 -0400

    expose HAVE_PGCOMMON to the slonik makefile so it can link in pgcommon if required

    Conflicts:
     configure.ac

commit 9217d72cdf740e7cb9ca7b540c3a7df334f81e0e
Author: Steve Singer <ssinger@ca.afilias.info>
Date:   Tue May 28 10:55:40 2013 -0400

    link with pgcommon in addition to pgport on PG 9.3+

    PG 9.3 introduces a new library called libpgcommon we need to link
    with this when we link with pgport.

Makefile.global.in
config/acx_libpq.m4
configure.ac
src/slonik/Makefile
src/slonik/win32.mak

index 36e71a84dbe9cb495bd28e68f5c440a71b34add5..3e8eeb87208fb1634f22a7a77c4cdd32b5f6d11c 100644 (file)
@@ -59,6 +59,10 @@ ifeq (@HAVE_PGPORT@,1)
 HAVE_PGPORT=           @HAVE_PGPORT@
 endif
 
+ifeq (@HAVE_PGCOMMON@,1)
+HAVE_PGCOMMON=           @HAVE_PGCOMMON@
+endif
+
 # Documentation
 JADE=                  @JADE@
 NSGMLS=                        @NSGMLS@
index 4999f62aee6b825402c1d59ef2104b1bd2b0330a..22722f8b8fc774155214113069546677eb0634fc 100644 (file)
@@ -508,8 +508,20 @@ AC_SUBST(NLSLIB)
 
 if test "$with_pgport" = "yes"; then
    AC_MSG_CHECKING(for pgport)
+   # check if we have pgcommon this is a lib in 9.3+ that
+   # is needed  with PGPORT
+   OLD_LIBS=$LIBS
+   AC_DEFINE(HAVE_PGCOMMON)
+   LIBS="$LIBS -lpgcommon"
+   AC_TRY_LINK_FUNC(pg_malloc,[HAVE_PGCOMMON=1
+                                  AC_MSG_RESULT(yes)],
+                                HAVE_PGCOMMON=0  )
+   LIBS=$OLD_LIBS 
    AC_DEFINE(HAVE_PGPORT)
-   LIBS="$LIBS -lpgport"
+   if test $HAVE_PGCOMMON = 1  ; then
+       EXTRALIBS=" -lpgcommon"
+   fi
+   LIBS="$LIBS -lpgport $EXTRALIBS"
    AC_TRY_LINK_FUNC(find_my_exec,[HAVE_PGPORT=1
                                   AC_MSG_RESULT(yes)], 
                     AC_MSG_ERROR("pgport was not found. build without --with-pgport=yes to disable"))
index 7d21da2f4614b5bc629da77bc2570c85922291fe..f2b432375a5c3494d9339804758497c7acab7909 100644 (file)
@@ -252,6 +252,7 @@ AC_SUBST(HOST_OS,$host_os)
 AC_SUBST(PORTNAME,$template)
 
 AC_SUBST(HAVE_PGPORT,$HAVE_PGPORT)
+AC_SUBST(HAVE_PGCOMMON,$HAVE_PGCOMMON)
 if test "${SLON_BINDIR}" = ""; then
  if test ${prefix} = "NONE"; then
    SLON_BINDIR="${PG_BINDIR}"
index b5fc6301aaf1583b400f462d18447a4d7f5f1380..fa8113aacd550133fd55df648f87abed2f4b8b04 100644 (file)
@@ -28,6 +28,9 @@ PROG            = slonik.exe
 LDFLAGS += -lpgport
 else ifdef HAVE_PGPORT
 LDFLAGS += -lpgport
+ifdef HAVE_PGCOMMON
+LDFLAGS += -lpgcommon
+endif
 endif
 
 OBJS           =                       \
index e79c6cf8975608cba36641d4b1e254d97739443a..958d76ce011298c9d6c83154192b1cdb1ed7a857 100644 (file)
@@ -1,6 +1,21 @@
 CPP=cl.exe
 LINK32=link.exe
-LINK32_FLAGS=/libpath:$(PG_LIB) libpq.lib libpgport.lib ws2_32.lib kernel32.lib user32.lib advapi32.lib /libpath:$(GETTEXT_LIB) intl.lib
+
+!if "$(PGVER)" == "8.3" 
+PORTLIBS=libpgport.lib
+!elseif  "$(PGVER)" == "8.4"
+PORTLIBS=libpgport.lib
+!elseif  "$(PGVER)" == "9.0"
+PORTLIBS=libpgport.lib
+!elseif  "$(PGVER)" == "9.1"
+PORTLIBS=libpgport.lib
+!elseif  "$(PGVER)" == "9.2"
+PORTLIBS=libpgport.lib
+!else
+PORTLIBS=libpgport.lib libpgcommon.lib
+!endif
+
+LINK32_FLAGS=/libpath:$(PG_LIB) libpq.lib $(PORTLIBS) ws2_32.lib kernel32.lib user32.lib advapi32.lib /libpath:$(GETTEXT_LIB) intl.lib
 OBJS = slonik.obj \
        dbutil.obj \
        parser.obj \