2 # Copyright © 2010-2014 Guillem Jover <guillem@debian.org>
4 # DPKG_BUILD_SHARED_LIBS()
5 # ----------------------
6 AC_DEFUN([DPKG_BUILD_SHARED_LIBS], [
7 AS_IF([test "$enable_shared" = "yes" && test -z "$AUTHOR_TESTING"], [
8 AC_MSG_ERROR([building libdpkg as a shared library is not supported])
10 AM_CONDITIONAL([BUILD_SHARED], [test "$enable_shared" = "yes"])
11 ])# DPKG_BUILD_SHARED_LIBS
13 # DPKG_BUILD_RELEASE_DATE()
14 # -----------------------
15 AC_DEFUN([DPKG_BUILD_RELEASE_DATE], [
16 AC_REQUIRE([DPKG_PROG_PERL])
17 TIMESTAMP=$(PERL=$PERL ${CONFIG_SHELL-/bin/sh} "$srcdir/build-aux/run-script" scripts/dpkg-parsechangelog.pl -l"$srcdir/debian/changelog" -STimestamp)
18 PACKAGE_RELEASE_DATE=$($PERL -MPOSIX -e "print POSIX::strftime('%Y-%m-%d', gmtime('$TIMESTAMP'));")
19 AC_SUBST([PACKAGE_RELEASE_DATE])
20 ])# DPKG_BUILD_RELEASE_DATE
22 # DPKG_BUILD_PROG(PROG)
24 # Allow disabling compilation and usage of specific programs.
25 AC_DEFUN([DPKG_BUILD_PROG], [
26 AC_MSG_CHECKING([whether to build $1])
28 [AS_HELP_STRING([--disable-$1], [do not build or use $1])],
29 [AS_TR_SH([build_$1])=$AS_TR_SH([enable_$1])],
30 [AS_TR_SH([build_$1])=yes])
31 AM_CONDITIONAL(AS_TR_CPP([BUILD_$1]),
32 [test "x$AS_TR_SH([build_$1])" = "xyes"])
33 AS_IF([test "x$AS_TR_SH([build_$1])" = "xyes"], [
34 AC_DEFINE(AS_TR_CPP([BUILD_$1]), [1], [Define to 1 if $1 is compiled.])
36 AC_DEFINE(AS_TR_CPP([BUILD_$1]), [0])
38 AC_MSG_RESULT([$AS_TR_SH([build_$1])])
41 # DPKG_BUILD_DEVEL_DOCS()
42 # ---------------------
43 # Select what type of documentation to build. Either for development including
44 # all symbol references, and extracting everything, or production documentation.
45 AC_DEFUN([DPKG_BUILD_DEVEL_DOCS], [
46 AC_ARG_ENABLE([devel-docs],
47 [AS_HELP_STRING([--disable-devel-docs], [build release docs])],
48 [build_devel_docs=$enable_devel_docs],
49 [build_devel_docs=yes]
51 AS_IF([test "x$build_devel_docs" = "xyes"], [
52 AC_SUBST([BUILD_DEVEL_DOCS], [YES])
54 AC_SUBST([BUILD_DEVEL_DOCS], [NO])
56 ])# DPKG_BUILD_DOCS_MODE
58 # DPKG_WITH_DIR(DIR, DEFAULT, DESCRIPTION)
60 # Allow specifying alternate directories.
61 AC_DEFUN([DPKG_WITH_DIR], [
63 AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1=DIR], [$3])], [
65 [""], [AC_MSG_ERROR([invalid $1 specified])],
71 # DPKG_DEB_COMPRESSOR(COMP)
73 # Change default «dpkg-deb --build» compressor.
74 AC_DEFUN([DPKG_DEB_COMPRESSOR], [
75 AC_ARG_WITH([dpkg-deb-compressor],
76 [AS_HELP_STRING([--with-dpkg-deb-compressor=COMP],
77 [change default dpkg-deb build compressor])],
78 [with_dpkg_deb_compressor=$withval], [with_dpkg_deb_compressor=$1])
79 AS_CASE([$with_dpkg_deb_compressor],
81 [AC_MSG_ERROR([unsupported default compressor $with_dpkg_deb_compressor])])
82 AC_DEFINE_UNQUOTED([DPKG_DEB_DEFAULT_COMPRESSOR],
83 [COMPRESSOR_TYPE_]AS_TR_CPP(${with_dpkg_deb_compressor}),
84 [default dpkg-deb build compressor])
85 ]) # DPKG_DEB_COMPRESSOR
87 # DPKG_DIST_IS_RELEASE()
88 # --------------------
89 # Check whether we are preparing a distribution tarball for a release, and
90 # set PACKAGE_DIST_IS_RELEASE accordingly.
91 AC_DEFUN([DPKG_DIST_IS_RELEASE], [
92 AS_IF([echo $PACKAGE_VERSION | grep -q -v '[-]'], [
93 dpkg_dist_is_release=1
95 dpkg_dist_is_release=0
97 AM_CONDITIONAL([PACKAGE_DIST_IS_RELEASE],
98 [test "$dpkg_dist_is_release" -eq 1])
99 AC_SUBST([PACKAGE_DIST_IS_RELEASE], [$dpkg_dist_is_release])
100 ])# DPKG_DIST_IS_RELEASE
102 # DPKG_DIST_CHECK(COND, ERROR)
104 # Check if the condition is fulfilled when preparing a distribution tarball.
105 AC_DEFUN([DPKG_DIST_CHECK], [
106 AS_IF([test ! -f "$srcdir/.dist-version" && $1], [
107 AC_MSG_ERROR([not building from distributed tarball, $2])