From 8f012ac89b227dc5b966d81bbbcb59adda76b367 Mon Sep 17 00:00:00 2001
From: Neil Conway <neilc@samurai.com>
Date: Thu, 4 Nov 2004 06:09:26 +0000
Subject: [PATCH] Contrib build fixes:

- add some additional files to the dbmirror install (approved by
ssinger)

- add a makefile for contrib/mysql, and add mysql to the list of
contribs build by default

- use xml2-config to pickup -I flags for libxml2 in contrib/xml and
contrib/xml2

Original work from Martin Pitt of Debian, minor cleanups by Neil
Conway.
---
 contrib/Makefile          |  4 ++--
 contrib/dbmirror/Makefile |  4 +++-
 contrib/mysql/Makefile    | 16 ++++++++++++++++
 contrib/mysql/mysql2pgsql |  2 +-
 contrib/xml/Makefile      |  4 +++-
 contrib/xml2/Makefile     |  1 +
 6 files changed, 26 insertions(+), 5 deletions(-)
 create mode 100644 contrib/mysql/Makefile

diff --git a/contrib/Makefile b/contrib/Makefile
index 321c1126f8e..600d4029579 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/contrib/Makefile,v 1.51 2004/09/16 21:20:19 tgl Exp $
+# $PostgreSQL: pgsql/contrib/Makefile,v 1.52 2004/11/04 06:09:17 neilc Exp $
 
 subdir = contrib
 top_builddir = ..
@@ -22,6 +22,7 @@ WANTED_DIRS = \
 		lo		\
 		ltree		\
 		miscutil	\
+		mysql		\
 		noupdate	\
 		oid2name	\
 		pg_autovacuum	\
@@ -47,7 +48,6 @@ WANTED_DIRS = \
 #		ipc_check	\ (does not have a makefile)
 #		mSQL-interface	\ (requires msql installed)
 #		mac		\ (does not have a makefile)
-#		mysql		\ (does not have a makefile)
 #		oracle		\ (does not have a makefile)
 #		pg_upgrade	\ (does not have a makefile)
 #		reindexdb	\ (does not have a makefile)
diff --git a/contrib/dbmirror/Makefile b/contrib/dbmirror/Makefile
index b0f538f8b50..e21141342fa 100644
--- a/contrib/dbmirror/Makefile
+++ b/contrib/dbmirror/Makefile
@@ -1,6 +1,8 @@
-# $PostgreSQL: pgsql/contrib/dbmirror/Makefile,v 1.3 2004/08/20 20:13:03 momjian Exp $
+# $PostgreSQL: pgsql/contrib/dbmirror/Makefile,v 1.4 2004/11/04 06:09:19 neilc Exp $
 
 MODULES = pending
+SCRIPTS = clean_pending.pl DBMirror.pl
+DATA = AddTrigger.sql MirrorSetup.sql slaveDatabase.conf
 DOCS = README.dbmirror
 
 ifdef USE_PGXS
diff --git a/contrib/mysql/Makefile b/contrib/mysql/Makefile
new file mode 100644
index 00000000000..13d4c2b226f
--- /dev/null
+++ b/contrib/mysql/Makefile
@@ -0,0 +1,16 @@
+# mysql conversion Perl scripts
+# $PostgreSQL: pgsql/contrib/mysql/Makefile,v 1.1 2004/11/04 06:09:21 neilc Exp $
+
+MODULES = 
+SCRIPTS = my2pg.pl  mysql2pgsql
+DOCS = README.mysql
+
+ifdef USE_PGXS
+PGXS = $(shell pg_config --pgxs)
+include $(PGXS)
+else
+subdir = contrib/mysql
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/contrib/contrib-global.mk
+endif
diff --git a/contrib/mysql/mysql2pgsql b/contrib/mysql/mysql2pgsql
index a51dfde53e3..dfe5d6ffa21 100755
--- a/contrib/mysql/mysql2pgsql
+++ b/contrib/mysql/mysql2pgsql
@@ -1,4 +1,4 @@
-# -*- perl -*-
+#!/usr/bin/perl
 # mysql2pgsql
 # Take a MySQL schema dump and turn it into SQL92 and PostgreSQL form.
 # Thomas Lockhart, (c) 2000, PostgreSQL Inc.
diff --git a/contrib/xml/Makefile b/contrib/xml/Makefile
index 0d8e48bac2c..879cd4d9ff3 100644
--- a/contrib/xml/Makefile
+++ b/contrib/xml/Makefile
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/contrib/xml/Attic/Makefile,v 1.9 2004/08/20 20:13:10 momjian Exp $
+# $PostgreSQL: pgsql/contrib/xml/Makefile,v 1.10 2004/11/04 06:09:23 neilc Exp $
 
 MODULE_big = pgxml_dom
 OBJS = pgxml_dom.o
@@ -6,6 +6,8 @@ SHLIB_LINK = -lxml2
 DATA_built = pgxml_dom.sql
 DOCS = README.xml
 
+override CFLAGS += $(shell xml2-config --cflags)
+
 ifdef USE_PGXS
 PGXS = $(shell pg_config --pgxs)
 include $(PGXS)
diff --git a/contrib/xml2/Makefile b/contrib/xml2/Makefile
index b2a4f2325e6..7d4779f25cb 100644
--- a/contrib/xml2/Makefile
+++ b/contrib/xml2/Makefile
@@ -11,6 +11,7 @@ SHLIB_LINK = -lxml2 -lxslt
 DATA_built = pgxml.sql
 DOCS = README.xml2
 
+override CFLAGS += $(shell xml2-config --cflags)
 
 ifdef USE_PGXS
 PGXS = $(shell pg_config --pgxs)
-- 
GitLab