source: trunk/debathena/third/schroot/configure.ac @ 24167

Revision 24167, 28.9 KB checked in by broder, 15 years ago (diff)
Import schroot upstream into subversion.
Line 
1#                                                              -*- Autoconf -*-
2# Copyright © 2004-2009  Roger Leigh <rleigh@debian.org>
3#
4# schroot is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# schroot is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program.  If not, see
16# <http://www.gnu.org/licenses/>.
17#
18#####################################################################
19#
20# Process this file with autoconf to produce a configure script.
21#
22#####################################################################
23dnl MAKING RELEASES (a step-by-step guide!)
24dnl ===============
25dnl
26dnl Since the last release:
27dnl 1. if only source code (not the interface) has changed, set
28dnl      SBUILD_MICRO_VERSION += 1;
29dnl      SBUILD_INTERFACE_AGE += 1;
30dnl 2. if any functions have been added, removed, or changed, set
31dnl      SBUILD_INTERFACE_AGE = 0;
32dnl      SBUILD_CURRENT_INTERFACE += 1;
33dnl 3. if interfaces have been added, set
34dnl      SBUILD_BINARY_AGE += 1;
35dnl 4. if interfaces have been removed, set
36dnl      SBUILD_BINARY_AGE = 0;
37dnl
38dnl For more detailed information, see the libtool info documentation.
39dnl
40dnl m4 magic from Eric Blake <ebb9@byu.net>, prior to automake inclusion
41m4_define([sbuild_m4_chomp],
42[m4_format([[%.*s]], m4_bregexp(m4_translit([$1], [
43]]m4_dquote(_m4_defn([m4_cr_all]))[, [/]]m4_format([%255s], [])[),
44  [/*$]), [$1])])
45m4_define([sbuild_m4_esyscmd_s],
46[sbuild_m4_chomp(m4_esyscmd([$1]))])
47AC_PREREQ(2.59)
48dnl Quoting the first argument results in a bizarrely corrupted package tarname
49AC_INIT(sbuild_m4_esyscmd_s([sed -ne '/^Package:/{s/Package:[[:space:]][[:space:]]*//p;q}' VERSION]),
50        [sbuild_m4_esyscmd_s([sed -ne '/^Version:/{s/Version:[[:space:]][[:space:]]*//p;q}' VERSION])],
51        [buildd-tools-devel@lists.alioth.debian.org])
52pushdef([SBUILD_CURRENT_INTERFACE], [1])
53pushdef([SBUILD_INTERFACE_AGE],     [0])
54pushdef([SBUILD_BINARY_AGE],        [0])
55dnl For safety, check we are in the right directory by
56dnl checking for a known unique file.
57AC_CONFIG_SRCDIR([sbuild/sbuild-session.cc])
58dnl Place auxilliary scripts here.
59AC_CONFIG_AUX_DIR([scripts])
60dnl Add config headers.
61AC_CONFIG_HEADER([config.h])
62AC_CONFIG_HEADER([sbuild/sbuild-config.h])
63
64AC_COPYRIGHT(
65[
66Copyright © 2004-2009  Roger Leigh <rleigh@debian.org>
67
68Parts of this configure script come from the 'configure.ac' file, and
69are not based on freely-redistributable m4 macros; you can
70redistribute it and/or modify it under the terms of the GNU General
71Public License as published by the Free Software Foundation, either
72version 3 of the License, or (at your option) any later version.
73
74This software is distributed in the hope that it will be useful, but
75WITHOUT ANY WARRANTY; without even the implied warranty of
76MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
77General Public License for more details.
78
79You should have received a copy of the GNU General Public License
80along with this program.  If not, see <http://www.gnu.org/licenses/>.
81])
82
83[SBUILD_CURRENT_INTERFACE]=SBUILD_CURRENT_INTERFACE
84[SBUILD_INTERFACE_AGE]=SBUILD_INTERFACE_AGE
85[SBUILD_BINARY_AGE]=SBUILD_BINARY_AGE
86popdef([SBUILD_CURRENT_INTERFACE])
87popdef([SBUILD_INTERFACE_AGE])
88popdef([SBUILD_BINARY_AGE])
89
90AC_SUBST([SBUILD_CURRENT_INTERFACE])
91AC_SUBST([SBUILD_INTERFACE_AGE])
92AC_SUBST([SBUILD_BINARY_AGE])
93
94dnl Initialise automake stuff.
95AM_INIT_AUTOMAKE([1.10 gnu check-news dist-bzip2 no-dist-gzip tar-pax silent-rules])
96AM_MAINTAINER_MODE
97RELEASE_DATE='sbuild_m4_esyscmd_s(date --date='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])' '+%s')'
98RELEASE_DATE_S='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])'
99AC_DEFINE_UNQUOTED([RELEASE_DATE_S], ["$RELEASE_DATE_S"], [Package release date (string).])
100AC_DEFINE_UNQUOTED([RELEASE_DATE], [$RELEASE_DATE], [Package release date (integer).])
101AC_SUBST([RELEASE_DATE])
102AC_SUBST([RELEASE_DATE_S])
103
104AC_MSG_CHECKING([whether to enable dchroot compatibility])
105AC_ARG_ENABLE([dchroot], [AS_HELP_STRING([--enable-dchroot], [Enable dchroot compatibility])],
106              [ case "${enableval}" in
107                yes) enable_dchroot_compat="yes" ;;
108                no)  enable_dchroot_compat="no" ;;
109                *) AC_MSG_RESULT([unknown])
110                   AC_MSG_ERROR([bad value ${enableval} for --enable-dchroot]) ;;
111                esac ],
112              [ enable_dchroot_compat="no" ])
113AC_MSG_RESULT([$enable_dchroot_compat])
114AM_CONDITIONAL([BUILD_DCHROOT], [test "$enable_dchroot_compat" = "yes"])
115
116AC_MSG_CHECKING([whether to enable dchroot-dsa compatibility])
117AC_ARG_ENABLE([dchroot-dsa], [AS_HELP_STRING([--enable-dchroot-dsa], [Enable dchroot-dsa compatibility])],
118              [ case "${enableval}" in
119                yes) enable_dchroot_dsa_compat="yes" ;;
120                no)  enable_dchroot_dsa_compat="no" ;;
121                *) AC_MSG_RESULT([unknown])
122                   AC_MSG_ERROR([bad value ${enableval} for --enable-dchroot-dsa]) ;;
123                esac ],
124              [ enable_dchroot_dsa_compat="no" ])
125AC_MSG_RESULT([$enable_dchroot_dsa_compat])
126AM_CONDITIONAL([BUILD_DCHROOT_DSA], [test "$enable_dchroot_dsa_compat" = "yes"])
127AM_CONDITIONAL([BUILD_LIBDCHROOT], [test "$enable_dchroot_compat" = "yes" || test "$enable_dchroot_dsa_compat" = "yes"])
128
129AC_MSG_CHECKING([whether to enable csbuild])
130AC_ARG_ENABLE([csbuild], [AS_HELP_STRING([--enable-csbuild], [Enable csbuild])],
131              [ case "${enableval}" in
132                yes) enable_csbuild_compat="yes" ;;
133                no)  enable_csbuild_compat="no" ;;
134                *) AC_MSG_RESULT([unknown])
135                   AC_MSG_ERROR([bad value ${enableval} for --enable-csbuild]) ;;
136                esac ],
137              [ enable_csbuild_compat="no" ])
138
139AC_MSG_RESULT([$enable_csbuild_compat])
140AM_CONDITIONAL([BUILD_CSBUILD], [test "$enable_csbuild_compat" = "yes"])
141
142AC_MSG_CHECKING([whether to enable debugging messages])
143AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Enable debugging messages])],
144              [ case "${enableval}" in
145                yes) enable_debug="yes" ;;
146                no)  enable_debug="no" ;;
147                *) AC_MSG_RESULT([unknown])
148                   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
149                esac ],
150              [ enable_debug="no" ])
151AC_MSG_RESULT([$enable_debug])
152if test "$enable_debug" = "yes"; then
153  AC_DEFINE_UNQUOTED([SBUILD_DEBUG], [1], [Enable debugging])
154fi
155
156default_environment_filter='^(BASH_ENV|CDPATH|ENV|HOSTALIASES|IFS|KRB5_CONFIG|KRBCONFDIR|KRBTKFILE|KRB_CONF|LD_.*|LOCALDOMAIN|NLSPATH|PATH_LOCALE|RES_OPTIONS|TERMINFO|TERMINFO_DIRS|TERMPATH)$'
157
158AC_MSG_CHECKING([whether to enable environment filtering regex])
159AC_ARG_ENABLE([environment-filter], [AS_HELP_STRING([--enable-environment-filter], [Enable default environment filtering (regex)])],
160              [ case "${enableval}" in
161                yes) enable_environment_filter="$default_environment_filter" ;;
162                no)  enable_environment_filter="" ;;
163                *) enable_environment_filter="${enableval}" ;;
164                esac ],
165              [ enable_environment_filter="$default_environment_filter" ])
166AC_MSG_RESULT([$enable_environment_filter])
167AH_TEMPLATE(SBUILD_DEFAULT_ENVIRONMENT_FILTER, [Default regular expression used to filter user environment])
168AC_DEFINE_UNQUOTED([SBUILD_DEFAULT_ENVIRONMENT_FILTER], ["$enable_environment_filter"])
169
170AC_MSG_CHECKING([whether to enable support for PAM authentication])
171AC_ARG_ENABLE([pam], [AS_HELP_STRING([--enable-pam], [Enable support for PAM authentication (requires libpam)])],
172              [ case "${enableval}" in
173                yes) enable_pam="yes" ;;
174                no)  enable_pam="no" ;;
175                *) AC_MSG_RESULT([unknown])
176                   AC_MSG_ERROR([bad value ${enableval} for --enable-pam]) ;;
177                esac],
178              [enable_pam="auto"])
179AC_MSG_RESULT([$enable_pam])
180
181AC_MSG_CHECKING([whether to enable support for block devices])
182AC_ARG_ENABLE([block-device], [AS_HELP_STRING([--enable-block-device], [Enable support for block devices (requires liblockdev)])],
183              [ case "${enableval}" in
184                yes) enable_blockdev="yes" ;;
185                no)  enable_blockdev="no" ;;
186                *) AC_MSG_RESULT([unknown])
187                   AC_MSG_ERROR([bad value ${enableval} for --enable-blockdev]) ;;
188                esac],
189              [enable_blockdev="auto"])
190AC_MSG_RESULT([$enable_blockdev])
191
192AC_MSG_CHECKING([whether to enable support for LVM snapshots])
193AC_ARG_ENABLE([lvm-snapshot], [AS_HELP_STRING([--enable-lvm-snapshot], [Enable support for LVM snapshots (requires LVM and liblockdev)])],
194              [ case "${enableval}" in
195                yes) enable_lvmsnapshot="yes"
196                     enable_blockdev="yes" ;;
197                no)  enable_lvmsnapshot="no" ;;
198                *) AC_MSG_RESULT([unknown])
199                   AC_MSG_ERROR([bad value ${enableval} for --enable-lvm-snapshot]) ;;
200                esac],
201              [enable_lvmsnapshot="auto"])
202AC_MSG_RESULT([$enable_lvmsnapshot])
203
204AC_MSG_CHECKING([whether to enable support for loopback mounts])
205AC_ARG_ENABLE([loopback], [AS_HELP_STRING([--enable-loopback], [Enable support for loopback mounts])],
206              [ case "${enableval}" in
207                yes) enable_loopback="yes" ;;
208                no)  enable_loopback="no" ;;
209                *) AC_MSG_RESULT([unknown])
210                   AC_MSG_ERROR([bad value ${enableval} for --enable-loopback]) ;;
211                esac],
212              [enable_loopback="auto"])
213AC_MSG_RESULT([$enable_loopback])
214
215AC_MSG_CHECKING([whether to enable support for UUIDs in session names])
216AC_ARG_ENABLE([uuid], [AS_HELP_STRING([--enable-uuid], [Enable support for UUIDs])],
217              [ case "${enableval}" in
218                yes) enable_uuid="yes" ;;
219                no)  enable_uuid="no" ;;
220                *) AC_MSG_RESULT([unknown])
221                   AC_MSG_ERROR([bad value ${enableval} for --enable-uuid]) ;;
222                esac],
223              [enable_uuid="auto"])
224AC_MSG_RESULT([$enable_uuid])
225
226AC_MSG_CHECKING([whether to enable support for union mounts])
227AC_ARG_ENABLE([union], [AS_HELP_STRING([--enable-union], [Enable support for union mounts])],
228              [ case "${enableval}" in
229                yes) enable_union="yes" ;;
230                no)  enable_union="no" ;;
231                *) AC_MSG_RESULT([unknown])
232                   AC_MSG_ERROR([bad value ${enableval} for --enable-union]) ;;
233                esac],
234              [enable_union="auto"])
235AC_MSG_RESULT([$enable_union])
236
237AC_MSG_CHECKING([whether to enable doxygen documentation])
238AC_ARG_ENABLE([doxygen], [AS_HELP_STRING([--enable-doxygen], [Enable doxygen documentation])],
239              [ case "${enableval}" in
240                yes) enable_doxygen="yes" ;;
241                no)  enable_doxygen="no" ;;
242                *) AC_MSG_RESULT([unknown])
243                   AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;;
244                esac],
245              [ enable_doxygen="no" ])
246AC_MSG_RESULT([$enable_doxygen])
247AM_CONDITIONAL([BUILD_DOXYGEN], [test "$enable_doxygen" = "yes"])
248
249AC_MSG_CHECKING([for bash completion directory])
250bashcompletiondir='${sysconfdir}/bash_completion.d'
251AC_ARG_WITH([bash-completion-dir], [AS_HELP_STRING([--with-bash-completion-dir], [bash shell completion directory])],
252              [bashcompletiondir="${withval}"])
253AC_MSG_RESULT([$bashcompletiondir])
254AC_SUBST([bashcompletiondir])
255
256# Checks for programs.
257AC_PROG_CXX
258AC_LANG([C++])
259ACX_PTHREAD([], [AC_MSG_ERROR([POSIX thread support is required for correct std::tr1::shared_ptr operation])])
260AC_DISABLE_SHARED
261AC_ENABLE_STATIC
262AC_PROG_LIBTOOL
263AM_GNU_GETTEXT_VERSION([0.16])
264AM_GNU_GETTEXT([external])
265AC_PATH_PROG([FIND], [find])
266AC_PATH_PROG([XARGS], [xargs])
267AC_PATH_PROG([DOXYGEN], [doxygen])
268HAVE_LVM="yes"
269AC_PATH_PROG([LVCREATE], [lvcreate], [HAVE_LVM="no"], [$PATH:/sbin:/usr/sbin])
270AC_PATH_PROG([LVREMOVE], [lvremove], [HAVE_LVM="no"], [$PATH:/sbin:/usr/sbin])
271HAVE_LOOPBACK="yes"
272AC_PATH_PROG([LOSETUP], [losetup], [HAVE_LOOPBACK="no"], [$PATH:/sbin:/usr/sbin])
273
274if test "$enable_doxygen" = "yes" && test -z "$DOXYGEN"; then
275  AC_MSG_FAILURE([doxygen is not installed, but is required by schroot])
276fi;
277AM_CONDITIONAL([BUILD_DOXYGEN], [test -n "$DOXYGEN" && test "$enable_doxygen" = "yes"])
278
279# Checks for libraries.
280PKG_CHECK_MODULES([UUID], [uuid],
281                  [AC_DEFINE(HAVE_UUID)
282                   HAVE_UUID=yes],
283                  [HAVE_UUID=no])
284
285AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
286AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"])
287
288SCHROOT_CFLAGS="$UUID_CFLAGS"
289AC_SUBST([SCHROOT_CFLAGS])
290
291# Checks for header files.
292AC_CHECK_HEADERS([tr1/memory])
293
294AC_CHECK_HEADERS([boost/shared_ptr.hpp],, [
295  if test $ac_cv_header_tr1_memory = yes; then
296    :
297  else
298    AC_MSG_ERROR([Boost.shared_ptr (Boost C++ Libraries) is not installed, but is required by schroot])
299  fi])
300
301AC_CHECK_HEADERS([tr1/tuple])
302
303AC_CHECK_HEADERS([boost/tuple/tuple.hpp],, [
304  if test $ac_cv_header_tr1_memory = yes; then
305    :
306  else
307    AC_MSG_ERROR([Boost.Tuple (Boost C++ Libraries) is not installed, but is required by schroot])
308  fi])
309
310AC_CHECK_HEADERS([boost/format.hpp],, [AC_MSG_ERROR([Boost.Format (Boost C++ Libraries) is not installed, but is required by schroot])])
311AC_CHECK_HEADERS([boost/program_options.hpp],, [AC_MSG_ERROR([Boost.Program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
312AC_CHECK_HEADERS([boost/type_traits.hpp],, [AC_MSG_ERROR([Boost.TypeTraits (Boost C++ Libraries) is not installed, but is required by schroot])])
313
314AC_CHECK_HEADERS([ext/stdio_filebuf.h],, [AC_MSG_ERROR([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
315
316AC_CHECK_HEADERS([sys/personality.h],
317                 [PERSONALITY_HEADER="yes"],
318                 [PERSONALITY_HEADER="no"])
319
320AC_CHECK_HEADERS([security/pam_appl.h],
321                 [PAM_HEADER="yes"],
322                 [PAM_HEADER="no"])
323
324# Checks for typedefs, structures, and compiler characteristics.
325
326# Checks for library functions.
327AC_CHECK_LIB([pam], [pam_authenticate],
328             [PAM_LIBS="-lpam"
329              PAM_FUNC="yes"],
330             [PAM_LIBS=""
331              PAM_FUNC="no"])
332AC_SUBST([PAM_LIBS])
333
334AC_CHECK_LIB([lockdev], [dev_lock],
335             [LOCKDEV_LIBS="-llockdev"
336              HAVE_LOCKDEV="yes"],
337             [LOCKDEV_LIBS=""
338              HAVE_LOCKDEV="no"])
339AC_SUBST([LOCKDEV_LIBS])
340AH_TEMPLATE(SBUILD_FEATURE_DEVLOCK, [Set if the device locking with liblockdev is available])
341if test "$HAVE_LOCKDEV" = "yes"; then
342  AC_DEFINE(SBUILD_FEATURE_DEVLOCK, 1)
343fi
344
345AC_CHECK_FUNC([personality],
346              [PERSONALITY_FUNC="yes"],
347              [PERSONALITY_FUNC="no"])
348
349# Determine which features to enable.
350AC_MSG_CHECKING([whether to build personality support])
351BUILD_PERSONALITY="yes"
352if test "$PERSONALITY_HEADER" = "no"; then
353  BUILD_PERSONALITY="no"
354fi
355if test "$PERSONALITY_FUNC" = "no"; then
356  BUILD_PERSONALITY="no"
357fi
358AC_MSG_RESULT([$BUILD_PERSONALITY])
359
360AM_CONDITIONAL([BUILD_PERSONALITY], [test "$BUILD_PERSONALITY" = "yes"])
361AH_TEMPLATE(SBUILD_FEATURE_PERSONALITY, [Set if personality support is present])
362if test "$BUILD_PERSONALITY" = "yes"; then
363  AC_DEFINE(SBUILD_FEATURE_PERSONALITY, 1)
364fi
365
366AC_MSG_CHECKING([whether to build UUID support])
367BUILD_UUID="yes"
368if test "$enable_uuid" = "yes"; then
369  BUILD_UUID="no"
370fi
371if test "$HAVE_UUID" = "no"; then
372  BUILD_UUID="no"
373fi
374AC_MSG_RESULT([$BUILD_UUID])
375
376AH_TEMPLATE(HAVE_UUID, [Set if UUID support is available])
377if test "$BUILD_UUID" = "yes"; then
378  AC_DEFINE(HAVE_UUID, 1)
379fi
380
381AC_MSG_CHECKING([whether to build PAM support])
382BUILD_PAM="yes"
383if test "$enable_pam" = "yes"; then
384  if test "$PAM_HEADER" = "no"; then
385    BUILD_PAM="no"
386    AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])
387  fi
388  if test "$PAM_FUNC" = "no"; then
389    BUILD_PAM="no"
390    AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])
391  fi
392elif test "$enable_pam" = "no"; then
393    BUILD_PAM="no"
394elif test "$enable_pam" = "auto"; then
395  if test "$PAM_HEADER" = "no"; then
396    BUILD_PAM="no"
397  fi
398  if test "$PAM_FUNC" = "no"; then
399    BUILD_PAM="no"
400  fi
401fi
402AC_MSG_RESULT([$BUILD_PAM])
403
404AM_CONDITIONAL([BUILD_PAM], [test "$BUILD_PAM" = "yes"])
405AH_TEMPLATE(SBUILD_FEATURE_PAM, [Set if PAM support is available])
406if test "$BUILD_PAM" = "yes"; then
407  AC_DEFINE(SBUILD_FEATURE_PAM, 1)
408fi
409
410AC_MSG_CHECKING([whether to build block-device support])
411BUILD_BLOCKDEV="yes"
412if test "$enable_blockdev" = "yes"; then
413  if test "$HAVE_LOCKDEV" = "no"; then
414    BUILD_BLOCKDEV="no"
415    AC_MSG_FAILURE([liblockdev (lockdev) is not installed, but is required by schroot])
416  fi
417elif test "$enable_blockdev" = "no"; then
418    BUILD_BLOCKDEV="no"
419elif test "$enable_blockdev" = "auto"; then
420  if test "$HAVE_LOCKDEV" = "no"; then
421    BUILD_BLOCKDEV="no"
422  fi
423fi
424AC_MSG_RESULT([$BUILD_BLOCKDEV])
425
426AM_CONDITIONAL([BUILD_BLOCKDEV], [test "$BUILD_BLOCKDEV" = "yes"])
427AH_TEMPLATE(SBUILD_FEATURE_BLOCKDEV, [Set if the block-device chroot type is present])
428if test "$BUILD_BLOCKDEV" = "yes"; then
429  AC_DEFINE(SBUILD_FEATURE_BLOCKDEV, 1)
430fi
431
432AC_MSG_CHECKING([whether to build lvm-snapshot support])
433BUILD_LVMSNAP="yes"
434if test "$enable_lvmsnapshot" = "yes"; then
435  if test "$HAVE_LVM" = "no"; then
436    BUILD_LVMSNAP="no"
437    AC_MSG_FAILURE([LVM (lvm) is not installed, but is required by schroot])
438  fi
439elif test "$enable_lvmsnapshot" = "no"; then
440    BUILD_LVMSNAP="no"
441elif test "$enable_lvmsnapshot" = "auto"; then
442  if test "$HAVE_LOCKDEV" = "no"; then
443    BUILD_LVMSNAP="no"
444  fi
445  if test "$HAVE_LVM" = "no"; then
446    BUILD_LVMSNAP="no"
447  fi
448fi
449AC_MSG_RESULT([$BUILD_LVMSNAP])
450
451AM_CONDITIONAL([BUILD_LVMSNAP], [test "$BUILD_LVMSNAP" = "yes"])
452AH_TEMPLATE(SBUILD_FEATURE_LVMSNAP, [Set if the lvm-snapshot chroot type is present])
453if test "$BUILD_LVMSNAP" = "yes"; then
454  AC_DEFINE(SBUILD_FEATURE_LVMSNAP, 1)
455fi
456
457AC_MSG_CHECKING([whether to build loopback support])
458BUILD_LOOPBACK="yes"
459if test "$enable_loopbackshot" = "yes"; then
460  if test "$HAVE_LOOPBACK" = "no"; then
461    BUILD_LOOPBACK="no"
462    AC_MSG_FAILURE([Loopback support is not avilable, but is required by schroot])
463  fi
464elif test "$enable_loopbackshot" = "no"; then
465    BUILD_LOOPBACK="no"
466elif test "$enable_loopbackshot" = "auto"; then
467  if test "$HAVE_LOOPBACK" = "no"; then
468    BUILD_LOOPBACK="no"
469  fi
470fi
471AC_MSG_RESULT([$BUILD_LOOPBACK])
472
473AM_CONDITIONAL([BUILD_LOOPBACK], [test "$BUILD_LOOPBACK" = "yes"])
474AH_TEMPLATE(SBUILD_FEATURE_LOOPBACK, [Set if the loopback chroot type is present])
475if test "$BUILD_LOOPBACK" = "yes"; then
476  AC_DEFINE(SBUILD_FEATURE_LOOPBACK, 1)
477fi
478
479AC_MSG_CHECKING([whether to build union support])
480BUILD_UNION="yes"
481if test "$enable_union" = "yes"; then
482  :
483elif test "$enable_union" = "no"; then
484  BUILD_UNION="no"
485elif test "$enable_union" = "auto"; then
486  BUILD_UNION="yes"
487fi
488AC_MSG_RESULT([$BUILD_UNION])
489
490AM_CONDITIONAL([BUILD_UNION], [test "$BUILD_UNION" = "yes"])
491AH_TEMPLATE(SBUILD_FEATURE_UNION, [Set if the union filesystem type is present])
492if test "$BUILD_UNION" = "yes"; then
493  AC_DEFINE(SBUILD_FEATURE_UNION, 1)
494fi
495
496AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options])
497saved_LIBS="${LIBS}"
498LIBS="${LIBS} -lboost_program_options"
499AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
500                               [boost::program_options::variables_map::variables_map dummy()])],
501               [AC_MSG_RESULT([yes])
502                BOOST_LIBS="${BOOST_LIBS} -lboost_program_options"],
503               [AC_MSG_RESULT([no])
504                AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
505LIBS="${saved_LIBS}"
506
507AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options])
508saved_LIBS="${LIBS}"
509LIBS="${LIBS} -lboost_program_options"
510AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
511                               [boost::program_options::options_description testgrp("test group");
512                                bool notused = testgrp.options().empty();
513])],
514               [AC_MSG_RESULT([yes])
515                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
516               [AC_MSG_RESULT([no])
517                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"])
518LIBS="${saved_LIBS}"
519AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available])
520if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then
521  AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
522fi
523
524AC_MSG_CHECKING([for boost::regex in -lboost_regex])
525saved_LIBS="${LIBS}"
526LIBS="${LIBS} -lboost_regex"
527AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>],
528                               [boost::regex("^foo[bar]$")])],
529               [AC_MSG_RESULT([yes])
530                BOOST_LIBS="${BOOST_LIBS} -lboost_regex"],
531               [AC_MSG_RESULT([no])
532                AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])
533LIBS="${saved_LIBS}"
534
535AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem])
536saved_LIBS="${LIBS}"
537LIBS="${LIBS} -lboost_filesystem"
538AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
539                               [boost::filesystem::is_directory("/")])],
540               [AC_MSG_RESULT([yes])
541                BOOST_FILESYSTEM_LIBS="-lboost_filesystem"],
542               [AC_MSG_RESULT([no])
543                AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])])
544LIBS="${saved_LIBS}"
545
546AC_SUBST([BOOST_LIBS])
547AC_SUBST([BOOST_FILESYSTEM_LIBS])
548
549AC_MSG_CHECKING([for __gnu_cxx::stdio_filebuf in libstdc++])
550AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ext/stdio_filebuf.h>
551#include <unistd.h>],
552                                [__gnu_cxx::stdio_filebuf<char> fdbuf(STDOUT_FILENO, std::ios::out)])],
553               [AC_MSG_RESULT([yes])],
554               [AC_MSG_RESULT([no])
555                AC_MSG_FAILURE([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
556
557dnl Set PACKAGE_LOCALE_DIR in config.h
558AH_TEMPLATE(PACKAGE_LOCALE_DIR, [Package locale directory])
559if test "x${prefix}" = "xNONE"; then
560  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, ["${ac_default_prefix}/share/locale"])
561else
562  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, ["${prefix}/share/locale"])
563fi
564
565dnl Set PACKAGE_DATA_DIR in config.h.
566AH_TEMPLATE(PACKAGE_DATA_DIR, [Package data directory])
567if test "x${datadir}" = 'x${prefix}/share' || test "x${datadir}" = 'x${datarootdir}'; then
568  if test "x${prefix}" = "xNONE"; then
569    PACKAGE_DATA_DIR="${ac_default_prefix}/share/${PACKAGE}"
570  else
571    PACKAGE_DATA_DIR="${prefix}/share/${PACKAGE}"
572  fi
573else
574  PACKAGE_DATA_DIR="${datadir}/${PACKAGE}"
575fi
576
577AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${PACKAGE_DATA_DIR}")
578
579dnl Set PACKAGE_LIB_DIR in config.h.
580AH_TEMPLATE(PACKAGE_LIB_DIR, [Package lib directory])
581if test "x${libdir}" = 'x${exec_prefix}/lib'; then
582  if test "x${exec_prefix}" = "xNONE"; then
583    if test "x${prefix}" = "xNONE"; then
584      PACKAGE_LIB_DIR="${ac_default_prefix}/lib/${PACKAGE}"
585    else
586      PACKAGE_LIB_DIR="${prefix}/lib/${PACKAGE}"
587    fi
588  else
589    PACKAGE_LIB_DIR="${exec_prefix}/lib/${PACKAGE}"
590  fi
591else
592  PACKAGE_LIB_DIR="${libdir}/${PACKAGE}"
593fi
594
595dnl Set PACKAGE_LIBEXEC_DIR in config.h.
596AH_TEMPLATE(PACKAGE_LIBEXEC_DIR, [Package libexec directory])
597if test "x${libexecdir}" = 'x${exec_prefix}/libexec'; then
598  if test "x${exec_prefix}" = "xNONE"; then
599    if test "x${prefix}" = "xNONE"; then
600      PACKAGE_LIBEXEC_DIR="${ac_default_prefix}/libexec/${PACKAGE}"
601    else
602      PACKAGE_LIBEXEC_DIR="${prefix}/libexec/${PACKAGE}"
603    fi
604  else
605    PACKAGE_LIBEXEC_DIR="${exec_prefix}/libexec/${PACKAGE}"
606  fi
607else
608  PACKAGE_LIBEXEC_DIR="${libexecdir}/${PACKAGE}"
609fi
610
611SCHROOT_LIBEXEC_DIR="${PACKAGE_LIBEXEC_DIR}"
612AC_SUBST(SCHROOT_LIBEXEC_DIR)
613AH_TEMPLATE(SCHROOT_LIBEXEC_DIR, [Package libexec directory])
614AC_DEFINE_UNQUOTED(SCHROOT_LIBEXEC_DIR, ["$SCHROOT_LIBEXEC_DIR"])
615
616dnl Set PACKAGE_LOCALSTATE_DIR in config.h.
617AH_TEMPLATE(PACKAGE_LOCALSTATE_DIR, [Package localstate directory])
618if test "x${localstatedir}" = 'x${prefix}/var'; then
619  if test "x${prefix}" = "xNONE"; then
620    if test "x${prefix}" = "xNONE"; then
621      PACKAGE_LOCALSTATE_DIR="${ac_default_prefix}/var"
622    else
623      PACKAGE_LOCALSTATE_DIR="${prefix}/var"
624    fi
625  else
626    PACKAGE_LOCALSTATE_DIR="${prefix}/var"
627  fi
628else
629  PACKAGE_LOCALSTATE_DIR="${localstatedir}"
630fi
631
632SCHROOT_MOUNT_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/mount"
633AC_SUBST([SCHROOT_MOUNT_DIR])
634AH_TEMPLATE(SCHROOT_MOUNT_DIR, [schroot mount directory])
635AC_DEFINE_UNQUOTED(SCHROOT_MOUNT_DIR, ["$SCHROOT_MOUNT_DIR"])
636
637SCHROOT_SESSION_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/session"
638AC_SUBST([SCHROOT_SESSION_DIR])
639AH_TEMPLATE(SCHROOT_SESSION_DIR, [schroot session directory])
640AC_DEFINE_UNQUOTED(SCHROOT_SESSION_DIR, ["$SCHROOT_SESSION_DIR"])
641
642SCHROOT_FILE_UNPACK_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/unpack"
643AC_SUBST([SCHROOT_FILE_UNPACK_DIR])
644AH_TEMPLATE(SCHROOT_FILE_UNPACK_DIR, [schroot file unpack directory])
645AC_DEFINE_UNQUOTED(SCHROOT_FILE_UNPACK_DIR, ["$SCHROOT_FILE_UNPACK_DIR"])
646
647SCHROOT_OVERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/overlay"
648AC_SUBST([SCHROOT_OVERLAY_DIR])
649AH_TEMPLATE(SCHROOT_OVERLAY_DIR, [schroot overlay directory])
650AC_DEFINE_UNQUOTED(SCHROOT_OVERLAY_DIR, ["$SCHROOT_OVERLAY_DIR"])
651
652SCHROOT_UNDERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/underlay"
653AC_SUBST([SCHROOT_UNDERLAY_DIR])
654AH_TEMPLATE(SCHROOT_UNDERLAY_DIR, [schroot underlay directory])
655AC_DEFINE_UNQUOTED(SCHROOT_UNDERLAY_DIR, ["$SCHROOT_UNDERLAY_DIR"])
656
657dnl Set PACKAGE_SYSCONF_DIR in config.h.
658AH_TEMPLATE(PACKAGE_SYSCONF_DIR, [Package system configuration directory])
659if test "x${sysconfdir}" = 'x${prefix}/etc'; then
660  if test "x${prefix}" = "xNONE"; then
661    PACKAGE_SYSCONF_DIR="${ac_default_prefix}/etc"
662  else
663    PACKAGE_SYSCONF_DIR="${prefix}/etc"
664  fi
665else
666  PACKAGE_SYSCONF_DIR="${sysconfdir}"
667fi
668PACKAGE_SYSCONF_DIR="${PACKAGE_SYSCONF_DIR}/schroot"
669AC_DEFINE_UNQUOTED([PACKAGE_SYSCONF_DIR], ["$PACKAGE_SYSCONF_DIR"])
670AC_SUBST([PACKAGE_SYSCONF_DIR])
671
672SCHROOT_CONF="${PACKAGE_SYSCONF_DIR}/schroot.conf"
673AC_SUBST([SCHROOT_CONF])
674
675AH_TEMPLATE(SCHROOT_CONF, [schroot config file path])
676AC_DEFINE_UNQUOTED(SCHROOT_CONF, ["$SCHROOT_CONF"])
677
678SCHROOT_CONF_CHROOT_D="${PACKAGE_SYSCONF_DIR}/chroot.d"
679AC_SUBST([SCHROOT_CONF_CHROOT_D])
680
681AH_TEMPLATE(SCHROOT_CONF_CHROOT_D, [schroot chroot directory])
682AC_DEFINE_UNQUOTED(SCHROOT_CONF_CHROOT_D, ["$SCHROOT_CONF_CHROOT_D"])
683
684SCHROOT_CONF_SETUP_D="${PACKAGE_SYSCONF_DIR}/setup.d"
685AC_SUBST([SCHROOT_CONF_SETUP_D])
686
687AH_TEMPLATE(SCHROOT_CONF_SETUP_D, [schroot chroot setup directory])
688AC_DEFINE_UNQUOTED(SCHROOT_CONF_SETUP_D, ["$SCHROOT_CONF_SETUP_D"])
689
690AH_TEMPLATE(SCHROOT_DATADIR, [Package data directory])
691SCHROOT_DATADIR="${PACKAGE_DATA_DIR}/${PACKAGE_VERSION}"
692AC_DEFINE_UNQUOTED(SCHROOT_DATADIR, ["$SCHROOT_DATADIR"])
693
694AH_TEMPLATE(SCHROOT_MODULEDIR, [Package module directory])
695SCHROOT_MODULEDIR="${PACKAGE_LIB_DIR}/${PACKAGE_VERSION}/modules"
696AC_DEFINE_UNQUOTED(SCHROOT_MODULEDIR, ["$SCHROOT_MODULEDIR"])
697
698if test "x${sysconfdir}" = 'x${prefix}/etc'; then
699  if test "x${prefix}" = "xNONE"; then
700    DCHROOT_SYSCONF_DIR="${ac_default_prefix}/etc"
701  else
702    DCHROOT_SYSCONF_DIR="${prefix}/etc"
703  fi
704else
705  DCHROOT_SYSCONF_DIR="${sysconfdir}"
706fi
707
708DCHROOT_CONF="${DCHROOT_SYSCONF_DIR}/dchroot.conf"
709AC_SUBST([DCHROOT_CONF])
710
711AH_TEMPLATE(DCHROOT_CONF, [dchroot config file path])
712AC_DEFINE_UNQUOTED(DCHROOT_CONF, ["$DCHROOT_CONF"])
713
714CSBUILD_CONF="${CSBUILD_SYSCONF_DIR}/csbuild.conf"
715AC_SUBST([CSBUILD_CONF])
716
717AH_TEMPLATE(CSBUILD_CONF, [csbuild config file path])
718AC_DEFINE_UNQUOTED(CSBUILD_CONF, ["$CSBUILD_CONF"])
719
720dnl Configure which files to generate.
721AC_CONFIG_FILES([doc/Makefile])
722AC_CONFIG_FILES([doc/sbuild.dox])
723AC_CONFIG_FILES([doc/schroot.dox])
724AC_CONFIG_FILES([po/Makefile.in])
725AC_CONFIG_FILES([sbuild/Makefile])
726AC_CONFIG_FILES([sbuild/sbuild.pc])
727AC_CONFIG_FILES([bin/Makefile])
728AC_CONFIG_FILES([bin/schroot-base/Makefile])
729AC_CONFIG_FILES([bin/schroot/Makefile])
730AC_CONFIG_FILES([bin/schroot-listmounts/Makefile])
731AC_CONFIG_FILES([bin/schroot-mount/Makefile])
732AC_CONFIG_FILES([bin/schroot-releaselock/Makefile])
733AC_CONFIG_FILES([bin/dchroot/Makefile])
734AC_CONFIG_FILES([bin/dchroot-dsa/Makefile])
735AC_CONFIG_FILES([bin/csbuild/Makefile])
736AC_CONFIG_FILES([etc/Makefile])
737AC_CONFIG_FILES([etc/pam/Makefile])
738AC_CONFIG_FILES([etc/setup.d/Makefile])
739AC_CONFIG_FILES([etc/bash_completion/Makefile])
740AC_CONFIG_FILES([man/Makefile])
741AC_CONFIG_FILES([man/schroot.1])
742AC_CONFIG_FILES([man/schroot-setup.5])
743AC_CONFIG_FILES([man/schroot.conf.5])
744AC_CONFIG_FILES([man/schroot-script-config.5])
745AC_CONFIG_FILES([man/dchroot.1])
746AC_CONFIG_FILES([man/dchroot-dsa.1])
747AC_CONFIG_FILES([man/csbuild.1])
748AC_CONFIG_FILES([scripts/po-notify])
749AC_CONFIG_FILES([test/Makefile])
750AC_CONFIG_FILES([Makefile])
751dnl Output the generated config.status script.
752AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.