*** ./src/interfaces/ecpg/compatlib/Makefile.ORIG	Wed Mar 16 12:22:06 2011
--- ./src/interfaces/ecpg/compatlib/Makefile	Wed Mar 16 12:27:33 2011
***************
*** 19,25 ****
  
  override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
  	-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
! override CFLAGS += $(PTHREAD_CFLAGS)
  
  SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
  	$(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
--- 19,25 ----
  
  override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
  	-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
! override CFLAGS := $(PTHREAD_FLAGS)
  
  SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
  	$(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
*** ./src/pl/plpython/plpy_cursorobject.c.ORIG	Tue Sep 25 09:58:15 2012
--- ./src/pl/plpython/plpy_cursorobject.c	Tue Sep 25 09:58:23 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_cursorobject.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "access/xact.h"
*** ./src/pl/plpython/plpy_elog.c.ORIG	Tue Sep 25 09:53:53 2012
--- ./src/pl/plpython/plpy_elog.c	Tue Sep 25 09:54:22 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_elog.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "lib/stringinfo.h"
*** ./src/pl/plpython/plpy_exec.c.ORIG	Tue Sep 25 09:54:13 2012
--- ./src/pl/plpython/plpy_exec.c	Tue Sep 25 09:54:43 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_exec.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "access/xact.h"
*** ./src/pl/plpython/plpy_main.c.ORIG	Tue Sep 25 09:54:51 2012
--- ./src/pl/plpython/plpy_main.c	Tue Sep 25 09:55:01 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_main.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "catalog/pg_proc.h"
*** ./src/pl/plpython/plpy_planobject.c.ORIG	Tue Sep 25 09:55:07 2012
--- ./src/pl/plpython/plpy_planobject.c	Tue Sep 25 09:55:19 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_planobject.c
   */
  
+ typedef char * mbstate_t; 
+ 
  #include "postgres.h"
  
  #include "plpython.h"
*** ./src/pl/plpython/plpy_procedure.c.ORIG	Tue Sep 25 09:55:28 2012
--- ./src/pl/plpython/plpy_procedure.c	Tue Sep 25 09:55:38 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_procedure.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "access/transam.h"
*** ./src/pl/plpython/plpy_resultobject.c.ORIG	Tue Sep 25 09:55:49 2012
--- ./src/pl/plpython/plpy_resultobject.c	Tue Sep 25 09:56:17 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_resultobject.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "plpython.h"
*** ./src/pl/plpython/plpy_plpymodule.c.ORIG	Tue Sep 25 09:58:37 2012
--- ./src/pl/plpython/plpy_plpymodule.c	Tue Sep 25 09:58:45 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_plpymodule.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "mb/pg_wchar.h"
*** ./src/pl/plpython/plpy_subxactobject.c.ORIG	Tue Sep 25 09:56:05 2012
--- ./src/pl/plpython/plpy_subxactobject.c	Tue Sep 25 09:56:56 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_subxactobject.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "access/xact.h"
*** ./src/pl/plpython/plpy_spi.c.ORIG	Tue Sep 25 09:58:55 2012
--- ./src/pl/plpython/plpy_spi.c	Tue Sep 25 09:59:04 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_spi.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "access/xact.h"
*** ./src/pl/plpython/plpy_typeio.c.ORIG	Tue Sep 25 09:59:11 2012
--- ./src/pl/plpython/plpy_typeio.c	Tue Sep 25 09:59:21 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_typeio.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "access/transam.h"
*** ./src/pl/plpython/plpy_util.c.ORIG	Tue Sep 25 09:59:28 2012
--- ./src/pl/plpython/plpy_util.c	Tue Sep 25 09:59:35 2012
***************
*** 4,9 ****
--- 4,11 ----
   * src/pl/plpython/plpy_util.c
   */
  
+ typedef char * mbstate_t;
+ 
  #include "postgres.h"
  
  #include "mb/pg_wchar.h"
*** ./src/pl/plpython/Makefile.ORIG	Wed Aug 13 20:35:37 2014
--- ./src/pl/plpython/Makefile	Wed Aug 13 20:36:01 2014
***************
*** 21,26 ****
--- 21,31 ----
  override python_libspec =
  endif
  
+ # AIX has its own ideas about how to do this.
+ ifeq ($(PORTNAME), aix)
+ shared_libpython = yes
+ endif
+ 
  # Darwin (OS X) does supply a .dylib, but the above test doesn't match that.
  ifeq ($(PORTNAME), darwin)
  shared_libpython = yes
