~launchpad-committers/ubuntu/lucid/slony1/ppa-8.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# ----------
# configure.ac
#
#	Autoconf configuration file for Slony-I
#
#	Copyright (c) 2003-2004, PostgreSQL Global Development Group
#	Author: Jan Wieck, Afilias USA INC.
#
# $Id: configure.ac,v 1.57.2.4 2007-08-29 05:44:58 devrim Exp $
#
# Process this file with autoconf to produce a configure script.
# ----------
m4_define([SLONREL_VERSION], esyscmd([echo "$Name: REL_1_2_15 $" | \
  sed -e 's/\:\ REL_//' -e 's/\$//g' -e 's/_/./g' -e 's/\./\_/3' \
    -e 's/\ //g' -e s/\:/`date +HEAD_%Y%m%d`/ | tr -d '\n']))

AC_INIT(postgresql-slony1,[SLONREL_VERSION])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR([src])

AC_CANONICAL_HOST

template=
AC_MSG_CHECKING([which template to use])

case $host_os in
     aix*) template=aix ;;
    beos*) template=beos ;;
    bsdi*) template=bsdi ;;
  cygwin*) template=win ;;
  darwin*) template=darwin ;;
    dgux*) template=dgux ;;
 freebsd*) template=freebsd ;;
    hpux*) template=hpux ;;
    irix*) template=irix ;;
   linux*|gnu*|k*bsd*-gnu) 
           template=linux ;;
   mingw*) template=win32 ;;
  netbsd*) template=netbsd ;;
nextstep*) template=nextstep ;;
 openbsd*) template=openbsd ;;
     osf*) template=osf ;;
     qnx*) template=qnx4 ;;
     sco*) template=sco ;;
 solaris*) template=solaris ;;
   sunos*) template=sunos4 ;;
 sysv4.2*)
        case $host_vendor in
          univel) template=univel ;;
        esac ;;
   sysv4*) template=svr4 ;;
   sysv5*) template=unixware ;;
  ultrix*) template=ultrix4 ;;
esac

if test x"$template" = x"" ; then
  AC_MSG_ERROR([[
*******************************************************************
Slony-I has apparently not been ported to your platform yet.
To try a manual configuration, look into the src/template directory
for a similar platform and use the '--with-template=' option.

Please also contact <slony1-general@gborg.postgresql.org> to see about
rectifying this.  Include the above 'checking host system type...'
line.
*******************************************************************]])
fi
AC_MSG_RESULT([$template])

# Checks for programs.
#AC_PROG_CC
SLON_AC_COMPILER()
AC_PROG_LD
PGAC_PATH_PERL
AC_PATH_PROG(TAR, tar)
AC_CHECK_PROGS(LEX, ['flex' , 'lex'])
AC_CHECK_PROGS(YACC, ['bison -y' , 'yacc'])
AC_CHECK_PROGS(SED, ['sed'])

AC_SUBST(LD)
AC_SUBST(CC)
AC_SUBST(GCC)
AC_SUBST(YACC)
AC_SUBST(YFLAGS)
AC_SUBST(LEXFLAGS)
AC_SUBST(YFLAGS)
AC_SUBST(SLONREL_VERSION)
AC_SUBST(with_gnu_ld)
AC_SUBST(PERL)
AC_SUBST(SED)

dnl Check whether to use the evil rpath or not
SLON_AC_ARG_BOOL(enable, rpath, yes,
              [  --disable-rpath         do not embed shared library search path in executables])
AC_SUBST(enable_rpath)

ACX_PTHREAD()

##Portability checks
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([stddef.h])
AC_CHECK_HEADERS([sys/socket.h]) 
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([inttypes.h])

AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([dup2])
AC_CHECK_FUNCS([alarm])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNCS([strtol])
AC_CHECK_FUNCS([strtoul])

AC_CHECK_TYPES([int32_t, uint32_t, u_int32_t])
AC_CHECK_TYPES([int64_t, uint64_t, u_int64_t])
AC_CHECK_TYPES([ssize_t])
SLON_AC_FUNC_POSIX_SIGNALS()

# ----
# Locate PostgreSQL paths
# ----

AC_ARG_WITH(pgconfigdir,        [  --with-pgconfigdir=<dir>         Location of the PostgreSQL pg_config program. ])
AC_ARG_WITH(pgbindir,           [  --with-pgbindir=<dir>            Location of the PostgreSQL postmaster. ])
AC_ARG_WITH(pgincludedir,       [  --with-pgincludedir=<dir>        Location of the PostgreSQL headers. ])
AC_ARG_WITH(pgincludeserverdir, [  --with-pgincludeserverdir=<dir>  Location of the PostgreSQL server headers. ])
AC_ARG_WITH(pglibdir,           [  --with-pglibdir=<dir>            Location of the PostgreSQL libs. ])
AC_ARG_WITH(pgpkglibdir,        [  --with-pgpkglibdir=<dir>         Location of the PostgreSQL pkglibs. E.g. plpgsql.so ])
AC_ARG_WITH(pgsharedir,         [  --with-pgsharedir=<dir>          Location of the PostgreSQL share dir. E.g. postgresql.conf.sample ])
AC_ARG_WITH(netsnmp,            [  --with-netsnmp=<dir>             Enable snmp support <dir> is the location of net-snmp-config. **EXPERIMENTAL** ])
AC_ARG_WITH(perltools,          [  --with-perltools=<dir>           Location to install the perl management tools. Default $PREFIX/bin. ])
AC_ARG_WITH(perlsharedir,       [  --with-perlsharedir=<dir>        Location to install slon-tools.pm. Default $pglibdir. ])
AC_ARG_WITH(docs,		[  --with-docs=<yes|no>             Build the sgml documentation [default=no]])
AC_ARG_WITH(docdir,		[  --with-docdir=<dir>              Location to install all the documentation. Default is $PREFIX/doc. ])
AC_ARG_WITH(d2mdir,		[  --with-d2mdir=<dir>              Location of docbook2man-spec.pl (Manpages will be skipped if not specified)])
AC_ARG_WITH(mandir,		[  --with-mandir=<dir>              Location to install the manpages. Default is $PREFIX/man.])


SLON_AC_ARG_BOOL(enable, engine, yes,
              [  --disable-engine          Don't build slony1-engine source. (Used when building documentation only)])

AC_SUBST(enable_engine)

#Our current path
SLONYPATH=`pwd`

# ----
# PostgreSQL checks
# ----
AC_MSG_CHECKING(if you have requested slony1-engine building)
AC_MSG_RESULT($enable_engine)

if test "$enable_engine" = "yes"; then

ACX_LIBPQ()
ACX_LIBSNMP()
ACX_SLONYTOOLS()

AC_SUBST(PG_VERSION_MAJOR, $PG_VERSION_MAJOR)
AC_SUBST(PG_VERSION_MINOR, $PG_VERSION_MINOR)
AC_SUBST(PG_VERSION, $PG_VERSION)

AC_SUBST(PGINCLUDEDIR, $PG_INCLUDEDIR)
AC_SUBST(PGINCLUDESERVERDIR, $PG_INCLUDESERVERDIR)
AC_SUBST(PGLIBDIR, $PG_LIBDIR)
AC_SUBST(PGPKGLIBDIR, $PG_PKGLIBDIR)
AC_SUBST(PGSHAREDIR, $PG_SHAREDIR)
AC_SUBST(PGBINDIR, $PG_BINDIR)
AC_SUBST(HAVE_NETSNMP, $HAVE_NETSNMP)
AC_SUBST(NETSNMP_CFLAGS, $NETSNMP_CFLAGS)
AC_SUBST(NETSNMP_AGENTLIBS, $NETSNMP_AGENTLIBS)
AC_SUBST(TOOLSBIN, $TOOLSBIN)

AC_SUBST(SLONYPATH)
AC_SUBST(HOST_OS,$host_os)
AC_SUBST(PORTNAME,$template)

if test ${prefix} = "NONE"; then
  SLONBINDIR="${PG_BINDIR}"
else
  SLONBINDIR="${prefix}/bin"
fi
AC_SUBST(SLONBINDIR,$SLONBINDIR)

fi

# ----
# Documentation checks
# ----
SLON_AC_DOCS()
ACX_SLONYDOCS()

AC_SUBST(with_docs, $with_docs)

AC_MSG_CHECKING(if you have requested documentation building)
if test "$with_docs" = "yes"; then

	AC_MSG_RESULT($with_docs)

	# ----
	# Tools for building docs
	# ---

	SLON_AC_PROG_GROFF
	SLON_AC_PROG_PS2PDF
	SLON_AC_PROG_DJPEG
	SLON_AC_PROG_PNMTOPS
	SLON_AC_PROG_CONVERT
	SLON_AC_PROG_PGAUTODOC

	#
	# Check for DocBook and tools
	#
	SLON_AC_PROG_NSGMLS
	SLON_AC_PROG_SGMLSPL
	SLON_AC_PROG_D2M

	SLON_AC_PROG_JADE
	SLON_AC_CHECK_DOCBOOK(4.2)
	SLON_AC_PATH_DOCBOOK_STYLESHEETS
	SLON_AC_PATH_COLLATEINDEX

	AC_SUBST(docdir, $docdir)
	AC_SUBST(mandir, $mandir)
else
  AC_MSG_RESULT(no)
fi

if test x"$with_perlsharedir" = x""; then
	with_perlsharedir="$PG_LIBDIR"
fi

AC_SUBST(perlsharedir, $with_perlsharedir)

AC_CONFIG_FILES([
	Makefile.global GNUmakefile
])

AC_OUTPUT([
    postgresql-slony1.spec
    Makefile.port:makefiles/Makefile.${template}
])