File: configure.ac

package info (click to toggle)
postgresql-debversion 1.0.8-2~bpo8%2B2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,616 kB
  • sloc: sh: 11,309; cpp: 157; sql: 131; makefile: 81
file content (147 lines) | stat: -rw-r--r-- 6,251 bytes parent folder | download | duplicates (2)
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
#                                                              -*- Autoconf -*-
# Copyright © 2004-2008  Roger Leigh <rleigh@debian.org>
#
# debversion is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# debversion is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see
# <http://www.gnu.org/licenses/>.
#
#####################################################################
#
# Process this file with autoconf to produce a configure script.
#
#####################################################################
dnl m4 magic from Eric Blake <ebb9@byu.net>, prior to automake inclusion
m4_define([sbuild_m4_chomp],
[m4_format([[%.*s]], m4_bregexp(m4_translit([$1], [
]]m4_dquote(_m4_defn([m4_cr_all]))[, [/]]m4_format([%255s], [])[),
  [/*$]), [$1])])
m4_define([sbuild_m4_esyscmd_s],
[sbuild_m4_chomp(m4_esyscmd([$1]))])
AC_PREREQ(2.59)
dnl Quoting the first argument results in a bizarrely corrupted package tarname
AC_INIT(sbuild_m4_esyscmd_s([sed -ne '/^Package:/{s/Package:[[:space:]][[:space:]]*//p;q}' VERSION]),
        [sbuild_m4_esyscmd_s([sed -ne '/^Version:/{s/Version:[[:space:]][[:space:]]*//p;q}' VERSION])],
        [buildd-tools-devel@lists.alioth.debian.org])
dnl For safety, check we are in the right directory by
dnl checking for a known unique file.
AC_CONFIG_SRCDIR([debversion/debversion.cc])
dnl Place auxilliary scripts here.
AC_CONFIG_AUX_DIR([scripts])
dnl Put macro definitions here.
AC_CONFIG_HEADER([config.h])

AC_COPYRIGHT(
[
Copyright © 2004-2009  Roger Leigh <rleigh@debian.org>

Parts of this configure script come from the 'configure.ac' file, and
are not based on freely-redistributable m4 macros; you can
redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
])

dnl Initialise automake stuff.
AM_INIT_AUTOMAKE([1.9 foreign check-news tar-pax])
AM_MAINTAINER_MODE
RELEASE_DATE='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])'
RELEASE_DATE_S='sbuild_m4_esyscmd_s(date --date='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])' '+%s')'
RELEASED_BY='sbuild_m4_esyscmd_s([sed -ne '/^Released-By:/{s/Released-By:[[:space:]][[:space:]]*//p;q}' VERSION])'
AC_DEFINE_UNQUOTED([RELEASE_DATE], ["$RELEASE_DATE_S"], [Package release date.])
AC_SUBST([RELEASE_DATE])
AC_SUBST([RELEASED_BY])

AC_MSG_CHECKING([whether to enable debugging messages])
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Enable debugging messages])],
              [ case "${enableval}" in
                yes) enable_debug="yes" ;;
                no)  enable_debug="no" ;;
                unset)  enable_debug="no" ;;
                *) AC_MSG_RESULT([unknown])
                   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
                esac ],
              [ enable_debug="no" ])
AC_MSG_RESULT([$enable_debug])
if test "$enable_debug" = "yes"; then
  AC_DEFINE_UNQUOTED([DEBVERSION_DEBUG], [1], [Enable debugging])
fi

# Checks for programs.
AC_PROG_CXX
AC_LANG([C++])
AC_DISABLE_STATIC
AC_ENABLE_SHARED
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PATH_PROG([PG_CONFIG], [pg_config])

if [ ! test -x "$PG_CONFIG" ]; then
  AC_MSG_ERROR([pg_config not found but is required by debversion])
fi

AC_MSG_CHECKING([for PostgreSQL server include directory])
pg_server_includedir=`"$PG_CONFIG" --includedir-server`
AC_ARG_ENABLE([pg-server-includedir], [AS_HELP_STRING([--enable-pg-server-includedir], [PostgreSQL server include directory])],
              [pg_server_includedir="${enableval}"])
AC_MSG_RESULT([$pg_server_includedir])
AC_SUBST([pg_server_includedir])

AC_MSG_CHECKING([for PostgreSQL server module directory])
pg_server_libdir=`"$PG_CONFIG" --pkglibdir`
AC_ARG_ENABLE([pg-server-libdir], [AS_HELP_STRING([--enable-pg-server-libdir], [PostgreSQL server module directory])],
              [pg_server_libdir="${enableval}"])
AC_MSG_RESULT([$pg_server_libdir])
AC_SUBST([pg_server_libdir])

AC_MSG_CHECKING([for PostgreSQL architecture-independent support files directory])
pg_server_sharedir=`"$PG_CONFIG" --sharedir`
AC_ARG_ENABLE([pg-server-sharedir], [AS_HELP_STRING([--enable-pg-server-sharedir], [PostgreSQL architecture-independent support files directory])],
              [pg_server_sharedir="${enableval}"])
AC_MSG_RESULT([$pg_server_sharedir])
AC_SUBST([pg_server_sharedir])

pg_extensiondir="$pg_server_sharedir/extension"
AC_SUBST([pg_extensiondir])

AC_MSG_CHECKING([for debVS in -lapt-pkg])
saved_libs="${LIBS}"
LIBS="${LIBS} -lapt-pkg"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <apt-pkg/debversion.h>],
                                [int result = debVS.CmpVersion ("1", "2");])],
               [AC_MSG_RESULT([yes])
                APT_PKG_LIBS="-lapt-pkg"],
               [AC_MSG_RESULT([no])
                AC_MSG_FAILURE([libapt-pkg (APT) is not installed, but is required by debversion])])
LIBS="${saved_libs}"
AC_SUBST([APT_PKG_LIBS])

if [ ! test -n "$APT_PKG_LIBS" ]; then
  AC_MSG_ERROR([libapt_pkg not found but is required by debversion])
fi

dnl Configure which files to generate.
AC_CONFIG_FILES([META.json])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([debversion/debversion.control])
AC_CONFIG_FILES([debversion/Makefile])

dnl Output the generated config.status script.
AC_OUTPUT