# -*- Autoconf -*- # Copyright © 2004-2008 Roger Leigh # # 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 # . # ##################################################################### # # Process this file with autoconf to produce a configure script. # ##################################################################### dnl m4 magic from Eric Blake , 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 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 . ]) 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 AC_MSG_CHECKING([whether to enable extension support]) AC_ARG_ENABLE([extension], [AS_HELP_STRING([--enable-extension], [Enable extension support])], [ case "${enableval}" in yes) enable_extension="yes" ;; no) enable_extension="no" ;; unset) enable_extension="yes" ;; *) AC_MSG_RESULT([unknown]) AC_MSG_ERROR([bad value ${enableval} for --enable-extension]) ;; esac ], [ enable_extension="yes" ]) AC_MSG_RESULT([$enable_extension]) AM_CONDITIONAL([BUILD_EXTENSION], [test "$enable_extension" = "yes"]) # 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]) 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_contribdir="$pg_server_sharedir/contrib" AC_SUBST([pg_contribdir]) 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 ], [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]) AM_CONDITIONAL([BUILD_DEBVERSION], [test -x "$PG_CONFIG" && test -n "$APT_PKG_LIBS"]) 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